/* Autism Brother — green/white tokens, shared with Calm Critter Meadow and Calm Coloring Studio.
 * The raw --green-* ramp is the brand. Everything a component paints uses the semantic
 * aliases below, so [data-theme="dark"] can retint the whole site in one place. */
:root {
  color-scheme: light;

  --green-900: #1e3a2f;
  --green-700: #2f6b52;
  --green-500: #4f9b76;
  --green-300: #95c6a9;
  --green-100: #d8e2dc;
  --green-50:  #eef6f1;
  --amber:     #f2d388;

  --bg:          #f4f7f4;
  --surface:     #ffffff;
  --ink:         #2c3e35;
  --muted:       #5a6f66;
  --line:        #dfe8e2;
  --tint:        #eef6f1;
  --tint-line:   #d8e2dc;
  --heading:     #1e3a2f;
  --accent:      #2f6b52;
  --accent-soft: #95c6a9;
  --field-bg:    #ffffff;
  --header-bg:   rgba(255, 255, 255, .92);
  --btn-bg:      #2f6b52;
  --btn-ink:     #ffffff;
  --warn-bg:     #fdf3dd;
  --warn-ink:    #8a5a2b;
  --warn-line:   #f0dcae;
  --shadow:      0 1px 2px rgba(30, 58, 47, .05), 0 10px 30px rgba(30, 58, 47, .06);

  --radius: 18px;
  --max:    1120px;
}

[data-theme="dark"] {
  color-scheme: dark;

  --bg:          #0f1f18;
  --surface:     #16291f;
  --ink:         #d9e7df;
  --muted:       #9db3a8;
  --line:        #26402f;
  --tint:        #1b3128;
  --tint-line:   #2c4a3a;
  --heading:     #e6f2ea;
  --accent:      #8fd2b1;
  --accent-soft: #3f8763;
  --field-bg:    #12251c;
  --header-bg:   rgba(15, 31, 24, .9);
  --btn-bg:      #2f7f5c;
  --btn-ink:     #f4fbf7;
  --warn-bg:     #33280f;
  --warn-ink:    #e6c483;
  --warn-line:   #5a4622;
  --shadow:      0 1px 2px rgba(0, 0, 0, .5), 0 10px 30px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
img, svg { max-width: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 "Segoe UI", "Nirmala UI", "Noto Sans Devanagari", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s ease, color .25s ease;
}

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; color: var(--heading); letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 1.2rem + 3.2vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.1rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1rem; }
a { color: var(--accent); }

.wrap {
  max-width: var(--max); margin: 0 auto;
  padding-inline: max(20px, env(safe-area-inset-left)) max(20px, env(safe-area-inset-right));
}
.section { padding: 72px 0; }
.section--tint { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.eyebrow {
  display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent); margin-bottom: .6rem;
}
.lede { font-size: 1.08rem; color: var(--muted); max-width: 62ch; }

/* ── header ─────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  transition: background-color .25s ease, border-color .25s ease;
}
/* Equal side tracks that cannot be squeezed: the nav sits on the exact centre of the
 * bar in either language, and brand plus switches keep the same gutters as the body. */
.site-header .wrap {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center; column-gap: 20px; min-height: 68px; padding-block: 8px;
}
.brand { grid-row: 1; justify-self: start; display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--heading); text-decoration: none; white-space: nowrap; }
.brand svg, .brand__mark { width: 30px; height: 30px; flex: none; }

.nav { grid-row: 1; justify-self: center; display: flex; align-items: center; gap: 4px; }
.nav a {
  text-decoration: none; color: var(--muted); font-size: .93rem; font-weight: 600;
  padding: 9px 13px; border-radius: 999px; white-space: nowrap;
}
.nav a:hover { background: var(--tint); color: var(--heading); }

.controls { grid-row: 1; grid-column: 3; justify-self: end; display: flex; gap: 8px; flex: none; }
/* 90px is the same floor for both switches: "हिन्दी"/"English" and "☾ Dark"/"☀ Light" swap on
 * click, and an equal floor means the bar cannot shuffle when they do. Below 480px the floor
 * goes away entirely — there the pair has to be only as wide as its labels to keep the row. */
.toggle {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 90px; min-height: 38px;
  font: inherit; font-size: .84rem; font-weight: 700; white-space: nowrap;
  color: var(--muted); background: transparent; border: 1px solid var(--line);
  border-radius: 999px; padding: 7px 12px;
  transition: border-color .2s ease, color .2s ease, background-color .2s ease;
}
.toggle:hover { border-color: var(--accent-soft); color: var(--heading); background: var(--tint); }
.toggle[aria-pressed="true"] { color: var(--heading); border-color: var(--accent-soft); }

/* Below desktop width the bar breaks into two level rows: identity and switches on
 * the first, the nav as one scrollable strip on the second. */
@media (max-width: 1199px) {
  .site-header .wrap { grid-template-columns: 1fr auto; column-gap: 12px; row-gap: 8px; min-height: 0; padding-block: 10px; }
  .brand { grid-column: 1; }
  .controls { grid-column: 2; }
  .nav {
    grid-row: 2; grid-column: 1 / -1; justify-self: stretch; justify-content: flex-start;
    overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: 2px;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: 11px 14px; }
  .toggle { min-height: 42px; }
}
@media (min-width: 900px) and (max-width: 1199px) { .nav { justify-content: center; } }
/* The strip overflows on small screens, so let its right edge fade — a link cut off
 * mid-word reads as a mistake, a faded one reads as "there is more". */
@media (max-width: 899px) { .nav { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); } }

/* Fingers, not cursors. */
@media (hover: none) and (pointer: coarse) {
  .nav a { padding: 12px 15px; }
  .toggle { min-height: 44px; }
  .btn { min-height: 46px; }
}

/* ── hero ───────────────────────────────────────────────── */
/* Quiet, centred hero: a soft radial wash behind the headline, a short accent bar
 * under the h1, and the belief lifted onto a card so it reads as the site's creed. */
.hero {
  padding: 92px 0 72px; text-align: center;
  background: radial-gradient(70% 60% at 50% 0%, var(--tint) 0%, transparent 100%);
}
.hero .wrap { display: grid; justify-items: center; gap: 28px; }
.hero h1 { max-width: 22ch; margin: 0; }
.hero h1::after {
  content: ""; display: block; width: 76px; height: 4px; margin: 22px auto 0;
  border-radius: 2px; background: var(--accent-soft);
}
.hero p.lede { font-size: 1.18rem; max-width: 66ch; margin: 0; }
.belief {
  margin: 0; padding: 24px 28px; max-width: 72ch; text-align: left;
  background: var(--surface); border: 1px solid var(--tint-line); border-left: 4px solid var(--accent-soft);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.belief p { margin: 0; font-size: 1.04rem; line-height: 1.6; color: var(--ink); }
.belief p + p { margin-top: 12px; }
.free-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--tint); border: 1px solid var(--tint-line); color: var(--heading);
  border-radius: 999px; padding: 7px 14px; font-weight: 700; font-size: .88rem;
}
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  background: var(--btn-bg); color: var(--btn-ink); border: 1px solid var(--btn-bg);
  border-radius: 999px; padding: 12px 20px; font-weight: 700; font-size: .96rem;
  transition: transform .12s ease, background .12s ease;
}
.btn:hover { background: var(--green-900); transform: translateY(-1px); }
.btn--ghost { background: var(--surface); color: var(--heading); border-color: var(--tint-line); }
.btn--ghost:hover { background: var(--tint); border-color: var(--accent-soft); }

/* ── app cards ──────────────────────────────────────────── */
/* min(...,100%) keeps the track floor below the container width: at 320px viewports a
 * fixed 280px floor would overflow the 273px content box instead of stacking. */
.grid { display: grid; gap: 20px; margin-top: 28px; }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 24px; display: flex; flex-direction: column; gap: 12px;
}
.card__icon {
  width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center;
  background: var(--tint); border: 1px solid var(--tint-line);
}
.card__icon svg { width: 26px; height: 26px; stroke: var(--accent); }
.card h3 { margin: 0; }
.card p { color: var(--muted); margin: 0; font-size: .96rem; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.tag {
  font-size: .76rem; font-weight: 700; color: var(--accent);
  background: var(--tint); border: 1px solid var(--tint-line);
  border-radius: 999px; padding: 4px 10px;
}
.card__link { font-weight: 800; text-decoration: none; display: inline-flex; gap: 6px; align-items: center; }
.card__link:hover { color: var(--heading); }

/* The meadow panel keeps the brand's deep green in both themes — white text on it is
 * the same read either way, and it is the one block that should stay a window. */
.feature {
  background: linear-gradient(160deg, var(--green-900), var(--green-700));
  color: #fff; border-radius: var(--radius); padding: 34px; box-shadow: var(--shadow);
  display: grid; gap: 18px; margin-top: 28px;
}
.feature h3 { color: #fff; font-size: 1.5rem; margin: 0; }
.feature p { color: #dceee4; max-width: 60ch; margin: 0; }
.feature .btn { background: #fff; color: var(--green-900); border-color: #fff; }
.feature .btn:hover { background: var(--green-50); }
.games { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); }
.game-chip {
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 14px; padding: 14px;
}
.game-chip b { display: block; color: #fff; margin-bottom: 2px; }
.game-chip span { color: #cfe6d9; font-size: .88rem; }

.promise { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); margin-top: 26px; }
.promise div { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.promise b { color: var(--heading); }
.promise p { margin: 4px 0 0; font-size: .92rem; color: var(--muted); }

/* ── credits ────────────────────────────────────────────── */
.models { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.models b { display: block; color: var(--heading); font-size: .92rem; overflow-wrap: anywhere; }

/* ── author ─────────────────────────────────────────────── */
.author { margin-top: 8px; max-width: 74ch; }
.quote {
  border-left: 4px solid var(--accent-soft); padding: 6px 0 6px 22px; margin: 0 0 18px;
  font-size: 1.18rem; color: var(--heading); font-style: italic; line-height: 1.55;
}
.signature { font-weight: 800; color: var(--heading); }
.signature span { display: block; font-weight: 600; color: var(--muted); font-size: .9rem; }

/* ── requests board ────────────────────────────────────── */
.board-head { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin: 22px 0 8px; }
.count-pill {
  font-size: .8rem; font-weight: 800; border-radius: 999px; padding: 6px 12px;
  background: var(--tint); border: 1px solid var(--tint-line); color: var(--accent);
}
.task {
  display: grid; gap: 6px; background: var(--surface); border: 1px solid var(--line);
  border-left: 5px solid var(--accent-soft); border-radius: 14px; padding: 16px 18px;
}
.task + .task { margin-top: 12px; }
.task--done { border-left-color: var(--accent); }
.task__top { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.task__top h3 { margin: 0; font-size: 1rem; }
.status {
  font-size: .74rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  border-radius: 999px; padding: 3px 10px; margin-left: auto;
}
.status--pending { background: var(--warn-bg); color: var(--warn-ink); border: 1px solid var(--warn-line); }
.status--done { background: var(--tint); color: var(--accent); border: 1px solid var(--tint-line); }
.task p { margin: 0; color: var(--muted); font-size: .94rem; }
.task__meta { font-size: .82rem; color: var(--muted); }

/* ── forms ──────────────────────────────────────────────── */
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 24px; margin-top: 26px;
}
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 700; font-size: .9rem; color: var(--heading); }
.field .hint { font-size: .82rem; color: var(--muted); font-weight: 600; }
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--field-bg); border: 1px solid var(--tint-line);
  border-radius: 12px; padding: 11px 13px; width: 100%;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent-soft); }
::placeholder { color: var(--muted); opacity: 1; }
.row-2 { display: grid; gap: 14px; }
@media (min-width: 640px) { .row-2 { grid-template-columns: 1fr 1fr; } }
.form-note { font-size: .84rem; color: var(--muted); margin: 12px 0 0; }
.msg { margin-top: 12px; font-weight: 700; color: var(--accent); min-height: 1.2em; }
.msg--warn { color: var(--warn-ink); }

/* ── thanks wall ────────────────────────────────────────── */
.notes { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr)); margin-top: 24px; }
.note {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); font-style: italic; color: var(--ink);
}
.note b { display: block; font-style: normal; margin-top: 10px; color: var(--accent); font-size: .88rem; }
.note__mark { color: var(--accent-soft); font-size: 1.6rem; line-height: 1; }

.site-footer { background: var(--green-900); color: #cfe6d9; padding: 34px 0; font-size: .9rem; }
.site-footer a { color: #fff; }
.site-footer .wrap { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; justify-content: space-between; }

/* ── app subpage frame ──────────────────────────────────── */
.app-main { padding: 22px 0 60px; }
.app-frame {
  width: 100%; height: calc(100vh - 210px); height: calc(100dvh - 210px); min-height: 560px;
  border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--field-bg); box-shadow: var(--shadow);
}
.startup {
  border: 1px solid var(--tint-line); background: var(--tint); border-radius: var(--radius);
  padding: 22px; display: grid; gap: 12px; color: var(--ink);
}
.startup code {
  display: block; background: var(--field-bg); border: 1px dashed var(--accent-soft); border-radius: 10px;
  padding: 10px 12px; font-size: .86rem; color: var(--heading); overflow-x: auto;
}
.app-intro { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.app-intro h1 { font-size: 1.6rem; margin: 0; }
.back { text-decoration: none; font-weight: 800; }

/* ── phones ─────────────────────────────────────────────── */
@media (max-width: 719px) {
  .section { padding: 46px 0; }
  .hero { padding: 44px 0 40px; }
  .hero .wrap { gap: 22px; }
  .belief { padding: 16px 18px; }
  .belief p { font-size: 1rem; }
  .cta-row { gap: 10px; }
  .cta-row .btn { flex: 1 1 210px; justify-content: center; }
  .card, .panel, .note { padding: 18px; }
  .grid { gap: 14px; }
  .feature { padding: 22px; }
  .feature h3 { font-size: 1.3rem; }
  .quote { font-size: 1.05rem; padding-left: 16px; }
  .app-main { padding: 16px 0 44px; }
  .app-intro h1 { font-size: 1.35rem; }
  .app-frame { height: calc(100vh - 250px); height: calc(100dvh - 250px); min-height: 440px; }
  .site-footer { padding: 26px 0; }
  .site-footer .wrap { gap: 8px; }
}
@media (max-width: 479px) {
  .wrap { padding-inline: max(16px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-right)); }
  .site-header .wrap { column-gap: 8px; }
  .toggle { min-width: 0; padding: 7px 10px; font-size: .8rem; }
  .brand { font-size: .98rem; gap: 8px; }
  .startup { padding: 18px; }
}
/* 320px phones: identity and switches have to share one row without the switches
 * sliding past the gutter, so both shrink together rather than one of them wrapping. */
@media (max-width: 359px) {
  .site-header .wrap { column-gap: 6px; }
  .brand { font-size: .88rem; gap: 7px; }
  .brand svg, .brand__mark { width: 26px; height: 26px; }
  .toggle { padding: 6px 8px; font-size: .76rem; min-height: 42px; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
