/* Loophole — landing + legal. Circadian Instrument aesthetic:
   a committed warm-ink dark ground, editorial serif display, copper→gold light. */

:root {
  --ground: #0C0A10;
  --ground-2: #100D15;
  --card: #16131C;
  --ink: #F3EEE7;
  --ink-soft: #B9B1A9;
  --ink-faint: #7C756E;
  --hairline: rgba(255, 255, 255, 0.08);
  --hairline-bright: rgba(255, 255, 255, 0.14);
  --copper: #E8925A;
  --gold: #F2C879;
  --coral: #E9704E;
  --phosphor: #8FD6C4;
  --serif: ui-serif, "New York", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --maxw: 760px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* Ambient dawn-light glow behind the hero. */
.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(60% 40% at 50% -8%, rgba(233, 146, 90, 0.20), transparent 70%),
    radial-gradient(40% 30% at 82% 4%, rgba(242, 200, 121, 0.12), transparent 70%);
}

main, header, footer { position: relative; z-index: 1; }

/* ---- Top bar ---- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 0;
}
.brandmark { display: flex; align-items: center; gap: 12px; }
.brandmark .glyph { width: 30px; height: 30px; }
.brandmark .name {
  font-family: var(--serif); font-size: 20px; font-weight: 600; letter-spacing: 0.2px;
}
.navlinks { display: flex; gap: 20px; font-size: 14px; }
.navlinks a { color: var(--ink-soft); }

/* ---- Hero ---- */
.hero { text-align: center; padding: 56px 0 40px; }
.hero .ring { width: 116px; height: 116px; margin: 0 auto 26px; display: block; }
.eyebrow {
  text-transform: uppercase; letter-spacing: 0.22em; font-size: 12px; font-weight: 600;
  color: var(--copper); margin-bottom: 18px;
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(38px, 8vw, 60px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0 0 18px;
}
.hero h1 .accent {
  background: linear-gradient(105deg, var(--gold), var(--copper) 55%, var(--coral));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .lede {
  font-size: clamp(17px, 2.6vw, 20px);
  color: var(--ink-soft);
  max-width: 540px; margin: 0 auto 30px;
}
.cta-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 13px 22px; border-radius: 999px; font-weight: 600; font-size: 15px;
  border: 1px solid transparent; cursor: pointer;
}
.btn-primary {
  color: #17110b;
  background: linear-gradient(105deg, var(--gold), var(--copper));
}
.btn-primary:hover { text-decoration: none; filter: brightness(1.05); }
.btn-ghost { color: var(--ink); border-color: var(--hairline-bright); }
.btn-ghost:hover { text-decoration: none; border-color: var(--ink-soft); }
.hero .note { margin-top: 18px; font-size: 13px; color: var(--ink-faint); }
.hero .note a { color: var(--ink-soft); }
.badge-link { display: inline-block; line-height: 0; }
.badge-link:hover { opacity: 0.88; }
.appstore-badge { height: 54px; width: auto; display: block; }

/* ---- Sections ---- */
section { padding: 30px 0; }
.section-title {
  font-family: var(--serif); font-size: clamp(24px, 4.5vw, 30px); font-weight: 600;
  margin: 0 0 8px; letter-spacing: -0.01em;
}
.section-sub { color: var(--ink-soft); margin: 0 0 26px; }

.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 620px) { .cards { grid-template-columns: 1fr; } }
.card {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: 18px;
  padding: 22px;
}
.card .k {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--copper); font-weight: 600; margin-bottom: 10px;
}
.card h3 { font-family: var(--serif); font-size: 19px; font-weight: 600; margin: 0 0 7px; }
.card p { margin: 0; color: var(--ink-soft); font-size: 15px; line-height: 1.6; }

/* Feature list (three paths) */
.paths { display: grid; gap: 12px; }
.path {
  display: flex; gap: 16px; align-items: flex-start;
  background: var(--card); border: 1px solid var(--hairline);
  border-radius: 16px; padding: 18px 20px;
}
.path .dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 8px; flex: none; }
.path h3 { font-family: var(--serif); font-size: 18px; margin: 0 0 4px; font-weight: 600; }
.path p { margin: 0; color: var(--ink-soft); font-size: 15px; }

/* ---- Legal pages ---- */
.legal { padding: 20px 0 40px; }
.legal h1 {
  font-family: var(--serif); font-size: clamp(30px, 6vw, 42px); font-weight: 600;
  margin: 24px 0 6px; letter-spacing: -0.01em;
}
.legal .updated { color: var(--ink-faint); font-size: 14px; margin-bottom: 30px; }
.legal h2 {
  font-family: var(--serif); font-size: 20px; font-weight: 600;
  margin: 30px 0 8px;
}
.legal p { color: var(--ink-soft); margin: 0 0 4px; }

/* ---- Footer ---- */
footer {
  border-top: 1px solid var(--hairline);
  margin-top: 40px; padding: 30px 0 50px;
  color: var(--ink-faint); font-size: 13.5px;
}
.footer-grid { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { color: var(--ink-soft); }
.disclaimer {
  margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--hairline);
  line-height: 1.6;
}

/* ---- Guide pages (code, lists, callouts) ---- */
.legal ol, .legal ul { color: var(--ink-soft); margin: 10px 0 16px; padding-left: 22px; }
.legal li { margin: 0 0 9px; line-height: 1.55; }
.legal li strong { color: var(--ink); }
.legal code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px;
  background: var(--hairline); padding: 1px 6px; border-radius: 5px; color: var(--ink);
}
.legal pre {
  background: var(--ground-2); border: 1px solid var(--hairline); border-radius: 11px;
  padding: 14px 16px; overflow-x: auto; margin: 10px 0 18px;
}
.legal pre code { background: none; padding: 0; font-size: 12.5px; line-height: 1.7; color: var(--ink); }
.legal .callout {
  border-left: 3px solid var(--copper); background: rgba(232, 146, 90, 0.09);
  padding: 11px 15px; border-radius: 9px; margin: 14px 0; color: var(--ink-soft);
}
.legal .callout strong { color: var(--ink); }

/* ---- OS guide: tabs + stepper + copy ---- */
.ostabs { display:inline-flex; flex-wrap:wrap; gap:4px; background:var(--card); border:1px solid var(--hairline); border-radius:13px; padding:5px; margin:14px 0 6px; }
.tab-btn { display:inline-flex; align-items:center; gap:7px; border:0; background:transparent; color:var(--ink-soft); font-family:var(--sans); font-size:14px; font-weight:600; padding:9px 16px; border-radius:9px; cursor:pointer; transition:background .15s, color .15s; }
.os-logo { width:15px; height:15px; flex:0 0 auto; opacity:.85; }
.tab-btn[aria-selected="true"] .os-logo { opacity:1; }
.tab-btn:hover { color:var(--ink); }
.tab-btn[aria-selected="true"] { background:linear-gradient(var(--gold), var(--copper)); color:#1b1206; }

.ospanel[hidden] { display:none; }
.stepper { position:relative; margin:4px 0 8px; }
.step { display:grid; grid-template-columns:34px 1fr; gap:16px; position:relative; padding-bottom:30px; }
.step:last-child { padding-bottom:2px; }
.step:not(:last-child)::before { content:""; position:absolute; left:16px; top:37px; bottom:2px; width:2px; background:linear-gradient(var(--copper), rgba(232,146,90,.14)); }
.step:not(:last-child)::after { content:"\25BE"; position:absolute; left:11.5px; bottom:5px; color:var(--copper); font-size:13px; line-height:1; }
.step-num { width:34px; height:34px; border-radius:50%; border:1.5px solid var(--copper); color:var(--gold); background:var(--ground-2); display:grid; place-items:center; font-family:var(--serif); font-weight:600; font-size:15px; z-index:1; }
.step-body h3 { font-family:var(--serif); font-size:16.5px; font-weight:600; margin:5px 0 7px; color:var(--ink); }
.step-body p { margin:0 0 8px; }

.codewrap { position:relative; }
.copy-btn { position:absolute; top:9px; right:9px; border:1px solid var(--hairline); background:var(--card); color:var(--ink-soft); font-family:var(--sans); font-size:11.5px; font-weight:600; padding:4px 9px; border-radius:7px; cursor:pointer; }
.copy-btn:hover { color:var(--ink); border-color:var(--hairline-bright); }
.copy-btn.copied { color:var(--phosphor); border-color:var(--phosphor); }
