/* Unwritten — unwritteninstructions.com
   Static, no build step, no web fonts. Light + dark (system-follow, with a
   manual toggle stored in localStorage as `theme`). */

:root {
  --bg: #faf8f4;
  --bg-soft: #f3f0ea;
  --surface: #ffffff;
  --ink: #17171c;
  --ink-soft: #3a3a44;
  --muted: #6b6b76;
  --line: #e6e1d8;
  --line-soft: #efebe4;
  --accent: #6366f1;
  --accent-strong: #4f46e5;
  --accent-wash: rgba(99, 102, 241, 0.09);
  --violet: #7c3aed;
  --highlight: rgba(250, 204, 21, 0.35);
  --shadow: 0 1px 2px rgba(23, 23, 28, 0.04), 0 12px 40px -12px rgba(23, 23, 28, 0.18);
  --shadow-lg: 0 2px 4px rgba(23, 23, 28, 0.04), 0 40px 80px -24px rgba(23, 23, 28, 0.28);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Charter, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius: 14px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0e0e12;
  --bg-soft: #131318;
  --surface: #17171d;
  --ink: #ededf2;
  --ink-soft: #c9c9d3;
  --muted: #9797a3;
  --line: #26262f;
  --line-soft: #1e1e25;
  --accent: #818cf8;
  --accent-strong: #a5b4fc;
  --accent-wash: rgba(129, 140, 248, 0.12);
  --violet: #a78bfa;
  --highlight: rgba(250, 204, 21, 0.22);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 40px -12px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.3), 0 40px 80px -24px rgba(0, 0, 0, 0.75);
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 200ms var(--ease), color 200ms var(--ease);
}

a { color: inherit; }
img, svg { display: block; max-width: 100%; }

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

.skip-link {
  position: absolute; left: -9999px; top: 8px; z-index: 100;
  background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 8px; text-decoration: none;
}
.skip-link:focus { left: 8px; }

.container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 28px; }

/* ---------- Nav ---------- */

.navbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms var(--ease);
}
.navbar.scrolled { border-bottom-color: var(--line); }
.nav-inner { display: flex; align-items: center; gap: 24px; height: 64px; }

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--serif); font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }

.nav-links { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-links a {
  font-size: 14px; color: var(--muted); text-decoration: none;
  padding: 6px 12px; border-radius: 999px;
  transition: color 150ms var(--ease), background-color 150ms var(--ease);
}
.nav-links a:hover { color: var(--ink); background: var(--accent-wash); }
.nav-links a.active { color: var(--ink); }

.theme-toggle {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer;
  transition: color 150ms var(--ease), border-color 150ms var(--ease), transform 150ms var(--ease);
}
.theme-toggle:hover { color: var(--ink); border-color: var(--muted); }
.theme-toggle:active { transform: scale(0.94); }
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 22px; border-radius: 999px;
  font: 600 15px/1 var(--sans); text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: transform 150ms var(--ease), background-color 150ms var(--ease), box-shadow 150ms var(--ease), border-color 150ms var(--ease);
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--ink); color: var(--bg); box-shadow: 0 8px 24px -10px rgba(23, 23, 28, 0.6); }
.btn-primary:hover { background: color-mix(in srgb, var(--ink) 86%, var(--accent)); }
.btn-ghost { color: var(--ink); border-color: var(--line); background: var(--surface); }
.btn-ghost:hover { border-color: var(--muted); }
.btn-sm { height: 36px; padding: 0 16px; font-size: 14px; }

/* ---------- Hero ---------- */

.hero { position: relative; padding: 88px 0 40px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -20% -10% auto; height: 640px; z-index: -1;
  background:
    radial-gradient(600px 300px at 20% 30%, var(--accent-wash), transparent 70%),
    radial-gradient(500px 260px at 80% 10%, color-mix(in srgb, var(--violet) 10%, transparent), transparent 70%);
}
.hero-copy { max-width: 780px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: var(--accent-strong);
  background: var(--accent-wash); padding: 5px 12px; border-radius: 999px; margin-bottom: 22px;
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 99px; background: var(--accent); }
.hero h1 {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(40px, 6.4vw, 74px); line-height: 1.02; letter-spacing: -0.025em;
}
.hero h1 em { font-style: italic; color: var(--accent-strong); }
.hero .lede { margin-top: 22px; font-size: clamp(17px, 1.6vw, 20px); color: var(--ink-soft); max-width: 640px; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 34px; }
.hero-note { margin-top: 14px; font-size: 13px; color: var(--muted); }

/* ---------- App window mockup (pure HTML/CSS) ---------- */

.window {
  margin-top: 64px; border-radius: 16px; background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow-lg); overflow: hidden;
  font-size: 13px; line-height: 1.5;
}
.window-bar {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px;
  border-bottom: 1px solid var(--line); background: var(--bg-soft);
}
.lights { display: flex; gap: 7px; }
.lights i { width: 11px; height: 11px; border-radius: 99px; background: #ff5f57; }
.lights i:nth-child(2) { background: #febc2e; }
.lights i:nth-child(3) { background: #28c840; }
.window-title { flex: 1; text-align: center; font-size: 12px; color: var(--muted); margin-right: 50px; }
.window-body { display: grid; grid-template-columns: 264px minmax(0, 1fr) 248px; min-height: 520px; }

.pane-side { border-right: 1px solid var(--line); background: var(--bg-soft); padding: 12px 10px; }
.vault-switch {
  display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 9px;
  background: var(--surface); border: 1px solid var(--line); font-weight: 600; margin-bottom: 14px;
}
.vault-switch .glyph { width: 20px; height: 20px; border-radius: 6px; background: var(--ink); color: var(--bg); display: grid; place-items: center; font: 600 11px/1 var(--serif); }
.vault-switch .chev { margin-left: auto; color: var(--muted); }
.side-section { margin-bottom: 12px; }
.side-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); padding: 0 9px 5px; font-weight: 600; }
.side-row { display: flex; align-items: center; gap: 8px; padding: 4px 9px; font-size: 12.5px; border-radius: 7px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; }
.side-row .n { flex: none; padding-left: 8px; margin-left: auto; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.side-row.on { background: var(--accent-wash); color: var(--ink); font-weight: 500; }
.side-row.plan { color: var(--muted); }
.side-row.indent { padding-left: 24px; }
.side-row .ic { width: 14px; height: 14px; flex: none; opacity: 0.75; }
.tag-p { font-size: 10px; font-weight: 700; color: var(--violet); }

.pane-main { position: relative; padding: 34px 48px 60px; }
.doc { max-width: 600px; margin: 0 auto; font-family: var(--serif); font-size: 16.5px; line-height: 1.7; color: var(--ink); }
.doc .props {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px;
  font-family: var(--sans); font-size: 11.5px; color: var(--muted);
}
.doc .props span { background: var(--bg-soft); border: 1px solid var(--line-soft); padding: 2px 8px; border-radius: 99px; }
.doc h2 { font-size: 28px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.2; margin-bottom: 14px; }
.doc p { margin-bottom: 14px; }
.doc .wl { color: var(--accent-strong); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); text-underline-offset: 3px; }
.doc mark { background: var(--highlight); color: inherit; padding: 0 2px; border-radius: 3px; }
.doc .raw { font-family: var(--mono); font-size: 13.5px; color: var(--muted); }
.caret { display: inline-block; width: 2px; height: 1.15em; vertical-align: -0.2em; background: var(--accent); margin-left: 1px; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.doc .callout {
  font-family: var(--sans); font-size: 13.5px; line-height: 1.55;
  border-left: 3px solid var(--violet); background: color-mix(in srgb, var(--violet) 7%, transparent);
  padding: 10px 14px; border-radius: 0 10px 10px 0; color: var(--ink-soft); margin-bottom: 14px;
}
.doc .callout b { color: var(--violet); }
.status {
  position: absolute; left: 0; right: 0; bottom: 0; height: 30px; padding: 0 16px;
  display: flex; align-items: center; gap: 14px; border-top: 1px solid var(--line-soft);
  font-size: 11.5px; color: var(--muted); background: var(--surface);
}
.status .ok { display: inline-flex; align-items: center; gap: 6px; }
.status .ok::before { content: ""; width: 7px; height: 7px; border-radius: 99px; background: #10b981; }
.status .right { margin-left: auto; font-variant-numeric: tabular-nums; }

.pane-inspect { border-left: 1px solid var(--line); padding: 14px 14px; background: var(--surface); }
.insp-block { margin-bottom: 18px; }
.insp-block h4 { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 7px; }
.insp-row { display: flex; align-items: center; gap: 8px; padding: 3px 0; color: var(--ink-soft); }
.insp-row .k { color: var(--muted); width: 58px; flex: none; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 99px; background: var(--accent-wash); color: var(--accent-strong); font-size: 11.5px; }
.backlink { padding: 6px 8px; border: 1px solid var(--line-soft); border-radius: 8px; margin-bottom: 6px; }
.backlink b { display: block; font-weight: 600; color: var(--ink); font-size: 12px; }
.backlink span { color: var(--muted); font-size: 11.5px; }

/* ---------- Sections ---------- */

section { padding: 96px 0; }
.section-head { max-width: 720px; margin-bottom: 48px; }
.kicker { font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent-strong); margin-bottom: 12px; }
.section-head h2, .split h2, .cta h2 {
  font-family: var(--serif); font-weight: 600; letter-spacing: -0.02em;
  font-size: clamp(30px, 3.6vw, 44px); line-height: 1.1;
}
.section-head p { margin-top: 14px; font-size: 18px; color: var(--ink-soft); }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px;
  transition: transform 200ms var(--ease), box-shadow 200ms var(--ease), border-color 200ms var(--ease);
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }
.card .icon {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; margin-bottom: 18px;
  background: var(--accent-wash); color: var(--accent-strong);
}
.card .icon svg { width: 20px; height: 20px; }
.card h3 { font-size: 17px; font-weight: 650; letter-spacing: -0.01em; margin-bottom: 8px; }
.card p { font-size: 15px; color: var(--ink-soft); }
.card code, .split code, .faq code { font-family: var(--mono); font-size: 0.88em; background: var(--bg-soft); border: 1px solid var(--line-soft); padding: 1px 6px; border-radius: 6px; }
.card.wide { grid-column: span 2; }

.band { background: var(--bg-soft); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; align-items: center; }
.split p { margin-top: 16px; font-size: 17px; color: var(--ink-soft); }
.checks { list-style: none; margin-top: 24px; display: grid; gap: 12px; }
.checks li { display: flex; gap: 12px; align-items: flex-start; font-size: 15.5px; color: var(--ink-soft); }
.checks li::before {
  content: ""; flex: none; width: 20px; height: 20px; margin-top: 2px; border-radius: 99px;
  background: var(--accent-wash) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%236366f1' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5.5 10.5l3 3 6-7'/%3E%3C/svg%3E") center / 14px no-repeat;
}

/* Timeline illustration */
.timeline-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 22px; box-shadow: var(--shadow); font-size: 12.5px; }
.tl-head { display: flex; justify-content: space-between; color: var(--muted); font-size: 11.5px; margin-bottom: 14px; }
.tl-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 99px; padding: 2px; }
.tl-seg span { padding: 2px 10px; border-radius: 99px; }
.tl-seg span.on { background: var(--ink); color: var(--bg); }
.lane { display: grid; grid-template-columns: 92px 1fr; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px dashed var(--line); }
.lane:first-of-type { border-top: 0; }
.lane .who { color: var(--muted); font-weight: 600; font-size: 12px; }
.lane .track { position: relative; height: 26px; }
.ev { position: absolute; top: 0; height: 26px; border-radius: 7px; padding: 0 9px; display: flex; align-items: center; white-space: nowrap; overflow: hidden; font-size: 11.5px; font-weight: 500; }
.ev.a { background: color-mix(in srgb, #6366f1 16%, transparent); color: var(--accent-strong); }
.ev.b { background: color-mix(in srgb, #10b981 16%, transparent); color: color-mix(in srgb, #10b981 80%, var(--ink)); }
.ev.c { background: color-mix(in srgb, #f59e0b 18%, transparent); color: color-mix(in srgb, #b45309 85%, var(--ink)); }
.ev.d { background: color-mix(in srgb, #a855f7 16%, transparent); color: var(--violet); }
.tl-axis { display: grid; grid-template-columns: 92px repeat(5, 1fr); margin-top: 10px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.tl-axis span:first-child { visibility: hidden; }

/* Sync illustration */
.devices { position: relative; display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; align-items: end; }
.device { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; box-shadow: var(--shadow); }
.device.ipad { border-radius: 18px; }
.device .dlabel { display: flex; align-items: center; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-bottom: 10px; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 600; }
.pill.ok { background: rgba(16, 185, 129, 0.12); color: #059669; }
.pill.off { background: rgba(245, 158, 11, 0.14); color: #b45309; }
:root[data-theme="dark"] .pill.ok { color: #34d399; }
:root[data-theme="dark"] .pill.off { color: #fbbf24; }
.lines i { display: block; height: 7px; border-radius: 99px; background: var(--line); margin: 8px 0; }
.lines i.hl { background: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.merge-note { margin-top: 16px; font-size: 13px; color: var(--muted); text-align: center; }

/* ---------- CTA / Footer ---------- */

.cta { text-align: center; padding: 104px 0; }
.cta p { margin: 16px auto 0; max-width: 560px; color: var(--ink-soft); font-size: 18px; }
.cta .hero-actions { justify-content: center; }

footer { border-top: 1px solid var(--line); padding: 40px 0 48px; font-size: 14px; color: var(--muted); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 28px; }
.footer-inner .brand { font-size: 17px; color: var(--ink); }
.footer-inner .brand img { width: 24px; height: 24px; border-radius: 6px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: var(--ink); }
.copyright { margin-left: auto; }

/* ---------- Inner pages ---------- */

.page-header { padding: 80px 0 28px; }
.page-header h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(36px, 5vw, 56px); letter-spacing: -0.02em; line-height: 1.05; }
.page-header p { margin-top: 14px; font-size: 18px; color: var(--ink-soft); max-width: 640px; }
.page-body { padding: 24px 0 96px; }
.prose { max-width: 760px; }

.contact-box {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; margin-bottom: 48px;
}
.contact-box strong { font-size: 16px; }
.contact-box p { color: var(--muted); font-size: 14.5px; }

.faq h2 { font-family: var(--serif); font-size: 28px; font-weight: 600; letter-spacing: -0.01em; margin: 8px 0 16px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; padding: 18px 36px 18px 0; position: relative;
  font-size: 16.5px; font-weight: 600; letter-spacing: -0.005em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 6px; top: 50%; width: 9px; height: 9px; margin-top: -7px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg);
  transition: transform 200ms var(--ease);
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq summary:hover { color: var(--accent-strong); }
.faq details p { padding: 0 0 18px; color: var(--ink-soft); font-size: 15.5px; max-width: 680px; }
.faq details p + p { margin-top: -8px; }

.download-card {
  max-width: 760px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 36px;
  box-shadow: var(--shadow);
}
.download-card .status-line { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: #b45309; background: rgba(245, 158, 11, 0.12); padding: 5px 12px; border-radius: 99px; }
:root[data-theme="dark"] .download-card .status-line { color: #fbbf24; }
.download-card h2 { font-family: var(--serif); font-size: 30px; font-weight: 600; letter-spacing: -0.015em; margin: 18px 0 10px; }
.download-card p { color: var(--ink-soft); font-size: 16.5px; }
.download-card .hero-actions { margin-top: 26px; }
.platforms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 28px; max-width: 760px; }
.platform { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; background: var(--surface); }
.platform b { display: block; font-size: 15px; }
.platform span { color: var(--muted); font-size: 14px; }

.policy-intro { max-width: 760px; color: var(--ink-soft); font-size: 16.5px; margin-bottom: 28px; }
.policy-intro p + p { margin-top: 12px; }
.termly-wrap { background: #fff; color: #17171c; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 24px; max-width: 900px; }

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
  .window-body { grid-template-columns: 252px minmax(0, 1fr); }
  .pane-inspect { display: none; }
}
@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr; gap: 40px; }
  section { padding: 72px 0; }
}
@media (max-width: 720px) {
  .container { padding: 0 20px; }
  .nav-links a:not(.keep) { display: none; }
  .hero { padding-top: 56px; }
  .window-body { grid-template-columns: 1fr; min-height: 440px; }
  .pane-side { display: none; }
  .pane-main { padding: 26px 22px 56px; }
  .grid { grid-template-columns: 1fr; }
  .card.wide { grid-column: auto; }
  .platforms { grid-template-columns: 1fr; }
  .copyright { margin-left: 0; width: 100%; }
  .devices { grid-template-columns: 1fr; }
}

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