:root {
  --paper: #f3efe7;
  --paper-2: #ebe5d9;
  --card: #fbf9f4;
  --ink: #1d1a17;
  --ink-2: #463f38;
  --muted: #655d54;
  --accent: #7a2b24;          /* oxblood: 8.4:1 on paper */
  --accent-ink: #fbf9f4;
  --line: rgba(29, 26, 23, .14);
  --shadow: 0 1px 2px rgba(40, 28, 18, .06), 0 18px 40px -18px rgba(40, 28, 18, .28);
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --gutter: clamp(16px, 4vw, 56px);
  --header-h: 68px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 16px/1.55 var(--sans); overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--ink); color: var(--paper); padding: 8px 12px; border-radius: 8px; }
.skip:focus { top: 12px; }
kbd { font: 12px/1 var(--mono); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 3px 6px; color: var(--muted); background: var(--card); }
.kicker { font: 500 12px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 18px; }
.kicker .dot { color: var(--accent); }

/* Header */
.top {
  position: sticky; top: 0; z-index: 20; height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 var(--gutter);
  background: rgba(243, 239, 231, .82); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent; transition: border-color .3s;
}
.top.scrolled { border-bottom-color: var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.mono-box { position: relative; width: 38px; height: 38px; flex: none; }
.mono-box svg, .mono-box canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.mono-box canvas { opacity: 0; transition: opacity .6s; }
.mono-ready .mono-box canvas { opacity: 1; }
.mono-ready .mono-box svg { opacity: 0; }
.wordmark { white-space: nowrap; font-size: 17px; letter-spacing: -.01em; }
.wm-a { font-family: var(--serif); font-size: 22px; }
.wm-b { font: 500 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); vertical-align: 3px; }
.top-nav { display: flex; align-items: center; gap: clamp(10px, 2vw, 22px); }
.navlink { text-decoration: none; font-size: 15px; color: var(--ink-2); white-space: nowrap; }
.navlink:hover { color: var(--accent); }
.btn {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  background: var(--accent); color: var(--accent-ink); text-decoration: none;
  font-weight: 600; font-size: 15px; padding: 10px 16px; border-radius: 999px;
  box-shadow: 0 8px 20px -10px rgba(122, 43, 36, .7); transition: transform .2s, background .2s;
}
.btn:hover { background: #5f1f1a; transform: translateY(-1px); }
.btn-lg { font-size: 17px; padding: 14px 22px; }

/* Canvas layer (fixed behind the page in motion mode) */
.orbit-canvas { position: fixed; inset: 0; z-index: 0; display: none; }
.orbit-canvas canvas { display: block; width: 100%; height: 100%; touch-action: pan-y; }
.gl-ready .orbit-canvas { display: block; }
.rm .orbit-canvas { position: absolute; bottom: auto; }
.orbit-tip {
  position: fixed; z-index: 15; pointer-events: none; opacity: 0; transform: translate(-50%, -100%);
  background: var(--ink); color: var(--paper); font: 500 13px/1.2 var(--sans); padding: 7px 11px; border-radius: 999px;
  white-space: nowrap; transition: opacity .18s;
}
.orbit-tip.on { opacity: 1; }
.orbit-tip small { font: 11px var(--mono); color: #cfc6b8; margin-left: 6px; letter-spacing: .04em; }

main, .foot { position: relative; z-index: 2; }
main { pointer-events: none; }
.pin, .services, .close { pointer-events: auto; }

/* Hero */
.hero {
  position: relative; min-height: calc(100svh - var(--header-h));
  display: grid; grid-template-columns: minmax(0, 600px) minmax(0, 1fr); gap: 24px;
  align-items: center; padding: 24px var(--gutter) 72px;
  pointer-events: none;
}
.copy, .scroll-cue { pointer-events: auto; }
.copy { position: relative; z-index: 3; padding-bottom: 40px; }
h1 {
  font: 400 clamp(46px, 5.9vw, 88px)/.98 var(--serif); letter-spacing: -.02em; margin: 0 0 22px; text-wrap: balance;
}
h1 em { color: var(--accent); }
.lede { font-size: clamp(17px, 1.35vw, 19px); color: var(--ink-2); max-width: 34em; margin: 0 0 30px; text-wrap: pretty; }

/* Terminal search */
.term { position: relative; max-width: 560px; }
.term-label { display: flex; align-items: center; gap: 8px; font: 500 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.term-label kbd { font-size: 11px; padding: 2px 5px; }
.term-line {
  display: flex; align-items: center; gap: 10px; padding: 0 12px 0 16px; height: 58px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
  transition: border-color .2s, box-shadow .2s;
}
.term-line:focus-within { border-color: rgba(122, 43, 36, .55); box-shadow: 0 0 0 4px rgba(122, 43, 36, .12), var(--shadow); }
.prompt { font: 600 18px/1 var(--mono); color: var(--accent); }
#search {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink);
  font: 17px/1.2 var(--mono); caret-color: var(--accent); caret-shape: block; padding: 0; height: 100%;
}
#search::placeholder { color: #7d7469; }
#search::-webkit-search-cancel-button { display: none; }
.term-kbd { flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chips[hidden] { display: none; }
.chip {
  font: 14px/1 var(--mono); color: var(--ink-2); background: transparent; cursor: pointer;
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px;
}
.chip::before { content: "> "; color: var(--accent); }
.chip:hover { border-color: var(--accent); color: var(--accent); }

.results {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 5; margin-top: 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 30px 70px -24px rgba(40, 28, 18, .42); padding: 8px; max-height: min(460px, 62svh); overflow: auto;
}
.res-status { margin: 4px 10px 6px; font: 12px/1.4 var(--mono); color: var(--muted); letter-spacing: .03em; }
.res-status a { color: var(--accent); }
#results { list-style: none; margin: 0; padding: 0; }
.res a {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 8px; border-radius: 10px; text-decoration: none;
}
.res[aria-selected="true"] a, .res a:hover { background: var(--paper-2); }
.res-thumb { width: 64px; height: 40px; border-radius: 6px; object-fit: cover; background: var(--paper-2); }
.res-ico { width: 64px; height: 40px; border-radius: 6px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); }
.res-ico svg { width: 20px; height: 20px; }
.res-title { display: block; font-weight: 600; font-size: 15px; line-height: 1.25; }
.res-line { display: block; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res-kind { display: block; font: 11px/1.2 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin-top: 3px; }
.res-go { font: 12px/1 var(--mono); color: var(--muted); white-space: nowrap; }
.res[aria-selected="true"] .res-go { color: var(--accent); }

/* Orbit slot: where the 3D ring sits in the layout */
.orbit-slot { position: relative; height: min(72svh, 680px); }
.orbit-hint {
  position: absolute; left: 50%; bottom: 9%; transform: translateX(-50%); margin: 0; white-space: nowrap;
  font: 12px/1 var(--mono); letter-spacing: .06em; color: var(--muted); display: none;
}
.gl-ready:not(.rm) .orbit-hint { display: block; }
.hint-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); vertical-align: 1px; margin-right: 6px; }
.orbit-fallback { position: absolute; inset: 8% 6%; }
.gl-ready .orbit-fallback { display: none; }
.orbit-fallback img {
  position: absolute; width: 58%; height: auto; left: 21%; top: 26%; border-radius: 12px; box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.orbit-fallback img:nth-child(1) { transform: translate(-34%, -8%) rotate(-8deg) scale(.86); }
.orbit-fallback img:nth-child(2) { transform: translate(34%, -8%) rotate(8deg) scale(.86); }
.orbit-fallback img:nth-child(3) { transform: translateY(6%); }
.scroll-cue {
  position: absolute; left: var(--gutter); bottom: 22px; text-decoration: none;
  font: 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}

/* Pinned filmstrip */
.pin { position: relative; }
.pin-sticky {
  position: sticky; top: 0; height: 100svh; overflow: hidden;
  display: grid; grid-template-rows: auto 1fr auto; grid-template-columns: minmax(0, 1fr); padding: calc(var(--header-h) + 3svh) 0 4svh;
}
.pin-head { padding: 0 var(--gutter); max-width: 780px; }
.pin-head h2, .services h2, .close h2 { font: 400 clamp(34px, 4vw, 58px)/1.02 var(--serif); letter-spacing: -.015em; margin: 0 0 10px; text-wrap: balance; }
.pin-note { margin: 0; color: var(--muted); font-size: 15px; }
.track { position: relative; display: flex; align-items: center; min-height: 0; }
.strip {
  list-style: none; margin: 0; padding: 0 var(--gutter); display: flex; gap: clamp(16px, 2vw, 28px);
  will-change: transform;
}
.film { flex: none; width: clamp(280px, 29vw, 420px); }
.film a { display: block; text-decoration: none; border-radius: 16px; }
.film-thumb {
  aspect-ratio: 1.6; border-radius: 12px; overflow: hidden; background: var(--paper-2);
  box-shadow: var(--shadow); opacity: var(--handoff, 1);
}
.film-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.film a:hover .film-thumb img { transform: scale(1.035); }
.film-meta { padding: 16px 4px 0; opacity: var(--handoff, 1); }
.film-top { display: flex; justify-content: space-between; gap: 10px; font: 11px/1.2 var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.film-kind { color: var(--accent); }
.film-title { font: 400 clamp(26px, 2.2vw, 32px)/1.08 var(--serif); margin: 8px 0 6px; }
.film-line { font-size: 15px; color: var(--ink-2); margin: 0; text-wrap: pretty; }
.film-open { display: inline-block; margin-top: 10px; font: 12px/1 var(--mono); color: var(--muted); letter-spacing: .04em; }
.film a:hover .film-open, .film a:focus-visible .film-open { color: var(--accent); }
.pin-foot { display: flex; align-items: center; gap: 16px; padding: 0 var(--gutter); opacity: var(--handoff, 1); }
.count { font: 12px/1 var(--mono); color: var(--muted); letter-spacing: .06em; }
.bar { flex: 1; max-width: 320px; height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }

/* Services + close */
.services, .close { padding: 110px var(--gutter) 40px; background: var(--paper); }
.svc-list { list-style: none; padding: 0; margin: 36px 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.svc a {
  display: block; height: 100%; padding: 22px; background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  text-decoration: none; transition: border-color .2s, transform .2s;
}
.svc a:hover { border-color: var(--accent); transform: translateY(-2px); }
.svc-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); margin-bottom: 18px; }
.svc-ico svg { width: 18px; height: 18px; }
.svc h3 { font: 400 25px/1.1 var(--serif); margin: 0 0 8px; }
.svc p { margin: 0 0 14px; color: var(--ink-2); font-size: 15px; }
.svc span.go { font: 12px/1 var(--mono); color: var(--accent); }
.close { padding-bottom: 110px; text-align: left; }
.close p { color: var(--ink-2); max-width: 36em; margin: 0 0 26px; font-size: 18px; }
.foot {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 26px var(--gutter) 34px;
  border-top: 1px solid var(--line); font: 13px var(--mono); color: var(--muted); background: var(--paper);
}
.foot a { color: var(--ink-2); }

/* Reduced motion: still ring in the hero, plain vertical list instead of the pin */
.rm .pin-sticky { position: static; height: auto; overflow: visible; display: block; padding: 90px 0 20px; }
.rm .track { display: block; margin-top: 36px; }
.rm .strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); transform: none !important; }
.rm .film { width: auto; }
.rm .pin-foot { display: none; }
.rm * { transition: none !important; animation: none !important; }

/* Tablet */
@media (max-width: 1080px) {
  .svc-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); align-items: start; gap: 0; padding-top: 20px; padding-bottom: 56px; }
  .copy { padding-bottom: 0; }
  .orbit-slot { height: clamp(300px, 46svh, 520px); margin-top: 8px; }
  .term { max-width: none; }
}
/* Phone */
@media (max-width: 560px) {
  :root { --header-h: 60px; }
  .navlink { font-size: 14px; }
  .btn { padding: 9px 13px; font-size: 14px; }
  .wordmark .wm-b { display: none; }
  .mono-box { width: 34px; height: 34px; }
  h1 { font-size: clamp(40px, 11.4vw, 50px); margin-bottom: 16px; }
  .lede { font-size: 16px; margin-bottom: 22px; }
  .kicker { margin-bottom: 12px; }
  .term-kbd, .term-label kbd { display: none; }
  .term-line { height: 54px; }
  #search { font-size: 16px; }
  .chip { font-size: 13px; padding: 8px 11px; }
  .res a { grid-template-columns: 52px minmax(0, 1fr); }
  .res-thumb, .res-ico { width: 52px; height: 34px; }
  .res-go { display: none; }
  .film { width: 78vw; }
  .pin-note { font-size: 14px; }
  .svc-list { grid-template-columns: minmax(0, 1fr); }
  .services, .close { padding-top: 80px; }
}
@media (max-width: 400px) {
  .top-nav { gap: 10px; }
  .navlink { font-size: 13px; }
  .btn { padding: 8px 11px; font-size: 13px; }
  .wm-a { font-size: 20px; }
  .brand { gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

@media (hover: none) { .hint-hover { display: none; } }
