/*
  Playful editorial variant inspired by the supplied education reference.
  The HTML structure, copy, routes, controls, and behavior remain unchanged.
*/

:root {
  --page: #edf1f5;
  --surface: #ffffff;
  --soft: #fff7df;
  --ink: #172d3b;
  --muted: #526976;
  --line: #b7c8d1;
  --brand: #5b43c9;
  --deep: #4931b1;
  --btn: #ffffff;
  --head: #ffffff;
  --sun: #ffc53d;
  --sky: #bfeeff;
  --pink: #f8a9cb;
  --mint: #bceecf;
  --coral-play: #ff7759;
  --outline: #19313e;
}

[data-theme="dark"] {
  --page: #111b25;
  --surface: #172734;
  --soft: #27303d;
  --ink: #f7fbff;
  --muted: #c3d1d9;
  --line: #587080;
  --brand: #a896ff;
  --deep: #d0c7ff;
  --btn: #111b25;
  --head: #172734;
  --sun: #e0a921;
  --sky: #19465b;
  --pink: #653b55;
  --mint: #244d3c;
  --coral-play: #ff927b;
  --outline: #081018;
}

html {
  background: var(--page);
}

body {
  width: min(calc(100% - 2rem), 1500px);
  min-height: 100dvh;
  margin: 1rem auto;
  overflow-x: clip;
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: 1.5rem;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 80px color-mix(in srgb, #526976 18%, transparent);
}

body::after {
  opacity: 0.035;
  background-image: repeating-linear-gradient(
    0deg,
    transparent 0 5px,
    var(--ink) 5px 5.5px
  );
}

.font-display,
h1,
h2,
h3 {
  font-family: "Avenir Next", "SF Pro Rounded", ui-rounded, system-ui,
    sans-serif;
  font-weight: 800;
}

body > header {
  top: 0.75rem !important;
  width: calc(100% - 2rem);
  margin: 0.75rem auto 1.5rem;
  border: 2px solid var(--outline);
  border-radius: 1rem;
  background: var(--head);
  backdrop-filter: none;
  box-shadow: 5px 5px 0 var(--sun);
}

body > header > div {
  max-width: none;
}

body > header [data-route="home"] > span:first-child {
  border: 2px solid var(--outline);
  border-radius: 0.75rem;
  background: var(--brand);
  box-shadow: 3px 3px 0 var(--sun);
}

.nav {
  padding-inline: 0.2rem;
}

.nav::after {
  height: 0.25rem;
  background: var(--brand);
}

button,
input,
select,
textarea,
dialog {
  font-family: "Avenir Next", ui-sans-serif, system-ui, sans-serif;
}

button {
  transition:
    transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1),
    background-color 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

button:hover {
  transform: translate(-1px, -2px) rotate(-0.35deg);
}

button:active {
  transform: translate(2px, 2px) scale(0.98);
}

[data-action],
.page button[data-route] {
  border: 2px solid var(--outline) !important;
  border-radius: 0.75rem !important;
  box-shadow: 4px 4px 0 var(--outline);
}

[data-action]:hover,
.page button[data-route]:hover {
  box-shadow: 6px 7px 0 var(--sun);
}

[data-action]:active,
.page button[data-route]:active {
  box-shadow: 1px 1px 0 var(--outline);
}

.cta-icon {
  border: 1px solid currentColor;
  border-radius: 0.5rem;
}

#menu {
  border: 2px solid var(--outline);
  border-radius: 1rem;
  background: var(--surface);
  backdrop-filter: none;
  box-shadow: 7px 7px 0 var(--sun);
}

#menuLinks button {
  border-radius: 0.75rem;
}

#menuLinks button[aria-current="page"] {
  background: var(--brand);
  color: var(--btn);
  box-shadow: 4px 4px 0 var(--sun);
}

main {
  background: var(--surface);
}

.page {
  background: var(--surface);
}

.page section {
  padding-top: 6rem;
  padding-bottom: 6rem;
}

.page[data-page="home"] > div:first-child {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(340px, 1.1fr);
  align-items: center;
  gap: clamp(2.5rem, 5vw, 5rem);
  min-height: auto;
  margin: 0 clamp(1rem, 3vw, 3rem);
  padding: clamp(3rem, 6vw, 6rem);
  overflow: visible;
  border: 2px solid var(--outline);
  border-radius: 1.5rem;
  background:
    radial-gradient(circle at 8% 13%, var(--sun) 0 0.35rem, transparent 0.4rem),
    radial-gradient(circle at 88% 10%, var(--pink) 0 0.5rem, transparent 0.55rem),
    radial-gradient(circle at 46% 88%, var(--sky) 0 0.4rem, transparent 0.45rem),
    var(--soft);
  box-shadow: 8px 8px 0 var(--outline);
}

.page[data-page="home"] > div:first-child > img {
  position: relative;
  inset: auto;
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  height: auto;
  min-height: 31rem;
  border: 3px solid var(--outline);
  border-radius: 1.25rem;
  object-fit: cover;
  object-position: 65% center;
  box-shadow: 9px 9px 0 var(--sky);
}

.page[data-page="home"] > div:first-child > div:nth-child(2) {
  display: none;
}

.page[data-page="home"] > div:first-child > div:last-child {
  position: relative;
  z-index: 1;
  grid-column: 1;
  grid-row: 1;
  min-height: 0;
  padding: 0;
}

.page[data-page="home"] > div:first-child > div:last-child > div {
  max-width: 40rem;
  color: var(--ink);
}

.page[data-page="home"] > div:first-child h1 {
  max-width: 11ch;
  font-size: clamp(3rem, 5.7vw, 5.5rem);
  line-height: 0.96;
  letter-spacing: -0.055em;
}

.page[data-page="home"] > div:first-child p {
  color: var(--muted) !important;
}

.page[data-page="home"] > div:first-child button[data-route] {
  border-color: var(--outline) !important;
  background: var(--surface);
  color: var(--ink);
}

.page[data-page="home"] > section:first-of-type {
  margin: 2rem clamp(1rem, 3vw, 3rem);
  border-radius: 1.5rem;
  background: var(--surface);
}

.page[data-page="home"] > section:first-of-type > div {
  max-width: 72rem;
}

.page[data-page="home"] > section:first-of-type h2,
.page[data-page="home"] > section:first-of-type > div > p {
  margin-inline: auto;
  text-align: center;
}

.page > div.mx-auto.grid {
  width: calc(100% - 2rem);
  margin: 1rem auto 3rem;
  padding: clamp(2rem, 5vw, 5rem);
  border: 2px solid var(--outline);
  border-radius: 1.5rem;
  background: var(--soft);
  box-shadow: 8px 8px 0 var(--sun);
}

.page > div.mx-auto.grid figure,
.page figure {
  padding: 0.4rem;
  border: 2px solid var(--outline) !important;
  border-radius: 1.25rem !important;
  background: var(--surface);
  box-shadow: 7px 7px 0 var(--sky) !important;
}

.page > div.mx-auto.grid figure img,
.page figure img {
  border-radius: 0.8rem;
}

.page > section:not(:first-child) > div,
.page[data-page="home"] > section > div {
  max-width: 72rem;
}

.page > section:nth-of-type(even) {
  margin: 2rem clamp(1rem, 3vw, 3rem);
  border: 2px solid var(--outline);
  border-radius: 1.5rem;
  background: var(--soft) !important;
  box-shadow: 8px 8px 0 var(--sun);
}

.page article,
.page li.reveal {
  border: 2px solid var(--outline) !important;
  border-radius: 1rem !important;
  background: var(--surface) !important;
  box-shadow: 5px 5px 0 color-mix(in srgb, var(--outline) 88%, transparent) !important;
}

.page article:nth-child(4n + 2),
.page li.reveal:nth-child(4n + 2) {
  background: color-mix(in srgb, var(--sun) 30%, var(--surface)) !important;
}

.page article:nth-child(4n + 3),
.page li.reveal:nth-child(4n + 3) {
  background: color-mix(in srgb, var(--sky) 68%, var(--surface)) !important;
}

.page article:nth-child(4n),
.page li.reveal:nth-child(4n) {
  background: color-mix(in srgb, var(--pink) 45%, var(--surface)) !important;
}

.page article:hover,
.page li.reveal:hover {
  transform: translate(-2px, -3px) rotate(-0.3deg);
  box-shadow: 8px 9px 0 var(--brand) !important;
}

.page article > i:first-child {
  display: grid;
  width: 3rem;
  height: 3rem;
  place-items: center;
  border: 2px solid var(--outline);
  border-radius: 0.75rem;
  background: var(--sun);
  color: var(--outline);
  box-shadow: 3px 3px 0 var(--outline);
}

.page [class*="rounded-full"][class*="border"] {
  border: 2px solid var(--outline) !important;
  border-radius: 0.75rem !important;
  box-shadow: 3px 3px 0 color-mix(in srgb, var(--outline) 80%, transparent);
}

.page blockquote {
  border: 2px solid var(--outline);
  border-radius: 1rem !important;
  background: var(--brand) !important;
  box-shadow: 7px 7px 0 var(--sun);
}

.page ol + div {
  border: 2px solid var(--outline);
  border-radius: 1rem !important;
  background: var(--brand) !important;
  box-shadow: 6px 6px 0 var(--sun);
}

.reveal {
  filter: none;
  transform: translateY(1.5rem) rotate(0.35deg);
}

.reveal.in {
  transform: translateY(0) rotate(0);
}

main + section {
  margin: 2rem clamp(1rem, 3vw, 3rem);
  border: 2px solid var(--outline);
  border-radius: 1.5rem;
  background: var(--sky) !important;
  color: var(--ink) !important;
  box-shadow: 8px 8px 0 var(--outline);
}

main + section .text-white\/75,
main + section .text-white\/70 {
  color: var(--muted) !important;
}

main + section .border-white\/40 {
  border-color: var(--outline) !important;
  color: var(--ink);
}

footer {
  margin-top: 3rem;
  border-radius: 1.25rem;
  background: var(--sky) !important;
}

#foot button[aria-current="page"] {
  color: var(--deep);
  text-decoration-color: var(--brand);
}

dialog {
  border: 2px solid var(--outline) !important;
  border-radius: 1rem !important;
  box-shadow: 9px 9px 0 var(--sun);
}

input,
select,
textarea {
  border: 2px solid var(--outline) !important;
  border-radius: 0.75rem !important;
  background: var(--surface) !important;
  color: var(--ink) !important;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid var(--sun);
  outline-offset: 2px;
}

#cookie {
  border: 2px solid var(--outline);
  border-radius: 1rem;
  background: var(--surface);
  box-shadow: 7px 7px 0 var(--sun);
}

@media (max-width: 1023px) {
  .page[data-page="home"] > div:first-child {
    grid-template-columns: 1fr;
    padding: clamp(2rem, 7vw, 4rem);
  }

  .page[data-page="home"] > div:first-child > div:last-child {
    grid-column: 1;
    grid-row: 1;
  }

  .page[data-page="home"] > div:first-child > img {
    grid-column: 1;
    grid-row: 2;
    min-height: 24rem;
  }
}

@media (max-width: 767px) {
  body {
    width: 100%;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  body > header {
    width: calc(100% - 1rem);
    margin-top: 0.5rem;
    box-shadow: 4px 4px 0 var(--sun);
  }

  #menu {
    height: calc(100dvh - 6.5rem);
  }

  .page section {
    padding-top: 4.5rem;
    padding-bottom: 4.5rem;
  }

  .page[data-page="home"] > div:first-child {
    margin: 0 0.75rem;
    padding: 2.25rem 1.25rem;
    border-radius: 1rem;
    box-shadow: 5px 5px 0 var(--outline);
  }

  .page[data-page="home"] > div:first-child h1 {
    max-width: 100%;
    font-size: clamp(2.65rem, 13vw, 4rem);
  }

  .page[data-page="home"] .mt-7.flex.gap-3 {
    flex-wrap: wrap;
  }

  .page[data-page="home"] > div:first-child > img {
    min-height: 19rem;
    border-radius: 0.875rem;
    box-shadow: 5px 5px 0 var(--sky);
  }

  .page[data-page="home"] > section:first-of-type,
  .page > section:nth-of-type(even),
  main + section {
    margin-right: 0.75rem;
    margin-left: 0.75rem;
    border-radius: 1rem;
    box-shadow: 5px 5px 0 var(--outline);
  }

  .page > div.mx-auto.grid {
    width: calc(100% - 1.5rem);
    padding: 2rem 1.25rem;
    border-radius: 1rem;
    box-shadow: 5px 5px 0 var(--sun);
  }

  .page article,
  .page li.reveal {
    box-shadow: 4px 4px 0 var(--outline) !important;
  }

  .page dl.grid-cols-3 {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .page dl.grid-cols-3 > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding-block: 0.6rem;
    border-bottom: 1px solid var(--line);
  }

  .page dl.grid-cols-3 > div:last-child {
    border-bottom: 0;
  }

  #formDialog,
  #infoDialog {
    width: calc(100vw - 1rem);
    max-height: calc(100dvh - 1rem);
  }

  #formDialog > div,
  #formDialog > form,
  #infoDialog > div {
    padding-right: 1rem;
    padding-left: 1rem;
  }
}

@media (max-width: 479px) {
  body > header > div {
    padding-inline: 0.75rem;
  }

  .page h2 {
    font-size: clamp(2.15rem, 11vw, 3.25rem);
  }

  .page h3 {
    overflow-wrap: anywhere;
  }

  .page [data-action],
  .page button[data-route] {
    max-width: 100%;
  }

  footer > div {
    padding-inline: 1.25rem !important;
  }
}

@media (max-width: 1279px) and (max-height: 600px) {
  #menu {
    top: calc(100% + 0.5rem);
    height: calc(100dvh - 5.75rem);
    padding: 0.75rem;
  }

  #menuLinks button {
    padding-block: 0.55rem;
    font-size: 1rem;
  }
}

@media (hover: none) {
  button:hover,
  .page article:hover,
  .page li.reveal:hover {
    transform: none;
  }

  [data-action]:hover,
  .page button[data-route]:hover {
    box-shadow: 4px 4px 0 var(--outline);
  }
}

@media (prefers-reduced-motion: reduce) {
  button,
  .reveal,
  .page article,
  .page li.reveal {
    transition: none !important;
    animation: none !important;
    transform: none !important;
  }
}
