/*
 * TutoNear public site.
 * Warm paper, dark ink, one accent. Hierarchy from type and space.
 * Every colour, size and gap used below is a token here.
 */
/* The app's own font: Roboto (Android's system font, and what the Flutter app
   renders with). Devices that have it use it directly; others download it
   once. Apache 2.0, see /fonts/Roboto_LICENSE.txt. The app never goes above
   weight 600, so Medium serves 500 and 600 and nothing is heavier. */
@font-face { font-family: "TutoNear Roboto"; src: local("Roboto"), local("Roboto-Regular"), url("/fonts/Roboto-Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "TutoNear Roboto"; src: local("Roboto Medium"), local("Roboto-Medium"), url("/fonts/Roboto-Medium.ttf") format("truetype"); font-weight: 500 600; font-style: normal; font-display: swap; }

/* The app's colour scheme (lib/core/theme/app_theme.dart, AppSchemes).
   Names on the right are the Flutter ColorScheme roles. */
:root {
  color-scheme: light dark;

  --paper: #f8fafc;        /* surfaceContainerLow: page background */
  --paper-2: #f1f5f9;      /* surfaceContainer: quiet bands */
  --ink: #0f172a;          /* onSurface */
  --ink-2: #56657a;        /* onSurfaceVariant */
  --rule: #e2e8f0;         /* outlineVariant */
  --accent: #2b55ff;       /* primary: TutoNear blue */
  --accent-ink: #ffffff;   /* onPrimary */
  --danger: #dc2626;       /* error */
  --danger-ink: #ffffff;   /* onError */
  --focus: #2b55ff;

  --font: "TutoNear Roboto", Roboto, system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --serif: var(--font);
  --sans: var(--font);

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
  --step-3: clamp(2rem, 1.4rem + 2.6vw, 3.25rem);
  --step-4: clamp(2.5rem, 1.6rem + 4vw, 4.5rem);

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: clamp(4rem, 3rem + 5vw, 8rem);

  --measure: 36rem;        /* comfortable line length */
  --page: 72rem;
  --gutter: clamp(1rem, 0.5rem + 2.5vw, 2.5rem);
  --radius: 12px;          /* the app's button and field radius */
}

/* Dark mode: the device's setting, unless the reader picked one in the header
   (data-theme on <html>, remembered in this browser). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0f172a;      /* surface */
    --paper-2: #131c2e;    /* surfaceContainerLow */
    --ink: #f1f5f9;
    --ink-2: #94a3b8;
    --rule: #273449;
    --accent: #6d8bff;     /* primary on dark */
    --accent-ink: #0f172a;
    --danger: #f87171;
    --danger-ink: #0f172a;
    --focus: #6d8bff;
  }
  :root:not([data-theme="light"]) .device .frame { background: #26334a; box-shadow: 0 0 0 1px #3a4a66; }
}

:root[data-theme="dark"] {
    --paper: #0f172a;      /* surface */
    --paper-2: #131c2e;    /* surfaceContainerLow */
    --ink: #f1f5f9;
    --ink-2: #94a3b8;
    --rule: #273449;
    --accent: #6d8bff;     /* primary on dark */
    --accent-ink: #0f172a;
    --danger: #f87171;
    --danger-ink: #0f172a;
    --focus: #6d8bff;
}
:root[data-theme="dark"] .device .frame { background: #26334a; box-shadow: 0 0 0 1px #3a4a66; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--step-0)/1.6 var(--sans);
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 { font-family: var(--font); font-weight: 600; line-height: 1.15; letter-spacing: -0.02em; margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper); padding: var(--space-1) var(--space-2); }
.skip:focus { left: var(--space-2); z-index: 10; }

.wrap { max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter); }
.muted { color: var(--ink-2); }
.eyebrow { font: 600 var(--step--1)/1.3 var(--sans); letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-2); }

/* Header */
.site-head { border-bottom: 1px solid var(--rule); }
.site-head .wrap { display: flex; align-items: center; gap: var(--space-3); min-height: 4rem; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--ink); text-decoration: none; font: 600 1.15rem/1 var(--font); margin-right: auto; }
.brand img { width: 34px; height: 34px; background: #ffffff; border-radius: var(--radius); padding: 3px; }
.site-nav { display: flex; gap: var(--space-3); }
.site-nav a { color: var(--ink); text-decoration: none; font-size: var(--step--1); padding: 0.75rem 0; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--accent); }
.site-nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 0.5em; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 3rem; padding: 0 1.4rem; border-radius: var(--radius); border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); font: 600 var(--step-0)/1 var(--sans); text-decoration: none; cursor: pointer; }
.btn:hover { filter: brightness(1.08); }
.btn.quiet { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn.quiet:hover { border-color: var(--ink-2); filter: none; }
.btn[aria-disabled="true"] { background: transparent; color: var(--ink-2); border-color: var(--rule); cursor: default; filter: none; }
.actions { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.note { font-size: var(--step--1); color: var(--ink-2); }

/* Hero */
.hero { padding: var(--space-5) 0 var(--space-6); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: var(--space-5); align-items: center; }
.hero h1 { font-size: var(--step-4); max-width: 12ch; }
.hero .lede { font-size: var(--step-1); color: var(--ink-2); max-width: var(--measure); margin: var(--space-3) 0 var(--space-4); }
.hero .actions { margin-bottom: var(--space-2); }

/* The product, in a plain phone frame */
.device { margin: 0; justify-self: center; width: min(100%, 320px); }
.device .frame { background: #0f172a; border-radius: 34px; padding: 10px; box-shadow: 0 30px 60px -30px rgba(15, 23, 42, 0.45); }
.device .screen { border-radius: 26px; overflow: hidden; aspect-ratio: 9 / 19.5; background: var(--paper-2); }
.device .screen img { width: 100%; height: 100%; object-fit: cover; }
.device figcaption { margin-top: var(--space-2); text-align: center; font-size: var(--step--1); color: var(--ink-2); }
.shot-missing { height: 100%; display: grid; place-content: center; text-align: center; padding: var(--space-3); color: var(--ink-2); font-size: var(--step--1); border: 1px dashed var(--rule); border-radius: 26px; }

/* Footer */
.site-foot { border-top: 1px solid var(--rule); padding: var(--space-4) 0 var(--space-5); font-size: var(--step--1); color: var(--ink-2); }
.site-foot .wrap { display: grid; gap: var(--space-2); }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 0.25rem var(--space-3); }
.site-foot nav a { color: var(--ink-2); padding: 0.4rem 0; }

@media (max-width: 760px) {
  .hero { padding-top: var(--space-4); }
  .hero .wrap { grid-template-columns: 1fr; gap: var(--space-4); }
  .site-nav { gap: var(--space-2); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Sections */
.band { padding: var(--space-6) 0; border-top: 1px solid var(--rule); }
.section-title { font-size: var(--step-3); max-width: 18ch; margin-bottom: var(--space-4); }
/* Two columns on a wide screen. In one column the second group sat far below
   the fold with empty space beside it; families and educators each get a
   column instead. Stacks back to one on a phone. */
.faq-list { max-width: 48rem; }
@media (min-width: 60rem) {
  .faq-list { max-width: 72rem; display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--space-5); align-items: start; }
}
.faq-col > .faq-group:first-child { margin-top: 0; }
}
.aside { margin-top: var(--space-4); max-width: var(--measure); }

/* How it works: a numbered path, read left to right */
.steps { list-style: none; margin: 0 0 var(--space-5); padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-4); counter-reset: step; }
.steps li { counter-increment: step; border-top: 2px solid var(--ink); padding-top: var(--space-2); }
.steps li::before { content: counter(step, decimal-leading-zero); display: block; font: 600 var(--step--1)/1 var(--sans); color: var(--ink-2); margin-bottom: var(--space-2); }
.steps h3 { font-size: var(--step-1); margin-bottom: var(--space-1); }
.steps p { color: var(--ink-2); font-size: var(--step--1); line-height: 1.6; }
.split { display: flex; justify-content: center; gap: var(--space-5); flex-wrap: wrap; }
.split .device { width: min(100%, 280px); }

/* Money: text beside a timeline */
.money { padding: var(--space-6) 0; background: var(--paper-2); border-top: 1px solid var(--rule); }
.money .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-5); align-items: start; }
.money-copy p { max-width: var(--measure); }
.money-copy p + p { margin-top: var(--space-2); }
.money .section-title { margin-bottom: var(--space-3); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: var(--space-2); padding: var(--space-2) 0; border-bottom: 1px solid var(--rule); }
.timeline li:first-child { border-top: 1px solid var(--rule); }
.t-when { font-weight: 600; }
.t-what { color: var(--ink-2); }

/* Privacy: before and after, side by side */
.compare { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); border-top: 1px solid var(--rule); }
.compare > div { padding: var(--space-3) var(--space-4) 0 0; }
.compare > div + div { border-left: 1px solid var(--rule); padding-left: var(--space-4); }
.compare h3 { font-size: var(--step-1); margin-bottom: var(--space-1); }
.compare p { color: var(--ink-2); max-width: 30rem; }

/* Tutors: product on the left this time */
.tutors { padding: var(--space-6) 0; border-top: 1px solid var(--rule); }
.tutors .wrap { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: var(--space-5); align-items: center; }
.tutors p { max-width: var(--measure); }
.tutors p + p { margin-top: var(--space-2); }
.tutors .section-title { margin-bottom: var(--space-3); }

/* FAQ */
.faq-group { font-size: var(--step-1); margin: var(--space-4) 0 var(--space-1); }
.faq-group:first-child { margin-top: 0; }
.faq { border-bottom: 1px solid var(--rule); }
.faq summary { cursor: pointer; padding: var(--space-2) 2rem var(--space-2) 0; font-weight: 600; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0.25rem; top: var(--space-2); font-weight: 400; color: var(--ink-2); }
.faq[open] summary::after { content: "\2212"; }
.faq p { color: var(--ink-2); padding-bottom: var(--space-2); max-width: var(--measure); }

/* Closing */
.closing { padding: var(--space-6) 0; border-top: 1px solid var(--rule); text-align: center; }
.closing h2 { font-size: var(--step-3); margin-bottom: var(--space-3); }
.closing .actions { justify-content: center; }

@media (max-width: 960px) {
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .steps { grid-template-columns: 1fr; gap: var(--space-3); }
  .money .wrap, .tutors .wrap, .compare { grid-template-columns: 1fr; }
  .compare > div + div { border-left: 0; border-top: 1px solid var(--rule); padding-left: 0; margin-top: var(--space-3); }
  .compare > div { padding-right: 0; }
  .timeline li { grid-template-columns: 1fr; gap: 0.15rem; }
  .tutors .device { order: 2; }
}

@media (max-width: 760px) {
  .split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
  .split .device { width: 100%; }
  .split .device .frame { border-radius: 24px; padding: 6px; }
  .split .device .screen, .split .shot-missing { border-radius: 19px; }
  .split .shot-missing { padding: var(--space-1); font-size: 0.75rem; }
}

/* Inner pages: a readable document column */
.doc { padding: var(--space-5) 0 var(--space-6); }
.doc .wrap { max-width: 46rem; }
.doc h1 { font-size: var(--step-3); margin-bottom: var(--space-2); }
.doc h2 { font-size: var(--step-1); margin: var(--space-4) 0 var(--space-1); }
.doc p, .doc li { max-width: var(--measure); }
.doc p + p { margin-top: var(--space-2); }
.doc ul { padding-left: 1.2rem; margin: var(--space-1) 0 0; }
.doc li + li { margin-top: 0.35rem; }
.doc .meta { font-size: var(--step--1); color: var(--ink-2); margin-top: var(--space-4); }
.doc .intro { font-size: var(--step-1); color: var(--ink-2); }
.draft { border: 1px solid var(--rule); border-left: 3px solid var(--ink); padding: var(--space-2); margin: var(--space-3) 0; font-size: var(--step--1); color: var(--ink-2); max-width: var(--measure); }
.draft strong { color: var(--ink); }
mark.todo { background: transparent; color: var(--danger); font-weight: 600; }

/* Plain definition list for contact details */
.facts { margin: var(--space-3) 0 0; display: grid; grid-template-columns: 8rem minmax(0, 1fr); gap: var(--space-2) var(--space-3); border-top: 1px solid var(--rule); padding-top: var(--space-3); }
.facts dt { font-weight: 600; }
.facts dd { margin: 0; color: var(--ink-2); overflow-wrap: anywhere; }
@media (max-width: 520px) { .facts { grid-template-columns: 1fr; gap: 0.2rem; } .facts dd { margin-bottom: var(--space-2); } }

/* The delete-account form */
.panel { border-top: 1px solid var(--rule); padding: var(--space-3) 0; margin-top: var(--space-3); }
.field { display: grid; gap: 0.4rem; max-width: 26rem; margin: var(--space-2) 0; }
.field label { font-weight: 600; }
.field input { font: inherit; min-height: 3rem; padding: 0 0.9rem; border: 1px solid var(--ink-2); border-radius: var(--radius); background: var(--paper); color: var(--ink); }
.field input:focus-visible { outline-offset: 1px; }
.field .hint { font-size: var(--step--1); color: var(--ink-2); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: var(--danger-ink); }
.msg { margin-top: var(--space-2); font-weight: 600; min-height: 1.6em; }
.msg.error { color: var(--danger); }
.hidden { display: none; }

/* Light / dark switch in the header */
.theme {
  display: inline-flex; border: 1px solid var(--rule); border-radius: 999px;
  padding: 2px; gap: 2px; background: var(--paper-2);
}
.theme button {
  display: inline-flex; align-items: center; gap: 0.35rem; min-height: 2.25rem;
  padding: 0 0.7rem; border: 0; border-radius: 999px; background: transparent;
  color: var(--ink-2); font: 600 var(--step--1)/1 var(--font); cursor: pointer;
}
.theme button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(15, 23, 42, .12); }
.theme button:hover { color: var(--ink); }
.theme svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 760px) {
  /* Wrapped onto its own row: keep it on the right, under the nav. */
  .theme { margin-left: auto; }
}
@media (max-width: 420px) {
  .theme button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .theme button { padding: 0 0.6rem; }
}

/* Local SEO & Location Hub Styles */
.breadcrumb {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem;
  font-size: var(--step--1); color: var(--ink-2); margin-bottom: var(--space-3);
}
.breadcrumb a { color: var(--ink-2); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); text-decoration: underline; }
.breadcrumb .sep { opacity: 0.5; }

.badge-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: var(--space-2); }
.badge {
  display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.25rem 0.65rem;
  border-radius: 999px; background: var(--paper-2); border: 1px solid var(--rule);
  font-size: var(--step--1); font-weight: 500; color: var(--ink-2);
}
.badge.accent { background: rgba(43, 85, 255, 0.08); border-color: rgba(43, 85, 255, 0.25); color: var(--accent); }

.city-hero { padding: var(--space-5) 0 var(--space-4); }
.city-hero h1 { font-size: var(--step-3); max-width: 24ch; line-height: 1.15; margin-bottom: var(--space-2); }
.city-hero .lede { font-size: var(--step-0); color: var(--ink-2); max-width: 44rem; margin-bottom: var(--space-3); }

.pill-cloud { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: var(--space-2) 0 var(--space-4); }
.pill {
  display: inline-block; padding: 0.4rem 0.85rem; border-radius: 8px;
  background: var(--paper-2); border: 1px solid var(--rule); font-size: var(--step--1);
  color: var(--ink); text-decoration: none; transition: border-color 0.15s, transform 0.15s;
}
.pill:hover { border-color: var(--accent); color: var(--accent); }

.features-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-3); margin-top: var(--space-3);
}
.feature-card {
  padding: var(--space-3); border-radius: var(--radius);
  background: var(--paper-2); border: 1px solid var(--rule);
}
.feature-card h3 { font-size: var(--step-0); font-weight: 600; margin-bottom: var(--space-1); }
.feature-card p { font-size: var(--step--1); color: var(--ink-2); line-height: 1.5; margin: 0; }

.state-block { margin-bottom: var(--space-5); }
.state-block h2 { font-size: var(--step-1); font-weight: 600; margin-bottom: var(--space-2); border-bottom: 2px solid var(--rule); padding-bottom: 0.4rem; }
.city-links-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem; margin-top: var(--space-2);
}
.city-link-card {
  display: flex; flex-direction: column; padding: 0.75rem 1rem; border-radius: var(--radius);
  background: var(--paper-2); border: 1px solid var(--rule); text-decoration: none;
  color: var(--ink); transition: border-color 0.15s, transform 0.15s;
}
.city-link-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.city-link-card .name { font-weight: 600; font-size: var(--step-0); }
.city-link-card .meta { font-size: var(--step--1); color: var(--ink-2); margin-top: 0.2rem; }
