/* orcha.sh landing page. Dark, IBM Plex Mono, terminal-flavored, shares the
 * client's tokens and fonts so the page and the embedded demo feel like one
 * surface. No frameworks, no third-party fetches. Desktop uses a two-column
 * lead (demo beside the feature list); it collapses to one column on phones.
 */

@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-display: swap; src: url(plexmono-400.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url(plexmono-500.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 600; font-display: swap; src: url(plexmono-600.woff2) format("woff2"); }

:root {
  --bg:      #0a0d11;
  --bg-2:    #0e1318;
  --panel:   #11171d;
  --line:    #1f2a35;
  --line-2:  #2b3c4b;
  --text:    #d2dde6;
  --muted:   #8799a6;
  --faint:   #84939f;
  --phos:    #7cc7e8;
  --phos-dim:#31566b;
  --busy:    #7ec998;
  --wait:    #e6b35a;
  --err:     #e57a64;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --maxw: 64rem;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  background-image: radial-gradient(ellipse 120% 50% at 50% -8%, #0f161e 0%, var(--bg) 55%);
  color: var(--text);
  font: 400 15px/1.6 var(--mono);
  -webkit-font-smoothing: antialiased;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
  .dot-on, .run-demo .play { box-shadow: none; }
}

::selection { background: var(--phos-dim); }
a { color: var(--phos); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); }
h1, h2 { font-weight: 600; line-height: 1.2; margin: 0; }

:focus-visible { outline: 2px solid var(--phos); outline-offset: 2px; border-radius: 2px; }
.skip { position: absolute; left: -999px; top: 0; z-index: 10; padding: .5rem .8rem; background: var(--panel); border: 1px solid var(--line); }
.skip:focus { left: .6rem; top: .6rem; }

section { padding: 2.75rem 1.25rem; max-width: var(--maxw); margin: 0 auto; scroll-margin-top: 3.75rem; }
#demo, #features { scroll-margin-top: 4rem; }
.sec-head { margin: 0 0 1.5rem; text-align: center; }
.sec-head h2 { font-size: 1.05rem; color: var(--muted); font-weight: 500; letter-spacing: .04em; }

/* ───────── nav ───────── */
.nav {
  position: sticky; top: 0; z-index: 9;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .55rem max(1.25rem, env(safe-area-inset-left));
  padding-top: max(.55rem, env(safe-area-inset-top));
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(9px);
}
.brand { display: flex; align-items: center; gap: .45rem; font-weight: 600; letter-spacing: .04em; color: var(--text); }
.brand:hover { text-decoration: none; }
.mark { width: 1.3rem; height: 1.3rem; }
.om-body { fill: #06090c; stroke: color-mix(in srgb, var(--phos) 45%, transparent); stroke-width: .55; }
.om-white { fill: #e8f2f7; }
.word { font-size: 1.05rem; }
.nav nav { display: flex; align-items: center; gap: 1rem; }
.nav nav a { color: var(--muted); letter-spacing: .04em; font-size: .82rem; }
.nav nav a:hover { color: var(--text); text-decoration: none; }
.nav nav .gh { display: inline-flex; align-items: center; }
.nav nav .gh svg { width: 17px; height: 17px; display: block; }

/* ───────── hero: pitch + install (left), demo (right) ───────── */
.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "head demo" "install demo";
  column-gap: 4rem; align-items: start; max-width: 62rem; margin: 0 auto;
  padding: 4rem 1.25rem 2.75rem;
}
.hero h1 { grid-area: head; font-size: clamp(1.85rem, 4.2vw, 2.7rem); letter-spacing: -.01em; margin: 0; max-width: 22ch; }
.hero h1 .hl { color: var(--phos); }
.install { grid-area: install; margin-top: 3rem; }

.demo { grid-area: demo; align-self: center; display: flex; flex-direction: column; align-items: center; gap: .7rem; }
.demo:hover { text-decoration: none; }
.demo:hover .run-demo { background: color-mix(in srgb, var(--bg) 22%, transparent); }
.demo-lead { color: var(--faint); font-size: .78rem; margin: 0; text-align: center; letter-spacing: .03em; }
.phone {
  width: 240px; flex-shrink: 0;
  border: 1px solid var(--line-2); border-radius: 24px; padding: 7px;
  background: linear-gradient(160deg, #141b22, #0b0f14);
  box-shadow: 0 18px 50px -22px rgba(0,0,0,.8), inset 0 0 0 1px rgba(124,199,232,.05);
}
.phone-screen { position: relative; border-radius: 17px; overflow: hidden; background: var(--bg); aspect-ratio: 9 / 14; }
.phone-screen .poster,
.phone-screen iframe { display: block; width: 100%; height: 100%; border: 0; object-fit: cover; object-position: top; }
.run-demo {
  position: absolute; inset: 0; display: flex; flex-direction: column; gap: .5rem;
  align-items: center; justify-content: center; cursor: pointer;
  font: inherit; color: var(--text); letter-spacing: .03em;
  background: color-mix(in srgb, var(--bg) 38%, transparent); border: 0;
  -webkit-backdrop-filter: blur(1px); backdrop-filter: blur(1px); transition: background .2s ease;
}
.run-demo:hover { background: color-mix(in srgb, var(--bg) 22%, transparent); }
.run-demo span:last-child { text-shadow: 0 1px 6px rgba(0,0,0,.7); }
.run-demo .play {
  width: 2.8rem; height: 2.8rem; display: grid; place-items: center;
  font-size: 1rem; color: #06121a; padding-left: 2px;
  background: var(--phos); border-radius: 50%;
  box-shadow: 0 0 22px color-mix(in srgb, var(--phos) 55%, transparent);
}
.phone-foot { display: flex; align-items: center; gap: .45rem; justify-content: center; padding: .5rem 0 .1rem; font-size: .72rem; color: var(--faint); letter-spacing: .04em; }
.qr { display: flex; flex-direction: column; align-items: center; gap: .5rem; margin-top: .4rem; }
.qr-img { background: #e8f2f7; padding: 7px; border-radius: 8px; line-height: 0; }
.qr-img svg { width: 92px; height: 92px; display: block; }
.qr > span { color: var(--faint); font-size: .72rem; letter-spacing: .03em; }
.dot-on { width: 7px; height: 7px; border-radius: 50%; background: var(--phos); box-shadow: 0 0 6px color-mix(in srgb, var(--phos) 55%, transparent); }
.reload { font: inherit; font-size: .68rem; color: var(--muted); cursor: pointer; margin-left: .4rem; background: none; border: 1px solid var(--line); border-radius: 5px; padding: .25rem .5rem; min-height: 32px; }
.reload:hover { color: var(--text); border-color: var(--line-2); }

/* ───────── features ───────── */
.feats-sec { padding-top: 3rem; }
.feats-card {
  max-width: 54rem; margin: 0 auto; padding: 2.25rem 2.5rem;
  border: 1px solid var(--line); border-radius: 14px;
  background: color-mix(in srgb, var(--panel) 45%, var(--bg));
}
.feats {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem 3rem;
}
.feats li { padding: 0 0 0 1.4rem; position: relative; color: var(--muted); }
.feats li b { color: var(--text); font-weight: 500; }
.feats li code { color: var(--text); }
.feats li::before { content: ""; position: absolute; left: 0; top: .52rem; width: 7px; height: 7px; border-radius: 50%; background: var(--phos); box-shadow: 0 0 7px color-mix(in srgb, var(--phos) 50%, transparent); }

/* ───────── how it works ───────── */
.flow { display: flex; align-items: center; justify-content: center; gap: .6rem; flex-wrap: wrap; max-width: 52rem; margin: 0 auto; }
.node {
  flex: 1 1 0; min-width: 8rem; max-width: 14rem;
  display: flex; flex-direction: column; justify-content: center; gap: .25rem;
  padding: .7rem .8rem; text-align: center;
  border: 1px solid var(--line); border-radius: 10px; background: color-mix(in srgb, var(--panel) 60%, var(--bg));
}
.node b { color: var(--text); font-weight: 500; }
.node span { color: var(--faint); font-size: .72rem; line-height: 1.4; }
.link { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .25rem; flex: 0 0 auto; min-width: 4rem; }
.link .bi { color: color-mix(in srgb, var(--phos) 65%, var(--phos-dim)); font-size: 1.8rem; line-height: 1; }
.lock { display: inline-flex; align-items: center; gap: .28rem; color: var(--phos); font-size: .64rem; letter-spacing: .03em; white-space: nowrap; }
.lk { width: .78rem; height: .78rem; flex-shrink: 0; }
.how { padding-bottom: 4.75rem; }
.flow-cap { text-align: center; color: var(--muted); font-size: .88rem; margin: 1.2rem auto 0; }
.threat { text-align: center; color: var(--faint); font-size: .82rem; margin: 1.2rem auto 0; }

/* ───────── install (left side of hero) ───────── */
.install-note { color: var(--faint); font-size: .82rem; margin: .9rem 0 0; max-width: 34rem; line-height: 1.55; }
.cmd { max-width: 34rem; margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: .5rem; }
.cmd-row { display: flex; align-items: center; gap: .5rem; padding: .55rem .5rem .55rem .85rem; border: 1px solid var(--line); border-radius: 7px; background: var(--bg-2); }
.cmd-row code { color: var(--text); font-size: .85rem; white-space: nowrap; flex: 1 1 auto; min-width: 0; overflow-x: auto; }
.cmd-row code::before { content: "$ "; color: var(--phos-dim); }
.copy { display: grid; place-items: center; color: var(--muted); cursor: pointer; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; width: 32px; height: 32px; padding: 0; flex-shrink: 0; }
.copy svg { width: 15px; height: 15px; }
.copy:hover { color: var(--text); border-color: var(--line-2); }
.copy.done { color: var(--busy); border-color: var(--phos-dim); }
.alts { max-width: 34rem; margin: 1.1rem 0 0; }
.alts summary { color: var(--muted); font-size: .82rem; cursor: pointer; }
.alts summary:hover { color: var(--text); }
.alt { margin: .7rem 0 0; }
.alt-label { display: block; color: var(--faint); font-size: .76rem; margin-bottom: .15rem; }
.alt code { color: var(--text); font-size: .82rem; word-break: break-all; }

/* ───────── demo page ───────── */
.demo-page { max-width: 58rem; margin: 0 auto; padding: 2.5rem 1.25rem 4rem; }
.demo-head { text-align: center; max-width: 40rem; margin: 0 auto 2.25rem; }
.demo-head h1 { font-size: clamp(1.5rem, 4vw, 2.1rem); }
.demo-head p { color: var(--muted); margin: .8rem 0 0; }
.demo-stage { display: flex; align-items: center; justify-content: center; gap: 3.5rem; flex-wrap: wrap; }
/* screen ~382px: the client needs ~360 to not overflow, so this leaves slack
   even if a scrollbar gutter appears. Gentler corner radius so the top-right
   settings gear is never clipped. */
.phone.big { width: 400px; }
.phone.big .phone-screen { aspect-ratio: 9 / 16; border-radius: 10px; }
.demo-side { display: flex; flex-direction: column; gap: 1.8rem; max-width: 18rem; }
.demo-hints { list-style: none; counter-reset: step; margin: 0; padding: 0; }
.demo-hints li { counter-increment: step; position: relative; padding: .55rem 0 .55rem 2rem; color: var(--muted); border-bottom: 1px solid var(--line); }
.demo-hints li:last-child { border-bottom: 0; }
.demo-hints li b { color: var(--text); font-weight: 500; }
.demo-hints li::before { content: counter(step); position: absolute; left: 0; top: .5rem; width: 1.4rem; height: 1.4rem; display: grid; place-items: center; font-size: .7rem; color: var(--phos); border: 1px solid var(--phos-dim); border-radius: 50%; }
@media (max-width: 760px) {
  /* on a phone the demo IS the phone — drop the bezel/chrome, fill the screen */
  .demo-page { padding: 0; max-width: none; }
  .demo-head, .demo-side { display: none; }
  .demo-stage { gap: 0; }
  .phone.big { width: 100%; border: 0; padding: 0; border-radius: 0; box-shadow: none; background: none; }
  .phone.big .phone-screen { border-radius: 0; aspect-ratio: auto; height: calc(100dvh - 3rem); }
}

/* ───────── docs ───────── */
.docs-layout { max-width: 62rem; margin: 0 auto; }
.doc-body { padding: 2.5rem 1.25rem 4rem; line-height: 1.7; min-width: 0; }
.doc-body h2 { font-size: 1.3rem; color: var(--text); font-weight: 600; margin: 0 0 1rem; }
.doc-body h3 { font-size: 1rem; color: var(--text); font-weight: 600; margin: 1.8rem 0 .5rem; }
.doc-body p { color: var(--text); margin: .8rem 0; }
.doc-body ul { color: var(--text); padding-left: 1.2rem; margin: .8rem 0; }
.doc-body li { margin: .4rem 0; }
.doc-body b, .doc-body strong { color: var(--text); font-weight: 600; }
.doc-body a { color: var(--phos); }
.doc-body code { color: var(--text); background: var(--bg-2); padding: .08rem .32rem; border: 1px solid var(--line); border-radius: 4px; font-size: .9em; }
.doc-body pre { background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: .9rem 1rem; overflow-x: auto; margin: .9rem 0; }
.doc-body pre code { background: none; border: 0; padding: 0; color: var(--text); white-space: pre; font-size: .82rem; }

/* table of contents: persistent sidebar on desktop, pull-out drawer on phones */
.drawer-title { color: var(--faint); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; margin: 0 0 .6rem; }
.doc-drawer a { display: block; color: var(--muted); padding: .4rem .5rem; border-radius: 6px; font-size: .9rem; border-left: 2px solid transparent; }
.doc-drawer a:hover { color: var(--text); text-decoration: none; background: var(--panel); }
.doc-drawer a.active { color: var(--phos); border-left-color: var(--phos); background: color-mix(in srgb, var(--phos) 8%, transparent); }

@media (min-width: 861px) {
  .docs-layout { display: grid; grid-template-columns: 13rem minmax(0, 1fr); gap: 2.5rem; padding: 0 1.25rem; }
  .doc-body { padding: 2.5rem 0 4rem; }
  .doc-drawer { position: sticky; top: 4rem; align-self: start; padding-top: 2.5rem; }
  .doc-toggle, .doc-scrim { display: none; }
}

@media (max-width: 860px) {
  .doc-toggle { position: fixed; right: max(1rem, env(safe-area-inset-right)); top: 3.3rem; z-index: 8; display: inline-flex; align-items: center; gap: .4rem; font: inherit; font-size: .82rem; color: var(--muted); background: color-mix(in srgb, var(--panel) 88%, var(--bg)); border: 1px solid var(--line); border-radius: 7px; padding: .5rem; cursor: pointer; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
  .doc-toggle:hover { color: var(--text); border-color: var(--line-2); }
  .doc-toggle .dt-label { display: none; }
  .doc-toggle svg { width: 20px; height: 20px; }
  .doc-scrim { position: fixed; inset: 0; z-index: 19; background: rgba(0,0,0,.5); opacity: 0; transition: opacity .2s ease; }
  .doc-scrim.open { opacity: 1; }
  .doc-drawer { position: fixed; z-index: 20; top: 0; right: 0; height: 100%; width: 15rem; max-width: 80vw; overflow-y: auto; padding: 1.25rem 1.1rem calc(1.25rem + env(safe-area-inset-bottom)); background: var(--bg-2); border-left: 1px solid var(--line); transform: translateX(100%); transition: transform .22s ease; }
  .doc-drawer.open { transform: translateX(0); }
}
@media (prefers-reduced-motion: reduce) { .doc-scrim, .doc-drawer { transition: none; } }

/* ───────── toast (github coming-soon) ───────── */
#toast {
  position: fixed; left: 50%; bottom: 1.4rem; z-index: 30;
  transform: translateX(-50%) translateY(.5rem);
  padding: .6rem 1rem; border: 1px solid var(--line-2); border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 92%, var(--bg)); color: var(--text);
  font-size: .85rem; box-shadow: 0 10px 30px -10px rgba(0,0,0,.7);
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (prefers-reduced-motion: reduce) { #toast { transition: opacity .2s ease; } }

/* ───────── footer ───────── */
.foot { border-top: 1px solid var(--line); padding: 2.25rem 1.25rem; text-align: center; }
.foot-row { display: flex; gap: 1.4rem; justify-content: center; flex-wrap: wrap; }
.foot-row a { color: var(--muted); letter-spacing: .04em; }
.foot-row a:hover { color: var(--text); }
.made { color: var(--faint); font-size: .78rem; margin: 1rem 0 0; }
.made .heart { color: var(--err); }

/* ───────── responsive ───────── */
@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr; grid-template-areas: "head" "demo" "install";
    column-gap: 0; row-gap: 2.9rem; padding: 3rem 1.25rem 2.5rem;
  }
  .hero h1 { max-width: none; }
  .install { margin-top: 0; }
  .demo { align-self: stretch; }
  .qr { display: none; }  /* on a phone you're already on your phone */
  .feats { grid-template-columns: 1fr; gap: 1.15rem; }
  .feats-card { max-width: 32rem; padding: 1.75rem 1.6rem; }
}
@media (max-width: 620px) {
  section { padding: 2.5rem 1.1rem; }
  .hero { padding: 2.5rem 1.1rem; }
  .hero .phone { width: min(56vw, 200px); }
  .hero .phone-screen { aspect-ratio: 4 / 5; }
  .flow { flex-direction: column; align-items: center; }
  .node { max-width: 16rem; width: 100%; }
  .link .bi { transform: rotate(90deg); }
}
