/* TheRailTrack landing page. Plain CSS, no framework; tokens match the portal (web/css/app.css). */

:root {
  --brand: #0C66E4;
  --brand-hover: #0055CC;
  --brand-pressed: #09326C;
  --brand-subtle: #E9F2FF;
  --text: #172B4D;
  --text-subtle: #44546F;
  --text-subtlest: #626F86;
  --bg: #FFFFFF;
  --surface-sunken: #F7F8F9;
  --surface-raised: #FFFFFF;
  --hover: #091E420F;
  --border: #091E4224;
  --success: #22A06B;
  --shadow-card: 0 1px 1px #091E4240, 0 0 1px #091E424F;
  --header-bg: #FFFFFFE6;
  --band-from: #0C66E4;
  --band-to: #0055CC;
  --radius: 8px;
  --radius-lg: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Noto Sans", "Ubuntu", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #579DFF;
    --brand-hover: #85B8FF;
    --brand-pressed: #CCE0FF;
    --brand-subtle: #1C2B41;
    --text: #B6C2CF;
    --text-subtle: #9FADBC;
    --text-subtlest: #8C9BAB;
    --bg: #1D2125;
    --surface-sunken: #161A1D;
    --surface-raised: #22272B;
    --hover: #A1BDD914;
    --border: #A6C5E229;
    --success: #4BCE97;
    --shadow-card: 0 0 0 1px #BCD6F00F, 0 1px 1px #03040442;
    --header-bg: #1D2125E6;
    --band-from: #09326C;
    --band-to: #0C3D80;
    color-scheme: dark;
  }
}

/* ---- Base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; overflow-x: clip; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  overflow-x: clip;
}
[hidden] { display: none !important; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { color: var(--text); line-height: 1.2; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.01em; text-wrap: balance; }
h1 { font-size: clamp(2rem, 1.3rem + 3.2vw, 3.5rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.625rem, 1.3rem + 1.4vw, 2.25rem); }
h3 { font-size: 1.125rem; }
p { margin: 0 0 1rem; }
a { color: var(--brand); text-underline-offset: .15em; }
a:hover { color: var(--brand-hover); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

.container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.container-narrow { max-width: 800px; }
.container-wide { max-width: 1320px; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
@media (min-width: 768px) { .container { padding: 0 24px; } }

.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  padding: 8px 16px; background: var(--brand); color: #fff; border-radius: var(--radius); text-decoration: none;
}
.skip-link:focus { top: 12px; color: #fff; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 8px 16px;
  border: 1px solid transparent; border-radius: var(--radius);
  font: inherit; font-size: .9375rem; font-weight: 600; line-height: 1.2; white-space: nowrap;
  text-decoration: none; cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn-lg { min-height: 48px; padding: 12px 24px; font-size: 1rem; }
.btn-block { display: flex; width: 100%; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-hover); color: #fff; }
.btn-primary:active { background: var(--brand-pressed); }
.btn-outline { background: transparent; color: var(--text); border-color: var(--border); }
.btn-outline:hover { background: var(--hover); color: var(--text); }
.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover { background: var(--hover); color: var(--text); }
.btn-light { background: #fff; color: #0C66E4; }
.btn-light:hover { background: #E9F2FF; color: #0055CC; }
.btn-on-brand { background: transparent; color: #fff; border-color: #FFFFFF80; }
.btn-on-brand:hover { background: #FFFFFF1F; color: #fff; }
.btn:disabled { cursor: not-allowed; opacity: .6; }
.btn:disabled:hover { background: transparent; }
@media (prefers-color-scheme: dark) {
  .btn-primary, .btn-primary:hover { color: #1D2125; }
  .btn-light { color: #09326C; }
}

/* ---- Header ---- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 1.125rem; text-decoration: none; }
.brand:hover { color: var(--text); }
.brand img { width: 32px; height: 32px; }
.header-nav { display: none; gap: 4px; margin-left: 16px; }
.header-nav a { color: var(--text-subtle); text-decoration: none; font-weight: 500; padding: 8px 12px; border-radius: var(--radius); }
.header-nav a:hover { color: var(--text); background: var(--hover); }
.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
@media (min-width: 768px) { .header-nav { display: flex; } }
@media (max-width: 359.98px) {
  .header-inner { gap: 8px; }
  .brand span { display: none; }
  .header-actions .btn { padding: 8px 12px; }
}

/* ---- Hero ---- */
.hero { padding: 56px 0 64px; text-align: center; background: linear-gradient(180deg, var(--brand-subtle) 0%, var(--bg) 70%); }
.hero-text { max-width: 760px; margin: 0 auto; }
.lead { font-size: clamp(1.0625rem, 1rem + .4vw, 1.25rem); color: var(--text-subtle); margin-bottom: 28px; }
.cta-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.fine { font-size: .875rem; color: var(--text-subtlest); margin: 12px 0 0; }
@media (min-width: 768px) { .hero { padding: 88px 0 96px; } }


/* ---- Sections ---- */
.section { padding: 64px 0; }
.section-alt { background: var(--surface-sunken); }
.section-head { max-width: 720px; margin: 0 auto 40px; text-align: center; }
.section-head p { color: var(--text-subtle); font-size: 1.0625rem; margin: 0; }
@media (min-width: 768px) { .section { padding: 96px 0; } }

/* Features */
.feature-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 576px) { .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 992px) { .feature-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; } }
.feature {
  padding: 24px; border-radius: var(--radius-lg);
  background: var(--surface-raised); border: 1px solid var(--border);
}
.feature p { color: var(--text-subtle); margin: 0; }
.feature-icon {
  display: block; width: 44px; height: 44px; padding: 10px; margin-bottom: 16px;
  border-radius: 10px; background: var(--brand-subtle);
  fill: none; stroke: var(--brand); stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
}

/* Android band */
.android-band {
  display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center;
  padding: 32px 24px; border-radius: var(--radius-lg);
  background: var(--brand-subtle); border: 1px solid var(--border);
}
.android-band h2 { margin-bottom: .25em; }
.android-band p { color: var(--text-subtle); margin: 0; }
.play-badge { display: inline-block; flex-shrink: 0; border-radius: var(--radius); }
.play-badge img { width: 180px; height: auto; }
@media (min-width: 768px) {
  .android-band { flex-direction: row; justify-content: space-between; text-align: left; padding: 40px 48px; }
}

/* Pricing */
/* 4 plans: one column on phones, 2 from 768 px, 4 from 1200 px. */
.pricing-grid { display: grid; gap: 24px; margin: 0 auto; grid-template-columns: 1fr; }
@media (min-width: 768px) { .pricing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .pricing-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; } }
.plan {
  position: relative; display: flex; flex-direction: column;
  padding: 32px 24px 24px; border-radius: var(--radius-lg);
  background: var(--surface-raised); border: 1px solid var(--border); box-shadow: var(--shadow-card);
}
.plan-featured { border-color: var(--brand); }
.plan h3 { font-size: 1.25rem; margin-bottom: 8px; }
.plan-badge {
  position: absolute; top: -13px; left: 24px; margin: 0;
  padding: 2px 10px; border-radius: 999px;
  background: var(--brand); color: #fff; font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
}
@media (prefers-color-scheme: dark) { .plan-badge { color: #1D2125; } }
.price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.amount { font-size: 2.5rem; font-weight: 800; line-height: 1; color: var(--text); letter-spacing: -.02em; }
.amount-text { font-size: 1.75rem; line-height: 1.43; }
.per { color: var(--text-subtle); }
.plan-intro { color: var(--text-subtle); }
.checklist { list-style: none; margin: 8px 0 24px; padding: 0; flex: 1; }
.checklist li { position: relative; padding-left: 28px; margin-bottom: 10px; }
.checklist li::before {
  content: ""; position: absolute; left: 4px; top: .5em;
  width: 12px; height: 7px;
  border-left: 2px solid var(--success); border-bottom: 2px solid var(--success);
  transform: rotate(-45deg);
}

/* Plan comparison: the table scrolls sideways inside its box on small screens. */
.compare-title { font-size: 1.375rem; text-align: center; margin: 64px 0 24px; }
.table-wrap {
  overflow-x: auto; border-radius: var(--radius-lg);
  background: var(--surface-raised); border: 1px solid var(--border); box-shadow: var(--shadow-card);
}
.compare { width: 100%; min-width: 640px; table-layout: fixed; border-collapse: collapse; font-size: .9375rem; }
.compare thead th:first-child { width: 32%; }
.compare th, .compare td { padding: 12px 16px; border-bottom: 1px solid var(--border); text-align: center; vertical-align: middle; }
.compare tbody tr:last-child th, .compare tbody tr:last-child td { border-bottom: 0; }
.compare thead th { font-size: 1rem; font-weight: 700; }
.compare tbody th { text-align: left; font-weight: 500; color: var(--text); }
.compare td { color: var(--text-subtle); }
.compare .yes {
  display: inline-block; width: 12px; height: 7px; margin-bottom: 3px;
  border-left: 2px solid var(--success); border-bottom: 2px solid var(--success);
  transform: rotate(-45deg);
}
.compare .no { color: var(--text-subtlest); }

/* FAQ */
.faq { border-top: 1px solid var(--border); }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary {
  position: relative; list-style: none; cursor: pointer;
  padding: 20px 40px 20px 0; font-weight: 600; font-size: 1.0625rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 8px; top: 50%;
  width: 9px; height: 9px; margin-top: -7px;
  border-right: 2px solid var(--text-subtle); border-bottom: 2px solid var(--text-subtle);
  transform: rotate(45deg); transition: transform .15s;
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq summary:hover { color: var(--brand); }
.faq details p { color: var(--text-subtle); margin: 0 0 20px; padding-right: 40px; }

/* Final call to action */
.cta-band {
  padding: 64px 0; text-align: center; color: #fff;
  background: linear-gradient(135deg, var(--band-from), var(--band-to));
}
.cta-band h2 { color: #fff; }
.cta-band p { color: #FFFFFFD9; font-size: 1.0625rem; margin-bottom: 28px; }
.cta-band :focus-visible { outline-color: #fff; }
@media (min-width: 768px) { .cta-band { padding: 88px 0; } }

/* Footer */
.site-footer { padding: 40px 0; border-top: 1px solid var(--border); font-size: .9375rem; }
.footer-inner { display: grid; gap: 20px; }
.footer-brand { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.footer-brand p { margin: 0; color: var(--text-subtlest); }
.footer-brand .brand { font-size: 1rem; }
.footer-brand .brand img { width: 28px; height: 28px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.footer-nav a { color: var(--text-subtle); text-decoration: none; }
.footer-nav a:hover { color: var(--brand); text-decoration: underline; }
.footer-legal { margin: 0; color: var(--text-subtlest); font-size: .8125rem; }

/* Simple content pages (privacy, terms, 404) */
.page { padding: 64px 0 96px; min-height: 60vh; }
.page h1 { font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.5rem); }
.page p { color: var(--text-subtle); font-size: 1.0625rem; }
.notice {
  padding: 16px 20px; margin: 24px 0; border-radius: var(--radius);
  background: var(--brand-subtle); border: 1px solid var(--border); color: var(--text);
}
.notice p { margin: 0; color: var(--text); }

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