/* ISHLVLSTUDIOS — Homepage. Built on the Digital Experience stylesheet (copied, unchanged below), plus homepage additions at the end. */
/* ============================================================
   DESIGN TOKENS (port to the site's global stylesheet)
   Layout: 3D = a narrow text column (desktop) or sheet (phone)
   beside a stage the camera always frames without cropping.
   2D = one column of CSS-3D decks over a depth field.
   Dark by default; Chevon's project switches to its white room.
   ============================================================ */
:root {
  color-scheme: dark;
  --void: #0a0a0b;
  --void-2: #141416;
  --ink: #f1efea;
  --ink-2: #aeaba3;
  --ink-3: #6f6d68;
  --line: rgba(241, 239, 234, 0.13);
  --glass: rgba(18, 18, 20, 0.62);
  --accent: #d63a2f;   /* Chevon red, from the HAUNTED artwork ring */

  --font-display: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;

  --step--1: 0.6875rem;
  --step-0: 0.9375rem;
  --step-1: 1.2rem;
  --step-2: 1.6rem;
  --step-3: clamp(1.9rem, 3vw, 2.7rem);
  --step-hero: clamp(1.9rem, 3vw, 3.3rem);

  --track: 0.22em;
  --edge: clamp(16px, 2.4vw, 36px);
  --panel-w: min(23rem, 27vw);
  --ease: cubic-bezier(.2, .7, .1, 1);
}
body.light-room {
  color-scheme: light;
  --void: #eceae6; --void-2: #e2dfda; --ink: #141416; --ink-2: #4b4945; --ink-3: #7d7a73;
  --line: rgba(20, 20, 22, 0.14); --glass: rgba(236, 234, 230, 0.72);
}
[hidden] { display: none !important; }
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--void); color: var(--ink);
  font-family: var(--font-ui); font-size: var(--step-0); line-height: 1.55; -webkit-font-smoothing: antialiased;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  transition: color .8s var(--ease);
}
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 1.5px solid var(--ink); outline-offset: 3px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 60; background: var(--ink); color: var(--void); padding: 8px 12px; }
.skip:focus { top: calc(12px + env(safe-area-inset-top, 0px)); }
.label { font-size: var(--step--1); font-stretch: 112%; font-weight: 500; letter-spacing: var(--track); text-transform: uppercase; color: var(--ink-3); }

/* ---------- top bar ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 30; display: flex; align-items: center; gap: 16px;
  padding-top: calc(16px + env(safe-area-inset-top, 0px)); padding-bottom: 12px;
  padding-left: max(var(--edge), env(safe-area-inset-left, 0px)); padding-right: max(var(--edge), env(safe-area-inset-right, 0px));
}
.brand { display: block; line-height: 0; }
.brand img { height: 24px; width: auto; transition: filter .8s; }
body.light-room .brand img { filter: invert(1); }
.crumb { padding-left: 16px; border-left: 1px solid var(--line); color: var(--ink-2); text-decoration: none; transition: color .3s; }
.crumb:hover { color: var(--ink); }
.dim-switch { margin-left: auto; display: flex; padding: 4px; gap: 2px; border: 1px solid var(--line); border-radius: 999px; background: var(--glass); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.pillbtn, .dim-switch button, .seg button {
  border: 0; background: none; cursor: pointer; border-radius: 999px; padding: 7px 13px; color: var(--ink-2);
  font-size: var(--step--1); font-stretch: 112%; letter-spacing: .16em; text-transform: uppercase; white-space: nowrap;
}
.dim-switch button[aria-pressed="true"], .seg button[aria-pressed="true"] { background: var(--ink); color: var(--void); }

/* ---------- 3D stage ---------- */
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; touch-action: none; outline: none; }
#labels { position: fixed; inset: 0; z-index: 4; pointer-events: none; overflow: hidden; }
.tag { position: absolute; left: 0; top: 0; white-space: nowrap; will-change: transform, opacity; text-align: center;
  font-size: var(--step--1); font-stretch: 112%; letter-spacing: var(--track); text-transform: uppercase; color: var(--ink-3); }
.tag b { display: block; margin-top: 2px; font-family: var(--font-serif); font-style: italic; font-weight: 400; font-size: 1.1rem; letter-spacing: 0; text-transform: none; color: var(--ink); }
.tag.cap { color: var(--ink-2); }

.stage-bar {
  position: fixed; z-index: 10; left: var(--sx-mid, 50%); top: var(--bar-y, auto); transform: translate(-50%, 0);
  display: flex; align-items: center; gap: 4px; padding: 4px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--glass);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); max-width: calc(100% - 20px);
}
.stage-bar button { border: 0; background: none; cursor: pointer; border-radius: 999px; padding: 8px 13px; color: var(--ink-2);
  font-size: var(--step--1); font-stretch: 112%; letter-spacing: .14em; text-transform: uppercase; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stage-bar button[aria-current="true"] { background: var(--ink); color: var(--void); }
.stage-bar .arrow, .deck-bar .arrow { color: var(--ink); letter-spacing: 0; font-size: 15px; padding: 7px 12px; }
.caption { padding: 0 8px; font-size: var(--step--1); font-stretch: 112%; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; font-variant-numeric: tabular-nums; }
.caption b { color: var(--ink); font-weight: 500; margin-right: 10px; }
.sound { display: inline-flex !important; align-items: center; gap: 7px; }
.sound[hidden] { display: none !important; }
.sound::before { content: ""; width: 7px; height: 7px; border-radius: 50%; border: 1px solid currentColor; }
.sound[aria-pressed="true"] { color: #fff !important; background: var(--accent) !important; }
.sound[aria-pressed="true"]::before { background: currentColor; }

/* ---------- 3D panel ---------- */
#panel { display: none; }
body.mode-3d #panel {
  display: flex; flex-direction: column; justify-content: center; position: fixed; z-index: 12;
  left: max(var(--edge), env(safe-area-inset-left, 0px)); width: var(--panel-w);
  top: calc(74px + env(safe-area-inset-top, 0px)); bottom: calc(26px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
}
.panel-view { display: none; }
body[data-view="orbit"] .panel-orbit, body[data-view="intro"] .panel-orbit { display: block; }
body[data-view="project"] .panel-project { display: block; }
body[data-view="intro"] .panel-orbit { opacity: 0; animation: fadeUp 1.1s .9s var(--ease) forwards; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.panel-project { animation: fadeUp .7s var(--ease) both; }
body.mode-3d .ring3d { display: none; }

.hero .eyebrow { margin: 0 0 14px; }
.hero h1 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: var(--step-hero); line-height: .92; letter-spacing: -.025em; text-transform: uppercase; }
.hero .lede { margin: 18px 0 0; font-family: var(--font-serif); font-style: italic; font-size: clamp(1.1rem, 1.3vw, 1.35rem); line-height: 1.28; max-width: 34ch; text-wrap: balance; }
.hero .lede span { display: block; color: var(--ink-2); }
.caps { list-style: none; margin: 20px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.caps li { font-size: var(--step--1); font-stretch: 112%; letter-spacing: var(--track); text-transform: uppercase; color: var(--ink-2); }
body.mode-3d .hero .caps { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.focus-card { margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.focus-card h2 { margin: 0; font-family: var(--font-serif); font-style: italic; font-weight: 400; font-size: var(--step-2); line-height: 1.1; text-wrap: balance; }
.focus-card p { margin: 0; color: var(--ink-2); max-width: 40ch; }
.focus-card .note { font-size: .82rem; color: var(--ink-3); }
.cta {
  justify-self: start; display: inline-flex; align-items: center; gap: 10px; margin-top: 8px;
  border: 1px solid var(--ink); background: var(--ink); color: var(--void); border-radius: 999px; padding: 11px 18px; cursor: pointer; text-decoration: none;
  font-size: var(--step--1); font-stretch: 112%; font-weight: 600; letter-spacing: var(--track); text-transform: uppercase;
}
.cta.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.proj-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.seg { display: flex; padding: 4px; gap: 2px; border: 1px solid var(--line); border-radius: 999px; }
.back { border: 0; background: none; cursor: pointer; padding: 6px 0; color: var(--ink-2); font-size: var(--step--1); font-stretch: 112%; letter-spacing: var(--track); text-transform: uppercase; }
.back:hover { color: var(--ink); }

/* ---------- case studies (shared by the 3D panel and the 2D page) ---------- */
.case h2 { margin: 0; font-family: var(--font-serif); font-style: italic; font-weight: 400; font-size: var(--step-3); line-height: 1.06; text-wrap: balance; }
.case-head .eyebrow { margin: 0 0 12px; }
.case .summary { color: var(--ink-2); max-width: 62ch; }
.case .summary p { margin: 14px 0 0; }
.pull { margin: 22px 0 0; padding-left: 16px; border-left: 1px solid var(--ink-3); font-family: var(--font-serif); font-style: italic; font-size: var(--step-1); line-height: 1.3; max-width: 32ch; }
.case-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.case-body { max-width: 66ch; }
.case-body section { padding-top: 30px; margin-top: 30px; border-top: 1px solid var(--line); }
.case-body h3 { margin: 0 0 6px; }
.case-body h4 { margin: 0 0 12px; font-family: var(--font-serif); font-style: italic; font-weight: 400; font-size: var(--step-2); line-height: 1.12; text-wrap: balance; }
.case-body p, .case-body li { color: var(--ink-2); }
.case-body p { margin: 0 0 14px; }
.case-body ol, .case-body ul { margin: 0 0 14px; padding-left: 1.2em; }
.case-body li { margin-bottom: 6px; }
.case-body strong { color: var(--ink); font-weight: 500; }
.meta { display: grid; grid-template-columns: max-content 1fr; gap: 8px 22px; margin: 18px 0; }
.meta dd { margin: 0; }
.pending { font-family: ui-monospace, Menlo, monospace; font-size: .82rem; background: rgba(127,127,127,.14); padding: 2px 6px; border-radius: 3px; }
.tbl-wrap { overflow-x: auto; margin: 6px 0 18px; }
.tbl { width: 100%; border-collapse: collapse; font-size: .88rem; }
.tbl th, .tbl td { text-align: left; vertical-align: top; padding: 9px 14px 9px 0; border-bottom: 1px solid var(--line); }
.tbl th { font-weight: 500; }
.tbl td { color: var(--ink-2); }
.note-box { margin: 18px 0; padding: 16px 18px; border: 1px solid var(--line); border-radius: 4px; }
.note-box p { margin: 0; color: var(--ink); }
.close-full { display: none; }

#panel .case { display: none; border: 0; padding: 0; }
#panel .case.active { display: block; }
#panel .case h2 { font-size: var(--step-2); }
#panel .case .pull { font-size: 1.1rem; }
#panel .case-body, #panel .deck { display: none; }
body.full #panel {
  width: min(46rem, 100%); left: 0; top: 0; bottom: 0; justify-content: flex-start; z-index: 25;
  padding: calc(84px + env(safe-area-inset-top, 0px)) max(var(--edge), env(safe-area-inset-left, 0px)) 60px;
  background: var(--void); border-right: 1px solid var(--line); animation: drawerIn .55s var(--ease) both;
}
body.full #panel .case.active .case-body { display: block; }
body.full #panel .open-full, body.full #panel .proj-top { display: none; }
body.full #panel .close-full { display: inline-flex; }
body.full .stage-bar, body.full #labels { opacity: .1; pointer-events: none; }
@keyframes drawerIn { from { transform: translateX(-24px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- 2D: one column of CSS 3D decks over a depth field ---------- */
#doc { position: relative; z-index: 2; overflow-x: clip; }
#field { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
body.mode-3d #doc, body.mode-3d #field { display: none; }
body:not(.mode-3d) #scene, body:not(.mode-3d) #labels, body:not(.mode-3d) .stage-bar { display: none; }
body:not(.mode-3d) .topbar { background: linear-gradient(var(--void) 60%, transparent); }
body:not(.mode-3d) #doc { max-width: 76rem; margin: 0 auto; padding-top: calc(80px + env(safe-area-inset-top, 0px)); padding-bottom: 80px; }
body:not(.mode-3d) .open-full { display: none; }
#doc .hero { position: relative; padding-block: 56px 72px; perspective: 1100px; }
#doc .hero h1 { font-size: clamp(2.4rem, 7.4vw, 6.6rem); position: relative; z-index: 2; }
#doc .hero > *:not(.ring3d) { position: relative; z-index: 2; }
.ring3d { position: absolute; z-index: 1; left: 50%; top: 46%; width: 0; height: 0; transform-style: preserve-3d; transform: translate(-50%, -50%) rotateX(-20deg); pointer-events: none; }
.ring3d .spin { position: absolute; transform-style: preserve-3d; animation: spin 46s linear infinite; }
.ring3d span { position: absolute; left: 0; top: 0; white-space: nowrap; transform: translate(-50%, -50%) rotateY(var(--a)) translateZ(var(--r, 380px));
  font-size: var(--step--1); font-stretch: 112%; letter-spacing: var(--track); text-transform: uppercase; color: var(--ink-3); opacity: .55; }
@keyframes spin { to { transform: rotateY(-360deg); } }
.case-2d { padding-block: 64px 24px; border-top: 1px solid var(--line); }
.case-2d .case-head { max-width: 62ch; margin-bottom: 30px; }

.deck { position: relative; margin: 8px 0 40px; }
.deck-stage { position: relative; height: clamp(280px, 56vh, 600px); perspective: 1400px; perspective-origin: 50% 40%; touch-action: pan-y; }
.deck-tilt { position: absolute; inset: 0; transform-style: preserve-3d; }
.card { position: absolute; left: 50%; top: 46%; margin: 0; transform-style: preserve-3d; transition: transform .9s var(--ease), opacity .9s var(--ease), filter .9s var(--ease); cursor: pointer; }
.card-media { width: 100%; height: 100%; border-radius: 6px; overflow: hidden; background: var(--void-2); box-shadow: 0 30px 60px -20px rgba(0,0,0,.6), 0 0 0 1px var(--line); }
.card-media video, .card-media img { width: 100%; height: 100%; object-fit: contain; display: block; }
.card::after { content: ""; position: absolute; left: 8%; right: 8%; bottom: -26px; height: 22px; border-radius: 50%; background: radial-gradient(closest-side, rgba(0,0,0,.55), transparent); }
.deck-bar { display: flex; align-items: center; justify-content: center; gap: 4px; margin: 26px auto 0; width: max-content; max-width: 100%; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--glass); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.deck-bar button { border: 0; background: none; cursor: pointer; border-radius: 999px; padding: 8px 13px; color: var(--ink-2); font-size: var(--step--1); font-stretch: 112%; letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; }
.doc-foot { border-top: 1px solid var(--line); padding-block: 30px; }

.veil { position: fixed; inset: 0; z-index: 50; background: var(--void); display: grid; place-items: center; transition: opacity .9s var(--ease), visibility 0s .9s; }
.veil.gone { opacity: 0; visibility: hidden; }

/* ---------- phones & narrow: stage on top, sheet below ---------- */
@media (max-width: 899px) {
  :root { --panel-w: auto; }
  body.mode-3d #panel {
    left: 0; right: 0; width: auto; top: 62%; bottom: 0; justify-content: flex-start;
    padding: 16px max(20px, env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px));
    background: linear-gradient(to bottom, transparent 0, var(--void) 20px);
  }
  body.mode-3d .hero .eyebrow { display: none; }
  body.mode-3d .hero h1 { font-size: clamp(1.5rem, 7vw, 2.3rem); }
  body.mode-3d .hero .lede { font-size: 1.02rem; margin-top: 10px; }
  .focus-card { margin-top: 16px; padding-top: 14px; }
  .focus-card h2 { font-size: 1.3rem; }
  .focus-card .note { display: none; }
  .proj-top { margin-bottom: 14px; }
  body.full #panel { top: 0; padding-top: calc(76px + env(safe-area-inset-top, 0px)); background: var(--void); }
  .caption { max-width: 34vw; }
  .stage-bar .idx-label { display: none; }
}
@media (max-width: 520px) { .crumb { display: none; } .deck-stage { height: 64vh; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-delay: 0s !important; transition-duration: .001s !important; }
  .ring3d .spin { animation: none; }
}

/* ============================================================
   HOMEPAGE ADDITIONS
   ============================================================ */
.util { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.util a.label { text-decoration: none; color: var(--ink-2); transition: color .3s; }
.util a.label:hover { color: var(--ink); }
.util .start { margin-top: 0; padding: 9px 15px; }
.util .start:hover { border-color: var(--ink); }
.dim-switch { margin-left: 4px; }
.summary .disc { font-size: var(--step--1); font-stretch: 112%; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
#panel .case-actions { margin-top: 18px; }
.focus-card .cta { text-decoration: none; }

/* 2D: each division's work as a quiet strip */
.strip2d { display: flex; gap: 14px; overflow-x: auto; padding: 6px 0 18px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.strip2d figure { flex: 0 0 auto; margin: 0; scroll-snap-align: start; display: grid; gap: 8px; }
.strip2d img { height: clamp(160px, 26vw, 300px); width: auto; display: block; border-radius: 6px; box-shadow: 0 24px 50px -24px rgba(0,0,0,.7), 0 0 0 1px var(--line); background: var(--void-2); }
.strip2d figcaption { font-size: var(--step--1); font-stretch: 112%; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); max-width: 36ch; }
#panel .strip2d { display: none; }
.doc-foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.foot-links { display: flex; gap: 18px; }
.foot-links a { text-decoration: none; color: var(--ink-2); }
.foot-links a:hover { color: var(--ink); }
body.light-room .util .start { border-color: var(--line); }

@media (max-width: 899px) {
  .util a.label { display: none; }
  .stage-bar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
}
@media (max-width: 520px) { .util .start { padding: 8px 12px; } }

.util .start{white-space:nowrap}
@media (max-width:480px){.util .start{padding-inline:12px;font-size:10px}}

/* long text: centre the column only when it fits, so nothing is pushed above the top edge; keep the way back in view */
body.mode-3d #panel { justify-content: flex-start; }
body.mode-3d #panel > .panel-view { margin-block: auto; }
body.mode-3d .proj-top { position: sticky; top: 0; z-index: 2; padding-block: 6px; background: linear-gradient(var(--void) 70%, transparent); }

/* seven divisions: keep the whole index bar (both arrows) on narrow phones */
@media (max-width: 560px) {
  #orbit-bar { gap: 0; padding: 3px; }
  #orbit-bar button { padding: 8px 8px; letter-spacing: .1em; }
  #orbit-bar .arrow { padding: 7px 9px; }
}
