/* ============================================================
   site.css, Candela Learnings
   The shared design system for every page: tokens, type, buttons,
   announcement strip, nav, section heads, footer, scroll reveals.
   Direction: the Experiential Learning Kit. Warm paper, ink
   borders, cardboard kraft, Candela orange. No shadows.
   Pages add their own sheet after this one.
   ============================================================ */

:root {
  --paper:      #F4EEE3;
  --paper-2:    #EBE2D1;
  --kraft-lt:   #E6DAC3;
  --kraft:      #C9A877;
  --kraft-dk:   #A98656;
  --kraft-in:   #6E5232;
  --ink:        #1A1F3A;
  --ink-2:      #565B70;
  --ink-soft:   #B9B4AA;
  --flame:      #FF6B1A;
  --flame-ink:  #B4460A;
  --red:        #B3261E;   /* the teacher's pen */

  --line: 1.5px solid var(--ink);
  --r: 2px;

  --f-display: 'Bricolage Grotesque', 'Anek Malayalam', system-ui, sans-serif;
  --f-body:    'Lexend', 'Anek Malayalam', system-ui, sans-serif;
  --f-mono:    'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --nav-h: 72px;
}

html[lang="ml"] {
  --f-display: 'Anek Malayalam', 'Bricolage Grotesque', system-ui, sans-serif;
  --f-body:    'Anek Malayalam', 'Lexend', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 16px); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 1.0625rem;
  font-weight: 350;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3 { font-family: var(--f-display); margin: 0; line-height: 1.05; letter-spacing: -0.02em; text-wrap: balance; }
html[lang="ml"] h1, html[lang="ml"] h2, html[lang="ml"] h3 { letter-spacing: 0; line-height: 1.25; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }

:focus-visible { outline: 3px solid var(--flame); outline-offset: 3px; }
::selection { background: var(--flame); color: var(--ink); }
html { scrollbar-color: var(--kraft-dk) var(--paper-2); accent-color: var(--flame-ink); }
input, textarea { caret-color: var(--flame-ink); }
a { text-underline-offset: 3px; }
.num, .sheet-top, .week-days, .chart-table, .teaser-top, .attend-val { font-variant-numeric: tabular-nums; }

.wrap { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: 24px; }
.mono { font-family: var(--f-mono); font-weight: 500; letter-spacing: 0.02em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.skip {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: var(--r);
}
.skip:focus { top: 12px; }

.lede { color: var(--ink-2); font-size: 1.15rem; max-width: 34em; }

/* ── buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 24px;
  font-family: var(--f-display); font-weight: 650; font-size: 1.02rem; letter-spacing: -0.005em;
  text-decoration: none; border: var(--line); border-radius: var(--r);
  transition: background-color .15s, color .15s;
}
.btn-sm { min-height: 42px; padding: 0 16px; font-size: 0.95rem; }
.btn-solid { background: var(--flame); color: var(--ink); }
.btn-solid:hover { background: var(--ink); color: var(--paper); }
.btn-line { background: transparent; color: var(--ink); }
.btn-line:hover { background: var(--ink); color: var(--paper); }
.link-btn {
  background: none; border: 0; padding: 8px 4px; cursor: pointer;
  font-family: var(--f-display); font-weight: 600; text-decoration: underline; text-underline-offset: 4px;
}

/* ── announcement strip ── */
.strip { background: var(--ink); color: var(--paper); font-size: 0.86rem; }
.strip p { padding-block: 9px; text-align: center; }
.strip a { color: var(--flame); text-underline-offset: 3px; }

/* ── nav ── */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--paper);
  border-bottom: 1.5px solid transparent;
  transition: border-color .2s;
}
.nav.is-stuck { border-bottom-color: var(--ink); }
.nav-row { display: flex; align-items: center; gap: 24px; height: var(--nav-h); }
.nav-logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.nav-logo img { width: 40px; height: 40px; }
.nav-word { font-family: var(--f-display); font-weight: 800; font-size: 1.35rem; line-height: 1; letter-spacing: -0.02em; display: flex; flex-direction: column; }
.nav-word small { font-family: var(--f-mono); font-weight: 500; font-size: 0.58rem; letter-spacing: 0.32em; text-transform: uppercase; margin-top: 4px; color: var(--ink-2); }
.nav nav { flex: 1; }
.nav-links { display: flex; justify-content: center; gap: 4px; }
.nav-links a {
  display: block; padding: 8px 14px; text-decoration: none;
  font-family: var(--f-display); font-weight: 550; font-size: 1rem; border-radius: var(--r);
}
.nav-links a:hover { background: var(--paper-2); }
.nav-links a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; text-decoration-color: var(--flame); }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.lang {
  min-height: 42px; padding: 0 12px; cursor: pointer;
  background: transparent; border: var(--line); border-radius: var(--r);
  font-family: 'Anek Malayalam', var(--f-display); font-weight: 600; font-size: 0.95rem;
}
.lang:hover { background: var(--paper-2); }
html[lang="ml"] .lang { font-family: var(--f-display); }
.nav-burger {
  display: none; width: 44px; height: 44px; padding: 0; cursor: pointer;
  background: transparent; border: var(--line); border-radius: var(--r);
  flex-direction: column; align-items: center; justify-content: center; gap: 6px;
}
.burger-bar { width: 20px; height: 2px; background: var(--ink); transition: transform .2s var(--ease-out); }
.nav-burger[aria-expanded="true"] .burger-bar:nth-of-type(2) { transform: translateY(4px) rotate(45deg); }
.nav-burger[aria-expanded="true"] .burger-bar:nth-of-type(3) { transform: translateY(-4px) rotate(-45deg); }

.nav-links a, .btn, .lang { white-space: nowrap; }
html[lang="ml"] .nav-links a { padding: 8px 9px; font-size: 0.95rem; }
@media (max-width: 1180px) {
  html[lang="ml"] .nav-actions .btn-sm { display: none; }
}
@media (max-width: 980px) {
  .nav-actions .btn-sm { display: none; }
}

.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

/* ── section heads ── */
section h2 { font-size: clamp(2.2rem, 4.6vw, 3.8rem); font-weight: 750; }
html[lang="ml"] section h2 { font-size: clamp(1.9rem, 3.8vw, 3rem); }
.sec-head { margin-bottom: clamp(36px, 5vw, 64px); max-width: 760px; }
.sec-head .lede { margin-top: 18px; }
.sec-head-split { max-width: none; display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; align-items: end; }
.sec-head-split .lede { margin-top: 0; }

/* ── footer ── */
.foot { background: var(--paper); padding-block: 64px 28px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 0.8fr 1fr 1.4fr; gap: 40px; }
.foot-brand p { margin-top: 18px; color: var(--ink-2); max-width: 22em; }
.social { display: flex; gap: 16px; margin-top: 18px; }
.social a { font-family: var(--f-display); font-weight: 600; text-underline-offset: 4px; }
.foot-h { font-family: var(--f-display); font-size: 1rem; font-weight: 700; letter-spacing: 0; margin-bottom: 14px; }
.foot-grid ul li { margin-bottom: 10px; color: var(--ink-2); }
.foot-grid ul a { color: var(--ink); text-decoration: none; }
.foot-grid ul a:hover { text-decoration: underline; text-underline-offset: 4px; }
.foot-base { margin-top: 48px; padding-top: 20px; border-top: var(--line); font-size: 0.75rem; color: var(--ink-2); }

/* ── scroll reveal ── */
.js .rv { opacity: 0; transform: translateY(22px); transition: opacity .6s var(--ease-out), transform .7s var(--ease-out); }
.js .rv.in { opacity: 1; transform: none; }


/* ── join route ── */
.join { padding-block: clamp(64px, 9vw, 128px); border-top: var(--line); }
.route-wrap { position: relative; }
.route { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 3vw, 48px); position: relative; }
.route-line { position: absolute; left: 0; right: 0; top: 23px; height: 0; border-top: 2px dashed var(--kraft-dk); }
.route-line span { position: absolute; left: 0; right: 0; top: -2px; height: 2px; background: var(--ink); transform: scaleX(0); transform-origin: left; }
.route-n { position: relative; z-index: 1; }
.route li { position: relative; }
.route li:nth-child(2) { margin-top: 48px; }
.route li:nth-child(3) { margin-top: 96px; }
.route-n {
  display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 22px;
  background: var(--paper); border: 2px solid var(--ink); border-radius: var(--r); font-size: 1.1rem; font-weight: 600;
}
.route li:nth-child(3) .route-n { background: var(--flame); }
.js .ex-steps .route li { opacity: .35; transition: opacity .45s; }
.js .ex-steps .route li .route-n { transform: scale(.6) rotate(-45deg); transition: transform .5s cubic-bezier(.16, 1, .3, 1), background-color .3s; }
.js .ex-steps .route li.is-on { opacity: 1; }
.js .ex-steps .route li.is-on .route-n { transform: none; }
.route h3 { font-size: 1.6rem; font-weight: 700; margin-bottom: 12px; }
.route p { color: var(--ink-2); }

/* ── close ── */
.close { position: relative; overflow: hidden; background: var(--kraft); border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); padding-block: clamp(96px, 11vw, 150px) clamp(56px, 8vw, 104px); }
.tape {
  position: absolute; left: -5%; right: -5%; top: clamp(22px, 3vw, 40px);
  background: #E8DBB9; border-block: 1.5px solid #7E6A45; transform: rotate(-1.6deg);
  overflow: hidden; white-space: nowrap;
}
.tape-track { display: inline-block; padding: 10px 0; font-family: var(--f-mono); font-weight: 600; font-size: 0.85rem; letter-spacing: 0.22em; text-transform: uppercase; color: #4A3A1F; }
.close-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(24px, 5vw, 72px); align-items: end; }
.close h2 { font-size: clamp(2.6rem, 6vw, 5.2rem); font-weight: 800; letter-spacing: -0.03em; }
.close-side p { font-size: 1.15rem; }
.close .hero-cta { margin-top: 24px; }
.close .btn-line:hover { background: var(--ink); }

/* ── pencil and red pen ── */
.mark { position: absolute; overflow: visible; pointer-events: none; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.mark path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw .42s cubic-bezier(.3, .7, .3, 1) forwards; }
.mark-scribble { inset: 0; width: 100%; height: 100%; stroke: var(--ink); stroke-width: 3.4; }
.mark-tick { position: static; width: 28px; height: 28px; margin-left: auto; flex-shrink: 0; stroke: var(--red); stroke-width: 3.4; }
.mark-tick path { animation-delay: .4s; }
.mark-ring { left: -9px; top: -9px; width: 46px; height: 46px; stroke: var(--red); stroke-width: 2.6; }
.mark-ring path { animation-duration: .6s; animation-delay: .45s; }
.is-picked .bubble { color: transparent; }
.is-instant .mark path, .mark.is-instant path { animation: none; stroke-dashoffset: 0; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ── FAQ ── */
.faq { border-top: var(--line); }
.faq details { border-bottom: var(--line); }
.faq summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 20px;
  padding: 22px 4px; font-family: var(--f-display); font-weight: 650; font-size: clamp(1.1rem, 2vw, 1.35rem); line-height: 1.3;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex-shrink: 0; width: 14px; height: 14px; margin-right: 6px;
  border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: rotate(45deg) translate(-3px, -3px);
  transition: transform .3s var(--ease-out);
}
.faq details[open] summary::after { transform: rotate(225deg) translate(-3px, -3px); }
.faq summary:hover { color: var(--flame-ink); }
.faq .faq-a { padding: 0 4px 24px; max-width: 46em; color: var(--ink-2); font-size: 1.05rem; }
.faq .faq-a a { color: var(--ink); }

/* ── page head (inner pages) ── */
.page-head { padding-block: clamp(48px, 8vw, 104px) clamp(40px, 6vw, 72px); overflow-x: clip; }
.page-head h1 { font-size: clamp(2.8rem, 6.6vw, 5.6rem); font-weight: 800; letter-spacing: -0.035em; line-height: 0.95; max-width: 14ch; }
html[lang="ml"] .page-head h1 { font-size: clamp(2.3rem, 5vw, 4.2rem); line-height: 1.15; }
.page-head h1 em { font-style: normal; color: var(--flame-ink); }
.page-head .lede { margin-top: 24px; font-size: 1.2rem; }

/* ── scroll motion helpers ── */
.progress { position: absolute; left: 0; right: 0; bottom: -1.5px; height: 3px; pointer-events: none; }
.progress i { display: block; height: 100%; background: var(--flame); transform: scaleX(0); transform-origin: left; }

.split .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.split .w > span { display: inline-block; transform: translateY(108%); transition: transform .8s var(--ease-out); transition-delay: calc(var(--i) * 45ms); }
.split.is-in .w > span { transform: none; }

/* ── responsive ── */
@media (max-width: 1080px) {
}

@media (max-width: 900px) {
  :root { --nav-h: 64px; }
  .wrap { padding-inline: 16px; }
  .nav-burger { display: inline-flex; }
  .nav-actions .btn-sm { display: none; }
  .nav nav { flex: 0; }
  .nav-links {
    position: fixed; left: 0; right: 0; top: var(--nav-top, var(--nav-h)); z-index: 49;
    flex-direction: column; gap: 0; padding: 8px 16px 20px;
    background: var(--paper); border-bottom: 2px solid var(--ink);
    display: none;
  }
  .nav-links.is-open { display: flex; }
  .nav-links a { padding: 14px 4px; font-size: 1.25rem; border-bottom: 1px solid var(--kraft); border-radius: 0; }
  .nav-actions { margin-left: auto; gap: 8px; }
  .sec-head-split, .close-grid { grid-template-columns: 1fr; }
  .route { grid-template-columns: 1fr; gap: 36px; padding-left: 64px; }
  .route-line { left: 23px; right: auto; top: 0; bottom: 0; height: auto; border-top: 0; border-left: 2px dashed var(--kraft-dk); }
  .route-line span { left: -2px; right: auto; top: 0; bottom: 0; width: 2px; height: auto; transform: scaleY(0); transform-origin: top; }
  .route li:nth-child(2), .route li:nth-child(3) { margin-top: 0; }
  .route-n { position: absolute; left: -64px; top: -6px; }
  .foot-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .foot-brand { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .hero-cta .btn { flex: 1 1 100%; }
  .nav-word small { display: none; }
  .foot-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-delay: 0s !important; }
  .js .rv { opacity: 1; transform: none; }
  .split .w > span { transform: none; }
  .js .ex-steps .route li { opacity: 1; }
  .js .ex-steps .route li .route-n { transform: none; }
  .mark path { animation: none; stroke-dashoffset: 0; }
}
