/* ============================================================
   Synogram Cloud — marketing stylesheet

   Tokens are copied from the app's app/globals.css and the type/spacing
   scales from DESIGN-SYSTEM.md §3-4. This file is the landing project's
   copy of the contract: the app and the landing deploy separately, so the
   values are duplicated here on purpose.

   If a token changes in app/globals.css, change it here too.
   Never introduce a hex value that is not in DESIGN-SYSTEM.md.
   ============================================================ */

/* ---------- 1. Tokens (light default) ---------- */
:root,
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #e7e4dd;
  --panel: #fbfaf7;
  --rail: #f1efe8;
  --card: #ffffff;
  --card-2: #f2f0ea;
  --line: rgba(28, 26, 23, 0.10);
  --line-2: rgba(28, 26, 23, 0.15);

  --ink: #1c1a17;
  --ink-2: #3a362f;
  --ink-3: #5b554a;
  --muted: #8a8172;
  --muted-2: #a89e8d;
  --faint: #bcb2a2;

  --accent: #c6f24e;
  --accent-hi: #d6ff6e;
  --accent-ink: #1b2606;
  --accent-soft: rgba(150, 190, 30, 0.16);
  --accent-text: #5f7d16;

  --ok: #3d8a4e;
  --err: #c0453e;

  --s1: #4338ca; --s2: #b1502d; --s3: #0f766e;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #050608; --panel: #0b0c0f; --rail: #08090b;
    --card: #101216; --card-2: #16181d;
    --line: #1c1f26; --line-2: #23262d;
    --ink: #e7e7e4; --ink-2: #c7c8c2; --ink-3: #a9aaa4;
    --muted: #8a8b85; --muted-2: #6b6e76; --faint: #5a5e66;
    --accent: #c6f24e; --accent-hi: #d6ff6e; --accent-ink: #0b0c0f;
    --accent-soft: rgba(198, 242, 78, 0.06); --accent-text: #c6f24e;
    --ok: #c6f24e; --err: #e8817c;
    --s1: #c6f24e; --s2: #6ea8fe; --s3: #f5a97f;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #050608; --panel: #0b0c0f; --rail: #08090b;
  --card: #101216; --card-2: #16181d;
  --line: #1c1f26; --line-2: #23262d;
  --ink: #e7e7e4; --ink-2: #c7c8c2; --ink-3: #a9aaa4;
  --muted: #8a8b85; --muted-2: #6b6e76; --faint: #5a5e66;
  --accent: #c6f24e; --accent-hi: #d6ff6e; --accent-ink: #0b0c0f;
  --accent-soft: rgba(198, 242, 78, 0.06); --accent-text: #c6f24e;
  --ok: #c6f24e; --err: #e8817c;
  --s1: #c6f24e; --s2: #6ea8fe; --s3: #f5a97f;
}

/* ---------- 2. Scales (DESIGN-SYSTEM.md §3-4) ---------- */
:root {
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "IBM Plex Sans Thai", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  /* Marketing spacing scale */
  --sec: 128px;      /* between major sections */
  --sec-gap: 24px;   /* heading -> body */
  --gutter: 24px;
  --maxw: 1120px;
}

@media (max-width: 760px) {
  :root { --sec: 72px; --sec-gap: 20px; --gutter: 16px; }
}

/* ---------- 3. Base ---------- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent-text); }

:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 2px;
  border-radius: 6px;
}

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

/* Sticky header clears anchor targets */
[id] { scroll-margin-top: 88px; }

.skip {
  position: absolute; left: -9999px;
  background: var(--card); color: var(--ink);
  padding: 12px 18px; border-radius: 11px; border: 1px solid var(--line-2);
  z-index: 100;
}
.skip:focus { left: 16px; top: 16px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---------- 4. Type (marketing scale) ---------- */
.d-xl, .d-l, .d-m {
  font-family: var(--font-display);
  color: var(--ink);
  margin: 0;
  text-wrap: balance;
}
.d-xl { font-size: 60px; line-height: 1.05; letter-spacing: -0.03em;  font-weight: 700; }
.d-l  { font-size: 40px; line-height: 1.15; letter-spacing: -0.025em; font-weight: 600; }
.d-m  { font-size: 24px; line-height: 1.3;  letter-spacing: -0.015em; font-weight: 600; }

.lede {
  font-size: 19px; line-height: 1.6;
  color: var(--ink-3);          /* NOT --muted: 3.03:1 fails AA in light */
  margin: 0;
  text-wrap: pretty;
}

.body-2 { color: var(--ink-3); margin: 0; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .13em;
  color: var(--accent-text);
  margin: 0;
}

@media (max-width: 760px) {
  .d-xl { font-size: 36px; line-height: 1.1; }
  .d-l  { font-size: 28px; line-height: 1.2; }
  .d-m  { font-size: 20px; line-height: 1.35; }
  .lede { font-size: 17px; }
}

/* ---------- 5. Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px;                      /* touch target */
  padding: 11px 20px;
  border-radius: 11px;
  font-family: var(--font-body);
  font-size: 15px;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}
.btn-primary:hover { background: var(--accent-hi); }
.btn-secondary {
  background: var(--card-2);
  border-color: var(--line-2);
  color: var(--ink);
  font-weight: 500;
}
.btn-secondary:hover { border-color: var(--accent); }

/* ---------- 6. Header ---------- */
.hdr {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.hdr-in {
  max-width: var(--maxw); margin: 0 auto; padding: 0 20px;
  height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--ink);
  font-family: var(--font-display); font-weight: 600; font-size: 16px;
  white-space: nowrap;   /* the header is tight on mobile; never wrap the name */
}
.brand-mark {
  display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--accent); color: var(--accent-ink);
}
.nav { display: flex; align-items: center; gap: 26px; }
.nav a {
  color: var(--ink-3); text-decoration: none; font-size: 14px;
  transition: color .15s ease;
}
.nav a:hover { color: var(--ink); }
.nav-cta { display: flex; align-items: center; gap: 10px; }

/* cross-product link gets a hairline so it reads as "elsewhere", not "section" */
.menu-btn { display: none; background: none; border: 0; color: var(--ink); padding: 10px; cursor: pointer; }

/* Theme toggle. Mirrors the app: `theme` in localStorage + [data-theme] on
   <html>. Both glyphs ship; CSS picks one so the button is correct on first
   paint, before any script runs. Shown glyph = the theme you'd switch TO. */
.theme-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px;
  background: var(--card-2);
  border: 1px solid var(--line-2);
  border-radius: 11px;
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease;
}
.theme-btn:hover { border-color: var(--accent); color: var(--ink); }

/* Light is the default, so offer the moon. */
.theme-btn .i-sun { display: none; }
.theme-btn .i-moon { display: block; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .i-moon { display: none; }
  :root:not([data-theme="light"]) .theme-btn .i-sun { display: block; }
}
:root[data-theme="dark"] .theme-btn .i-moon { display: none; }
:root[data-theme="dark"] .theme-btn .i-sun { display: block; }
:root[data-theme="light"] .theme-btn .i-sun { display: none; }
:root[data-theme="light"] .theme-btn .i-moon { display: block; }

@media (max-width: 940px) {
  .nav { display: none; }
  .menu-btn { display: inline-flex; }
  .hdr.open .nav {
    display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
    position: absolute; left: 0; right: 0; top: 64px;
    background: var(--panel); border-bottom: 1px solid var(--line);
    padding: 12px 20px 20px;
  }
  .hdr.open .nav a { padding: 11px 0; font-size: 16px; width: 100%; }
  .nav-cta .btn-secondary { display: none; }
}

/* Narrow phones: mark + theme + Sign in + menu is four things in 375px.
   Drop the "Cloud" half of the wordmark rather than let anything wrap. */
@media (max-width: 480px) {
  .hdr-in { gap: 10px; padding: 0 14px; }
  .brand-suffix { display: none; }
  .nav-cta { gap: 8px; }
  .theme-btn { width: 38px; height: 38px; }
  .nav-cta .btn { padding: 11px 14px; }
}

/* ---------- 7. Sections ---------- */
section { padding: var(--sec) 0; }
section + section { padding-top: 0; }

.hero { padding-top: 88px; padding-bottom: var(--sec); }
.hero-copy { max-width: 780px; }
.hero .d-xl { margin-top: 18px; }
.hero .lede { margin-top: 20px; max-width: 620px; }
.hero-cta { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hero-note { font-size: 13px; color: var(--ink-3); margin: 14px 0 0; }
.hero-note a { color: var(--accent-text); }

.shot {
  margin-top: 56px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  overflow: hidden;
  background: var(--card);
}

.sec-head { max-width: 720px; }
.sec-head .lede { margin-top: var(--sec-gap); }

/* ---------- 8. Steps ---------- */
.steps {
  margin-top: 48px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gutter);
}
.step {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 11px; padding: 24px;
}
.step-n {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .13em;
  text-transform: uppercase; color: var(--accent-text);
}
.step .d-m { margin-top: 10px; }
.step p { margin: 8px 0 0; color: var(--ink-3); font-size: 14px; }

/* ---------- 9. Proof rows ---------- */
.proof {
  margin-top: 72px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center;
}
.proof:first-of-type { margin-top: 48px; }
.proof.flip .proof-media { order: -1; }
.proof-copy .d-l { margin-top: 14px; }
.proof-copy p { margin: 18px 0 0; color: var(--ink-3); }
.proof-media {
  border: 1px solid var(--line-2); border-radius: 14px;
  overflow: hidden; background: var(--card);
}
.proof-media-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}
.proof-media-stack .proof-media { margin: 0; }
.proof-media figcaption {
  padding: 10px 12px 11px;
  font-family: var(--font-mono); font-size: 11px; line-height: 1.45;
  color: var(--ink-3);
}

.stat {
  margin-top: 24px; padding: 18px 20px;
  background: var(--accent-soft);
  border: 1px solid var(--line-2);
  border-radius: 11px;
}
.stat b {
  font-family: var(--font-display); font-size: 24px; font-weight: 700;
  color: var(--ink); display: block; letter-spacing: -0.015em;
}
.stat span { font-size: 14px; color: var(--ink-3); }

/* ---------- 9b. Connect card (MCP) ----------
   Sits in the second column of a .proof row, where the other rows put a
   screenshot. There's nothing to photograph here — the endpoint and the tool
   names are the picture. */
.connect-card {
  background: var(--card); border: 1px solid var(--line-2);
  border-radius: 14px; padding: 24px;
}
.connect-label {
  margin: 0;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .13em;
  text-transform: uppercase; color: var(--muted);
}
.connect-endpoint {
  margin: 10px 0 0;
  font-family: var(--font-mono); font-size: 14px; line-height: 1.5;
  color: var(--ink); word-break: break-all;
}
.connect-card hr { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }
.tool-list {
  list-style: none; margin: 12px 0 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 8px;
}
.tool-list li {
  font-family: var(--font-mono); font-size: 12px; color: var(--ink-2);
  border: 1px solid var(--line-2); border-radius: 999px; padding: 4px 11px;
}
.connect-foot { margin: 22px 0 0; font-size: 13px; color: var(--ink-3); }

/* ---------- 10. Feature list ---------- */
.feats {
  margin-top: 48px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px var(--gutter);
  border-top: 1px solid var(--line);
}
.feat { padding: 20px 0; border-bottom: 1px solid var(--line); }
.feat h3 {
  font-family: var(--font-display); font-size: 16px; font-weight: 600;
  margin: 0; color: var(--ink);
}
.feat p { margin: 5px 0 0; font-size: 14px; color: var(--ink-3); }

/* ---------- 11. Security ---------- */
.sec-list { margin-top: 40px; display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--gutter); }
.sec-item {
  display: flex; gap: 13px; align-items: flex-start;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 11px; padding: 20px;
}
.sec-item svg { flex: none; margin-top: 2px; color: var(--accent-text); }
.sec-item h3 { font-family: var(--font-display); font-size: 15px; font-weight: 600; margin: 0; }
.sec-item p { margin: 5px 0 0; font-size: 14px; color: var(--ink-3); }

/* ---------- 12. FAQ ---------- */
.faq { margin-top: 40px; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer;
  padding: 22px 40px 22px 0; position: relative;
  font-family: var(--font-display); font-size: 17px; font-weight: 600; color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 8px; top: 30px;
  width: 9px; height: 9px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg); transition: transform .18s ease;
}
.faq details[open] summary::after { transform: rotate(-135deg); top: 34px; }
.faq p { margin: 0 0 22px; color: var(--ink-3); max-width: 68ch; }

/* ---------- 13. CTA + footer ---------- */
.cta-band {
  margin-top: var(--sec);
  background: var(--card); border: 1px solid var(--line-2);
  border-radius: 14px; padding: 56px 40px; text-align: center;
}
.cta-band .lede { margin: 16px auto 0; max-width: 520px; }
.cta-band .hero-cta { justify-content: center; }

.ftr { border-top: 1px solid var(--line); margin-top: var(--sec); padding: 40px 0; }
.ftr-in {
  max-width: var(--maxw); margin: 0 auto; padding: 0 20px;
  display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: center;
}
.ftr-links { display: flex; flex-wrap: wrap; gap: 22px; }
.ftr-links a { color: var(--ink-3); text-decoration: none; font-size: 14px; }
.ftr-links a:hover { color: var(--ink); }
.ftr-note { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }

/* ---------- 14. Responsive ---------- */
@media (max-width: 940px) {
  .steps { grid-template-columns: 1fr; }
  .proof { grid-template-columns: 1fr; gap: 28px; }
  .proof.flip .proof-media { order: 0; }
  .proof-media-stack { grid-template-columns: 1fr 1fr; }
  .feats, .sec-list { grid-template-columns: 1fr; }
  .cta-band { padding: 40px 22px; }
}

@media (max-width: 560px) {
  .proof-media-stack { grid-template-columns: 1fr; }
}
