/* Layout: a fixed WebGL stage of self-performing machines. The home page: the hero says what we make, then one panel per line of the studio in the order they earn (Atelier, Pageant, Machinery), each beside the machine it descends from; then Origins (each machine's story, filmed closer) and contact. */
:root {
  --void: #050608;
  --ink: #EDEAE3;
  --soft: #CFCBC3;
  --dim: #A3A097;
  --line: rgba(237, 234, 227, 0.14);
  --brass: #D9B46F;
  --sans: 'Hanken Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --serif: 'Instrument Serif', 'Times New Roman', serif;
  --didone: 'Bodoni Moda', Didot, 'Bodoni 72', serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --gutter: max(16px, env(safe-area-inset-left, 0px), 3vw);
  --gutter-r: max(16px, env(safe-area-inset-right, 0px), 3vw);
  color-scheme: dark;
}
html, body { background: var(--void); }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; color: var(--ink); font-family: var(--sans); font-weight: 300; -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--void); }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }

#stage { position: fixed; inset: 0; width: 100%; height: 100%; display: block; background: radial-gradient(ellipse at 62% 45%, #19130b 0%, var(--void) 60%); }
.veil { position: fixed; inset: 0; pointer-events: none; background: linear-gradient(to top, rgba(5, 6, 8, 0.7), rgba(5, 6, 8, 0) 30%), radial-gradient(ellipse at 60% 42%, rgba(5, 6, 8, 0) 45%, rgba(5, 6, 8, 0.7) 100%); }
.grain { position: fixed; inset: -50%; pointer-events: none; opacity: 0.07; mix-blend-mode: overlay; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>"); }

/* top bar */
.top { position: fixed; top: 0; left: 0; right: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: calc(18px + env(safe-area-inset-top, 0px)); padding-bottom: 18px; padding-left: var(--gutter); padding-right: var(--gutter-r); background: linear-gradient(to bottom, rgba(5, 6, 8, 0.8), rgba(5, 6, 8, 0)); border-bottom: 1px solid transparent; transition: background-color 0.3s, border-color 0.3s; }
.top.solid { background: rgba(5, 6, 8, 0.82); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom-color: var(--line); }
.logo { display: inline-flex; align-items: center; gap: 12px; }
.mark { display: inline-flex; align-items: baseline; font-size: clamp(22px, 2vw, 28px); line-height: 1; text-transform: uppercase; color: var(--ink); }
.mark .g { display: inline-block; width: 0.72em; text-align: center; }
.mark .g.wide { width: 0.88em; }
.mark .g.thin { width: 0.44em; }
/* the faces that change the glyph's size keep its slot the same width, and the word keeps one size, so STUDIO and 曲水工坊 never move */
.mark { flex: none; width: 6.52em; height: 1em; }
.mark .g.f2 { width: calc(0.72em / 0.86); } .mark .g.wide.f2 { width: calc(0.88em / 0.86); } .mark .g.thin.f2 { width: calc(0.44em / 0.86); }
.mark .g.f3 { width: calc(0.72em / 1.1); } .mark .g.wide.f3 { width: calc(0.88em / 1.1); } .mark .g.thin.f3 { width: calc(0.44em / 1.1); }
.studio { margin-left: -2px; font-family: var(--mono); font-size: 10px; line-height: 1; letter-spacing: 0.28em; text-transform: uppercase; color: var(--dim); }
@media (max-width: 360px) { .studio { display: none; } }
.seal { display: inline-flex; align-items: center; height: 18px; padding-left: 12px; border-left: 1px solid rgba(217, 180, 111, 0.45); color: var(--brass); font-family: 'Noto Serif SC', 'Songti SC', 'STSong', serif; font-weight: 600; font-size: 13px; line-height: 1; letter-spacing: 0.08em; white-space: nowrap; }
.f0 { font-family: var(--sans); font-weight: 600; }
.f1 { font-family: var(--didone); font-style: italic; font-weight: 500; }
.f2 { font-family: var(--mono); font-weight: 400; font-size: 0.86em; }
.f3 { font-family: var(--serif); font-size: 1.1em; }
.f4 { font-family: var(--didone); font-weight: 500; }
.top-right { display: flex; align-items: center; gap: clamp(14px, 2.2vw, 30px); }
.nav { display: flex; align-items: center; gap: clamp(16px, 2.4vw, 34px); font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); }
.nav a:hover { color: var(--ink); }
.nav .nav-cta { padding: 8px 15px; border: 1px solid rgba(217, 180, 111, 0.55); border-radius: 999px; color: var(--brass); transition: background-color 0.2s, color 0.2s; }
.nav .nav-cta:hover { background: var(--brass); color: var(--void); }
.pill { min-height: 32px; padding: 0 4px; background: none; border: 0; border-radius: 0; color: var(--dim); font: 400 11px/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; cursor: pointer; }
.pill[aria-pressed="true"] { color: var(--ink); }
.pill:hover { color: var(--ink); }
.snd, .snd[aria-pressed="true"] { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; color: var(--brass); }
.snd:hover { color: var(--ink); }
.snd .on, .snd[aria-pressed="true"] .off { display: none; }
.snd[aria-pressed="true"] .on { display: inline; }

/* shared type */
.eyebrow { margin: 0; font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); font-variant-numeric: tabular-nums; }
.eyebrow b { font-weight: 500; color: var(--brass); }
h1, h2 { margin: 0; font-weight: 300; letter-spacing: -0.035em; text-wrap: balance; }
h1 em, h2 em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; color: var(--brass); }

/* hero */
.hero { position: relative; z-index: 2; min-height: 100svh; box-sizing: border-box; display: flex; flex-direction: column; justify-content: flex-end; padding-bottom: clamp(22px, 5vh, 48px); padding-left: var(--gutter); padding-right: var(--gutter-r); }
.hero-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 28px 48px; flex-wrap: wrap; }
.lead { min-width: 0; max-width: min(780px, 48vw); display: flex; flex-direction: column; gap: 20px; }
h1 { font-size: clamp(40px, 6vw, 104px); line-height: 0.95; }
.hero h1 em { display: block; }
.lede { margin: 0; max-width: 40ch; font-size: clamp(18px, 1.55vw, 22px); line-height: 1.5; color: var(--ink); }
.ctas { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; min-height: 46px; padding: 0 22px; border-radius: 999px; background: var(--ink); color: var(--void); font: 500 12px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; }
.btn:hover { background: var(--brass); }
.link { font: 400 12px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink); border-bottom: 1px solid var(--line); padding-bottom: 5px; }
.link:hover { border-color: var(--ink); }
.act { position: relative; min-width: 0; width: min(420px, 100%); display: flex; flex-direction: column; gap: 8px; }
.act > .more { align-self: flex-start; }
.reel { display: flex; gap: 6px; margin-bottom: 8px; }
.reel button { position: relative; flex: 1 1 0; min-width: 0; padding: 10px 4px 4px 0; background: none; border: 0; border-top: 1px solid var(--line); color: var(--dim); font: 400 10px/1.35 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; text-align: left; cursor: pointer; }
.reel button b { display: block; margin-bottom: 2px; font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 16px; letter-spacing: 0; text-transform: none; color: var(--dim); }
.reel button[aria-selected="true"], .reel button:hover { color: var(--ink); }
.reel button[aria-selected="true"] b { color: var(--brass); }
.reel i { position: absolute; left: 0; top: -1px; width: 100%; height: 1px; background: var(--brass); transform-origin: left; transform: scaleX(var(--p, 0)); }
.reel button[aria-selected="false"] i { transform: scaleX(0); }

/* lineage chapters */
.lineage { position: relative; z-index: 2; background: linear-gradient(to right, rgba(5, 6, 8, 0.92) 0%, rgba(5, 6, 8, 0.8) 38%, rgba(5, 6, 8, 0) 62%); }
.chapter { min-height: 100svh; box-sizing: border-box; display: flex; align-items: center; padding-top: 12vh; padding-bottom: 12vh; padding-left: var(--gutter); padding-right: var(--gutter-r); }
.chapter-text { width: min(540px, 100%); display: flex; flex-direction: column; gap: 20px; }
.chapter-text .more { align-self: flex-start; margin-top: 8px; }
.chapter h2 { font-size: clamp(36px, 4.4vw, 66px); line-height: 1; }
.chapter p:not(.eyebrow) { margin: 0; font-size: clamp(17px, 1.35vw, 20px); line-height: 1.6; color: var(--soft); }
.origins-intro { padding: 22vh var(--gutter-r) 4vh var(--gutter); display: flex; flex-direction: column; gap: 20px; }
.origins-intro > * { max-width: 560px; }
.origins-intro h2 { font-size: clamp(40px, 5vw, 76px); line-height: 1; }
.origins-intro p:not(.eyebrow) { margin: 0; font-size: clamp(17px, 1.35vw, 20px); line-height: 1.6; color: var(--soft); }
.chapter .beat { font-family: var(--serif); font-style: italic; font-size: clamp(26px, 2.6vw, 38px) !important; line-height: 1.15 !important; color: var(--ink) !important; }

/* panels */
.panel { position: relative; z-index: 2; padding-top: clamp(80px, 14vh, 160px); padding-bottom: clamp(80px, 14vh, 160px); padding-left: var(--gutter); padding-right: var(--gutter-r); background: rgba(5, 6, 8, 0.84); border-top: 1px solid var(--line); }
.panel-inner { max-width: 1180px; margin: 0; display: flex; flex-direction: column; gap: clamp(36px, 6vh, 64px); }
.panel h2 { font-size: clamp(34px, 4.6vw, 72px); line-height: 1; max-width: 18ch; }
.panel.line { min-height: 100svh; box-sizing: border-box; display: flex; align-items: center; border-top: 0; background: linear-gradient(to right, rgba(5, 6, 8, 0.93) 0%, rgba(5, 6, 8, 0.82) 40%, rgba(5, 6, 8, 0) 64%); }
.line .panel-inner { width: min(600px, 100%); gap: clamp(26px, 4.5vh, 46px); }
.line-head { display: grid; grid-template-columns: 72px minmax(0, 1fr); align-items: start; }
.line-head .roman { font-family: var(--serif); font-style: italic; font-size: 44px; line-height: 1.2; color: var(--brass); }
.line-head > div { display: flex; flex-direction: column; gap: 12px; }
.line-head h2 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; font-size: clamp(56px, 7vw, 112px); line-height: 0.95; max-width: none; color: var(--ink); }
.line-head .tag { margin: 0; font-family: var(--serif); font-style: italic; font-size: clamp(20px, 1.8vw, 28px); color: var(--brass); }
.line-lede { margin: 0 0 0 72px; max-width: 46ch; font-size: clamp(18px, 1.5vw, 22px); line-height: 1.55; color: var(--ink); }
.line-foot { margin-left: 72px; display: flex; justify-content: flex-start; align-items: center; gap: 20px 28px; flex-wrap: wrap; }
.stats { margin: 0 0 0 72px; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.stats li { min-width: 0; padding: 22px 16px 22px 0; display: flex; flex-direction: column; gap: 10px; }
.stats li:nth-child(even) { padding-left: 20px; border-left: 1px solid var(--line); }
.stats li:nth-child(n+3) { border-top: 1px solid var(--line); }
.stats b { font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 3.6vw, 58px); line-height: 0.9; letter-spacing: -0.01em; color: var(--brass); }
.stats span { font-size: 15px; line-height: 1.45; color: var(--soft); }
.index { display: flex; flex-wrap: wrap; gap: 8px 26px; padding-top: 18px; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink); }
.index a { display: inline-flex; align-items: baseline; gap: 8px; }
.index b { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 17px; letter-spacing: 0; text-transform: none; color: var(--brass); }
.index a:hover { color: var(--brass); }
/* links to a page of their own: a quiet label, the name, an arrow */
.more { display: inline-flex; align-items: baseline; gap: 10px; padding-bottom: 5px; border-bottom: 1px solid var(--line); font-size: 15px; line-height: 1.4; color: var(--ink); transition: border-color 0.2s; }
.more .eyebrow { font-size: 11px; }
.more > span[aria-hidden] { color: var(--brass); transition: transform 0.2s; }
.more:hover { border-color: var(--brass); }
.more:hover > span[aria-hidden] { transform: translateX(4px); }
.more.soon { cursor: default; border-bottom-style: dashed; color: var(--soft); }
.more.soon svg { width: 16px; height: 16px; align-self: center; fill: currentColor; }
.more.soon .eyebrow { color: var(--brass); }
/* the crew */
.crew .panel-inner { gap: 22px; max-width: 640px; }
.crew h2 { font-size: clamp(36px, 4.4vw, 66px); }
.crew-text { margin: 0; font-size: clamp(17px, 1.35vw, 20px); line-height: 1.6; color: var(--soft); }
.crew-text b { font-weight: inherit; color: var(--brass); }

/* the inquiry form, opened by every Inquire */
.inquire { width: min(540px, calc(100vw - 32px)); max-height: calc(100svh - 32px); box-sizing: border-box; padding: clamp(28px, 4vw, 46px); border: 1px solid var(--line); border-radius: 4px; background: #0a0b0e; color: var(--ink); overflow: auto; }
.inquire::backdrop { background: rgba(5, 6, 8, 0.74); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.inquire h2 { margin: 10px 0 28px; font-size: clamp(32px, 4vw, 50px); line-height: 1; }
.inquire-close { position: absolute; top: 12px; right: 14px; width: 40px; height: 40px; background: none; border: 0; color: var(--dim); font: 300 28px/1 var(--sans); cursor: pointer; }
.inquire-close:hover { color: var(--ink); }
.inquire-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 24px; }
.inquire-fields .wide { grid-column: 1 / -1; }
.inquire label { display: flex; flex-direction: column; gap: 8px; }
.inquire label span { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); }
.inquire-lede { margin: -14px 0 26px; font-size: 16px; line-height: 1.5; color: var(--soft); }
.inquire input, .inquire select, .inquire textarea { width: 100%; box-sizing: border-box; padding: 8px 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; color: var(--ink); font: 300 17px/1.45 var(--sans); outline: none; resize: vertical; transition: border-color 0.2s; }
.inquire select { -webkit-appearance: none; appearance: none; padding-right: 28px; background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' fill='none' stroke='%23D9B46F' stroke-width='1.4'/></svg>") no-repeat right 4px center; cursor: pointer; }
.inquire option { background: #0a0b0e; color: var(--ink); }
.inquire input:focus, .inquire select:focus, .inquire textarea:focus { border-color: var(--brass); }
.inquire [aria-invalid="true"] { border-color: #e0896a; }
.inquire .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.inquire-foot { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-top: 30px; }
.inquire-status { margin: 0; font-size: 15px; line-height: 1.5; color: var(--soft); }
.inquire-status a { color: var(--brass); }
.inquire-done { display: flex; flex-direction: column; align-items: flex-start; gap: 22px; }
.inquire [hidden] { display: none; }
.inquire-done h2 { margin: 6px 0 0; }
@media (max-width: 600px) { .inquire-fields { grid-template-columns: minmax(0, 1fr); } }
.contact h2 { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; font-size: clamp(56px, 9vw, 150px); line-height: 0.95; max-width: none; color: var(--ink); }
.contact-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.contact-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 18px; }
.contact-row p { margin: 0; max-width: 40ch; font-size: 18px; line-height: 1.55; color: var(--soft); }
.email:hover { color: var(--ink); border-color: var(--ink); }
.email { font-family: var(--mono); font-size: clamp(16px, 1.6vw, 22px); letter-spacing: 0.02em; color: var(--brass); user-select: all; border-bottom: 1px solid rgba(217, 180, 111, 0.4); padding-bottom: 6px; }
.foot { position: relative; z-index: 2; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 22px; padding-bottom: 28px; padding-left: var(--gutter); padding-right: var(--gutter-r); border-top: 1px solid var(--line); background: var(--void); font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--dim); }

@media (max-width: 900px) {
  .line-head { grid-template-columns: 44px minmax(0, 1fr); }
  .line-head .roman { font-size: 32px; }
  .line-lede, .line-foot, .stats { margin-left: 44px; }
}
@media (max-width: 760px) {
  .nav { display: none; }
  /* phones: the stage keeps the top third; the text starts below it and may run past the fold */
  .hero { justify-content: flex-start; padding-top: max(32svh, 210px); background: linear-gradient(to bottom, rgba(5, 6, 8, 0) 22%, rgba(5, 6, 8, 0.9) 34%, rgba(5, 6, 8, 0.94) 100%); }
  .lineage { background: none; }
  .panel.line { align-items: flex-end; padding-top: 50vh; background: none; }
  .line .panel-inner { padding-top: 22px; background: linear-gradient(to bottom, rgba(5, 6, 8, 0), rgba(5, 6, 8, 0.92) 70px); }
  .chapter { align-items: flex-end; padding-top: 52vh; padding-bottom: 8vh; }
  .chapter-text { padding: 22px 0 0; background: linear-gradient(to bottom, rgba(5, 6, 8, 0), rgba(5, 6, 8, 0.9) 18%); }
  .lead { max-width: none; gap: 16px; }
  .contact-actions { align-items: flex-start; }
  .lede { font-size: 17px; }
  .act { width: 100%; order: -1; }
  .hero-row { gap: 22px; }
}
@media (max-width: 400px) {
  .hero .eyebrow { letter-spacing: 0.04em; }
}
