/* Troto website. Tokens first; components use only these. Light and dark follow the system. */
:root {
  --bg: #f5f8ff;
  --surface: #ffffff;
  --surface-alt: #eaf1ff;
  --border: #d9e3f5;
  --text: #0f1b33;
  --text-muted: #55657f;
  --primary: #2f63e8;
  --primary-strong: #1f4cc4;
  --on-primary: #ffffff;
  --highlight: #ffd65c;
  --on-highlight: #0f1b33;
  --phone-bg: #111a2e;
  --phone-surface: #1b263d;
  --phone-text: #eef3fb;
  --phone-muted: #93a2bd;
  --shadow: 0 24px 60px -24px rgba(23, 52, 120, 0.35);
  --radius: 20px;
  --radius-sm: 12px;
  --max: 1120px;
  --prose: 760px;
  --font: 'Lexend', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1424;
    --surface: #121f36;
    --surface-alt: #172846;
    --border: #243759;
    --text: #eef3fb;
    --text-muted: #9fb0cc;
    --primary: #7aa2ff;
    --primary-strong: #a3bfff;
    --on-primary: #0b1424;
    --highlight: #ffd65c;
    --on-highlight: #0f1b33;
    --phone-bg: #0a1220;
    --phone-surface: #182641;
    --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.6);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: 300;
  line-height: 1.6;
  font-size: 17px;
}

a {
  color: var(--primary);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--primary-strong);
}

h1,
h2,
h3 {
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 0.5em;
}

p {
  margin: 0 0 1em;
}

strong {
  font-weight: 500;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: 16px;
  top: 16px;
  z-index: 10;
  background: var(--surface);
  padding: 8px 12px;
  border-radius: 8px;
}

:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.brand:hover {
  color: var(--text);
}

.brand-mark {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 9px;
}

.nav {
  display: flex;
  gap: 22px;
  font-size: 15px;
}

.nav a {
  color: var(--text-muted);
  text-decoration: none;
}

.nav a:hover,
.nav a[aria-current='page'] {
  color: var(--text);
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  font: inherit;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
}

.button-primary {
  background: var(--primary);
  color: var(--on-primary);
}

.button-primary:hover {
  background: var(--primary-strong);
  color: var(--on-primary);
}

.button-ghost {
  border-color: var(--border);
  color: var(--text);
  background: var(--surface);
}

.button-ghost:hover {
  color: var(--text);
  border-color: var(--primary);
}

/* Hero */
.hero {
  padding: 72px 0 88px;
}

.hero .container {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: center;
}

.eyebrow {
  display: inline-block;
  font-size: 14px;
  font-weight: 500;
  color: var(--primary);
  background: var(--surface-alt);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(38px, 6vw, 60px);
  letter-spacing: -0.03em;
}

.hero .lead {
  font-size: 19px;
  color: var(--text-muted);
  max-width: 34em;
  margin-bottom: 28px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-note {
  margin-top: 18px;
  font-size: 14px;
  color: var(--text-muted);
}

.mark {
  background: var(--highlight);
  color: var(--on-highlight);
  border-radius: 6px;
  padding: 0 4px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* Phone preview (a lesson in chat format) */
.phone {
  width: 100%;
  max-width: 330px;
  margin: 0 auto;
  background: var(--phone-bg);
  color: var(--phone-text);
  border-radius: 40px;
  padding: 14px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.phone-tutor {
  height: 150px;
  border-radius: 28px;
  background: radial-gradient(circle at 50% 120%, #3d5479 0%, #263856 55%, #1b263d 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 14px;
  gap: 8px;
}

.phone-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #eef3fb;
  color: #111a2e;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 24px;
}

.phone-pill {
  font-size: 12px;
  background: rgba(17, 26, 46, 0.75);
  padding: 3px 10px;
  border-radius: 999px;
  color: var(--phone-muted);
}

.phone-chat {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 4px 12px;
  font-size: 14px;
  line-height: 1.45;
}

.bubble {
  max-width: 86%;
  padding: 10px 14px;
  border-radius: 18px;
}

.bubble-tutor {
  background: var(--phone-surface);
  border-bottom-left-radius: 6px;
  align-self: flex-start;
}

.bubble-learner {
  background: #eef3fb;
  color: #111a2e;
  border-bottom-right-radius: 6px;
  align-self: flex-end;
}

.say-card {
  border: 1px dashed rgba(238, 243, 251, 0.35);
  border-radius: 16px;
  padding: 12px 14px;
}

.say-card small {
  display: block;
  color: var(--phone-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.phone-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--phone-surface);
  border-radius: 999px;
  padding: 8px 8px 8px 16px;
  font-size: 13px;
  color: var(--phone-muted);
}

.phone-bar span {
  flex: 1;
}

.phone-mic {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #eef3fb;
  display: grid;
  place-items: center;
  color: #111a2e;
}

/* Sections */
.section {
  padding: 80px 0;
}

.section-alt {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-head {
  max-width: 640px;
  margin-bottom: 44px;
}

.section-head h2 {
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: -0.02em;
}

.section-head p {
  color: var(--text-muted);
  font-size: 18px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.section-alt .card {
  background: var(--bg);
}

.card h3 {
  font-size: 20px;
}

.card p {
  color: var(--text-muted);
  margin: 0;
}

.icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--surface-alt);
  color: var(--primary);
  display: grid;
  place-items: center;
  margin-bottom: 18px;
}

.icon svg {
  width: 22px;
  height: 22px;
}

.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.steps li {
  position: relative;
  padding-top: 56px;
}

.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  top: 0;
  left: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  display: grid;
  place-items: center;
  font-weight: 600;
}

.steps h3 {
  font-size: 19px;
}

.steps p {
  color: var(--text-muted);
  margin: 0;
}

.promise {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.promise .card {
  padding: 24px;
}

.cta {
  text-align: center;
  background: var(--primary);
  color: var(--on-primary);
  border-radius: 28px;
  padding: 56px 24px;
}

.cta h2 {
  font-size: clamp(28px, 4vw, 40px);
}

.cta p {
  opacity: 0.9;
  max-width: 34em;
  margin: 0 auto 24px;
}

.cta .button {
  background: var(--on-primary);
  color: var(--primary);
}

.cta .button:hover {
  color: var(--primary-strong);
}

/* Legal pages */
.legal {
  padding: 56px 0 80px;
}

.legal .container {
  max-width: calc(var(--prose) + 40px);
}

.legal-header {
  margin-bottom: 40px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

.legal-header h1 {
  font-size: clamp(34px, 5vw, 48px);
  letter-spacing: -0.02em;
}

.legal-meta {
  color: var(--text-muted);
  font-size: 15px;
  margin: 0;
}

.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin-bottom: 44px;
}

.toc h2 {
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.toc ol {
  margin: 0;
  padding-left: 22px;
  columns: 2;
  column-gap: 32px;
  font-size: 15px;
}

.toc li {
  break-inside: avoid;
  margin-bottom: 4px;
}

.prose h2 {
  font-size: 26px;
  margin-top: 48px;
  scroll-margin-top: 84px;
}

.prose h3 {
  font-size: 19px;
  margin-top: 28px;
}

.prose ul {
  padding-left: 22px;
  margin: 0 0 1em;
}

.prose li {
  margin-bottom: 6px;
}

.prose address {
  font-style: normal;
}

.prose dl {
  margin: 0 0 1em;
}

.prose dt {
  font-weight: 500;
  margin-top: 14px;
}

.prose dd {
  margin: 2px 0 0;
  color: var(--text-muted);
}

.table-wrap {
  overflow-x: auto;
  margin: 0 0 1.5em;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.prose th,
.prose td {
  text-align: left;
  vertical-align: top;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.prose th {
  background: var(--surface-alt);
  font-weight: 500;
}

.prose tr:last-child td {
  border-bottom: 0;
}

.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px;
}

.contact-card p:last-child {
  margin-bottom: 0;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  font-size: 15px;
  color: var(--text-muted);
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 20px;
}

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

.footer-links a {
  color: var(--text-muted);
}

.footer-links a:hover {
  color: var(--text);
}

.site-footer p {
  margin: 0;
}

/* Responsive */
@media (max-width: 900px) {
  .hero {
    padding: 48px 0 64px;
  }

  .hero .container {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .grid,
  .promise {
    grid-template-columns: 1fr 1fr;
  }

  .steps {
    grid-template-columns: 1fr 1fr;
    row-gap: 36px;
  }
}

@media (max-width: 600px) {
  body {
    font-size: 16px;
  }

  .container {
    padding: 0 16px;
  }

  .nav {
    gap: 14px;
    font-size: 14px;
  }

  .nav .nav-optional {
    display: none;
  }

  .section {
    padding: 60px 0;
  }

  .grid,
  .promise,
  .steps {
    grid-template-columns: 1fr;
  }

  .toc ol {
    columns: 1;
  }

  .hero-actions .button {
    flex: 1 1 100%;
  }

  .cta {
    border-radius: 22px;
    padding: 44px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
