/* ============================================================
   DEON — Polymathic Studio
   Liquid Brutalism: cacao-black ground, cream type, copper accent.
   ============================================================ */

/* Owner-supplied display/body face. Two quirks it has to work around:

   1. It ships a single 400 weight, so anything that should read heavier
      is thickened with a text stroke, not a synthetic bold (.display).
   2. This free release stubs out its numerals — every digit 0-9 draws
      the same placeholder glyph. The unicode-range below deliberately
      excludes U+0030-0039 so digits fall through to the next family in
      the stack: Overpass, the open-license typeface "FT Overpass" is
      itself built on (same name, same highway-gothic-derived letter
      shapes), so substituted digits sit close to invisible next to the
      real glyphs around them. Drop the unicode-range if a full version
      of the font with real numerals is ever installed. */
@font-face {
  font-family: 'FT Overpass';
  src: url('../fonts/FTOverpass.woff2') format('woff2'),
       url('../fonts/FTOverpass.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-002F, U+003A-10FFFF;
}

/* Overpass (OFL-licensed, self-hosted) — the digit fallback described
   above. Scoped to numerals only so it never competes with FT Overpass
   for the letters it does draw correctly. */
@font-face {
  font-family: 'Overpass';
  src: url('../fonts/Overpass-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0030-0039;
}

:root {
  --bg:        #120B09;   /* ground */
  --fg:        #FDF9F3;   /* cream */
  --body:      #FAF6F0;
  --muted:     #B3A089;   /* muted foreground */
  --border:    #2A1B17;
  --card:      #1D1310;
  --accent:    #ff8c00;   /* copper */
  --radius:    0.25rem;
  --ease:      cubic-bezier(0.16, 1, 0.3, 1);
  --pad:       clamp(20px, 6vw, 64px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--body);
  /* Overpass sits second on purpose — it catches the digits that
     FT Overpass deliberately doesn't cover. See the @font-face note. */
  font-family: 'FT Overpass', 'Overpass', 'JetBrains Mono', ui-sans-serif, system-ui, -apple-system, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  /* one real weight only — never let the browser fake the rest */
  font-synthesis-weight: none;
  font-synthesis: none;
}

/* Titles: thicken with a stroke instead of a bold weight.
   paint-order keeps the counters clean by drawing fill over stroke. */
.display {
  font-weight: 400;
  paint-order: stroke fill;
  -webkit-text-stroke: var(--stroke, 0.6px) currentColor;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; text-align: left; }
ul, dl { list-style: none; }
img { display: block; max-width: 100%; }

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

.view[hidden] { display: none; }

/* mono label system */
.mono, .label {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  font-weight: 400;
}
.dim   { color: rgba(253, 249, 243, 0.7); }
.amber { color: var(--accent); }

/* copper gradient type — stroked in the accent so it thickens with the
   rest of the title without flattening the gradient underneath */
.amber.gradient, .hero-head .amber {
  background: linear-gradient(90deg, #ff8c00, gold);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  paint-order: stroke fill;
  -webkit-text-stroke: 0.5px #ff8c00;
}

/* film grain overlay */
.grain::after {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(253, 249, 243, 0.04) 1px, transparent 1px);
  background-size: 3px 3px;
  pointer-events: none;
}

/* entrance animation */
@keyframes riseIn { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
.rise { opacity: 0; animation: riseIn 1s var(--ease) forwards; }
.rise-1 { animation-delay: 0.4s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rise { opacity: 1; animation: none; }
}

/* ============================================================
   MASTHEAD — small centred symbol, shared by every view (home
   and project detail alike, since it sits outside both). The
   glyph itself has no background: assets/logo-mark.png is a
   white shape on a transparent field, used purely as a mask so
   an animated sunset gradient shows through the symbol only.
   ============================================================ */
.masthead {
  display: flex;
  justify-content: center;
  padding: 16px 0 0;
}
.logo-mark {
  width: 44px;
  aspect-ratio: 1.9 / 1;
  cursor: pointer;
  -webkit-mask-image: url('../assets/logo-mark.png');
  mask-image: url('../assets/logo-mark.png');
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  background: linear-gradient(115deg, #ff8c00, #ffd27a, #ff5f6d, #ffb84d, #ff8c00);
  background-size: 300% 300%;
  animation: sunsetShift 9s ease-in-out infinite;
}
@keyframes sunsetShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
@media (prefers-reduced-motion: reduce) {
  .logo-mark { animation: none; background-position: 30% 50%; }
}

/* Instagram + knotsss icon links — same sunset-gradient-through-a-mask
   treatment as the masthead logo, just smaller and inline. No border,
   no background box; the icon shape itself is the whole link target. */
.icon-row { display: flex; align-items: center; justify-content: center; gap: 20px; }
.icon-link {
  width: 24px; height: 24px;
  display: block;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
  -webkit-mask-size: contain; mask-size: contain;
  background: linear-gradient(115deg, #ff8c00, #ffd27a, #ff5f6d, #ffb84d, #ff8c00);
  background-size: 300% 300%;
  animation: sunsetShift 9s ease-in-out infinite;
  transition: opacity 0.25s;
}
.icon-link:hover { opacity: 0.75; }
.icon-link.instagram { -webkit-mask-image: url('../assets/icon-instagram.png'); mask-image: url('../assets/icon-instagram.png'); }
.icon-link.knotsss { -webkit-mask-image: url('../assets/logo-knotsss.png'); mask-image: url('../assets/logo-knotsss.png'); }
#hero-icon-row { margin-top: 18px; }
@media (prefers-reduced-motion: reduce) {
  .icon-link { animation: none; background-position: 30% 50%; }
}

/* ============================================================
   TITLE — compact, sits at the very top of the page (no more
   full-viewport centering; the ghost wordmark is now a cropped
   backdrop behind a short header instead of the whole hero).
   ============================================================ */
.hero {
  position: relative;
  overflow: hidden;
  padding: 28px 24px 22px;
  text-align: center;
}
.hero-ghost {
  position: absolute; inset: 0;
  display: flex; align-items: flex-start; justify-content: center;
  pointer-events: none; user-select: none;
}
.hero-ghost span {
  /* raised so its centre lands on the title's centre — the ghost
     scales with viewport width but the title's font-size is capped,
     so this offset has to grow (and go negative) across breakpoints;
     tuned per breakpoint below rather than computed, since exact
     glyph metrics don't match the box model 1:1 */
  transform: translateY(10px);
  font-size: 22vw;
  line-height: 1;
  letter-spacing: -0.05em;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(253, 249, 243, 0.18);
  white-space: nowrap;
}
.hero-copy { position: relative; z-index: 10; max-width: 48rem; margin: 0 auto; }
.hero-head {
  --stroke: 0.5px;
  font-size: 22px;
  line-height: 1.15;
  color: var(--fg);
}
.hero-sub {
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.375;
  color: var(--fg);
  max-width: 20rem;
  margin-left: auto;
  margin-right: auto;
}

/* ============================================================
   PROJECT PREVIEWS — one static (non-scrolling) collage per
   section. The first section is untitled and sits directly under
   the hero; every section after it carries a title (project type,
   by default) in place of the old filter bar. Positions never
   move — tiles just wrap to as many rows as the content needs.
   Content, titles and per-section project order all come from
   content/data.json, edited at /dash.
   ============================================================ */
.archive { display: flex; flex-direction: column; }
.section-block { padding-top: 34px; }
.section-block:first-child { padding-top: 0; }
.section-title {
  margin: 0 var(--pad) 12px;
  font-size: 13px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: rgba(253, 249, 243, 0.7);
}
.collage {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tile {
  flex: 1 1 auto;
  height: clamp(150px, 32vw, 320px);
  display: block;
  overflow: hidden;
  cursor: pointer;
  background: var(--card);
  border: none;
}
.tile img, .tile video {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 0.6s var(--ease), filter 0.6s var(--ease);
  filter: saturate(0.9);
}
.tile:hover img, .tile:focus-visible img,
.tile:hover video, .tile:focus-visible video { transform: scale(1.05); filter: saturate(1.05); }

/* ============================================================
   STUDIO
   ============================================================ */
.studio {
  margin-top: clamp(72px, 16vw, 160px);
  border-top: 1px solid var(--border);
  padding: clamp(48px, 10vw, 96px) var(--pad) 32px;
}
.studio-name {
  --stroke: 1.1px;
  margin-top: 14px;
  font-size: clamp(30px, 8vw, 56px);
  letter-spacing: -0.02em;
  line-height: 1;
  /* same sunset gradient as the masthead logo, via background-clip
     since this is real text rather than a masked shape */
  background: linear-gradient(115deg, #ff8c00, #ffd27a, #ff5f6d, #ffb84d, #ff8c00);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  -webkit-text-stroke-color: #ff8c00;
  animation: sunsetShift 9s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .studio-name { animation: none; background-position: 30% 50%; }
}
.studio-blurb {
  margin-top: 14px;
  font-size: 15px;
  color: var(--muted);
  max-width: 34ch;
}
.studio .label { display: block; margin-top: 40px; }
.disciplines { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.disciplines li { font-size: 15px; color: var(--body); }
.contact { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.contact a, .contact button { font-size: 15px; color: var(--body); transition: color 0.3s var(--ease); }
.contact a:hover, .contact button:hover { color: var(--accent); }

#contact-icon-row { margin-top: 20px; justify-content: flex-start; }

/* ============================================================
   PROJECT DETAIL
   ============================================================ */
.detail-wrap { padding: clamp(28px, 8vw, 72px) var(--pad) clamp(56px, 12vw, 120px); max-width: 900px; margin: 0 auto; }
.back-link { display: inline-flex; align-items: center; gap: 8px; color: rgba(253, 249, 243, 0.7); transition: color 0.3s var(--ease); }
.back-link::before { content: '←'; }
.back-link:hover { color: var(--accent); }

.detail-meta { display: block; margin-top: 40px; }
.detail-title {
  --stroke: 1.2px;
  margin-top: 12px;
  font-size: clamp(32px, 9vw, 64px);
  letter-spacing: -0.02em;
  line-height: 1.02;
  color: var(--fg);
}
.detail-cover {
  margin-top: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
}
.detail-cover img, .detail-cover video { width: 100%; height: auto; display: block; }

.detail-wrap .label { display: block; margin-top: 48px; }

.detail-specs {
  margin-top: 20px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  border-top: 1px solid var(--border);
  padding-top: 20px;
}
.spec dt {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px; letter-spacing: 2.5px; text-transform: uppercase;
  color: rgba(253, 249, 243, 0.7);
}
.spec dd { margin-top: 5px; font-size: 15px; color: var(--body); }

.detail-summary { margin-top: 28px; font-size: clamp(17px, 4.4vw, 22px); line-height: 1.4; color: var(--fg); }
.detail-narrative { margin-top: 18px; font-size: 15px; line-height: 1.65; color: var(--muted); }

/* embedded player for the full piece (YouTube / Vimeo) */
.detail-embed[hidden] { display: none; }
.embed {
  margin-top: 20px;
  aspect-ratio: 16 / 9;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
}
.embed iframe { width: 100%; height: 100%; border: 0; display: block; }

.detail-gallery { margin-top: 28px; display: flex; flex-direction: column; gap: 14px; }
.detail-gallery img, .detail-gallery video { width: 100%; display: block; border: 1px solid var(--border); border-radius: var(--radius); }
.gallery-note {
  margin-top: 20px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px; letter-spacing: 2.5px; text-transform: uppercase;
  color: rgba(253, 249, 243, 0.45);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 22px;
  text-align: center;
}

.back-big {
  --stroke: 0.7px;
  margin-top: 14px;
  font-size: clamp(22px, 6vw, 34px);
  letter-spacing: -0.01em;
  color: var(--fg);
  transition: color 0.3s var(--ease);
}
.back-big:hover { color: var(--accent); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (min-width: 640px) {
  .hero { padding: 36px 24px 28px; }
  .hero-ghost span { transform: translateY(0px); }
  .hero-head { font-size: 36px; }
  .hero-sub { font-size: 16px; max-width: 24rem; }
  .detail-specs { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 900px) {
  .hero-head { font-size: 48px; }
  .hero-ghost span { font-size: 24vw; transform: translateY(-82px); }
}
