/* ==========================================================================
   TMS Tools — marketing & compliance site
   Design system: deep indigo canvas, violet→cyan accents (matches the app),
   generous whitespace, calm scientific tone.
   ========================================================================== */

:root {
  /* Brand palette (mirrors the app's tool tones) */
  --indigo:      #6366f1;
  --violet:      #8b5cf6;
  --cyan:        #06b6d4;
  --pink:        #ec4899;
  --emerald:     #10b981;

  /* Ink & surface */
  --ink:         #0b1020;
  --ink-2:       #161d33;
  --slate:       #334155;
  --muted:       #64748b;
  --line:        #e6eaf2;
  --surface:     #ffffff;
  --surface-2:   #f6f8fc;
  --surface-3:   #eef2f9;

  /* Effects */
  --grad: linear-gradient(120deg, var(--indigo), var(--violet) 55%, var(--cyan));
  --grad-soft: linear-gradient(120deg, #eef0ff, #f3ecff 55%, #e7fbff);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .08);
  --shadow-md: 0 10px 30px -12px rgba(30, 27, 75, .25);
  --shadow-lg: 0 30px 60px -20px rgba(30, 27, 75, .35);
  --radius:    18px;
  --radius-sm: 12px;
  --maxw:      1120px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--surface);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--indigo); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--violet); }
h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -0.02em; color: var(--ink); margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.2rem; }
p  { margin: 0 0 1rem; color: var(--slate); }
::selection { background: rgba(139, 92, 246, .22); }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: 88px 0; }
.section--tight { padding: 56px 0; }
.eyebrow {
  display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--violet); margin-bottom: 14px;
}
.center { text-align: center; }
.lede { font-size: 1.18rem; color: var(--muted); max-width: 640px; }
.center .lede { margin-left: auto; margin-right: auto; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.brand img { width: 34px; height: 34px; border-radius: 9px; box-shadow: var(--shadow-sm); }
.brand span { font-size: 1.06rem; }
.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a { color: var(--slate); font-size: .95rem; font-weight: 500; }
.nav-links a:hover { color: var(--indigo); }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--ink); margin: 4px 0; border-radius: 2px; transition: .2s; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer;
  font-weight: 600; font-size: .98rem; font-family: inherit;
  padding: 13px 24px; border-radius: 999px; border: 1px solid transparent;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--grad); color: #fff; box-shadow: var(--shadow-md); }
.btn--primary:hover { color: #fff; box-shadow: var(--shadow-lg); }
.btn--ghost { background: var(--surface); color: var(--ink); border-color: var(--line); box-shadow: var(--shadow-sm); }
.btn--ghost:hover { color: var(--indigo); border-color: #d7ddf0; }
.btn--lg { padding: 16px 30px; font-size: 1.03rem; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; background: var(--surface); }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(60% 55% at 82% -5%, rgba(99, 102, 241, .16), transparent 60%),
    radial-gradient(50% 50% at 8% 8%, rgba(6, 182, 212, .12), transparent 60%),
    linear-gradient(180deg, #fbfcff, #ffffff);
}
.hero .container { position: relative; z-index: 1; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; padding: 84px 0 76px; }
.hero h1 { margin-bottom: 20px; }
.hero h1 .accent { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lede { margin-bottom: 30px; font-size: 1.24rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 22px; }
.hero-note { font-size: .9rem; color: var(--muted); display: flex; align-items: center; gap: 8px; }

/* Device mock */
.device {
  position: relative; margin: 0 auto; width: 300px; max-width: 100%;
  border-radius: 42px; padding: 14px;
  background: linear-gradient(160deg, #1b2140, #0b1020);
  box-shadow: var(--shadow-lg), inset 0 0 0 1px rgba(255,255,255,.06);
}
.device-screen {
  border-radius: 30px; overflow: hidden; background: var(--surface-3);
  aspect-ratio: 300 / 620; display: flex; flex-direction: column;
}
.device-screen .ds-logo { padding: 40px 0 8px; }
.device-screen .ds-logo img { width: 78px; margin: 0 auto; border-radius: 18px; box-shadow: var(--shadow-md); }
.device-screen .ds-title { text-align: center; font-weight: 700; color: var(--ink); margin: 12px 0 22px; letter-spacing: -.01em; }
.ds-tools { display: flex; flex-direction: column; gap: 12px; padding: 0 18px; }
.ds-tool { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow-sm); }
.ds-dot { width: 34px; height: 34px; border-radius: 10px; flex: none; }
.ds-tool b { font-size: .82rem; color: var(--ink); display: block; }
.ds-tool small { font-size: .68rem; color: var(--muted); }

/* ---------- Store badges ---------- */
.stores { display: flex; flex-wrap: wrap; gap: 14px; }
.store-badge {
  display: inline-flex; align-items: center; gap: 11px;
  background: var(--ink); color: #fff; border-radius: 14px; padding: 10px 18px;
  box-shadow: var(--shadow-md); transition: transform .12s ease, box-shadow .2s ease;
}
.store-badge:hover { color: #fff; transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.store-badge svg { width: 26px; height: 26px; flex: none; }
.store-badge small { display: block; font-size: .64rem; opacity: .8; letter-spacing: .04em; text-transform: uppercase; line-height: 1; margin-bottom: 3px; }
.store-badge b { font-size: 1.02rem; font-weight: 600; line-height: 1; }

/* ---------- Tool cards ---------- */
.grid { display: grid; gap: 24px; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px; box-shadow: var(--shadow-sm); transition: transform .15s ease, box-shadow .25s ease, border-color .2s ease;
}
.card--hover:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: #dbe1f2; }
.card .icon {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
  margin-bottom: 18px; color: #fff; box-shadow: var(--shadow-sm);
}
.card h3 { margin-bottom: 8px; }
.card p { font-size: .96rem; margin-bottom: 0; }
.tone-mtat    { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.tone-adaptive{ background: linear-gradient(135deg, #06b6d4, #3b82f6); }
.tone-beam    { background: linear-gradient(135deg, #ec4899, #f43f5e); }
.tone-eeg     { background: linear-gradient(135deg, #10b981, #06b6d4); }
.tone-ink     { background: linear-gradient(135deg, #334155, #0b1020); }

/* ---------- Alt section ---------- */
.section--alt { background: var(--surface-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section--ink { background: var(--ink); color: #cbd5e1; }
.section--ink h2, .section--ink h3 { color: #fff; }
.section--ink p { color: #94a3b8; }

/* ---------- Feature list ---------- */
.feature { display: flex; gap: 16px; align-items: flex-start; }
.feature .fi { width: 42px; height: 42px; border-radius: 11px; flex: none; display: grid; place-items: center; background: var(--surface-3); color: var(--indigo); }
.feature h3 { font-size: 1.06rem; margin-bottom: 4px; }
.feature p { font-size: .95rem; margin: 0; }

/* ---------- CTA band ---------- */
.cta {
  border-radius: 26px; padding: 56px; text-align: center; color: #fff;
  background: var(--grad); box-shadow: var(--shadow-lg); position: relative; overflow: hidden;
}
.cta h2 { color: #fff; }
.cta p { color: rgba(255,255,255,.9); max-width: 560px; margin: 0 auto 26px; }
.cta .btn--ghost { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.35); backdrop-filter: blur(4px); }
.cta .btn--ghost:hover { background: rgba(255,255,255,.22); color: #fff; }

/* ---------- Contact form ---------- */
.form-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 34px; box-shadow: var(--shadow-md); }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: .88rem; font-weight: 600; color: var(--ink); margin-bottom: 7px; }
.field input, .field textarea, .field select {
  width: 100%; font-family: inherit; font-size: 1rem; color: var(--ink);
  padding: 13px 15px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2); transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--indigo); background: #fff;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, .12);
}
.field textarea { resize: vertical; min-height: 140px; }
.field .hint { font-size: .82rem; color: var(--muted); margin-top: 6px; }
.hp { position: absolute; left: -9999px; opacity: 0; height: 0; width: 0; overflow: hidden; }
.form-status { display: none; padding: 14px 16px; border-radius: var(--radius-sm); font-size: .95rem; margin-bottom: 18px; }
.form-status.ok  { display: block; background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.form-status.err { display: block; background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

/* ---------- Legal / long-form pages ---------- */
.page-head { background: var(--grad-soft); border-bottom: 1px solid var(--line); padding: 64px 0 48px; }
.page-head .eyebrow { color: var(--violet); }
.page-head h1 { margin-bottom: 10px; }
.page-head p { color: var(--muted); margin: 0; }
.prose { max-width: 820px; margin: 0 auto; }
.prose h2 { margin-top: 42px; padding-top: 6px; font-size: 1.4rem; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 26px; font-size: 1.08rem; color: var(--ink-2); }
.prose ul { padding-left: 22px; margin: 0 0 1rem; }
.prose li { margin-bottom: 8px; color: var(--slate); }
.prose .updated { color: var(--muted); font-size: .9rem; }
.legalese { font-size: .9rem; color: var(--muted); }
.toc { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 26px; margin-bottom: 40px; }
.toc h4 { margin: 0 0 10px; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.toc ul { list-style: none; padding: 0; margin: 0; columns: 2; }
.toc li { margin-bottom: 6px; break-inside: avoid; }
.callout { background: var(--surface-2); border: 1px solid var(--line); border-left: 4px solid var(--violet); border-radius: var(--radius-sm); padding: 18px 22px; margin: 24px 0; }
.callout strong { color: var(--ink); }

/* Data-safety style table */
.dtable { width: 100%; border-collapse: collapse; margin: 18px 0 26px; font-size: .95rem; }
.dtable th, .dtable td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.dtable th { background: var(--surface-2); font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.badge { display: inline-block; font-size: .78rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.badge--no  { background: #ecfdf5; color: #047857; }
.badge--yes { background: #fef3c7; color: #92400e; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #94a3b8; padding: 60px 0 34px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 44px; }
.footer-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.footer-brand img { width: 38px; height: 38px; border-radius: 10px; }
.footer-brand b { color: #fff; font-size: 1.1rem; }
.site-footer p { color: #94a3b8; font-size: .95rem; max-width: 320px; }
.footer-col h4 { color: #fff; font-size: .82rem; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 16px; }
.footer-col a { display: block; color: #94a3b8; font-size: .95rem; margin-bottom: 11px; }
.footer-col a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.09); padding-top: 24px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: .88rem; color: #64748b; }
.footer-bottom a { color: #94a3b8; }

/* ---------- Utilities ---------- */
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.stack > * + * { margin-top: 22px; }
.muted { color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 7px; background: var(--surface-3); color: var(--slate); font-size: .82rem; font-weight: 600; padding: 6px 13px; border-radius: 999px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 44px; text-align: center; }
  .hero-cta, .hero-note, .stores { justify-content: center; }
  .hero .lede { margin-left: auto; margin-right: auto; }
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .toc ul { columns: 1; }
}
@media (max-width: 640px) {
  .section { padding: 60px 0; }
  .nav-links {
    position: fixed; inset: 68px 0 auto 0; flex-direction: column; gap: 0;
    background: #fff; border-bottom: 1px solid var(--line); padding: 8px 24px 20px;
    box-shadow: var(--shadow-md); transform: translateY(-140%); transition: transform .25s ease; align-items: stretch;
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { padding: 13px 0; border-bottom: 1px solid var(--surface-3); }
  .nav-links .btn { margin-top: 12px; justify-content: center; }
  .nav-toggle { display: block; }
  .grid--4, .grid--3, .grid--2, .form-row, .footer-grid { grid-template-columns: 1fr; }
  .cta { padding: 40px 24px; }
  .device { width: 260px; }
}

/* ---------- Download groups ---------- */
.dl-group { margin-top: 46px; }
.dl-group + .dl-group { margin-top: 60px; padding-top: 52px; border-top: 1px solid var(--line); }
.dl-group-head { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.dl-icon {
  width: 50px; height: 50px; border-radius: 15px; display: grid; place-items: center;
  color: #fff; flex: none; box-shadow: var(--shadow-sm);
}
.dl-icon svg { width: 27px; height: 27px; }
.dl-group-head h3 { margin: 0 0 4px; }
.dl-group-head p { margin: 0; font-size: .95rem; color: var(--muted); max-width: 640px; }

.dl-card { display: flex; flex-direction: column; gap: 18px; }
.dl-card h4 { margin: 0 0 8px; font-size: 1.08rem; font-weight: 650; }
.dl-card p { color: var(--muted); font-size: .95rem; margin-bottom: 0; }
.dl-card .btn { align-self: flex-start; margin-top: auto; }
.dl-card--solo { max-width: 620px; }
.dl-card--wide { margin-top: 24px; }
.dl-wide-head { display: flex; align-items: flex-start; gap: 20px; }
.dl-wide-head .icon { margin-bottom: 0; }
.dl-wide-head p { max-width: 720px; }

.dl-tag {
  display: inline-block; vertical-align: middle; margin-left: 8px;
  font-size: .64rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--slate); background: var(--surface-3, #f4f4fb); border: 1px solid var(--line);
  border-radius: 999px; padding: 3px 9px;
}

.dl-note {
  background: #fffaf2; border: 1px solid #f3e0c4; border-radius: var(--radius-sm);
  padding: 22px 24px;
}
.dl-note strong { display: block; font-size: .97rem; color: var(--ink); margin-bottom: 8px; }
.dl-note p { font-size: .93rem; color: var(--slate); margin-bottom: 0; }
.dl-note em { font-style: normal; color: var(--ink); background: #fff2dc; padding: 1px 5px; border-radius: 5px; }
.dl-steps { margin: 14px 0 0; padding-left: 20px; }
.dl-steps li { font-size: .93rem; color: var(--slate); margin-bottom: 7px; }
.dl-steps li:last-child { margin-bottom: 0; }
.dl-steps b { color: var(--ink); font-weight: 650; }
.dl-fine { margin-top: 14px !important; font-size: .87rem !important; color: var(--muted) !important; }

.tone-amazon  { background: linear-gradient(135deg, #ff9900, #e8730b); }
.tone-samsung { background: linear-gradient(135deg, #1428a0, #3b82f6); }
.tone-direct  { background: linear-gradient(135deg, #10b981, #06b6d4); }

@media (max-width: 640px) {
  .dl-group-head { align-items: flex-start; }
  .dl-wide-head { flex-direction: column; gap: 14px; }
  .dl-card .btn { align-self: stretch; justify-content: center; }
  .dl-note { padding: 18px 16px; }
}

/* ---------- Download: pending stores & file details ---------- */
.btn--disabled {
  background: var(--surface-3, #f1f3f9); color: var(--muted);
  border-color: var(--line); box-shadow: none; cursor: default;
  font-weight: 600;
}
.btn--disabled:hover { color: var(--muted); }
.dl-card--soon .icon { filter: grayscale(1); opacity: .55; }
.dl-card--soon h4 { color: var(--slate); }
.dl-card--soon p { color: var(--muted); }

.dl-meta { margin-top: 14px; font-size: .84rem; color: var(--muted); line-height: 1.7; }
.dl-meta b { color: var(--slate); font-weight: 650; }
.dl-sha { overflow-wrap: anywhere; }
.dl-sha code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .78rem; color: var(--slate);
  background: var(--surface-3, #f4f4fb); border: 1px solid var(--line);
  border-radius: 6px; padding: 2px 6px;
}
