/* ============================================================
   DDDYLAN — design system
   Ink (plum) / Volt (chartreuse) / Ember (neon orange)
   Holo hairline = the foil. Used at 1px only. That's the rule.
   ============================================================ */

:root {
  --ink-0: #120b18;
  --ink-1: #1a1022;
  --ink-2: #241631;
  --ink-3: #31203f;
  --volt: #d8ff3a;
  --volt-dim: #a8cc23;
  --ember: #ff5c1f;
  --ember-hot: #ff7a3d;
  --bone: #efe9f6;
  --bone-dim: #b9aecb;
  --gild: #e9cf8e;

  --holo: conic-gradient(
    from var(--holo-a, 140deg),
    #e9cf8e, #ffb1d9, #9ef2ff, #d8ff3a, #ffbe7a, #e9cf8e
  );

  --font-display: "Unbounded", system-ui, sans-serif;
  --font-body: "Instrument Sans", system-ui, sans-serif;
  --font-mono: "Space Mono", ui-monospace, monospace;

  --gutter: clamp(1.25rem, 4vw, 4rem);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --holo-a: 140deg;
}

@property --holo-a {
  syntax: "<angle>";
  inherits: true;
  initial-value: 140deg;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--ink-0);
  color: var(--bone);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video, canvas, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* film grain over everything — matches the shader's printed feel */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: 0.05;
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="240" height="240"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="2"/></filter><rect width="100%25" height="100%25" filter="url(%23n)"/></svg>');
}

::selection { background: var(--volt); color: var(--ink-0); }

:focus-visible {
  outline: 2px solid var(--volt);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- utilities ---------- */
.mono {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bone-dim);
}
.mono.volt { color: var(--volt); }
.mono.ember { color: var(--ember-hot); }

/* Soft dark glow behind dark text on pale surfaces (per brief) */
.shadowed-ink {
  text-shadow: 0 0 24px rgba(18, 11, 24, 0.55), 0 2px 10px rgba(18, 11, 24, 0.35);
}

/* ---------- holo hairline material ----------
   The rare-foil border. 1px conic gradient, angle animated
   by pointer / scroll from JS via --holo-a. */
.holo-line {
  position: relative;
  border-radius: 18px;
  background: var(--ink-1);
}
.holo-line::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--holo);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask-composite: exclude;
  opacity: 0.55;
  transition: opacity 0.4s var(--ease-out);
  pointer-events: none;
}
.holo-line:hover::before { opacity: 1; }

/* ---------- acrylic material ----------
   Diffused semi-transparent panel. Volt or ember tinted. */
.acrylic {
  background: linear-gradient(
    135deg,
    rgba(216, 255, 58, 0.10),
    rgba(216, 255, 58, 0.03) 45%,
    rgba(18, 11, 24, 0.35)
  );
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  backdrop-filter: blur(18px) saturate(1.3);
  border-radius: 18px;
}
.acrylic.ember-tint {
  background: linear-gradient(
    135deg,
    rgba(255, 92, 31, 0.12),
    rgba(255, 92, 31, 0.03) 45%,
    rgba(18, 11, 24, 0.35)
  );
}

/* ---------- reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}
.reveal.is-in { opacity: 1; transform: none; }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.4rem 0.5rem;
  border-radius: 999px;
}
.nav::before { border-radius: 999px; }
.nav .brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.9rem 0.35rem 0.6rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
}
.nav .brand svg { width: 26px; height: 14px; }
.nav a.link {
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bone-dim);
  transition: color 0.3s, background 0.3s;
}
.nav a.link:hover { color: var(--ink-0); background: var(--volt); }
.nav a.link.hot:hover { background: var(--ember); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-items: end;
  overflow: hidden;
}
.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-media canvas,
.hero-media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-media::after {
  /* plum vignette so type always reads */
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 90% at 50% 10%, transparent 40%, rgba(18,11,24,0.55) 100%),
    linear-gradient(to top, rgba(18,11,24,0.9), transparent 45%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 0 var(--gutter) clamp(2rem, 6vh, 5rem);
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3.2rem, 13vw, 12rem);
  line-height: 0.92;
  letter-spacing: -0.02em;
  color: var(--bone);
  text-transform: uppercase;
}
.hero-title .infinity-inline {
  display: inline-block;
  width: 0.92em;
  height: 0.5em;
  vertical-align: baseline;
  transform: translateY(0.04em);
}
.hero-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
}
.hero-sub .tag { max-width: 34ch; }

.scroll-hint {
  position: relative;
  padding-bottom: 0.5rem;
}
.scroll-hint::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, var(--volt), var(--ember));
  transform-origin: left;
  animation: hint 2.6s var(--ease-out) infinite;
}
@keyframes hint {
  0% { transform: scaleX(0); opacity: 1; }
  55% { transform: scaleX(1); opacity: 1; }
  100% { transform: scaleX(1); opacity: 0; }
}

/* ============================================================
   MARQUEE
   ============================================================ */
.marquee {
  position: relative;
  overflow: hidden;
  padding: 1.1rem 0;
  border-top: 1px solid rgba(233, 207, 142, 0.18);
  border-bottom: 1px solid rgba(233, 207, 142, 0.18);
  background: var(--ink-1);
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 32s linear infinite;
}
.marquee-track > span { padding-right: 3rem; }
.marquee-track span {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 0.95rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bone-dim);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 3rem;
}
.marquee-track svg { width: 30px; height: 16px; flex: none; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ============================================================
   SECTIONS — shared header
   ============================================================ */
.section { padding: clamp(5rem, 12vh, 9rem) var(--gutter); }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: clamp(2.5rem, 6vh, 4.5rem);
}
.section-head h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.8rem, 4.5vw, 3.4rem);
  letter-spacing: -0.01em;
  text-transform: uppercase;
}
.section-head h2 em {
  font-style: normal;
  color: var(--volt);
}

/* ============================================================
   WORK
   ============================================================ */
.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(1rem, 2.5vw, 2rem);
}
.work-card {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 18px;
}
.work-card .media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 18px 18px 0 0;
  background: var(--ink-2);
}
.work-card .media img,
.work-card .media video,
.work-card .media canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  transition: transform 1.2s var(--ease-out);
}
.work-card:hover .media img,
.work-card:hover .media video,
.work-card:hover .media canvas { transform: scale(1.07); }

.work-card .meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.25rem 1.25rem;
}
.work-card .meta h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1rem, 1.8vw, 1.35rem);
}
.work-card.dormant { opacity: 0.55; }
.work-card.dormant .media {
  display: grid;
  place-items: center;
}
.work-card.dormant .media .pulse {
  width: 54px;
  height: 28px;
  color: var(--volt-dim);
  animation: pulse 3s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.25; } }

/* ============================================================
   SCRUB FIELD — videos driven by scroll
   ============================================================ */
.scrub-wide {
  position: relative;
  height: 300vh; /* scroll runway */
}
.scrub-wide .sticky {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.scrub-wide .frame {
  position: relative;
  width: min(92vw, 1400px);
  aspect-ratio: 21 / 9;
  overflow: hidden;
  border-radius: 22px;
}
.scrub-wide .frame video,
.scrub-wide .frame canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.scrub-wide .frame .overlay-word {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 2;
  mix-blend-mode: screen;
}
.scrub-wide .frame .overlay-word span {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.4rem, 8vw, 7rem);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--volt);
  opacity: 0.9;
}
.scrub-wide .progress {
  position: absolute;
  left: 50%;
  bottom: 6vh;
  transform: translateX(-50%);
  width: min(60vw, 420px);
  height: 1px;
  background: rgba(239, 233, 246, 0.15);
}
.scrub-wide .progress i {
  position: absolute;
  inset: 0;
  transform-origin: left;
  transform: scaleX(var(--p, 0));
  background: var(--ember);
}

.scrub-grid-section { padding: 0 var(--gutter) clamp(5rem, 12vh, 9rem); }
.scrub-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(0.8rem, 2vw, 1.5rem);
}
.scrub-cell {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 16px;
  background: var(--ink-2);
}
.scrub-cell video,
.scrub-cell canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.scrub-cell .idx {
  position: absolute;
  top: 0.75rem;
  left: 0.85rem;
  z-index: 2;
}
/* hero infinity draws itself on load — the identity moment */
.infinity-inline path {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: draw-in 2.2s var(--ease-out) 0.4s forwards;
}
@keyframes draw-in { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  .infinity-inline path { animation: none; stroke-dashoffset: 0; }
}

/* ============================================================
   GALLERY
   ============================================================ */
.gallery-grid {
  columns: 3;
  column-gap: clamp(0.8rem, 2vw, 1.5rem);
}
.gallery-item {
  position: relative;
  margin-bottom: clamp(0.8rem, 2vw, 1.5rem);
  overflow: hidden;
  border-radius: 16px;
  break-inside: avoid;
  background: var(--ink-2);
}
.gallery-item img, .gallery-item canvas { width: 100%; height: auto; }
.gallery-item canvas { aspect-ratio: var(--ar, 1); }

/* ============================================================
   SIGNAL (about) + CONTACT
   ============================================================ */
.signal {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}
.signal .statement {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.3rem, 2.6vw, 2.1rem);
  line-height: 1.35;
}
.signal .statement b { font-weight: 700; color: var(--volt); }
.signal .statement i { font-style: normal; color: var(--ember-hot); }
.signal-spec {
  display: grid;
  gap: 0.9rem;
  padding: clamp(1.5rem, 3vw, 2.5rem);
}
.signal-spec .row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px dashed rgba(233, 207, 142, 0.2);
}
.signal-spec .row:last-child { border: 0; padding-bottom: 0; }

.contact {
  position: relative;
  padding: clamp(6rem, 16vh, 11rem) var(--gutter) clamp(3rem, 8vh, 5rem);
  text-align: center;
  overflow: hidden;
}
.contact .big-infinity {
  width: min(46vw, 420px);
  margin: 0 auto 2rem;
  color: var(--volt);
}
.contact h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.6rem, 4.5vw, 3.4rem);
  text-transform: uppercase;
  margin-bottom: 2rem;
}
.contact .cta {
  display: inline-block;
  padding: 1rem 2.4rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-0);
  background: var(--volt);
  transition: background 0.3s, transform 0.4s var(--ease-out);
}
.contact .cta:hover { background: var(--ember); transform: translateY(-3px); }
.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: clamp(4rem, 10vh, 7rem);
}

/* ============================================================
   GUIDE PAGE
   ============================================================ */
.guide-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 9rem var(--gutter) 6rem;
}
.guide-wrap h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 6vw, 3.6rem);
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}
.guide-wrap h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.3rem;
  margin: 3.5rem 0 1rem;
  color: var(--volt);
}
.guide-wrap p { color: var(--bone-dim); max-width: 65ch; margin-bottom: 1rem; }
.guide-wrap p strong { color: var(--bone); }
.guide-wrap code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--ember-hot);
  background: var(--ink-2);
  padding: 0.1em 0.4em;
  border-radius: 6px;
}
.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  margin: 1.25rem 0 0.5rem;
}
.spec-table th {
  text-align: left;
  text-transform: uppercase;
  color: var(--volt);
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid rgba(233, 207, 142, 0.3);
}
.spec-table td {
  padding: 0.6rem 0.75rem;
  color: var(--bone-dim);
  border-bottom: 1px dashed rgba(233, 207, 142, 0.15);
  vertical-align: top;
}
.spec-table td:first-child { color: var(--ember-hot); white-space: nowrap; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .work-grid { grid-template-columns: 1fr; }
  .scrub-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid { columns: 2; }
  .signal { grid-template-columns: 1fr; }
  .scrub-wide .frame { aspect-ratio: 4 / 5; width: 92vw; }
}
@media (max-width: 560px) {
  .nav a.link { padding: 0.45rem 0.6rem; }
  .nav .brand span { display: none; }
  .scrub-grid { grid-template-columns: 1fr; }
  .gallery-grid { columns: 1; }
  .hero-title { font-size: 9.5vw; } /* Unbounded is wide — keep EVERYTHING on one line */
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .marquee-track { animation: none; }
  .scroll-hint::after { animation: none; transform: scaleX(1); }
  .reveal { opacity: 1; transform: none; transition: none; }
  .work-card .media img,
  .work-card .media video,
  .work-card .media canvas { transition: none; }
}
