/* ===========================================================================
   Nico Hartl — 3D Artist
   Palette sampled from the portrait illustration: a warm, red-shifted black
   for the studio backdrop, bone for type, vermilion used as light rather
   than as paint.
   =========================================================================== */

:root {
  /* Backdrop — warm blacks pulled from the portrait's shadow values */
  --ink:        #151011;
  --ink-deep:   #0C0809;
  --ink-lift:   #1E1719;
  --ink-raise:  #271E20;

  /* Type */
  --bone:       #EDE7E3;
  --smoke:      #9C8F89;
  --smoke-dim:  #8A7E79;   /* 4.79:1 on --ink */

  /* Light */
  --vermilion:  #E23A1E;   /* light and large type only: 4.36:1 */
  --vermilion-text: #F2543A; /* the same hue lifted to 5.48:1 for body-size text */
  --ember:      #F0783C;

  --line:       rgba(237, 231, 227, .11);
  --line-soft:  rgba(237, 231, 227, .06);

  --shell:      clamp(1.25rem, 5vw, 5.5rem);
  --measure:    62ch;

  --step:  cubic-bezier(.22, .61, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

/* An author `display` beats the UA's [hidden] rule, so state it explicitly —
   without this, hiding a filtered-out .tile (display:flex) does nothing. */
[hidden] { display: none !important; }

html {
  /* Anchor scrolling is done in main.js so it can land on the section's
     heading rather than the top of its padding box. */
  scroll-padding-top: var(--anchor-offset, 5rem);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  font-family: 'Archivo', ui-sans-serif, system-ui, sans-serif;
  font-variation-settings: 'wdth' 100, 'wght' 400;
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg, canvas { display: block; max-width: 100%; }
img { height: auto; }

a { color: inherit; }

:where(a, button, [tabindex]):focus-visible {
  outline: 2px solid var(--vermilion);
  outline-offset: 3px;
  border-radius: 1px;
}

::selection { background: var(--vermilion); color: #fff; }

.skip {
  position: fixed; top: .5rem; left: .5rem; z-index: 200;
  padding: .6rem 1rem;
  background: var(--bone); color: var(--ink);
  font-variation-settings: 'wdth' 92, 'wght' 600;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform .18s var(--step);
}
.skip:focus { transform: none; }

/* ── Type scale ───────────────────────────────────────────────────────── */

h1, h2, h3 {
  margin: 0;
  line-height: 1.02;
  letter-spacing: -.02em;
  text-wrap: balance;
}

h2 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-variation-settings: 'wdth' 112, 'wght' 700;
}

h3 {
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  font-variation-settings: 'wdth' 100, 'wght' 650;
  line-height: 1.2;
}

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

/* ── Top bar ──────────────────────────────────────────────────────────── */

.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 90;
  display: flex; align-items: center; justify-content: space-between;
  gap: clamp(.75rem, 2vw, 1.5rem);
  padding: 1rem var(--shell);
  background: linear-gradient(var(--ink) 42%, transparent);
  transition: background .3s var(--step);
}
.topbar[data-solid='true'] {
  background: color-mix(in srgb, var(--ink) 92%, transparent);
  border-bottom: 1px solid var(--line-soft);
  backdrop-filter: blur(14px);
}

.mark {
  display: inline-flex; align-items: center; gap: .7rem;
  text-decoration: none;
  color: var(--bone);
}
.mark__glyph { width: 30px; height: 30px; flex: none; }
.mark__name {
  font-size: .95rem;
  font-variation-settings: 'wdth' 88, 'wght' 600;
  letter-spacing: .01em;
}
@media (max-width: 640px) { .mark__name { display: none; } }

.topnav { display: flex; gap: clamp(.7rem, 2.2vw, 2rem); margin-left: auto; }
.topnav a {
  position: relative;
  font-size: .92rem;
  font-variation-settings: 'wdth' 92, 'wght' 500;
  color: var(--smoke);
  text-decoration: none;
  padding: .25rem 0;
  transition: color .18s var(--step);
}
.topnav a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0;
  height: 1px; background: var(--vermilion);
  transform: scaleX(0); transform-origin: left;
  transition: transform .22s var(--step);
}
.topnav a:hover, .topnav a[aria-current='true'] { color: var(--bone); }
.topnav a[aria-current='true']::after { transform: scaleX(1); }

.langs { display: flex; gap: .1rem; flex: none; }
.langs button {
  font: inherit;
  font-size: .78rem;
  font-variation-settings: 'wdth' 86, 'wght' 600;
  letter-spacing: .04em;
  color: var(--smoke-dim);
  background: none;
  border: 0;
  padding: .3rem .4rem;
  cursor: pointer;
  transition: color .16s var(--step);
}
.langs button:hover { color: var(--bone); }
.langs button[aria-pressed='true'] { color: var(--bone); }
.langs button + button { border-left: 1px solid var(--line); }

/* ── Hero ─────────────────────────────────────────────────────────────── */

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-rows: 1fr auto;
  padding: 7rem var(--shell) 2rem;
  isolation: isolate;
  overflow: hidden;
}

/* The cyclorama: a soft pool of light behind the subject, falling off to black */
.hero::before {
  content: '';
  position: absolute; inset: 0; z-index: -2;
  background:
    radial-gradient(120% 78% at 50% 38%, #241A1B 0%, var(--ink) 46%, var(--ink-deep) 100%);
}
.hero::after {
  content: '';
  position: absolute; inset: auto 0 0 0; height: 34%; z-index: -1;
  background: linear-gradient(transparent, var(--ink));
  pointer-events: none;
}

.hero__stage {
  position: absolute; inset: 0; z-index: -1;
  display: grid; place-items: center;
}
.hero__stage canvas { width: 100%; height: 100%; opacity: 0; transition: opacity .9s var(--step); }
.hero__stage[data-live='true'] canvas { opacity: 1; }
.hero__stage[data-live='true'] .hero__poster { opacity: 0; }

.hero__poster {
  position: absolute;
  width: min(76vw, 780px); height: auto;
  opacity: .5;
  filter: saturate(.75) contrast(1.05);
  mask-image: radial-gradient(60% 60% at 50% 50%, #000 40%, transparent 100%);
  transition: opacity .6s var(--step);
}

.hero__copy {
  align-self: end;
  max-width: 46ch;
  position: relative;
}

.hero__eyebrow {
  margin: 0 0 1.2rem;
  font-size: .9rem;
  font-variation-settings: 'wdth' 88, 'wght' 500;
  color: var(--smoke);
}

.hero__name {
  display: flex; flex-direction: column;
  font-size: clamp(3.4rem, 13.5vw, 11rem);
  font-variation-settings: 'wdth' 125, 'wght' 800;
  letter-spacing: -.045em;
  line-height: .84;
  margin-bottom: 1.6rem;
}
.hero__name span { color: var(--vermilion); }

.hero__lede {
  max-width: 34ch;
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  color: var(--smoke);
  margin: 0;
}

.hero__down {
  justify-self: start;
  display: flex; align-items: center; gap: 1rem;
  margin-top: 3.5rem;
  font-size: .85rem;
  font-variation-settings: 'wdth' 88, 'wght' 500;
  color: var(--smoke);
  text-decoration: none;
  transition: color .2s var(--step);
}
.hero__down:hover { color: var(--bone); }
.hero__rule {
  display: block; width: clamp(3rem, 12vw, 9rem); height: 1px;
  background: linear-gradient(90deg, var(--vermilion), transparent);
  transform-origin: left;
  animation: sweep 3.4s var(--step) infinite;
}
@keyframes sweep {
  0%, 100% { transform: scaleX(.35); opacity: .55; }
  50%      { transform: scaleX(1);   opacity: 1; }
}

/* Turntable picker — lets a visitor put any of the four models on the stage */
.hero__models {
  position: absolute;
  right: var(--shell);
  bottom: 2rem;
  display: flex; flex-direction: column; align-items: flex-end;
  gap: .15rem;
  z-index: 2;
}
.hero__models button {
  font: inherit;
  font-size: .82rem;
  font-variation-settings: 'wdth' 86, 'wght' 500;
  color: var(--smoke-dim);
  background: none; border: 0;
  padding: .25rem 0;
  cursor: pointer;
  transition: color .18s var(--step);
}
.hero__models button:hover { color: var(--bone); }
.hero__models button[aria-pressed='true'] { color: var(--vermilion-text); }
@media (max-width: 900px) {
  .hero__models { position: static; flex-direction: row; flex-wrap: wrap; align-items: center; gap: .25rem 1rem; margin-top: 2rem; }
}

/* Viewer toolbar */
.vtools {
  position: absolute; inset: auto 0 0 0;
  display: flex; align-items: center; flex-wrap: wrap;
  gap: .4rem .75rem;
  padding: .6rem .75rem;
  background: linear-gradient(transparent, rgba(12, 8, 9, .92) 45%);
}
.vtools__modes { display: flex; gap: .25rem; }
.vtools button {
  font: inherit;
  font-size: .76rem;
  font-variation-settings: 'wdth' 86, 'wght' 500;
  color: var(--smoke);
  background: rgba(20, 15, 16, .7);
  border: 1px solid var(--line);
  padding: .28rem .7rem;
  cursor: pointer;
  transition: color .16s var(--step), border-color .16s var(--step), background-color .16s var(--step);
}
.vtools button:hover { color: var(--bone); border-color: rgba(237,231,227,.3); }
.vtools button[aria-pressed='true'] {
  color: var(--ink); background: var(--bone); border-color: var(--bone);
}
.vtools__reset { margin-left: auto; }
.vtools__count {
  font-size: .74rem;
  font-variation-settings: 'wdth' 84, 'wght' 450;
  color: var(--smoke-dim);
}

/* ── Bands ────────────────────────────────────────────────────────────── */

.band { padding: clamp(4.5rem, 11vw, 9rem) var(--shell); }
.band--about { background: var(--ink-deep); }
.band--contact { text-align: center; border-top: 1px solid var(--line-soft); }

.band__head { margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.band__note {
  max-width: var(--measure);
  margin: 1.2rem 0 0;
  color: var(--smoke);
  font-size: 1.05rem;
}

.subhead {
  margin: clamp(3rem, 6vw, 5rem) 0 1.75rem;
  color: var(--smoke);
  font-variation-settings: 'wdth' 90, 'wght' 600;
}

/* ── Filters ──────────────────────────────────────────────────────────── */

.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 2.25rem; }

.filters button {
  font: inherit;
  font-size: .88rem;
  font-variation-settings: 'wdth' 90, 'wght' 500;
  color: var(--smoke);
  background: transparent;
  border: 1px solid var(--line);
  padding: .45rem 1rem;
  cursor: pointer;
  transition: color .18s var(--step), border-color .18s var(--step), background-color .18s var(--step);
}
.filters button:hover { color: var(--bone); border-color: rgba(237,231,227,.28); }
.filters button[aria-pressed='true'] {
  color: var(--ink);
  background: var(--bone);
  border-color: var(--bone);
}

/* ── Work grid ────────────────────────────────────────────────────────── */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr));
  gap: clamp(1.5rem, 3vw, 2.75rem) clamp(1rem, 2vw, 1.75rem);
}

.grid__empty { color: var(--smoke); }

.tile {
  display: flex; flex-direction: column;
  text-align: left;
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.tile--featured { grid-column: span 2; }
@media (max-width: 720px) { .tile--featured { grid-column: span 1; } }

.tile__frame {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--ink-lift);
}

.tile__frame img {
  width: 100%; height: 100%;
  object-fit: cover;
  /* unlit by default — hovering brings the frame up to full key */
  filter: brightness(.82) saturate(.94);
  transform: scale(1.001);
  transition: filter .35s var(--step), transform .6s var(--step);
}
.tile:hover .tile__frame img,
.tile:focus-visible .tile__frame img { filter: none; transform: scale(1.03); }

/* Tools are the thing a studio actually scans for, so they surface on focus */
.tile__tools {
  position: absolute; inset: auto 0 0 0;
  display: flex; flex-wrap: wrap; gap: .35rem;
  padding: 2.5rem .75rem .75rem;
  background: linear-gradient(transparent, rgba(12, 8, 9, .88));
  opacity: 0;
  transition: opacity .28s var(--step);
}
.tile:hover .tile__tools,
.tile:focus-visible .tile__tools { opacity: 1; }
.tile__tools span {
  font-size: .72rem;
  font-variation-settings: 'wdth' 84, 'wght' 500;
  color: var(--bone);
  border: 1px solid rgba(237,231,227,.3);
  padding: .1rem .5rem;
  white-space: nowrap;
}

.tile__caption {
  display: flex; align-items: baseline; gap: .75rem;
  margin-top: .9rem;
}
.tile__title {
  font-size: 1.05rem;
  font-variation-settings: 'wdth' 100, 'wght' 650;
  letter-spacing: -.01em;
}
.tile__year {
  margin-left: auto;
  font-size: .82rem;
  font-variation-settings: 'wdth' 84, 'wght' 450;
  color: var(--smoke-dim);
  white-space: nowrap;
}
.tile__blurb {
  margin-top: .3rem;
  font-size: .92rem;
  color: var(--smoke);
  max-width: 46ch;
}
.tile__has-model {
  flex: none;
  align-self: center;
  font-size: .64rem;
  font-variation-settings: 'wdth' 84, 'wght' 650;
  letter-spacing: .06em;
  line-height: 1;
  color: var(--vermilion-text);
  border: 1px solid currentColor;
  padding: .18rem .3rem .14rem;
}

/* ── About ────────────────────────────────────────────────────────────── */

.about {
  display: grid;
  grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}
@media (max-width: 860px) { .about { grid-template-columns: 1fr; } }

.about__figure { margin: 0; }
.about__figure img {
  width: 100%;
  filter: saturate(1.05);
}

.about__text h2 { margin-bottom: 1.75rem; }
.about__text p {
  max-width: var(--measure);
  color: var(--smoke);
  font-size: 1.08rem;
}
.about__text p:first-of-type { color: var(--bone); font-size: 1.25rem; }

.skills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  gap: 2rem clamp(1.5rem, 3vw, 3rem);
  margin-top: clamp(3rem, 7vw, 5.5rem);
  padding-top: clamp(2.5rem, 5vw, 3.5rem);
  border-top: 1px solid var(--line);
}
.skills h3 { margin-bottom: .9rem; }
.skills ul { list-style: none; margin: 0; padding: 0; }
.skills li {
  color: var(--smoke);
  font-size: .95rem;
  line-height: 1.85;
}

/* ── Timeline ─────────────────────────────────────────────────────────── */

.track { list-style: none; margin: 0; padding: 0; }

.track li {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: clamp(1rem, 3vw, 2.5rem);
  padding: 1.75rem 0;
  border-top: 1px solid var(--line);
}
.track li:last-child { border-bottom: 1px solid var(--line); }
@media (max-width: 700px) {
  .track li { grid-template-columns: 1fr; gap: .5rem; }
}

.track__period {
  color: var(--smoke-dim);
  font-size: .9rem;
  font-variation-settings: 'wdth' 84, 'wght' 500;
  padding-top: .2rem;
}
.track__org {
  display: block;
  margin-top: .2rem;
  color: var(--vermilion-text);
  font-size: .92rem;
  font-variation-settings: 'wdth' 90, 'wght' 550;
}
.track__text {
  margin: .55rem 0 0;
  color: var(--smoke);
  max-width: var(--measure);
}
.track--tight li { padding: 1.15rem 0; }

/* ── Contact ──────────────────────────────────────────────────────────── */

.contact__line { color: var(--smoke); margin-top: 1.25rem; }

.contact__mail {
  display: inline-block;
  margin: 2rem 0 2.5rem;
  font-size: clamp(1.3rem, 4.5vw, 2.6rem);
  font-variation-settings: 'wdth' 108, 'wght' 650;
  letter-spacing: -.02em;
  text-decoration: none;
  color: var(--bone);
  border-bottom: 2px solid var(--vermilion);
  padding-bottom: .15rem;
  transition: color .2s var(--step);
  overflow-wrap: anywhere;
}
.contact__mail:hover { color: var(--vermilion); }

.contact__links {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: .5rem 1.75rem;
}
.contact__links a {
  color: var(--smoke);
  font-size: .95rem;
  font-variation-settings: 'wdth' 92, 'wght' 500;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .18s var(--step), border-color .18s var(--step);
}
.contact__links a:hover { color: var(--bone); border-bottom-color: var(--vermilion); }

.foot {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem;
  padding: 2rem var(--shell) 2.5rem;
  color: var(--smoke-dim);
  font-size: .85rem;
  border-top: 1px solid var(--line-soft);
}
.foot p { margin: 0; }

/* ── Project sheet ────────────────────────────────────────────────────── */

.sheet { position: fixed; inset: 0; z-index: 120; }
.sheet[hidden] { display: none; }

.sheet__scrim {
  position: absolute; inset: 0;
  background: rgba(8, 5, 6, .8);
  backdrop-filter: blur(6px);
  animation: fade .25s var(--step);
}

.sheet__panel {
  position: absolute; inset: 0 0 0 auto;
  width: min(100%, 62rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--ink);
  border-left: 1px solid var(--line);
  padding: clamp(2.5rem, 6vw, 4.5rem) clamp(1.25rem, 4vw, 3.5rem) 4rem;
  animation: slide .34s var(--step);
}
@keyframes fade  { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(3%); opacity: 0; } }

.sheet__close {
  position: sticky; top: 0; float: right;
  display: grid; place-items: center;
  width: 2.75rem; height: 2.75rem;
  margin: -.75rem -.75rem 0 0;
  background: var(--ink-lift);
  border: 1px solid var(--line);
  color: var(--bone);
  cursor: pointer;
  z-index: 2;
  transition: background-color .18s var(--step);
}
.sheet__close:hover { background: var(--ink-raise); }
.sheet__close svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.6; fill: none; }

.sheet__year {
  margin: 0 0 .6rem;
  color: var(--smoke-dim);
  font-size: .9rem;
  font-variation-settings: 'wdth' 84, 'wght' 500;
}
.sheet__head h2 { font-size: clamp(2rem, 6vw, 3.4rem); }
.sheet__blurb {
  margin: 1.1rem 0 0;
  max-width: 44ch;
  font-size: 1.2rem;
  color: var(--bone);
}

.sheet__meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
  gap: 1.25rem;
  margin: 2.25rem 0 0;
  padding: 1.5rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.sheet__meta > div { min-width: 0; }
.sheet__meta dt {
  color: var(--smoke-dim);
  font-size: .78rem;
  font-variation-settings: 'wdth' 84, 'wght' 550;
  margin-bottom: .3rem;
}
.sheet__meta dd {
  margin: 0;
  font-size: .95rem;
  color: var(--bone);
  line-height: 1.5;
}

.sheet__body { margin: 2.5rem 0 0; }
.sheet__body p {
  max-width: var(--measure);
  color: var(--smoke);
  font-size: 1.05rem;
}
.sheet__note {
  margin-top: 1.5rem;
  padding: .9rem 1.1rem;
  border-left: 2px solid var(--vermilion);
  background: var(--ink-lift);
  color: var(--smoke);
  font-size: .95rem;
}

.sheet__plates { display: grid; gap: 1rem; margin-top: 2.75rem; }
.sheet__plates img { width: 100%; background: var(--ink-lift); }

.sheet__video {
  aspect-ratio: 16 / 9;
  background: var(--ink-deep);
  border: 1px solid var(--line);
}
.sheet__video iframe { width: 100%; height: 100%; border: 0; display: block; }

/* Model viewer */
.viewer {
  position: relative;
  aspect-ratio: 4 / 3;
  background: radial-gradient(80% 80% at 50% 45%, #241A1B, var(--ink-deep));
  border: 1px solid var(--line);
  overflow: hidden;
  touch-action: pan-y;
}
.viewer canvas { width: 100%; height: 100%; }
.viewer__hint {
  /* sits at the top so it does not collide with the toolbar */
  position: absolute; inset: 0 0 auto 0;
  margin: 0;
  padding: .6rem .9rem;
  font-size: .78rem;
  font-variation-settings: 'wdth' 86, 'wght' 500;
  color: var(--smoke);
  background: linear-gradient(rgba(12,8,9,.85), transparent);
  pointer-events: none;
}
.viewer__load {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  color: var(--smoke);
  font-size: .9rem;
}
.viewer__fallback {
  padding: 1rem;
  color: var(--smoke);
  font-size: .9rem;
}

.sheet__nav {
  display: flex; justify-content: space-between; gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.sheet__step {
  font: inherit;
  font-size: .95rem;
  font-variation-settings: 'wdth' 92, 'wght' 550;
  background: none; border: 0; padding: .5rem 0;
  color: var(--smoke);
  cursor: pointer;
  text-align: left;
  transition: color .18s var(--step);
}
.sheet__step:hover:not(:disabled) { color: var(--bone); }
.sheet__step:disabled { opacity: .3; cursor: default; }
.sheet__step--next { text-align: right; }
.sheet__step small {
  display: block;
  font-size: .74rem;
  font-variation-settings: 'wdth' 84, 'wght' 500;
  color: var(--smoke-dim);
}

body.is-locked { overflow: hidden; }

/* ── Motion preferences ───────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  /* Nothing else to undo here: the dim and the tools overlay are static
     styles, and their transitions are already neutralised above. */
}
