/* DataMail: Script Atlas design system (Option A) */

:root {
  --paper: #F7F5F1;
  --paper-raised: #FFFFFF;
  --ink: #1C1A17;
  --ink-mute: #6B6558;
  --rule: #DCD6C9;
  --accent: #A63D1F;
  --accent-soft: #F0DDCF;
  --accent-ink: #6E2A15;
  --good: #3D6B4A;
  /* Fixed tokens: never flip with theme. Used only by the brand-dark
     bands (app-band, business-band, sticky app bar) and the QR boxes,
     which are baked to specific pixel colors and must stay legible
     regardless of the page theme. */
  --ink-fixed: #1C1A17;
  --paper-fixed: #F7F5F1;
  --accent-soft-fixed: #F0DDCF;
  --max: 1280px;
  --gutter: 64px;
}
@media (max-width: 640px) {
  :root { --gutter: 20px; }
}

/* Dark theme: applies when the OS prefers dark and the visitor hasn't
   explicitly chosen light, or when they've explicitly chosen dark via
   the header toggle (data-theme, persisted to localStorage). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #17140F;
    --paper-raised: #211D16;
    --ink: #EFE9DD;
    --ink-mute: #A79C89;
    --rule: #3A3327;
    --accent: #E2703F;
    --accent-soft: #3D2417;
    --accent-ink: #FFD4B8;
    --good: #6FBF82;
  }
}
:root[data-theme="dark"] {
  --paper: #17140F;
  --paper-raised: #211D16;
  --ink: #EFE9DD;
  --ink-mute: #A79C89;
  --rule: #3A3327;
  --accent: #E2703F;
  --accent-soft: #3D2417;
  --accent-ink: #FFD4B8;
  --good: #6FBF82;
}
body, .card, .press-card, .video-card, footer.site-footer, header.masthead, .meta-bar {
  transition: background-color .25s ease, color .25s ease, border-color .25s ease;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.serif { font-family: 'Instrument Serif', Georgia, serif; }
.serif-i { font-family: 'Instrument Serif', Georgia, serif; font-style: italic; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { text-wrap: balance; font-weight: 400; margin: 0; }
p { line-height: 1.65; }
a { color: inherit; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-mute); }

.wrap { max-width: var(--max); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.rule { height: 1px; background: var(--rule); width: 0; animation: drawLine 1.1s ease forwards; }

/* Links */
a.link-draw { position: relative; text-decoration: none; padding-bottom: 2px; }
a.link-draw::after { content: ""; position: absolute; left: 0; bottom: 0; width: 0; height: 1px; background: var(--accent); transition: width .28s ease; }
a.link-draw:hover::after, a.link-draw:focus-visible::after { width: 100%; }
a.link-draw:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Buttons */
.btn-solid, .btn-outline {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-size: 14.5px; font-weight: 600; cursor: pointer;
  padding: 13px 24px; border-radius: 2px; text-decoration: none;
  transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
}
.btn-solid { background: var(--ink); color: var(--paper); border: none; }
.btn-solid:hover { background: var(--accent); transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Motion */
@keyframes drawLine { to { width: 100%; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.fade-1 { animation: fadeUp .7s ease both; }
.fade-2 { animation: fadeUp .7s ease .13s both; }
.fade-3 { animation: fadeUp .7s ease .26s both; }
.fade-4 { animation: fadeUp .7s ease .39s both; }
@keyframes pulseDot { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.pulse-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); display: inline-block; animation: pulseDot 1.3s ease-in-out infinite; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rule { width: 100%; animation: none; }
  .fade-1, .fade-2, .fade-3, .fade-4 { animation: none; opacity: 1; transform: none; }
  .pulse-dot { animation: none; }
  .ticker-track, .mobile-ticker { animation: none !important; }
}

/* Meta bar + masthead */
.meta-bar { display: flex; justify-content: space-between; align-items: center; padding: 10px var(--gutter); font-size: 12px; color: var(--ink-mute); border-bottom: 1px solid var(--rule); gap: 12px; }
.meta-bar .meta-right { display: flex; align-items: center; gap: 18px; }
@media (max-width: 560px) {
  .meta-bar { justify-content: flex-end; }
  .meta-bar .meta-tagline { display: none; }
}
.theme-toggle { display: flex; align-items: center; justify-content: center; background: none; border: none; padding: 3px; margin: 0; cursor: pointer; color: inherit; line-height: 0; }
.theme-toggle:hover { color: var(--accent); }
.theme-toggle .icon-moon { display: none; }
.lang-switch { display: flex; align-items: center; gap: 7px; }
.lang-switch a { color: inherit; text-decoration: none; }
.lang-switch a:hover, .lang-switch a:focus-visible { color: var(--accent); }
.lang-switch a.current { color: var(--ink); font-weight: 600; }
.lang-switch .sep { color: var(--ink-mute); opacity: 0.55; }
.lang-switch .lang-more { font-weight: 600; }

/* Dual-language page view toggle (per-language landing pages) */
.view-toggle { display: inline-flex; border: 1px solid var(--rule); border-radius: 100px; padding: 3px; gap: 2px; }
.lv-btn { border: none; background: none; padding: 7px 18px; border-radius: 100px; font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--ink-mute); font-family: inherit; }
.lv-btn:hover:not(.active) { color: var(--ink); }
.lv-btn.active { background: var(--ink); color: var(--paper); }
[data-view-content="native"] { display: block; }
[data-view-content="english"] { display: none; }
html[data-lang-view="english"] [data-view-content="native"] { display: none; }
html[data-lang-view="english"] [data-view-content="english"] { display: block; }
.eyebrow[data-view-content="native"] { display: inline; }
.eyebrow[data-view-content="english"] { display: none; }
html[data-lang-view="english"] .eyebrow[data-view-content="native"] { display: none; }
html[data-lang-view="english"] .eyebrow[data-view-content="english"] { display: inline; }
.masthead { padding: 36px var(--gutter) 0; }
.masthead-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px; }
.brand-mark { display: inline-flex; align-items: center; }
.brand-mark img { height: 52px; width: auto; display: block; }
.wordmark { font-family: 'Instrument Serif', Georgia, serif; font-style: italic; font-size: 34px; line-height: 1; text-decoration: none; color: var(--ink); }
.masthead-actions { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
nav.primary-nav { display: flex; gap: 30px; padding: 16px 0; font-size: 12.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; flex-wrap: wrap; }
nav.primary-nav a.current { color: var(--accent); }
.menu-toggle { display: none; background: none; border: none; cursor: pointer; padding: 4px; }
@media (max-width: 820px) {
  nav.primary-nav { display: none; flex-direction: column; gap: 4px; }
  nav.primary-nav.open { display: flex; }
  .menu-toggle { display: block; }
}

/* Press ticker */
.press-band { padding: 40px 0; border-bottom: 1px solid var(--rule); overflow: hidden; }
.ticker-mask { -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent); mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent); overflow: hidden; }
.ticker-track { display: flex; align-items: center; gap: 0; width: max-content; animation: marquee 30s linear infinite; }
.ticker-track:hover { animation-play-state: paused; }
.press-item { font-family: 'Instrument Serif', Georgia, serif; font-style: italic; font-size: 22px; white-space: nowrap; padding: 0 22px; color: var(--ink); text-decoration: none; border-right: 1px solid var(--rule); }
.press-item:last-child { border-right: none; }
a.press-item { transition: color .2s ease; }
a.press-item:hover { color: var(--accent); }
span.press-item { color: var(--ink-mute); }

/* Sections / rhythm */
.section { padding-top: 72px; padding-bottom: 72px; border-bottom: 1px solid var(--rule); }
.section-tight { padding-top: 56px; padding-bottom: 56px; }
.section-head { max-width: 640px; margin-bottom: 20px; }
.section-title { font-size: clamp(28px, 4vw, 38px); margin-top: 12px; }

/* Numbered manifesto list */
.num-list { list-style: none; margin: 0; padding: 0; }
.num-list li { display: flex; gap: 24px; padding: 20px 0; border-bottom: 1px solid var(--rule); }
.num-list li:last-child { border-bottom: none; }
.num-list .n { font-family: 'Instrument Serif', Georgia, serif; font-size: 22px; color: var(--ink-mute); width: 44px; flex-shrink: 0; transition: color .2s ease, transform .2s ease; display: inline-block; }
.num-list li > div { flex: 1; min-width: 0; }
.num-list li:hover .n { color: var(--accent); transform: translateX(6px); }
.num-list strong { display: block; font-size: 17px; font-weight: 600; margin-bottom: 4px; }
.num-list span.d { font-size: 14px; color: var(--ink-mute); line-height: 1.6; }

/* Specimen grid */
.specimen-grid { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--rule); border-left: 1px solid var(--rule); }
.specimen-cell { padding: 26px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); transition: background .2s ease; }
.specimen-cell:hover { background: var(--accent-soft); }
.specimen-cell .native { font-family: 'Instrument Serif', Georgia, serif; font-size: 30px; }
@media (max-width: 820px) { .specimen-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 460px) { .specimen-grid { grid-template-columns: 1fr; } }

/* Cards / grids */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 760px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* Section-level asymmetric grids (hero, why, founder, app-download):
   each ratio gets its own class so a mobile breakpoint can actually reach it
   (inline grid-template-columns can't be overridden by a media query). */
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 48px; align-items: end; }
.why-grid { display: grid; grid-template-columns: 0.9fr 1.6fr; gap: 48px; }
.founder-grid { display: grid; grid-template-columns: 0.62fr 1.38fr; gap: 48px; }
.appdl-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 48px; align-items: center; }
.credentials-grid { display: grid; grid-template-columns: 1fr 1fr; }
@media (max-width: 900px) {
  .hero-grid, .why-grid, .founder-grid, .appdl-grid { grid-template-columns: 1fr; align-items: start; }
  .credentials-grid { grid-template-columns: 1fr; }
  .credentials-grid > div { border-left: none !important; padding-left: 0 !important; }
}
.card { background: var(--paper-raised); border: 1px solid var(--rule); border-radius: 3px; padding: 24px; }

/* Stat strip */
.stat-strip { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--rule); }
.stat-cell { padding: 30px var(--gutter); border-right: 1px solid var(--rule); }
.stat-cell:last-child { border-right: none; }
.stat-num { font-family: 'Instrument Serif', Georgia, serif; font-size: 44px; line-height: 1; }
@media (max-width: 820px) { .stat-strip { grid-template-columns: repeat(2, 1fr); } .stat-cell { border-right: 1px solid var(--rule); } .stat-cell:nth-child(2n) { border-right: none; } }
@media (max-width: 480px) { .stat-strip { grid-template-columns: 1fr; } .stat-cell { border-right: none; border-bottom: 1px solid var(--rule); } }

/* App band */
.app-band { background: var(--ink-fixed); padding: 56px var(--gutter); display: flex; justify-content: space-between; align-items: center; border-bottom: 4px solid var(--accent); flex-wrap: wrap; gap: 24px; }
.app-band .headline { font-family: 'Instrument Serif', Georgia, serif; font-style: italic; font-size: 48px; color: var(--paper-fixed); line-height: 1.05; }
.qr-box { width: 88px; height: 88px; background: var(--paper-fixed); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* Business band */
.business-band { background: var(--ink-fixed); color: var(--paper-fixed); padding: 56px var(--gutter); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px; }
.business-band .btn-solid { background: var(--paper-fixed); color: var(--ink-fixed); }
.business-band .btn-solid:hover { background: var(--accent); color: var(--paper-fixed); }

/* Footer */
footer.site-footer { padding: 56px var(--gutter) 30px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr 1fr; gap: 28px; padding-bottom: 36px; border-bottom: 1px solid var(--rule); }
.footer-grid a { display: block; font-size: 13.5px; color: var(--ink); text-decoration: none; padding: 4px 0; }
.footer-grid a:hover { color: var(--accent); }
.footer-bottom { display: flex; justify-content: space-between; padding-top: 22px; font-size: 12px; color: var(--ink-mute); flex-wrap: wrap; gap: 8px; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr 1fr; } }

/* Long-form content (Story, Help, News articles) */
.prose { max-width: 68ch; }
.prose h2 { font-size: 26px; margin-top: 40px; margin-bottom: 14px; }
.prose h3 { font-size: 19px; font-weight: 600; margin-top: 28px; margin-bottom: 10px; }
.prose p { font-size: 16px; color: var(--ink); margin: 0 0 16px; }
.prose p.lede { font-size: 19px; color: var(--ink-mute); }
.prose ul, .prose ol { font-size: 15.5px; line-height: 1.7; padding-left: 20px; }
.prose blockquote { margin: 24px 0; padding: 18px 22px; border-left: 3px solid var(--accent); background: var(--accent-soft); font-size: 16px; line-height: 1.6; }
.prose .cite { font-size: 12.5px; color: var(--ink-mute); margin-top: 8px; }

/* Page header (inner pages) */
.page-header { padding-top: 48px; padding-bottom: 40px; border-bottom: 1px solid var(--rule); }
.breadcrumb { font-size: 12px; color: var(--ink-mute); margin-bottom: 16px; }
.breadcrumb a { color: var(--ink-mute); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }
.page-header h1 { font-size: clamp(32px, 5vw, 52px); }
.page-header .sub { color: var(--ink-mute); font-size: 16px; margin-top: 14px; max-width: 62ch; }

/* Tables (citations, comparisons) */
.table-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: 3px; }
table.data { border-collapse: collapse; width: 100%; font-size: 13.5px; }
table.data th, table.data td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.data th { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-mute); font-weight: 600; background: var(--accent-soft); }
table.data tr:last-child td { border-bottom: none; }

/* Tags */
.tag { display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; padding: 2px 8px; border-radius: 100px; text-transform: uppercase; }
.tag-verified { background: var(--accent-soft); color: var(--accent-ink); }
.tag-press { background: var(--rule); color: var(--ink-mute); }
.tag-update { background: var(--good); color: var(--paper); }

/* Mobile sticky app bar (site-wide) */
.sticky-app-bar { position: sticky; bottom: 0; left: 0; right: 0; background: var(--ink-fixed); padding: 12px 18px; display: none; align-items: center; justify-content: space-between; z-index: 40; }
.sticky-app-bar span { color: var(--paper-fixed); font-size: 12.5px; font-weight: 600; }
.sticky-app-bar .badges { display: flex; gap: 8px; }
.sticky-app-bar .badges a { width: 32px; height: 32px; background: var(--paper-fixed); display: flex; align-items: center; justify-content: center; border-radius: 2px; }
@media (max-width: 760px) { .sticky-app-bar { display: flex; } body { padding-bottom: 0; } }

.callout { border: 1px solid var(--accent); background: var(--accent-soft); padding: 18px 22px; border-radius: 3px; font-size: 14px; line-height: 1.6; color: var(--ink); }
.callout strong { color: var(--accent-ink); }
code.k { font-family: 'IBM Plex Mono', 'Courier New', monospace; background: var(--accent-soft); padding: 1px 6px; border-radius: 3px; font-size: 12.5px; }

.skip-link { position: absolute; left: -9999px; top: 0; background: var(--ink); color: var(--paper); padding: 12px 18px; z-index: 100; }
.skip-link:focus { left: 12px; top: 12px; }

/* Timeline (Our Story) */
.timeline { position: relative; padding-left: 40px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 1px; background: var(--rule); }
.timeline-item { position: relative; padding-bottom: 40px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before { content: ""; position: absolute; left: -40px; top: 4px; width: 11px; height: 11px; border-radius: 50%; background: var(--paper); border: 2px solid var(--accent); }
.timeline-item .year { font-family: 'Instrument Serif', Georgia, serif; font-size: 26px; color: var(--accent); display: block; margin-bottom: 6px; }
.timeline-item p { font-size: 15px; color: var(--ink); max-width: 60ch; }
@media (max-width: 560px) { .timeline { padding-left: 28px; } .timeline-item::before { left: -28px; } }

/* Layer stack (Security) */
.layer-stack { position: relative; padding-left: 64px; }
.layer-stack::before { content: ""; position: absolute; left: 23px; top: 24px; bottom: 24px; width: 1px; background: var(--rule); }
.layer-item { position: relative; padding-bottom: 36px; }
.layer-item:last-child { padding-bottom: 0; }
.layer-icon { position: absolute; left: -64px; top: 0; width: 48px; height: 48px; border: 1px solid var(--ink); border-radius: 50%; background: var(--paper); display: flex; align-items: center; justify-content: center; }
.layer-item strong { display: block; font-size: 16px; margin-bottom: 5px; }
.layer-item p { font-size: 14px; color: var(--ink-mute); max-width: 56ch; margin: 0; }
@media (max-width: 560px) { .layer-stack { padding-left: 52px; } .layer-icon { left: -52px; width: 40px; height: 40px; } }

/* Press cards (Newsroom) */
.press-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 900px) { .press-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .press-grid { grid-template-columns: 1fr; } }
.press-card { border: 1px solid var(--rule); background: var(--paper-raised); padding: 22px; transition: border-color .2s ease, transform .2s ease; }
.press-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.press-card .outlet { font-family: 'Instrument Serif', Georgia, serif; font-style: italic; font-size: 19px; }
.press-card .title { font-size: 13.5px; margin-top: 8px; line-height: 1.5; color: var(--ink); }
.press-card .meta { font-size: 11.5px; color: var(--ink-mute); margin-top: 10px; }
.press-card.update { border-left: 3px solid var(--accent); }

/* Video testimonials (Newsroom) */
.video-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 900px) { .video-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .video-grid { grid-template-columns: 1fr; } }
.video-card { border: 1px solid var(--rule); background: var(--paper-raised); overflow: hidden; }
.video-card video { width: 100%; display: block; background: var(--ink); aspect-ratio: 16/9; }
.video-card .who { padding: 14px 16px; }
.video-card .who strong { display: block; font-size: 14px; }
.video-card .who span { display: block; font-size: 12px; color: var(--ink-mute); margin-top: 4px; line-height: 1.5; }

/* Phone mock (App page) */
.phone-mock { width: 240px; background: var(--ink); border-radius: 28px; padding: 12px; box-shadow: 0 30px 60px -24px rgba(28,26,23,0.35); }
.phone-mock .screen { background: var(--paper-raised); border-radius: 18px; overflow: hidden; }
.phone-mock .bar { height: 8px; background: var(--rule); border-radius: 4px; }
@media (max-width: 900px) { .phone-mock { margin: 0 auto; } }
