@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Fraunces:opsz,wght@9..144,600;9..144,700&display=swap');

:root {
  --ink: #19323c;
  --muted: #586970;
  --paper: #fff9ef;
  --white: #ffffff;
  --teal: #067a78;
  --teal-dark: #045e5c;
  --coral: #ed6a5a;
  --yellow: #f5c451;
  --sky: #7cc6de;
  --leaf: #75a84f;
  --line: #d9ddd7;
  --shadow: 0 16px 40px rgba(25, 50, 60, 0.11);
  --content: 1160px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "DM Sans", sans-serif;
  line-height: 1.6;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background-image: radial-gradient(rgba(25, 50, 60, 0.08) 0.7px, transparent 0.7px);
  background-size: 18px 18px;
  pointer-events: none;
}

a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 20;
  padding: 10px 14px;
  color: var(--white);
  background: var(--ink);
  transform: translateY(-150%);
}

.skip-link:focus { transform: translateY(0); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 76px;
  padding: 12px max(24px, calc((100vw - var(--content)) / 2));
  background: rgba(255, 249, 239, 0.94);
  border-bottom: 1px solid rgba(25, 50, 60, 0.12);
  backdrop-filter: blur(12px);
}

.brand, .footer-brand {
  color: var(--ink);
  font-family: "Fraunces", serif;
  font-size: 1.15rem;
  text-decoration: none;
}

.brand { display: flex; align-items: center; gap: 11px; }
.brand strong { color: var(--teal); font-weight: 700; }

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  background: var(--teal);
  border-radius: 50%;
}

.brand-mark i { position: absolute; width: 9px; height: 9px; border-radius: 50%; background: var(--yellow); }
.brand-mark i:nth-child(1) { transform: translate(-8px, -5px); }
.brand-mark i:nth-child(2) { background: var(--coral); transform: translate(8px, -5px); }
.brand-mark i:nth-child(3) { background: var(--white); transform: translateY(9px); }

.site-nav { display: flex; align-items: center; gap: 6px; }
.site-nav a { padding: 9px 13px; color: var(--muted); font-weight: 600; text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--teal-dark); }
.site-nav .nav-action { margin-left: 6px; color: var(--white); background: var(--teal); border-radius: 6px; }
.site-nav .nav-action:hover, .site-nav .nav-action[aria-current="page"] { color: var(--white); background: var(--teal-dark); }
.menu-button { display: none; }

main { min-height: 70vh; }

.hero, .page-intro, .section, .support-layout, .contact-layout, .privacy-layout {
  width: min(var(--content), calc(100% - 48px));
  margin-inline: auto;
}

.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(40px, 7vw, 88px);
  align-items: center;
  min-height: calc(100vh - 76px);
  max-height: 820px;
  padding-block: 72px 92px;
}

.eyebrow { margin: 0 0 10px; color: var(--teal-dark); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
h1, h2, h3 { margin-top: 0; font-family: "Fraunces", serif; line-height: 1.12; }
h1 { margin-bottom: 22px; font-size: clamp(3rem, 6vw, 5.7rem); letter-spacing: 0; }
h2 { margin-bottom: 18px; font-size: clamp(2rem, 4vw, 3.35rem); letter-spacing: 0; }
h3 { margin-bottom: 9px; font-size: 1.3rem; letter-spacing: 0; }
.hero-copy > p:not(.eyebrow), .page-intro > p:not(.eyebrow) { max-width: 650px; color: var(--muted); font-size: 1.13rem; }
.button-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 11px 19px; border: 2px solid var(--teal); border-radius: 6px; color: var(--white); background: var(--teal); font-weight: 700; text-decoration: none; cursor: pointer; }
.button:hover { background: var(--teal-dark); border-color: var(--teal-dark); }
.button-secondary { color: var(--teal-dark); background: transparent; }
.button-secondary:hover { color: var(--white); }

.learning-board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: min(480px, 100%);
  aspect-ratio: 1 / 1;
  padding: 18px;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transform: rotate(1.5deg);
}

.learning-tile { display: flex; flex-direction: column; justify-content: space-between; min-width: 0; padding: 22px; overflow: hidden; }
.learning-tile span { font-family: "Fraunces", serif; font-size: clamp(1.35rem, 3vw, 2.4rem); font-weight: 700; line-height: 1; }
.learning-tile small { font-weight: 700; }
.tile-atlas { color: var(--white); background: var(--teal); }
.tile-body { background: var(--coral); }
.tile-letters { background: var(--yellow); }
.tile-space { color: var(--white); background: var(--ink); }
.board-note { position: absolute; right: -12px; bottom: 30px; padding: 9px 13px; color: var(--ink); background: var(--sky); font-weight: 700; box-shadow: 4px 5px 0 var(--ink); transform: rotate(-3deg); }

.section { padding-block: 88px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 32px; }
.section-heading h2 { max-width: 680px; margin-bottom: 0; }
.text-link { color: var(--teal-dark); font-weight: 700; text-underline-offset: 4px; }
.band { background: var(--white); border-block: 1px solid var(--line); }

.principles, .app-grid, .answer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.principle { padding: 24px 0; border-top: 4px solid var(--coral); }
.principle:nth-child(2) { border-color: var(--teal); }
.principle:nth-child(3) { border-color: var(--yellow); }
.principle p, .app-card p, .answer-card p { margin-bottom: 0; color: var(--muted); }

.app-card, .answer-card { padding: 25px; background: var(--white); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 7px 20px rgba(25, 50, 60, 0.06); }
.app-card { min-height: 205px; }
.app-card:nth-child(4n + 1) { border-top: 7px solid var(--teal); }
.app-card:nth-child(4n + 2) { border-top: 7px solid var(--coral); }
.app-card:nth-child(4n + 3) { border-top: 7px solid var(--yellow); }
.app-card:nth-child(4n + 4) { border-top: 7px solid var(--sky); }
.app-card .app-number { display: block; margin-bottom: 26px; color: var(--muted); font-size: 0.78rem; font-weight: 700; }

.page-intro { padding-block: 88px 55px; }
.page-intro h1 { max-width: 860px; font-size: clamp(2.8rem, 5.5vw, 5rem); }
.support-layout, .contact-layout, .privacy-layout { display: grid; grid-template-columns: 0.72fr 1.28fr; gap: clamp(35px, 7vw, 90px); padding-bottom: 100px; }
.side-note { padding-top: 10px; }
.side-note p { color: var(--muted); }
.support-steps { margin: 0; padding: 0; list-style: none; counter-reset: support; }
.support-steps li { position: relative; padding: 0 0 28px 58px; counter-increment: support; }
.support-steps li::before { position: absolute; left: 0; display: grid; place-items: center; width: 38px; height: 38px; content: counter(support); color: var(--white); background: var(--teal); border-radius: 50%; font-weight: 700; }
.support-steps strong { display: block; margin-bottom: 3px; }
.support-steps p { margin: 0; color: var(--muted); }

.privacy-section { padding: 30px 0; border-top: 1px solid var(--line); }
.privacy-section:first-child { padding-top: 0; border-top: 0; }
.privacy-section p, .privacy-section li { color: var(--muted); }

.contact-form { padding: 30px; background: var(--white); border: 1px solid var(--line); box-shadow: var(--shadow); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field-full { grid-column: 1 / -1; }
.field label { font-weight: 700; }
.field small { color: var(--muted); }
.field input, .field select, .field textarea { width: 100%; padding: 12px 13px; color: var(--ink); background: var(--paper); border: 1px solid #aeb9b7; border-radius: 4px; }
.field textarea { min-height: 160px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 3px solid rgba(6, 122, 120, 0.18); border-color: var(--teal); }
.honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-footer { display: flex; align-items: center; gap: 18px; margin-top: 20px; }
.form-status { margin: 0; font-weight: 600; }
.form-status[data-state="success"] { color: #2f7138; }
.form-status[data-state="error"] { color: #a33b32; }

.site-footer { display: grid; grid-template-columns: 1fr auto; gap: 28px 50px; padding: 55px max(24px, calc((100vw - var(--content)) / 2)); color: var(--white); background: var(--ink); }
.site-footer p { margin: 7px 0 0; color: #c4d0d3; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 9px 22px; align-items: start; }
.site-footer a { color: var(--white); }
.site-footer .copyright { grid-column: 1 / -1; padding-top: 24px; border-top: 1px solid rgba(255,255,255,0.2); font-size: 0.88rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 800px) {
  .site-header { min-height: 68px; }
  .brand { font-size: 1rem; }
  .brand-mark { width: 36px; height: 36px; }
  .menu-button { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: 4px; }
  .menu-icon, .menu-icon::before, .menu-icon::after { display: block; width: 20px; height: 2px; content: ""; background: currentColor; }
  .menu-icon { position: relative; }
  .menu-icon::before { position: absolute; top: -6px; }
  .menu-icon::after { position: absolute; top: 6px; }
  .site-nav { position: absolute; top: 68px; right: 0; left: 0; display: none; flex-direction: column; align-items: stretch; padding: 12px 24px 20px; background: var(--paper); border-bottom: 1px solid var(--line); }
  .site-nav[data-open="true"] { display: flex; }
  .site-nav .nav-action { margin: 4px 0 0; text-align: center; }
  .hero { grid-template-columns: 1fr; min-height: auto; max-height: none; padding-block: 58px 74px; }
  .hero-copy { order: 1; }
  .learning-board { order: 2; justify-self: center; }
  .principles, .app-grid, .answer-grid { grid-template-columns: 1fr 1fr; }
  .support-layout, .contact-layout, .privacy-layout { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .hero, .page-intro, .section, .support-layout, .contact-layout, .privacy-layout { width: min(100% - 32px, var(--content)); }
  .brand strong { display: none; }
  h1 { font-size: 2.9rem; }
  .hero { gap: 44px; padding-top: 44px; }
  .learning-board { padding: 10px; gap: 8px; }
  .learning-tile { padding: 14px; }
  .board-note { right: -4px; bottom: 20px; font-size: 0.82rem; }
  .section { padding-block: 64px; }
  .section-heading { display: block; }
  .section-heading .text-link { display: inline-block; margin-top: 8px; }
  .principles, .app-grid, .answer-grid, .form-grid { grid-template-columns: 1fr; }
  .field-full { grid-column: auto; }
  .contact-form { padding: 20px; }
  .form-footer { align-items: stretch; flex-direction: column; }
  .site-footer { grid-template-columns: 1fr; }
  .site-footer nav { flex-direction: column; }
  .site-footer .copyright { grid-column: auto; }
}

@media (prefers-reduced-motion: no-preference) {
  [data-view] { animation: reveal 360ms ease both; }
  .learning-tile { animation: tile-in 500ms ease both; }
  .learning-tile:nth-child(2) { animation-delay: 80ms; }
  .learning-tile:nth-child(3) { animation-delay: 160ms; }
  .learning-tile:nth-child(4) { animation-delay: 240ms; }
  @keyframes reveal { from { opacity: 0; transform: translateY(8px); } }
  @keyframes tile-in { from { opacity: 0; transform: scale(0.94); } }
}
