/* Thulyr homepage
   Tokens mirror thulyr-planner/design-system/tokens so this page stands alone.
   Re-sync the :root block if the design system changes. */

/* ---------- Fonts ----------
   Fredoka is self-hosted. It carries the brand and the wordmark, so it must not
   depend on a third-party CDN being reachable. Variable file, weight axis
   300-700, latin subset. Mulish and JetBrains Mono still come from Google Fonts
   (linked in <head>) and fall back to system faces if that fails. */
@font-face {
  font-family: 'Fredoka';
  src: url('assets/fonts/fredoka-variable-latin.a78a2136.woff2') format('woff2');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Tokens ---------- */
:root {
  --brand-sprout: #78C64E;
  --brand-spark:  #87D328;
  --brand-cream:  #F2E9D5;
  --brand-ink:    #080707;

  --green-50:  #F0F9E6;
  --green-100: #DDF1C6;
  --green-200: #C3E79C;
  --green-300: #A4DB6F;
  --green-400: #87D328;
  --green-500: #78C64E;
  --green-600: #5DA838;
  --green-700: #47872A;
  --green-750: #3E7D26;
  --green-800: #356421;
  --green-900: #244517;

  --n-0:   #FFFFFF;
  --n-25:  #FBF9F5;
  --n-50:  #F4F1EA;
  --n-100: #ECE8DF;
  --n-150: #E6E1D9;
  --n-200: #D9D4C9;
  --n-300: #C5BEB2;
  --n-400: #A9A296;
  --n-500: #8A8377;
  --n-600: #6C665C;
  --n-700: #4F4A42;
  --n-800: #33302B;
  --n-850: #24221E;
  --n-900: #1A1815;
  --n-950: #080707;

  --ink:   #23201A;
  --cream: #F2E9D5;

  --amber-50:  #FBEFD6;
  --amber-300: #EECB84;
  --amber-500: #E0A93A;
  --amber-700: #9C6A20;

  /* BER bands, Ireland's 8-band scale (24 May 2026) */
  --ber-a0: #1C7C3C;
  --ber-a:  #2E9E4B;
  --ber-b:  #5FB23E;
  --ber-c:  #9BC13A;
  --ber-d:  #E0B93A;
  --ber-e:  #E28E2E;
  --ber-f:  #D2632A;
  --ber-g:  #C0492E;

  --font-display: 'Fredoka', system-ui, sans-serif;
  --font-body: 'Mulish', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --container: 1160px;
  --ease-out: cubic-bezier(.22,.7,.28,1);
}

/* Light */
:root {
  color-scheme: light;
  --surface-page:   var(--n-150);
  --surface-card:   var(--n-25);
  --surface-raised: var(--n-0);
  --surface-sunken: var(--n-100);

  --text-strong: var(--ink);
  --text-body:   #3A362E;
  --text-muted:  var(--n-600);
  --text-subtle: var(--n-500);
  --text-link:   var(--green-800);

  --border-subtle:  var(--n-200);
  --border-default: var(--n-300);
  --border-strong:  var(--n-400);

  --action-primary:       var(--green-750);
  --action-primary-hover: var(--green-800);
  --action-primary-text:  #FFFFFF;

  --positive-text: var(--green-800);
  --warning-text:  #7A5218;
  --warning-bg:    var(--amber-50);

  --cta-glow: rgba(62,125,38,.55);
}

/* Dark */
[data-theme="dark"] {
  color-scheme: dark;
  --surface-page:   var(--n-950);
  --surface-card:   #17150F;
  --surface-raised: #201E16;
  --surface-sunken: #100F0B;

  --text-strong: var(--cream);
  --text-body:   #D8D0BE;
  --text-muted:  #9A9284;
  --text-subtle: #786F60;
  --text-link:   var(--green-300);

  --border-subtle:  rgba(242,233,213,.10);
  --border-default: rgba(242,233,213,.17);
  --border-strong:  rgba(242,233,213,.28);

  --action-primary:       var(--green-500);
  --action-primary-hover: var(--green-400);
  --action-primary-text:  #0C1408;

  --positive-text: var(--green-300);
  --warning-text:  var(--amber-300);
  --warning-bg:    rgba(224,169,58,.16);

  --cta-glow: #78C64E;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
  background: var(--surface-page);
}

body {
  background: var(--surface-page);
  color: var(--text-body);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--text-link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

::selection { background: var(--green-500); color: #0C1408; }

:focus-visible {
  outline: 3px solid var(--action-primary);
  outline-offset: 2px;
}
[data-theme="dark"] :focus-visible { outline-color: var(--green-400); }

.skip {
  position: fixed; left: -9999px; top: 0; z-index: 200;
  background: var(--action-primary); color: var(--action-primary-text);
  padding: 12px 18px; border-radius: 0 0 12px 0; font-weight: 700;
}
.skip:focus { left: 0; }

.wrap { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 28px; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text-strong);
}

.eyebrow {
  display: block;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .06em;
  color: var(--positive-text);
  margin-bottom: 14px;
}

.tagline {
  display: block;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: .22em;
  text-transform: uppercase;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 11px;
  font-family: var(--font-body); font-weight: 700;
  text-decoration: none; border: 0; cursor: pointer;
  border-radius: 999px;
  background: var(--action-primary);
  color: var(--action-primary-text);
  transition: background .15s var(--ease-out), box-shadow .2s var(--ease-out);
}
.btn:hover { background: var(--action-primary-hover); }

.btn-sm {
  font-size: 15px; padding: 11px 20px; min-height: 44px; gap: 9px;
  box-shadow: 0 12px 26px -16px var(--cta-glow);
}
.btn-lg {
  font-size: 17.5px; padding: 18px 34px; min-height: 58px;
  box-shadow: 0 18px 40px -20px var(--cta-glow);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--surface-page);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--border-subtle);
}
.site-header .wrap {
  display: flex; align-items: center; gap: 24px;
  min-height: 74px; padding-top: 10px; padding-bottom: 10px;
}

.brand { display: flex; align-items: center; flex: 0 1 auto; min-width: 0; }
.brand img { height: 30px; width: auto; }
.brand .wm-dark { display: none; }
[data-theme="dark"] .brand .wm-dark { display: block; }
[data-theme="dark"] .brand .wm-light { display: none; }

.site-nav { display: flex; gap: 2px; margin-left: auto; align-items: center; }
.site-nav a {
  color: var(--text-body); text-decoration: none;
  font-size: 15px; font-weight: 600; white-space: nowrap;
  padding: 9px 14px; border-radius: 999px;
  transition: color .12s var(--ease-out), background .12s var(--ease-out);
}
.site-nav a:hover { color: var(--text-strong); background: var(--surface-card); }

.header-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; margin-left: auto; }
.site-nav + .header-actions { margin-left: 0; }

.theme-toggle {
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--border-subtle);
  border-radius: 999px; color: var(--text-muted); cursor: pointer;
  transition: color .12s var(--ease-out), border-color .12s var(--ease-out);
}
.theme-toggle:hover { color: var(--text-strong); border-color: var(--border-default); }
/* Show the icon for the mode the click switches TO: a sun in dark (go light),
   a moon in light (go dark). */
.theme-toggle .sun { display: none; }
.theme-toggle .moon { display: block; }
[data-theme="dark"] .theme-toggle .sun { display: block; }
[data-theme="dark"] .theme-toggle .moon { display: none; }

/* ---------- Sections ---------- */
.sect { padding: clamp(64px, 8vw, 104px) 0; }

.section-head { max-width: 60ch; margin-bottom: clamp(36px, 4vw, 52px); }
.section-head h2 {
  font-size: clamp(30px, 3.6vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.015em;
}
.section-head p { margin-top: 20px; font-size: 18px; color: var(--text-muted); max-width: 66ch; }

.band-sunken { background: var(--surface-sunken); border-top: 1px solid var(--border-subtle); }

.glow {
  position: absolute; width: min(980px, 110%); aspect-ratio: 1;
  background: radial-gradient(circle, rgba(120,198,78,.17), transparent 62%);
  pointer-events: none;
}

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  padding: clamp(56px, 8vw, 108px) 0 clamp(56px, 7vw, 96px);
}
.hero .glow { left: 12%; top: -30%; transform: translateX(-50%); }
.hero-sprout {
  position: absolute; right: -70px; bottom: -110px;
  width: min(420px, 40vw); opacity: .06; pointer-events: none;
  filter: grayscale(1) brightness(2.6);
}
.hero .wrap { position: relative; z-index: 1; }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  gap: clamp(40px, 5vw, 76px);
  align-items: center;
}
.hero-copy, .hero-visual { min-width: 0; }

.hero .tagline { margin-bottom: 22px; color: var(--positive-text); }

.hero h1 {
  font-size: clamp(40px, 5.4vw, 66px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  max-width: 17ch;
}
.hero h1 .hl { color: var(--positive-text); }

.hero .lede {
  margin-top: 26px;
  font-size: clamp(18px, 1.6vw, 21px);
  line-height: 1.6;
  color: var(--text-body);
  max-width: 45ch;
}

.hero-cta { margin-top: 36px; }

.hero-trust {
  display: flex; flex-wrap: wrap; gap: 10px 22px;
  margin-top: 22px;
  font-size: 14.5px; font-weight: 700; color: var(--text-muted);
}
.hero-trust .sep { color: var(--border-default); }

.hero-scope {
  margin-top: 30px; padding-top: 22px;
  border-top: 1px solid var(--border-subtle);
  font-size: 14.5px; line-height: 1.6;
  color: var(--text-muted); max-width: 46ch;
}
.hero-scope .nb { white-space: nowrap; }

/* ---------- Plan card ---------- */
.plan-card {
  background: linear-gradient(180deg, var(--surface-raised), var(--surface-card));
  border: 1px solid var(--border-default);
  border-radius: 26px;
  box-shadow: 0 4px 12px rgba(0,0,0,.5), 0 40px 80px -34px rgba(0,0,0,.9);
  padding: 26px 26px 22px;
}
[data-theme="light"] .plan-card,
:root:not([data-theme="dark"]) .plan-card {
  box-shadow: 0 4px 12px rgba(8,7,7,.07), 0 40px 80px -34px rgba(8,7,7,.30);
}

.pc-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 14px; margin-bottom: 26px;
}
.pc-title { font-family: var(--font-display); font-weight: 600; font-size: 18px; color: var(--text-strong); }
.pc-sub {
  font-family: var(--font-mono); font-size: 11.5px;
  letter-spacing: .04em; text-transform: uppercase; color: var(--text-subtle);
}

.climb-track { position: relative; height: 74px; margin-bottom: 8px; }
.climb {
  position: absolute; top: 0; left: 31.25%; transform: translateX(-50%);
  animation: climb 2.6s var(--ease-out) .55s 1 both;
}
.ber-chip {
  position: absolute; left: 50%; top: 0; transform: translateX(-50%);
  font-family: var(--font-mono); font-weight: 700; font-size: 21px;
  width: 48px; height: 48px; border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #0C1408;
}
.ber-chip.from { background: var(--ber-e); animation: fadeOut 2.6s linear .55s 1 both; }
.ber-chip.to   { background: var(--ber-b); box-shadow: 0 12px 28px -12px #5FB23E; animation: fadeIn 2.6s linear .55s 1 both; }

.scale { position: relative; height: 12px; margin-bottom: 12px; }
.scale-inner { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.scale-inner span { border-radius: 4px; }
.scale-inner .dim { opacity: .2; }
.scale-inner .lit { animation: lightUp .5s ease-out 1 both; }

.scale-labels {
  display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--text-subtle); text-align: center; margin-bottom: 24px;
}

.measures { list-style: none; display: flex; flex-direction: column; }
.measures li {
  display: grid; grid-template-columns: 26px minmax(0, 1fr) auto;
  gap: 14px; align-items: center;
  padding: 12px 0; border-top: 1px solid var(--border-subtle);
}
.measures .step {
  font-family: var(--font-mono); font-size: 12.5px; font-weight: 700;
  width: 26px; height: 26px; border-radius: 999px;
  background: rgba(120,198,78,.14); color: var(--text-link);
  display: inline-flex; align-items: center; justify-content: center;
}
.measures .name { display: block; font-size: 15px; font-weight: 700; color: var(--text-strong); }
.measures .phase { display: block; font-size: 12.5px; color: var(--text-muted); }
.measures .grant {
  font-family: var(--font-mono); font-size: 13.5px;
  color: var(--text-link); white-space: nowrap;
}

.plan-foot {
  margin-top: 16px; padding: 0 6px;
  font-size: 12.5px; line-height: 1.6; color: var(--text-muted);
}

/* ---------- Cards (why order matters) ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: 22px;
  padding: 28px 26px;
  transition: border-color .2s var(--ease-out);
}
.card:hover { border-color: var(--border-default); }
.card .tag {
  display: inline-block;
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--warning-text); background: var(--warning-bg);
  padding: 5px 11px; border-radius: 999px; margin-bottom: 18px;
}
.card h3 { font-size: 21px; line-height: 1.25; margin-bottom: 12px; }
.card p { font-size: 15.5px; color: var(--text-muted); text-wrap: pretty; }

/* ---------- Steps ---------- */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 28px; }
.step-card { border-top: 1px solid var(--border-default); padding-top: 24px; }
.step-card .num {
  display: block;
  font-family: var(--font-mono); font-size: 12.5px; font-weight: 700;
  letter-spacing: .1em; color: var(--positive-text); margin-bottom: 16px;
}
.step-card h3 { font-size: 22px; line-height: 1.25; margin-bottom: 12px; }
.step-card p { font-size: 16px; color: var(--text-muted); text-wrap: pretty; }

/* ---------- Other homes ---------- */
.other-homes { padding: clamp(56px, 7vw, 88px) 0; }
.split {
  border-top: 1px solid var(--border-strong);
  padding-top: 18px;
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 72px);
  align-items: start;
}
.split-label { display: flex; flex-direction: column; gap: 10px; }
.split-label .lbl {
  font-family: var(--font-mono); font-size: 11.5px;
  letter-spacing: .16em; text-transform: uppercase; color: var(--text-subtle);
}
.split-label .dot { width: 26px; height: 26px; border-radius: 50%; background: var(--green-500); flex: 0 0 auto; }

.split h2 {
  font-size: clamp(30px, 4.4vw, 50px);
  line-height: 1.06; letter-spacing: -0.02em;
  margin-bottom: 24px; max-width: 22ch;
}
.split p {
  font-size: clamp(17px, 1.5vw, 19px); line-height: 1.62;
  color: var(--text-body); max-width: 58ch; text-wrap: pretty;
  margin-bottom: 16px;
}
.split p.last { margin-bottom: 30px; }

.email-link {
  display: inline-flex; align-items: baseline; gap: 12px;
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(20px, 2.2vw, 26px);
  color: var(--text-strong); text-decoration: none;
  border-bottom: 2px solid var(--green-500);
  padding-bottom: 4px; line-height: 1.2;
  transition: color .15s var(--ease-out), border-color .15s var(--ease-out);
}
.email-link:hover { color: var(--positive-text); border-color: var(--text-strong); }
.email-link .arrow { font-size: .8em; }

.split .fineprint {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .02em;
  color: var(--text-subtle); margin: 26px 0 0; max-width: 56ch; line-height: 1.7;
}

/* ---------- Closing ---------- */
.closing {
  position: relative; overflow: hidden; text-align: center;
  border-top: 1px solid var(--border-subtle);
  padding: clamp(72px, 9vw, 116px) 0;
}
.closing .glow { left: 50%; top: 50%; transform: translate(-50%,-50%); width: min(900px, 120%); }
.closing .wrap { position: relative; z-index: 1; }
.closing h2 {
  font-size: clamp(32px, 4vw, 48px); line-height: 1.1;
  letter-spacing: -0.015em; margin: 0 auto; max-width: 18ch;
}
.closing .lede { color: var(--text-muted); margin: 20px auto 0; max-width: 50ch; font-size: 17.5px; }
.closing .btn { margin-top: 34px; }
.closing .fine { margin: 20px auto 0; font-size: 14px; color: var(--text-muted); line-height: 1.6; max-width: 58ch; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--surface-sunken); color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
  padding: 54px 0 40px; font-size: 14.5px;
}
.footer-grid { display: flex; flex-wrap: wrap; gap: 36px; justify-content: space-between; align-items: flex-start; }
.footer-brand { max-width: 46ch; }
.footer-brand img { height: 32px; width: auto; margin-bottom: 12px; }
.footer-brand .wm-dark { display: none; }
[data-theme="dark"] .footer-brand .wm-dark { display: block; }
[data-theme="dark"] .footer-brand .wm-light { display: none; }
.footer-brand .tagline { color: var(--text-subtle); font-size: 12.5px; margin-bottom: 16px; }
.footer-brand p { line-height: 1.6; }

.footer-links { display: flex; flex-wrap: wrap; gap: 10px 28px; }

.footer-bottom {
  margin-top: 38px; padding-top: 22px;
  border-top: 1px solid var(--border-subtle);
  display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between;
  font-size: 13.5px; color: var(--text-muted);
}
.footer-bottom .legal { max-width: 62ch; line-height: 1.6; }

[lang="ta"] { font-family: 'Noto Sans Tamil', 'Tamil Sangam MN', 'Nirmala UI', var(--font-body); }

/* ---------- Animation ---------- */
@keyframes climb   { from { left: 31.25%; } to { left: 68.75%; } }
@keyframes fadeOut { 0%, 34% { opacity: 1; } 52%, 100% { opacity: 0; } }
@keyframes fadeIn  { 0%, 34% { opacity: 0; } 52%, 100% { opacity: 1; } }
@keyframes lightUp { from { opacity: .18; } to { opacity: 1; } }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .wrap { padding-left: 20px; padding-right: 20px; }
  .sect, .other-homes, .closing { padding-top: 58px; padding-bottom: 58px; }
  .hero { padding-top: 58px; padding-bottom: 58px; }
  .hero-grid, .split { grid-template-columns: minmax(0, 1fr); gap: 34px; }
  .site-nav { display: none; }
  .hero h1 { font-size: 36px; max-width: none; }
  .section-head h2 { font-size: 28px; }
  .split h2, .closing h2 { font-size: 32px; }
  .hero .lede { font-size: 17.5px; }
  .btn-lg { width: 100%; justify-content: center; padding-left: 20px; padding-right: 20px; }
  .plan-card { padding: 20px 18px 16px; border-radius: 20px; }
  .split-label { flex-direction: row; align-items: center; gap: 12px; }
  .email-link { font-size: 21px; }
  .glow { display: none; }
}

@media (max-width: 430px) {
  .measures li { grid-template-columns: 24px minmax(0, 1fr); row-gap: 4px; }
  .measures .grant { grid-column: 2; justify-self: start; }
  .email-link { font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  .climb { left: 68.75%; }
  .ber-chip.from { opacity: 0; }
  .ber-chip.to, .scale-inner .lit { opacity: 1; }
}

/* ---------- Print ---------- */
@media print {
  .site-header, .theme-toggle, .hero-sprout, .glow { display: none !important; }
  body, .hero, .closing, .site-footer, .plan-card { background: #fff !important; }
  body *, .site-footer * { color: #000 !important; }
  .climb { left: 68.75% !important; }
  .ber-chip.from { display: none !important; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 11px; }
}
