/* ============================================================
   MissionPilot - shared design system (SOURCE OF TRUTH)
   Edit here, then run ./sync-shared.sh to copy into each product.
   Products load this as css/design-system.css + their own css/page.css.
   ============================================================ */

:root {
  /* Surfaces - warm cream, never pure white */
  --color-bg:            #FBF7F0;
  --color-surface:       #FFFDF9;
  --color-surface-sunk:  #F4EDE1;

  /* Ink - navy, never pure black */
  --color-ink:           #22335C;
  --color-ink-body:      #33405E;
  --color-muted:         #6E7488;
  --color-faint:         #A7A6AE;

  /* Lines */
  --color-line:          #E7DECF;
  --color-line-strong:   #D8CDB8;

  /* Brand accent, sampled from the logos */
  --knot-magenta: #DB3E92; --knot-orange: #EE8A2E; --knot-purple: #6C4FCB;
  --knot-blue: #356FE0; --knot-teal: #2AA79A; --knot-pink: #EF5C9C;
  --gradient-thread: linear-gradient(90deg,
    var(--knot-magenta) 0%, var(--knot-orange) 24%, var(--knot-purple) 48%,
    var(--knot-blue) 72%, var(--knot-teal) 100%);
  --color-accent: #C2417F; --color-accent-ink: #9E2E66;
  --color-success: #2E8B6F; --color-danger: #C0453B;

  /* Type */
  --font-display: 'Fraunces', 'Hoefler Text', Georgia, 'Times New Roman', serif;
  --font-body: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --step--1: clamp(0.83rem, 0.79rem + 0.18vw, 0.94rem);
  --step-0:  clamp(1.00rem, 0.95rem + 0.25vw, 1.13rem);
  --step-1:  clamp(1.20rem, 1.10rem + 0.50vw, 1.44rem);
  --step-2:  clamp(1.55rem, 1.35rem + 1.00vw, 2.10rem);
  --step-3:  clamp(2.05rem, 1.70rem + 1.75vw, 3.05rem);
  --step-4:  clamp(2.80rem, 2.08rem + 3.50vw, 4.70rem);

  /* Space */
  --space-2: 0.5rem;  --space-3: 0.75rem; --space-4: 1rem;
  --space-6: 1.5rem;  --space-8: 2rem;    --space-12: 3rem;
  --space-16: 4rem;   --space-24: 6rem;   --space-32: 8rem;

  --container-max: 1180px;
  --container-pad: clamp(1.25rem, 5vw, 2.5rem);
  --row-gap: clamp(2rem, 6vw, 5rem);
  --radius-card: 20px;
  --radius-shot: 40px;
}

/* Reset / base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font-body); font-size: var(--step-0); line-height: 1.6;
  color: var(--color-ink-body); background: var(--color-bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--color-accent); text-decoration: none; }
a:hover { color: var(--color-accent-ink); }
h1, h2, h3 { font-family: var(--font-display); color: var(--color-ink); font-weight: 500; line-height: 1.12; margin: 0; }
h1 em, h2 em, h3 em { font-style: italic; font-weight: 500; }
p { margin: 0; }

.container { width: 100%; max-width: var(--container-max); margin-inline: auto; padding-inline: var(--container-pad); }
.section { padding-block: clamp(var(--space-16), 10vw, var(--space-32)); }
.section--sunk { background: var(--color-surface-sunk); }
.eyebrow { font-size: var(--step--1); font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--color-muted); margin: 0 0 var(--space-3); }
.lead { font-size: var(--step-1); color: var(--color-ink-body); max-width: 44ch; }
.prose { max-width: 60ch; }
.center { text-align: center; margin-inline: auto; }
.skip-link { position: absolute; left: -999px; top: 0; z-index: 100; background: var(--color-ink); color: #fff; padding: 0.75rem 1rem; border-radius: 0 0 8px 0; }
.skip-link:focus { left: 0; color: #fff; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; border-radius: 4px; }
.thread { height: 2px; border: 0; margin: 0; background: var(--gradient-thread); opacity: 0.9; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--color-bg) 88%, transparent);
  backdrop-filter: saturate(1.2) blur(10px); border-bottom: 1px solid var(--color-line);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; padding-block: 0.75rem; }
.brand { display: flex; align-items: center; gap: 0.6rem; }
.brand img.mark, .brand img { width: 34px; height: 34px; }
.brand .wordmark { font-family: var(--font-display); font-style: italic; font-weight: 600; font-size: 1.5rem; color: var(--color-ink); letter-spacing: -0.01em; }
.site-nav { display: flex; align-items: center; gap: clamp(1rem, 2.5vw, 1.75rem); }
.site-nav__links { display: flex; align-items: center; gap: clamp(1rem, 2.5vw, 1.75rem); }
.site-nav__links a { font-family: var(--font-body); font-weight: 600; font-size: var(--step--1); color: var(--color-ink-body); }
.site-nav__links a:hover { color: var(--color-accent-ink); }
.header-cta { font-family: var(--font-body); font-weight: 600; font-size: var(--step--1); color: var(--color-ink); }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 600; font-family: var(--font-body); padding: 0.85rem 1.5rem; border-radius: 14px; transition: transform 0.15s ease, box-shadow 0.2s ease; }
.btn--primary { background: var(--color-ink); color: #fff; box-shadow: 0 10px 24px -12px rgba(34,51,92,0.5); position: relative; }
.btn--primary:hover { color: #fff; transform: translateY(-2px); }
.btn--primary::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 8px; height: 2px; background: var(--gradient-thread); border-radius: 2px; opacity: 0; transition: opacity 0.2s; }
.btn--primary:hover::after { opacity: 1; }
.btn--ghost { color: var(--color-ink); border: 1px solid var(--color-line-strong); }
.btn--ghost:hover { color: var(--color-ink); border-color: var(--color-ink); }

.appstore-btn {
  display: inline-flex; align-items: center; gap: 0.7rem; background: var(--color-ink); color: #fff;
  padding: 0.85rem 1.4rem; border-radius: 14px; position: relative;
  transition: transform 0.15s ease, box-shadow 0.2s ease; box-shadow: 0 10px 24px -12px rgba(34,51,92,0.5);
}
.appstore-btn:hover { color: #fff; transform: translateY(-2px); }
.appstore-btn::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 8px; height: 2px; background: var(--gradient-thread); border-radius: 2px; opacity: 0; transition: opacity 0.2s ease; }
.appstore-btn:hover::after { opacity: 1; }
.appstore-btn svg { width: 26px; height: 26px; flex: none; }
.appstore-btn .lines { display: flex; flex-direction: column; line-height: 1.05; text-align: left; }
.appstore-btn .small { font-size: 0.62rem; letter-spacing: 0.02em; opacity: 0.85; }
.appstore-btn .big { font-size: 1.15rem; font-weight: 600; font-family: var(--font-body); }

/* Device screenshot framing */
.device-shot { position: relative; max-width: 300px; margin-inline: auto; }
.device-shot::before { content: ""; position: absolute; inset: -6% -8%; z-index: 0; background: var(--gradient-thread); filter: blur(46px); opacity: 0.16; border-radius: 50%; }
.device-shot img, .device-shot .placeholder { position: relative; z-index: 1; width: 100%; border-radius: var(--radius-shot); border: 1px solid var(--color-line-strong); box-shadow: 0 1px 2px rgba(34,51,92,0.06), 0 22px 48px -14px rgba(34,51,92,0.28); }
.placeholder { aspect-ratio: 1242 / 2688; background: #0b0b0d; color: #8a8f9e; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 2rem; gap: 0.75rem; overflow: hidden; }
.placeholder .ph-logo { width: 44px; height: 44px; opacity: 0.9; }
.placeholder .ph-word { font-family: var(--font-display); font-style: italic; color: #f2f2f5; font-size: 1.3rem; }
.placeholder .ph-title { color: #cfd2db; font-weight: 600; font-family: var(--font-body); font-size: 1rem; margin-top: 0.5rem; }
.placeholder .ph-hint { font-size: 0.78rem; color: #6d7180; max-width: 22ch; }

/* Footer */
.site-footer { border-top: 2px solid transparent; border-image: var(--gradient-thread) 1; background: var(--color-surface); }
.site-footer .container { padding-block: var(--space-16); display: grid; gap: var(--space-8); }
.footer-top { display: flex; flex-wrap: wrap; gap: var(--space-8); justify-content: space-between; align-items: flex-start; }
.footer-brand { display: flex; align-items: center; gap: 0.6rem; }
.footer-brand img { width: 40px; height: 40px; }
.footer-brand .wordmark { font-family: var(--font-display); font-style: italic; font-weight: 600; font-size: 1.4rem; color: var(--color-ink); }
.footer-links { display: flex; flex-wrap: wrap; gap: var(--space-6); font-weight: 500; }
.footer-links a { color: var(--color-ink-body); }
.footer-meta { font-size: var(--step--1); color: var(--color-muted); border-top: 1px solid var(--color-line); padding-top: var(--space-6); display: flex; flex-wrap: wrap; gap: var(--space-4); justify-content: space-between; }

/* Reveal (motion-safe) */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.is-in { opacity: 1; transform: none; }

/* Shared small-screen rules */
@media (max-width: 767px) {
  .site-nav__links { display: none; }
  .brand .wordmark { font-size: 1.3rem; }
  .device-shot { max-width: 260px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .appstore-btn { transition: none; }
}
