/* TC2 — The Creative Time Company
   A quiet gallery: white walls, the works, and a few words. Shared styles. */

:root {
  --void: #0b0b0c;          /* black gallery wall */
  --hall: #141416;          /* a shade lighter, for bands */
  --wall: #18181b;
  --line: rgba(236, 232, 225, 0.12);
  --line-strong: rgba(236, 232, 225, 0.26);
  --ink: #ece8e1;
  --ink-soft: rgba(236, 232, 225, 0.68);
  --ink-faint: rgba(236, 232, 225, 0.44);
  --quantum: #e2362b;       /* the red "QUANTUM" of the deck, used sparingly */
  --oak: #c9a46a;
  --display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Inter", "Helvetica Neue", Arial, sans-serif;
  --mono: var(--sans);
  --gutter: clamp(16px, 5vw, 96px);
  --max: 1720px;
  --ease: ease;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: clip; }
body {
  margin: 0;
  background: var(--void);
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(16px, 0.95vw, 18px);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
::selection { background: var(--ink); color: var(--void); }

/* ---------- type ---------- */
.eyebrow {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  display: inline-block;
}
h1, h2, h3 { font-family: var(--display); font-weight: 400; letter-spacing: 0; margin: 0; text-wrap: balance; }
h3 { font-family: var(--sans); font-weight: 500; font-size: 15px; }
.h-xl { font-size: clamp(40px, 5.6vw, 104px); line-height: 1.02; }
.h-lg { font-size: clamp(32px, 3.8vw, 70px); line-height: 1.06; }
.h-md { font-size: clamp(24px, 2.6vw, 34px); line-height: 1.2; }
.h-sm { font-size: 15px; }
.red { color: var(--quantum); }
.serif { font-family: var(--serif); font-style: italic; font-weight: 400; }
.lead { font-family: var(--serif); font-size: clamp(21px, 1.7vw, 32px); line-height: 1.45; color: var(--ink); max-width: 40ch; }
.muted { color: var(--ink-soft); }
.mono { font-family: var(--sans); }
p { max-width: 64ch; }

/* ---------- layout ---------- */
.wrap { max-width: var(--max); margin: 0 auto; padding-left: max(var(--gutter), env(safe-area-inset-left, 0px)); padding-right: max(var(--gutter), env(safe-area-inset-right, 0px)); }
section { position: relative; }
.room { padding: clamp(56px, 6.5vw, 110px) 0; }
.room + .room { border-top: 1px solid var(--line); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(32px, 6vw, 96px); align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 3vw, 44px); }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(20px, 2.4vw, 32px); }
@media (max-width: 900px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) { .grid-4 { grid-template-columns: 1fr; } }

/* ---------- header ---------- */
.site-head {
  position: relative; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  max-width: var(--max); margin: 0 auto;
  padding: 22px max(var(--gutter), env(safe-area-inset-right, 0px)) 22px max(var(--gutter), env(safe-area-inset-left, 0px));
}
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.brand-logo { height: 52px; width: auto; }
.brand-name { font-size: 13px; letter-spacing: .04em; line-height: 1.35; color: var(--ink); }
.foot-logo { height: 72px; width: auto; margin-bottom: 28px; }
.nav { display: flex; gap: clamp(16px, 2.4vw, 32px); align-items: center; }
.nav a { text-decoration: none; font-size: 14px; color: var(--ink-soft); padding: 4px 0; border-bottom: 1px solid transparent; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); border-color: var(--ink); }
.nav .btn { padding: 8px 16px; font-size: 14px; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line-strong); color: var(--ink); padding: 8px 14px; font: inherit; font-size: 13px; cursor: pointer; }
@media (max-width: 960px) {
  .nav-toggle { display: block; }
  .nav { position: fixed; inset: 0; background: var(--void); flex-direction: column; justify-content: center; gap: 22px; display: none; z-index: 60; }
  .nav a { font-family: var(--display); font-size: 28px; color: var(--ink); }
  body.nav-open .nav { display: flex; }
  body.nav-open .nav-toggle { position: relative; z-index: 70; }
  .brand-name { display: none; }
}

/* ---------- buttons & links ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 22px; border: 1px solid var(--ink); color: var(--ink); background: transparent;
  text-decoration: none; font: inherit; font-size: 14px; letter-spacing: .02em; cursor: pointer;
}
.btn:hover { background: var(--ink); color: var(--void); }
.btn.solid { background: var(--ink); color: var(--void); }
.btn.solid:hover { background: transparent; color: var(--ink); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.link { text-decoration: none; border-bottom: 1px solid var(--line-strong); padding-bottom: 1px; }
.link:hover { border-color: var(--ink); }
.text-link { text-decoration: none; border-bottom: 1px solid var(--ink); padding-bottom: 1px; font-size: 15px; }
.text-link:hover { color: var(--quantum); border-color: var(--quantum); }

/* Old effect hooks, now inert */
.q-field, .bitline { display: none !important; }
.reveal { opacity: 1; transform: none; }

/* ---------- page hero (inner pages) ---------- */
.page-hero { padding: clamp(48px, 8vw, 110px) 0 clamp(48px, 7vw, 90px); }
.page-hero .h-xl { margin: 14px 0 22px; }

/* ---------- cards & lists ---------- */
.card { border-top: 1px solid var(--line-strong); padding: 22px 0 0; }
.card .num { font-size: 13px; color: var(--ink-faint); }
.card h3 { margin: 8px 0 8px; font-size: 16px; }
.card p { margin: 0; color: var(--ink-soft); }
.card blockquote { margin: 14px 0 0; font-family: var(--serif); font-style: italic; font-size: 21px; line-height: 1.35; color: var(--ink); }

.steps { display: grid; grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr)); gap: 28px; }
.steps > div { border-top: 1px solid var(--line-strong); padding-top: 18px; }
.steps .num { font-size: 13px; color: var(--ink-faint); }
.steps h3 { font-size: 16px; margin: 6px 0 6px; }
.steps p { margin: 0; color: var(--ink-soft); font-size: 15px; }
@media (max-width: 900px) { .steps { grid-template-columns: 1fr; gap: 0; } .steps > div { padding: 16px 0 22px; } }
.steps.vertical { grid-template-columns: 1fr; gap: 0; }
.steps.vertical > div { padding: 16px 0 20px; }

.quote-block { max-width: 900px; }
.quote-block blockquote { margin: 0; font-family: var(--serif); font-style: italic; font-size: clamp(28px, 3.6vw, 46px); line-height: 1.2; }
.quote-block cite { display: block; margin-top: 18px; font-style: normal; font-size: 13px; color: var(--ink-faint); }

/* ---------- forms ---------- */
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 26px; }
.form .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label, .field legend { font-size: 13px; color: var(--ink-soft); }
.field input, .field select, .field textarea {
  font: inherit; color: var(--ink); background: var(--wall);
  border: 1px solid var(--line-strong); padding: 12px 12px; outline: none; border-radius: 0;
}
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%), linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.field textarea { min-height: 130px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--ink); }
.field input:invalid:not(:placeholder-shown) { border-color: #b3642e; }
fieldset.field { border: 0; padding: 0; margin: 0; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span { display: inline-block; padding: 8px 14px; border: 1px solid var(--line-strong); font-size: 14px; cursor: pointer; background: var(--wall); }
.choice input:checked + span { background: var(--ink); color: var(--void); border-color: var(--ink); }
.choice input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.form-note { font-size: 13px; color: var(--ink-faint); }
.form-done { display: none; border: 1px solid var(--line-strong); padding: 32px; background: var(--wall); }
.form-done.show { display: block; }
.form-done .summary { margin: 0; padding: 16px; background: var(--void); border: 1px solid var(--line); font-family: ui-monospace, Menlo, monospace; font-size: 13px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; color: var(--ink); max-height: 320px; overflow: auto; }
.form-done .addr { color: var(--ink); font-weight: 500; user-select: all; }
.form.hide { display: none; }
.form-note.error { color: var(--ink); }
.form-note.error::before { content: "! "; color: #e0675a; font-weight: 600; }
.form .hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form button[disabled] { opacity: .6; cursor: progress; }
@media (max-width: 700px) { .form { grid-template-columns: 1fr; } }

/* ---------- footer ---------- */
.site-foot { border-top: 1px solid var(--line); padding: 64px 0 36px; }
.foot-big { font-family: var(--display); font-size: clamp(28px, 3.4vw, 42px); line-height: 1.15; margin: 0; }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; margin-top: 48px; font-size: 14px; color: var(--ink-soft); }
.foot-grid h4 { margin: 0 0 10px; font-size: 13px; font-weight: 500; color: var(--ink); }
.foot-grid a { text-decoration: none; display: block; padding: 2px 0; }
.foot-grid a:hover { color: var(--ink); }
.foot-legal { margin-top: 48px; font-size: 13px; color: var(--ink-faint); }
@media (max-width: 800px) { .foot-grid { grid-template-columns: 1fr 1fr; } }

/* ---------- live clock hands (shared SVG) ---------- */
.qclock { width: 100%; height: 100%; overflow: visible; }
.qclock .hand { transform-origin: 0 0; }
.qclock .h, .qclock .m { fill: #111; }
.qclock .s { fill: none; stroke: #e0362b; stroke-width: 2.6; stroke-linecap: round; }
.qclock .pin { fill: #111; }

/* ---------- a framed work with live hands ---------- */
.piece { position: relative; width: 100%; aspect-ratio: 900 / 1240; background: #ddd; box-shadow: 0 0 0 clamp(6px, 1vw, 12px) var(--oak), 0 24px 44px -20px rgba(0,0,0,.9); margin: clamp(6px, 1vw, 12px); width: calc(100% - 2 * clamp(6px, 1vw, 12px)); }
.piece img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.piece .dial { position: absolute; left: 48%; top: 43%; width: 70%; aspect-ratio: 1; transform: translate(-50%, -50%); pointer-events: none; }
.piece .dial .qclock .hand { transition: transform .4s ease-out; }

/* ---------- patents (kept for reuse) ---------- */
.patents { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.patent { border-top: 1px solid var(--line-strong); padding-top: 16px; }

/* ---------- colour bands: black (default), white, red ---------- */
.band-white, .band-red { background: var(--void); color: var(--ink); }
.band-white {
  --void: #f4f1ec; --hall: #ebe7e0; --wall: #ffffff;
  --line: rgba(20, 18, 16, 0.12); --line-strong: rgba(20, 18, 16, 0.28);
  --ink: #141210; --ink-soft: #4f4a43; --ink-faint: #857f75;
  color-scheme: light;
}
.band-red {
  --void: #c8322a; --hall: #b72c25; --wall: #b72c25;
  --line: rgba(255, 255, 255, 0.22); --line-strong: rgba(255, 255, 255, 0.45);
  --ink: #ffffff; --ink-soft: rgba(255, 255, 255, 0.86); --ink-faint: rgba(255, 255, 255, 0.7);
  --quantum: #141210;
}
.band-white + .room, .band-red + .room, .room + .band-white, .room + .band-red { border-top: 0; }
.band-white .text-link:hover { color: var(--quantum); border-color: var(--quantum); }
.band-red .text-link:hover { color: #141210; border-color: #141210; }
