/*
  Open Desk: layout, typography and panels.
  Mobile first. Breakpoints: 480px, 760px, 1100px.
  Scene-specific rules (canvas, camera controls) live in world.css.
  The content library (lib- classes) has its own stylesheet, library.css.
*/

/* ---------- Tokens ---------- */

:root {
  --bg: #0b1016;
  --surface: #121a22;
  --surface-2: #1b2631;
  --ink: #f2f4ee;
  --muted: #b3bec6;
  --faint: #8593a0;
  --accent: #b9a3ff;
  --warm: #f0a868;
  --line: rgba(214, 226, 236, .15);
  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --sans: 'DM Sans', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --r: 10px;

  --panel: #0c1118;
  --gutter: 20px;

  color-scheme: dark;
  font-synthesis: none;
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-width: 320px;
}

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  overflow: hidden;
  font: 400 16px/1.6 var(--sans);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
p,
ol,
dl,
dd {
  margin: 0;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

button:disabled {
  cursor: default;
}

a {
  color: inherit;
}

svg {
  display: block;
  flex: none;
}

kbd {
  font: 500 12px/1 var(--mono);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: -80px;
  z-index: 25;
  padding: 12px 20px;
  border-radius: var(--r);
  background: var(--ink);
  color: var(--bg);
  font-weight: 500;
  font-size: 16px;
  text-decoration: none;
}

.skip-link:focus {
  top: 16px;
}

/* ---------- Shared pieces ---------- */

.eyebrow {
  display: block;
  font: 500 12px/1.5 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--faint);
}

.count {
  font: 500 12px/1 var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  color: var(--faint);
}

.ink-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font: 500 16px/1.2 var(--sans);
  text-align: center;
  text-decoration: none;
  transition: background-color .18s, transform .18s;
}

.ink-button:hover {
  background: var(--accent);
}

.ink-button:active {
  transform: translateY(1px);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: 500 16px/1.2 var(--sans);
  text-decoration: underline;
  text-decoration-color: rgba(185, 163, 255, .4);
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
  transition: text-decoration-color .18s, color .18s;
}

.text-link:hover {
  color: var(--ink);
  text-decoration-color: currentColor;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
  margin-top: 40px;
}

/* ---------- Site header ---------- */

.site-header {
  position: absolute;
  z-index: 5;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 12px var(--gutter);
  transition: opacity .4s, transform .4s;
}

.monogram {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 44px;
  text-decoration: none;
  color: var(--ink);
}

.monogram-mark {
  font: 600 32px/1 var(--display);
  letter-spacing: -.02em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.site-sections {
  display: none;
  align-items: center;
  gap: 4px;
  margin-right: 12px;
}

.site-sections button {
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--ink);
  font: 500 16px/1 var(--sans);
  text-shadow: 0 1px 8px rgba(8, 30, 32, .55);
  transition: background-color .18s;
}

.site-sections button:hover {
  background: rgba(8, 28, 34, .38);
}

.icon-link {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--ink);
  filter: drop-shadow(0 1px 6px rgba(8, 30, 32, .45));
  transition: background-color .18s, color .18s;
}

.icon-link:hover {
  background: rgba(8, 28, 34, .38);
  color: #fff;
}

.hello-button {
  min-height: 44px;
  margin-left: 8px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font: 500 16px/1 var(--sans);
  white-space: nowrap;
  transition: background-color .18s;
}

.hello-button:hover {
  background: var(--accent);
}

/* ---------- Home: scene and hero ---------- */

.studio-home {
  position: relative;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
}

.scene-viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #0b252f;
}

.scene-world {
  position: absolute;
  inset: 0;
}

#studio-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  pointer-events: none;
}

.scene-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(0deg, rgba(6, 20, 24, .96) 0%, rgba(6, 20, 24, .78) 24%, transparent 48%),
    linear-gradient(180deg, rgba(8, 35, 48, .42), transparent 46%);
}

.hero-copy {
  position: absolute;
  z-index: 2;
  top: 84px;
  left: var(--gutter);
  right: var(--gutter);
  pointer-events: none;
  transition: opacity .35s, transform .5s;
}

.hero-copy h1 {
  margin: 8px 0 12px;
  font: 600 clamp(60px, 19vw, 84px)/.98 var(--display);
  letter-spacing: -.02em;
  color: #f6f4e6;
  text-shadow: 0 2px 28px rgba(7, 24, 26, .28);
}

.hero-copy h1 > span {
  color: var(--warm);
}

.hero-description {
  font: 400 18px/1.45 var(--sans);
  letter-spacing: -.01em;
  color: #f2f4ee;
  text-shadow: 0 1px 14px rgba(7, 24, 26, .5);
}

/* ---------- Scene hotspots (world.css positions them over the 3D objects) ---------- */

.scene-hotspot {
  position: absolute;
  z-index: 2;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border: 0;
  background: none;
}

.scene-hotspot > i {
  display: block;
  width: 8px;
  height: 8px;
  border: 1px solid #e9f6f0;
  border-radius: 50%;
  background: rgba(190, 241, 232, .25);
  box-shadow: 0 0 0 6px rgba(219, 245, 230, .1), 0 0 18px rgba(217, 255, 241, .3);
  opacity: .8;
  transition: transform .25s, background-color .25s;
}

.scene-hotspot > span {
  padding: 8px 14px;
  border: 1px solid rgba(200, 228, 228, .24);
  border-radius: 999px;
  background: rgba(9, 30, 37, .86);
  color: var(--ink);
  font: 500 14px/1.2 var(--sans);
  white-space: nowrap;
  opacity: 0;
  transform: translateY(5px);
  transition: transform .25s, opacity .25s;
}

.scene-hotspot > span > b {
  margin-left: 6px;
  font-weight: 400;
  color: var(--accent);
}

.scene-hotspot:hover > span,
.scene-hotspot:focus-visible > span {
  opacity: 1;
  transform: translateY(0);
}

.scene-hotspot:hover > i,
.scene-hotspot:focus-visible > i {
  background: #e2ffef;
  opacity: 1;
  transform: scale(1.4);
}

/* ---------- Home: collection nav (the doors) ---------- */

.collection-nav {
  position: absolute;
  z-index: 4;
  left: var(--gutter);
  right: var(--gutter);
  bottom: 68px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  transition: opacity .4s, transform .4s;
}

.collection-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 48px;
  padding: 0 12px 0 16px;
  border: 1px solid rgba(215, 232, 222, .22);
  border-radius: var(--r);
  background: rgba(9, 28, 34, .7);
  color: var(--ink);
  text-align: left;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: background-color .18s, border-color .18s;
}

.collection-button:hover {
  background: rgba(18, 46, 54, .86);
  border-color: rgba(215, 232, 222, .42);
}

.collection-name {
  display: flex;
  flex: 1;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font: 500 16px/1.2 var(--sans);
}

.collection-name .count {
  color: var(--muted);
}

.collection-button small {
  display: none;
}

.collection-arrow {
  color: var(--accent);
  font-size: 16px;
  transition: transform .25s;
}

.collection-button:hover .collection-arrow {
  transform: translate(2px, -2px);
}

/* ---------- Footer strip ---------- */

.studio-footer {
  position: absolute;
  z-index: 5;
  left: var(--gutter);
  right: var(--gutter);
  top: calc(max(100svh, 560px) - 56px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 44px;
  color: var(--muted);
  font: 400 12px/1.4 var(--sans);
}

.location {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.location time {
  margin-left: 4px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.live-dot {
  display: inline-block;
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(185, 163, 255, .4);
}

#motion-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  white-space: nowrap;
}

#motion-toggle:hover {
  color: var(--ink);
}

.motion-symbol {
  font-size: 14px;
}

/* ---------- Panel: dialog shell ---------- */

.portfolio-dialog {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  overflow: hidden;
  outline: 0;
  opacity: 0;
  transform: translateY(14px) scale(.985);
  transition:
    opacity .16s ease-in,
    transform .16s ease-in,
    overlay .16s allow-discrete,
    display .16s allow-discrete;
}

.portfolio-dialog[open] {
  opacity: 1;
  transform: none;
  transition-duration: .24s;
  transition-timing-function: cubic-bezier(.2, .8, .2, 1);
}

@starting-style {
  .portfolio-dialog[open] {
    opacity: 0;
    transform: translateY(14px) scale(.985);
  }
}

.portfolio-dialog::backdrop {
  background: rgba(3, 12, 16, 0);
  -webkit-backdrop-filter: blur(0);
  backdrop-filter: blur(0);
  transition:
    background-color .2s,
    backdrop-filter .2s,
    -webkit-backdrop-filter .2s,
    overlay .2s allow-discrete,
    display .2s allow-discrete;
}

.portfolio-dialog[open]::backdrop {
  background: rgba(3, 12, 16, .66);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

@starting-style {
  .portfolio-dialog[open]::backdrop {
    background: rgba(3, 12, 16, 0);
    -webkit-backdrop-filter: blur(0);
    backdrop-filter: blur(0);
  }
}

.panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr);
  grid-template-areas:
    'bar'
    'nav'
    'scroll';
  width: 100%;
  height: 100%;
  background: var(--panel);
  overflow: hidden;
}

/* Top bar: where you are, and the way out */

.panel-bar {
  grid-area: bar;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
  padding: 8px 12px 8px var(--gutter);
}

.panel-kicker {
  font: 500 12px/1.4 var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

.close-dialog {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: 500 14px/1 var(--sans);
  transition: background-color .18s, border-color .18s;
}

.close-dialog:hover {
  background: var(--surface-2);
  border-color: rgba(200, 228, 228, .4);
}

.close-dialog kbd {
  display: none;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
}

/* Section nav: a scrollable tab row on phones, a left rail on desktop */

.panel-nav {
  grid-area: nav;
  min-width: 0;
  border-bottom: 1px solid var(--line);
}

.panel-brand,
.panel-nav-foot {
  display: none;
}

.panel-tabs {
  display: flex;
  gap: 4px;
  padding: 0 12px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.panel-tabs::-webkit-scrollbar {
  display: none;
}

.panel-tabs button {
  position: relative;
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 10px;
  border: 0;
  background: none;
  color: var(--muted);
  font: 500 16px/1 var(--sans);
  white-space: nowrap;
  transition: color .18s, background-color .18s;
}

.panel-tabs button:hover {
  color: var(--ink);
}

.panel-tabs button:focus-visible {
  outline-offset: -3px;
  border-radius: 8px;
}

.panel-tabs button::after {
  content: '';
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 0;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--accent);
  opacity: 0;
}

.panel-tabs button.is-active {
  color: var(--ink);
}

.panel-tabs button.is-active::after {
  opacity: 1;
}

.panel-tabs button.is-active .count {
  color: var(--accent);
}

/* Scrolling content */

.panel-scroll {
  grid-area: scroll;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 32px var(--gutter) 32px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(200, 228, 228, .28) transparent;
  scrollbar-width: thin;
}

.panel-content {
  flex: none;
  padding-bottom: 64px;
  container: panel / inline-size;
  animation: content-in .24s cubic-bezier(.2, .8, .2, 1);
}

.panel-content.is-swapping {
  animation: none;
}

@keyframes content-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.panel-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 14px;
}

/* ---------- Panel: typography ---------- */

.panel-content {
  font-size: 16px;
  line-height: 1.6;
}

.panel-content > .eyebrow {
  margin-bottom: 12px;
}

.portfolio-dialog h2 {
  margin-bottom: 16px;
  font: 600 clamp(32px, 4vw, 56px)/1.04 var(--display);
  letter-spacing: -.012em;
  color: var(--ink);
  text-wrap: balance;
}

.portfolio-dialog h2:focus {
  outline: 0;
}

.portfolio-dialog h2 > span {
  color: var(--warm);
}

.panel-lede {
  max-width: 58ch;
  margin-bottom: 40px;
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink);
  text-wrap: pretty;
}

.portfolio-dialog h3 {
  font: 600 32px/1.12 var(--display);
  letter-spacing: -.005em;
  color: var(--ink);
}

.portfolio-dialog h4 {
  font: 600 24px/1.18 var(--display);
  color: var(--ink);
  text-wrap: balance;
}

.section-title {
  margin: 56px 0 24px;
}

.prose {
  max-width: 68ch;
}

.prose p {
  color: var(--muted);
  text-wrap: pretty;
}

.prose p + p {
  margin-top: 16px;
}

.prose em {
  color: var(--ink);
}

.prose .quiet-note {
  margin-top: 24px;
  padding-left: 16px;
  border-left: 2px solid var(--line);
  font-size: 14px;
  color: var(--faint);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin: -12px 0 12px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: 500 14px/1 var(--sans);
}

.back-link:hover {
  color: var(--ink);
}

/* ---------- Panel: feature block (Rig, podcast) ---------- */

.feature {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
}

.feature-art {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  min-height: 176px;
  padding: 24px;
  background: var(--surface-2);
}

.feature-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 12px;
  padding: 24px;
}

.feature-copy > p:not(.eyebrow) {
  max-width: 52ch;
  color: var(--muted);
}

.feature-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
  margin-top: 8px;
}

.rig-art {
  background:
    radial-gradient(120% 90% at 0% 100%, rgba(185, 163, 255, .16), transparent 62%),
    var(--surface-2);
}

.rig-word {
  font: 500 56px/1 var(--mono);
  letter-spacing: -.04em;
  color: var(--ink);
}

.rig-word span {
  color: var(--warm);
}

.rig-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font: 500 12px/1 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink);
}

.rig-flow span {
  padding: 8px 10px;
  border: 1px solid rgba(200, 228, 228, .28);
  border-radius: 6px;
}

.rig-flow i {
  font-style: normal;
  color: var(--accent);
}

@keyframes wave {
  to {
    transform: scaleY(.4);
  }
}

@container panel (min-width: 620px) {
  .feature {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  }

  .feature-art {
    min-height: 248px;
    padding: 32px;
  }

  .feature-copy {
    padding: 32px 40px;
  }
}

/* ---------- Panel: library slot and its no-library fallback ---------- */

.library-section {
  margin-top: 48px;
}

.library-fallback .section-title {
  margin-top: 0;
}

.link-list {
  border-top: 1px solid var(--line);
}

.link-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  padding: 16px 4px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: background-color .18s;
}

.link-list a:hover {
  background: rgba(200, 228, 228, .05);
}

.link-list a > span {
  display: grid;
  gap: 4px;
}

.link-list small {
  font: 500 12px/1.5 var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--faint);
}

.link-list strong {
  font: 600 24px/1.2 var(--display);
  color: var(--ink);
}

.link-list em {
  max-width: 64ch;
  font-style: normal;
  font-size: 16px;
  color: var(--muted);
}

.link-list a > i {
  font-style: normal;
  font-size: 18px;
  color: var(--accent);
  transition: transform .2s;
}

.link-list a:hover > i {
  transform: translate(2px, -2px);
}

/* ---------- Panel: Rig detail ---------- */

.rig-steps {
  display: grid;
  gap: 8px;
  max-width: 720px;
  margin-bottom: 40px;
  padding: 0;
  list-style: none;
}

.rig-steps li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  font: 600 24px/1.2 var(--display);
  color: var(--ink);
}

.rig-steps span {
  font: 500 12px/1 var(--mono);
  letter-spacing: .08em;
  color: var(--warm);
}

/* ---------- Panel: story ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 24px;
  margin-top: 40px;
}

.stats > div {
  padding: 16px 0 20px;
  border-top: 1px solid var(--line);
}

.stats dt {
  font: 600 44px/1.05 var(--display);
  color: var(--ink);
}

.stats dd {
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
}

.timeline {
  --rail: 7px;
  max-width: 760px;
  padding: 0;
  list-style: none;
}

.timeline > li {
  position: relative;
  padding: 0 0 48px 32px;
}

.timeline > li::before {
  content: '';
  position: absolute;
  left: var(--rail);
  top: 16px;
  bottom: -12px;
  width: 1px;
  background: var(--line);
}

.timeline > li:last-child {
  padding-bottom: 0;
}

.timeline > li:last-child::before {
  display: none;
}

.timeline > li::after {
  content: '';
  position: absolute;
  left: 1px;
  top: 10px;
  width: 13px;
  height: 13px;
  border: 2px solid var(--bg);
  border-radius: 50%;
  background: var(--accent);
  background: color-mix(in srgb, var(--tone, var(--accent)) 55%, #f2f4ee);
  box-shadow: 0 0 0 1px rgba(200, 228, 228, .3);
}

.timeline-when {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  margin-bottom: 8px;
}

.timeline-year {
  font: 600 32px/1 var(--display);
  color: var(--accent);
  color: color-mix(in srgb, var(--tone, var(--accent)) 38%, #f2f4ee);
}

.timeline-place {
  font: 500 12px/1.5 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--faint);
}

.timeline h4 {
  max-width: 30ch;
  margin-bottom: 12px;
  font-size: 24px;
}

.timeline li > p:not(.timeline-when) {
  max-width: 68ch;
  color: var(--muted);
  text-wrap: pretty;
}

.timeline li > p + p:not(.timeline-when) {
  margin-top: 12px;
}

.timeline-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 32px;
  margin-top: 20px;
}

.timeline-facts > div {
  display: flex;
  flex-direction: column;
  max-width: 180px;
}

.timeline-facts dt {
  font: 600 32px/1.05 var(--display);
  color: var(--ink);
}

.timeline-facts dd {
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--faint);
}

.timeline-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.timeline-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font: 500 14px/1.2 var(--sans);
  text-decoration: none;
  transition: background-color .18s, border-color .18s;
}

.timeline-links a:hover {
  background: var(--surface-2);
  border-color: rgba(200, 228, 228, .4);
}

.timeline-links a span {
  color: var(--accent);
}

/* ---------- Panel: contact ---------- */

.contact-email {
  display: inline-block;
  max-width: 100%;
  font: 600 clamp(24px, 7.4vw, 44px)/1.15 var(--display);
  font-size: clamp(24px, 8cqi, 52px);
  letter-spacing: -.01em;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: .18em;
  overflow-wrap: anywhere;
  transition: color .18s;
}

.contact-email:hover {
  color: var(--accent);
}

.contact-email span {
  font-size: .6em;
  color: var(--accent);
}

.contact-options {
  display: grid;
  gap: 12px;
  max-width: 720px;
  margin-top: 40px;
}

.contact-options a {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 80px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  text-decoration: none;
  transition: background-color .18s, border-color .18s;
}

.contact-options a:hover {
  background: var(--surface-2);
  border-color: rgba(200, 228, 228, .4);
}

.contact-options a > span {
  display: grid;
  gap: 2px;
}

.contact-options small {
  font-size: 14px;
  color: var(--muted);
}

.contact-options strong {
  font: 600 24px/1.1 var(--display);
  color: var(--ink);
}

.contact-options strong i {
  font: 400 16px/1 var(--sans);
  color: var(--accent);
}

.contact-signoff {
  margin-top: 48px;
  font-size: 16px;
  color: var(--muted);
}

.contact-signoff span {
  font: 600 32px/1.2 var(--display);
  color: var(--ink);
}

/* ---------- Without JavaScript ---------- */

.noscript {
  position: fixed;
  left: 20px;
  right: 20px;
  bottom: 72px;
  z-index: 20;
  padding: 20px;
  border-radius: var(--r);
  background: var(--surface);
  font-size: 16px;
}

/* ---------- Motion preferences ---------- */

/* Paused motion drops animations outright, so nothing freezes on an invisible first frame. */
.motion-paused * {
  animation: none !important;
}

.tab-inactive * {
  animation-play-state: paused !important;
}

/* ---------- 480px and up: large phones ---------- */

@media (min-width: 480px) {
  .panel-content {
    font-size: 16px;
  }

  .close-dialog kbd {
    display: inline-block;
  }

  .contact-options {
    grid-template-columns: 1fr 1fr;
  }

  .stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .collection-nav {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ---------- 760px and up: tablets and desktop ---------- */

@media (min-width: 760px) {
  :root {
    --gutter: 32px;
  }

  .site-header {
    padding: 20px var(--gutter);
  }

  .scene-shade {
    background:
      linear-gradient(0deg, rgba(6, 20, 24, .94) 0%, rgba(6, 20, 24, .6) 14%, transparent 34%),
      linear-gradient(90deg, rgba(8, 35, 45, .34), transparent 52%);
  }

  .scene-hotspot {
    display: flex;
  }

  .hero-copy {
    top: 17%;
    left: 6%;
    right: auto;
  }

  .hero-copy h1 {
    margin: 12px 0 20px;
    font-size: clamp(84px, 9.4vw, 168px);
    line-height: .95;
  }

  .hero-description {
    font-size: clamp(20px, 1.7vw, 24px);
  }

  .collection-nav {
    left: 6%;
    right: 6%;
    bottom: 72px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 24px;
  }

  .collection-button.collection-contact {
    display: none;
  }

  .collection-button {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 6px 8px;
    min-height: 0;
    padding: 16px 0 8px;
    border: 0;
    border-top: 1px solid rgba(226, 240, 232, .34);
    border-radius: 0;
    background: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .collection-button:hover {
    background: none;
  }

  .collection-button::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 0;
    width: 28px;
    height: 1px;
    background: var(--warm);
    transition: width .35s;
  }

  .collection-button:hover::before,
  .collection-button:focus-visible::before {
    width: 100%;
  }

  .collection-name {
    justify-content: flex-start;
    gap: 10px;
    font: 600 clamp(20px, 2.3vw, 32px)/1.05 var(--display);
  }

  .collection-button small {
    display: block;
    grid-column: 1 / -1;
    font: 400 14px/1.4 var(--sans);
    color: var(--muted);
  }

  .collection-name .count {
    font-size: 14px;
  }

  .collection-arrow {
    grid-area: 1 / 2;
    font-size: 18px;
    line-height: 1.6;
  }

  .studio-footer {
    left: var(--gutter);
    right: var(--gutter);
    top: calc(max(100svh, 560px) - 52px);
    font-size: 14px;
  }

  /* The panel becomes a floating sheet with a left rail */

  .portfolio-dialog {
    width: min(1240px, calc(100vw - 48px));
    height: min(900px, calc(100dvh - 48px));
    margin: auto;
    border-radius: 18px;
    overflow: visible;
  }

  .panel {
    grid-template-columns: 224px minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas:
      'nav bar'
      'nav scroll';
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 40px 120px rgba(0, 0, 0, .55);
  }

  .panel-bar {
    min-height: 72px;
    padding: 12px 16px 12px 48px;
  }

  .panel-nav {
    display: flex;
    flex-direction: column;
    padding: 20px 12px 16px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
    background: rgba(4, 14, 18, .34);
  }

  .panel-brand {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 24px;
    padding: 4px 12px 0;
    font: 500 14px/1.4 var(--sans);
    color: var(--muted);
  }

  .panel-brand span {
    font: 600 32px/1 var(--display);
    color: var(--ink);
  }

  .panel-tabs {
    flex-direction: column;
    gap: 2px;
    padding: 0;
    overflow: visible;
  }

  .panel-tabs button {
    justify-content: space-between;
    width: 100%;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 8px;
    text-align: left;
  }

  .panel-tabs button:hover {
    background: rgba(200, 228, 228, .06);
  }

  .panel-tabs button::after {
    left: 0;
    right: auto;
    top: 12px;
    bottom: 12px;
    width: 2px;
    height: auto;
    border-radius: 2px;
  }

  .panel-tabs button.is-active {
    background: var(--surface-2);
  }

  .panel-nav-foot {
    display: grid;
    gap: 2px;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--line);
  }

  .panel-nav-foot a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 8px;
    color: var(--muted);
    font: 500 14px/1 var(--sans);
    text-decoration: none;
    transition: color .18s, background-color .18s;
  }

  .panel-nav-foot a:hover {
    background: rgba(200, 228, 228, .06);
    color: var(--ink);
  }

  .panel-nav-foot a span {
    margin-left: auto;
    color: var(--faint);
  }

  .panel-scroll {
    padding: 8px 48px 40px;
  }

  .panel-lede {
    font-size: 18px;
  }

  .portfolio-dialog h3 {
    font-size: 32px;
  }

  .rig-word {
    font-size: 72px;
  }

  .rig-steps {
    grid-template-columns: repeat(3, 1fr);
  }

  .rig-steps li {
    flex-direction: column;
    gap: 16px;
    padding: 20px;
  }

  .timeline h4 {
    font-size: 32px;
  }

  .timeline-year {
    font-size: 32px;
  }

  .timeline > li::after {
    top: 12px;
  }

  .noscript {
    left: var(--gutter);
    right: auto;
    max-width: 480px;
  }
}

/* ---------- 1100px and up: wide desktop ---------- */

@media (min-width: 1100px) {
  :root {
    --gutter: 4.2vw;
  }

  .site-sections {
    display: flex;
  }

  .panel {
    grid-template-columns: 248px minmax(0, 1fr);
  }

  .panel-nav {
    padding: 24px 16px 16px;
  }

  .panel-bar {
    padding-left: 64px;
  }

  .panel-scroll {
    padding: 8px 64px 48px;
  }

  .stats {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

/* ---------- Short viewports ---------- */

@media (max-height: 700px) and (min-width: 760px) {
  .hero-copy {
    top: 15%;
  }

  .hero-copy h1 {
    margin: 8px 0 12px;
    font-size: clamp(72px, 12vh, 96px);
  }

  .hero-description {
    font-size: 18px;
  }

  .collection-button small {
    display: none;
  }

  .portfolio-dialog {
    height: calc(100dvh - 24px);
  }
}

@media (max-height: 640px) and (max-width: 759px) {
  .hero-copy {
    top: 72px;
  }

  .hero-copy h1 {
    font-size: 56px;
  }

  .hero-description {
    font-size: 18px;
  }

}

@media (max-height: 560px) {
  body {
    overflow: auto;
  }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  body:not(.motion-opt-in) *,
  body:not(.motion-opt-in) *::before,
  body:not(.motion-opt-in) *::after,
  body:not(.motion-opt-in) ::backdrop {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
