/* Pilothouse website — no build step, system fonts, light/dark tokens. */

:root {
  --bg: #f6f8f9;
  --bg-alt: #eef3f4;
  --surface: #ffffff;
  --surface-2: #f1f5f6;
  --text: #0d1b1e;
  --text-2: #4a5d61;
  --border: #dbe4e6;
  --accent: #0e8f86;
  --accent-strong: #0a6f68;
  --accent-soft: #dff4f1;
  --on-accent: #ffffff;
  --navy: #0f2a30;
  --danger: #c2413a;
  --add: #1b7f4a;
  --add-bg: #e3f5ea;
  --del: #b23a34;
  --del-bg: #fbe7e5;
  --shadow: 0 1px 2px rgba(13, 27, 30, .06), 0 8px 24px rgba(13, 27, 30, .06);
  --shadow-lg: 0 30px 60px -20px rgba(13, 40, 45, .35);
  --radius: 16px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a1416;
    --bg-alt: #0e1b1e;
    --surface: #122225;
    --surface-2: #172b2f;
    --text: #e7f0f1;
    --text-2: #9fb3b6;
    --border: #22393d;
    --accent: #3ccbbc;
    --accent-strong: #66dccf;
    --accent-soft: #123c3a;
    --on-accent: #04201d;
    --navy: #0b1d21;
    --danger: #f07b72;
    --add: #6fd99a;
    --add-bg: #133224;
    --del: #f2918a;
    --del-bg: #3a1a19;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    --shadow-lg: 0 30px 60px -20px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a1416;
  --bg-alt: #0e1b1e;
  --surface: #122225;
  --surface-2: #172b2f;
  --text: #e7f0f1;
  --text-2: #9fb3b6;
  --border: #22393d;
  --accent: #3ccbbc;
  --accent-strong: #66dccf;
  --accent-soft: #123c3a;
  --on-accent: #04201d;
  --navy: #0b1d21;
  --danger: #f07b72;
  --add: #6fd99a;
  --add-bg: #133224;
  --del: #f2918a;
  --del-bg: #3a1a19;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  --shadow-lg: 0 30px 60px -20px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }
section[id] { scroll-margin-top: 64px; }
a { color: var(--accent-strong); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
code { font-family: var(--mono); font-size: .9em; background: var(--surface-2); padding: .1em .35em; border-radius: 6px; overflow-wrap: anywhere; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; letter-spacing: -.02em; margin: 0; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.wrap-narrow { max-width: 820px; }
@media (min-width: 640px) { .wrap { padding: 0 28px; } }

.muted { color: var(--text-2); }
.small { font-size: .875rem; }

.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--accent); color: var(--on-accent); padding: 8px 14px; border-radius: 8px; text-decoration: none; }
.skip:focus { top: 12px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px; border-radius: 999px;
  font: 600 1rem/1 var(--font); text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}
.btn svg { width: 20px; height: 20px; }
.btn-primary { background: var(--accent-strong); color: var(--on-accent); box-shadow: 0 6px 18px -6px color-mix(in srgb, var(--accent) 60%, transparent); }
.btn-primary:hover { background: var(--accent); color: var(--on-accent); transform: translateY(-1px); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--accent); transform: translateY(-1px); }
.btn-small { min-height: 38px; padding: 0 16px; font-size: .9rem; }
.btn-block { width: 100%; }
.i-apple { fill: currentColor; }
.i-dl { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.nav-inner { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; color: var(--text); text-decoration: none; letter-spacing: -.01em; }
.brand:hover { color: var(--text); }
.brand img { border-radius: 8px; }
.nav-links { display: none; gap: 4px; margin-left: 12px; }
.nav-links a { color: var(--text-2); text-decoration: none; padding: 8px 12px; border-radius: 8px; font-size: .95rem; }
.nav-links a:hover { color: var(--text); background: var(--surface-2); }
.nav-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.nav-cta { display: none; }
@media (min-width: 880px) { .nav-links { display: flex; } }
@media (min-width: 520px) { .nav-cta { display: inline-flex; } }

.lang { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; padding: 3px; background: var(--surface); }
.lang button { border: 0; background: none; color: var(--text-2); font: 600 .8rem/1 var(--font); padding: 0 10px; min-height: 30px; min-width: 36px; border-radius: 999px; cursor: pointer; }
.lang button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-strong); }

.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.icon-btn .i-moon { fill: currentColor; stroke: none; }
.icon-btn .i-sun { display: none; }
:root[data-theme="dark"] .icon-btn .i-sun { display: block; }
:root[data-theme="dark"] .icon-btn .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-btn .i-sun { display: block; }
  :root:not([data-theme="light"]) .icon-btn .i-moon { display: none; }
}

/* ---------- Hero ---------- */
.hero { position: relative; padding: 48px 0 72px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -40% -10% auto -10%; height: 120%; z-index: -1;
  background:
    radial-gradient(50% 50% at 75% 40%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%),
    radial-gradient(40% 40% at 10% 10%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%);
}
.hero-grid { display: grid; gap: 48px; align-items: center; }
@media (min-width: 960px) { .hero { padding: 80px 0 104px; } .hero-grid { grid-template-columns: 1.1fr .9fr; gap: 64px; } }

.eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: var(--text-2); font-size: .92rem; margin-bottom: 20px; }
.pill { background: var(--accent-soft); color: var(--accent-strong); font-weight: 700; font-size: .78rem; padding: 4px 10px; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; }
.hero h1 { font-size: clamp(2.2rem, 6.4vw, 4rem); font-weight: 800; letter-spacing: -.035em; }
.lead { margin-top: 20px; font-size: clamp(1.05rem, 2.2vw, 1.22rem); color: var(--text-2); max-width: 36em; }
.lead b { color: var(--text); font-weight: 600; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 8px 20px; list-style: none; padding: 0; margin: 28px 0 0; color: var(--text-2); font-size: .92rem; }
.hero-facts li { display: inline-flex; align-items: center; gap: 8px; }
.hero-facts li::before { content: ""; width: 16px; height: 16px; border-radius: 50%; background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.2l2.2 2.2 4.8-5' fill='none' stroke='%230e8f86' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/16px no-repeat; }

/* Illustrative phone */
.hero-art { position: relative; display: grid; place-items: center; }
.glow { position: absolute; width: 70%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 35%, transparent), transparent 65%); filter: blur(20px); }
.phone {
  position: relative; width: min(320px, 82vw); aspect-ratio: 9 / 18.5;
  background: #0b1416; border-radius: 48px; padding: 12px;
  box-shadow: var(--shadow-lg), inset 0 0 0 2px #2a3a3d;
}
.phone-notch { position: absolute; top: 22px; left: 50%; transform: translateX(-50%); width: 92px; height: 26px; border-radius: 20px; background: #000; z-index: 2; }
.phone-screen {
  position: relative; height: 100%; border-radius: 38px; overflow: hidden;
  background: var(--surface); padding: 58px 14px 14px; display: flex; flex-direction: column; gap: 10px;
  font-size: 12.5px; line-height: 1.45;
}
.ph-top { display: flex; align-items: center; gap: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.ph-dot { width: 8px; height: 8px; border-radius: 50%; background: #34c759; }
.ph-title { font-family: var(--mono); font-size: 11px; color: var(--text-2); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-agent { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); }
.ph-msg { padding: 8px 11px; border-radius: 14px; max-width: 88%; }
.ph-user { align-self: flex-end; background: var(--accent-strong); color: var(--on-accent); border-bottom-right-radius: 4px; }
.ph-ai { background: var(--surface-2); border-bottom-left-radius: 4px; }
.ph-tool { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.ph-tool-head { padding: 6px 10px; font-family: var(--mono); font-size: 10.5px; color: var(--text-2); background: var(--surface-2); }
.ph-tool-name { color: var(--accent-strong); font-weight: 700; }
.ph-diff { margin: 0; padding: 6px 0; font: 10.5px/1.6 var(--mono); white-space: pre; overflow: hidden; }
.ph-diff span { display: block; padding: 0 10px; }
.ph-diff .del { background: var(--del-bg); color: var(--del); }
.ph-diff .add { background: var(--add-bg); color: var(--add); }
.ph-agents { display: flex; gap: 6px; flex-wrap: wrap; }
.ph-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-2); }
.ph-chip i { width: 7px; height: 7px; border-radius: 50%; }
.ph-chip .run { background: #f5a524; box-shadow: 0 0 0 3px color-mix(in srgb, #f5a524 25%, transparent); }
.ph-chip .ok { background: #34c759; }
.ph-sheet {
  margin-top: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 22px;
  padding: 14px; box-shadow: 0 -10px 30px -12px rgba(0, 0, 0, .25);
}
.ph-sheet-title { font-weight: 700; font-size: 13px; margin-bottom: 8px; }
.ph-sheet code { display: block; font-size: 11px; padding: 6px 9px; }
.ph-sheet-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.ph-sheet-btns span { text-align: center; padding: 9px; border-radius: 12px; font-weight: 700; font-size: 12.5px; }
.ph-deny { background: var(--surface-2); color: var(--danger); }
.ph-allow { background: var(--accent-strong); color: var(--on-accent); }

/* ---------- Sections ---------- */
.section { padding: 80px 0; }
.section-alt { background: var(--bg-alt); }
.section-head { max-width: 720px; margin-bottom: 40px; }
.section-head h2 { font-size: clamp(1.75rem, 4.2vw, 2.6rem); font-weight: 800; }
.section-head p:not(.kicker) { margin-top: 14px; color: var(--text-2); font-size: 1.08rem; }
.kicker { color: var(--accent-strong); font-weight: 700; font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 10px; }

.grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(3, 1fr); gap: 20px; } }
.card {
  position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow); transition: transform .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.card-new { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.card h3 { font-size: 1.12rem; margin: 16px 0 8px; }
.card p { color: var(--text-2); font-size: .97rem; }
.card-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-strong); }
.card-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.badge { position: absolute; top: 20px; right: 20px; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 3px 9px; border-radius: 999px; background: var(--accent-strong); color: var(--on-accent); }

/* Steps */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; counter-reset: s; }
@media (min-width: 860px) { .steps { grid-template-columns: repeat(3, 1fr); gap: 20px; } }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px 24px; box-shadow: var(--shadow); }
.step-num { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 800; margin-bottom: 18px; }
:root[data-theme="dark"] .step-num { background: var(--accent-strong); color: var(--on-accent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .step-num { background: var(--accent-strong); color: var(--on-accent); } }
.step h3 { font-size: 1.15rem; margin-bottom: 8px; }
.step p { color: var(--text-2); }

/* Download */
.dl-grid { display: grid; gap: 20px; }
@media (min-width: 900px) { .dl-grid { grid-template-columns: 1fr 1fr; } }
.dl-card { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 28px 24px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.dl-head h3 { font-size: 1.3rem; margin-bottom: 4px; }
.dl-meta { font-size: .88rem; margin-top: -6px; }
.dl-label { font-weight: 600; }
.code-block { position: relative; background: var(--navy); color: #d9eeec; border-radius: 12px; }
.code-block pre { margin: 0; padding: 16px; overflow-x: auto; font: .82rem/1.7 var(--mono); }
.code-block code { background: none; padding: 0; font-size: inherit; overflow-wrap: normal; }
.dl-label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 4px; margin-bottom: -6px; }
.copy-btn { border: 1px solid var(--border); background: var(--surface); color: var(--text); font: 600 .8rem/1 var(--font); padding: 8px 12px; min-height: 34px; border-radius: 8px; cursor: pointer; }
.copy-btn:hover { border-color: var(--accent); }
.qr-row { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; }
.qr-row > div:last-child { flex: 1 1 200px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.qr { flex: none; width: 176px; height: 176px; padding: 12px; background: #fff; border-radius: 16px; border: 1px solid var(--border); }
.qr canvas, .qr img { width: 100% !important; height: 100% !important; image-rendering: pixelated; }
.qr.is-placeholder { opacity: .35; }

/* Security */
.sec-grid { display: grid; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
@media (min-width: 700px) { .sec-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .sec-grid { grid-template-columns: repeat(3, 1fr); } }
.sec-item { background: var(--surface); padding: 24px; }
.sec-item h3 { font-size: 1.02rem; margin-bottom: 8px; }
.sec-item p { color: var(--text-2); font-size: .95rem; }

/* FAQ */
.faq { display: grid; gap: 10px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.faq summary { list-style: none; cursor: pointer; padding: 18px 52px 18px 20px; font-weight: 600; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: 22px; top: 50%; width: 10px; height: 10px; border-right: 2px solid var(--text-2); border-bottom: 2px solid var(--text-2); transform: translateY(-70%) rotate(45deg); transition: transform .2s ease; }
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq details p { padding: 0 20px 20px; color: var(--text-2); }

/* Footer */
.footer { border-top: 1px solid var(--border); padding: 40px 0 48px; }
.footer .wrap { display: grid; gap: 14px; }
.footer-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.footer-links { display: flex; gap: 18px; }
.footer-links a { color: var(--text-2); text-decoration: none; }
.footer-links a:hover { color: var(--text); text-decoration: underline; }
.notice { padding: 14px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); font-size: .92rem; color: var(--text-2); }
.notice b { color: var(--text); }
