@font-face {
  font-family: "Milky Nice";
  src: url("../assets/fonts/MilkyNice-Clean.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #050000;
  --ink-2: #120305;
  --red: #ff1f45;
  --gold-hi: #fff1b0;
  --gold: #ffc83d;
  --gold-lo: #c98a00;
  --text: #f6e9c8;
  --text-dim: #cdb98a;
  --gold-grad: linear-gradient(180deg, var(--gold-hi) 0%, var(--gold) 52%, var(--gold-lo) 100%);
  --nav-h: 4rem;
  --gutter: clamp(1.25rem, 4vw, 4rem);
  --ease: cubic-bezier(.16, 1, .3, 1);
  --display: "Milky Nice", "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 1rem);
  background: var(--ink);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ink);
  color: var(--text);
  font-family: var(--display);
  font-size: 1.0625rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

::selection { background: var(--gold); color: var(--ink); }

html { scrollbar-color: var(--gold-lo) var(--ink); scrollbar-width: thin; }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--ink); }
::-webkit-scrollbar-thumb { background: var(--gold-lo); }

:focus-visible { outline: 3px solid var(--gold-hi); outline-offset: 3px; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- Stage: wave field + pixel canvas ---------- */

.stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.waves { position: absolute; inset: 0; width: 100%; height: 100%; }

#shots {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 40;
  pointer-events: none;
}

/* ---------- Gold ---------- */

.gold {
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--gold);
  filter: drop-shadow(0 2px 10px rgba(255, 200, 61, .35));
  padding-bottom: .08em;
}
@media (prefers-reduced-motion: no-preference) {
  .gold {
    background-image: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, .85) 50%, transparent 62%), var(--gold-grad);
    background-size: 260% 100%, 100% 100%;
    background-repeat: no-repeat;
    background-position: 160% 0, 0 0;
    animation: shine 6.5s ease-in-out infinite, glow 3.2s ease-in-out infinite alternate;
  }
  h2 .gold { animation: none; background-image: var(--gold-grad); background-size: 100% 100%; background-position: 0 0; background-repeat: repeat; filter: none; }
}
@keyframes shine {
  0%, 62% { background-position: 160% 0, 0 0; }
  100%    { background-position: -60% 0, 0 0; }
}
@keyframes glow {
  from { filter: drop-shadow(0 2px 8px rgba(255, 200, 61, .25)); }
  to   { filter: drop-shadow(0 2px 16px rgba(255, 200, 61, .55)); }
}

/* ---------- Nav ---------- */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 var(--gutter);
  background: linear-gradient(180deg, rgba(5, 0, 0, .92) 0%, rgba(5, 0, 0, .55) 60%, rgba(5, 0, 0, 0) 100%);
}
/* once the page scrolls, a solid drawer slides down from the top edge behind the menu text:
   attached to the top, only its bottom corners rounded, as wide as the text it carries */
.nav nav, .nav-brand { position: relative; align-self: stretch; display: flex; align-items: center; }
.nav nav::before, .nav-brand::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 -1.3rem;
  background: var(--ink);
  border: 1px solid rgba(255, 200, 61, .35);
  border-top: 0;
  border-radius: 0 0 1.1rem 1.1rem;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .55);
  transform: translateY(-105%);
  transition: transform .45s var(--ease);
  pointer-events: none;
}
.nav.is-scrolled { background: none; }
.nav.is-scrolled nav::before, .nav.is-scrolled .nav-brand::before { transform: none; }
@media (prefers-reduced-motion: reduce) { .nav nav::before, .nav-brand::before { transition: none; } }

.nav-brand {
  font-size: 1.5rem;
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--gold);
}
.nav ul { display: flex; gap: clamp(1rem, 3vw, 2.5rem); }
.nav nav a {
  display: block;
  padding: .5rem .1rem;
  font-size: 1rem;
  color: var(--text);
  position: relative;
  transition: color .25s var(--ease);
}
.nav nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: .1rem;
  height: 3px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s var(--ease);
}
.nav nav a:hover, .nav nav a[aria-current="true"] { color: var(--gold-hi); }
.nav nav a:hover::after, .nav nav a[aria-current="true"]::after { transform: scaleX(1); }

/* ---------- Layout ---------- */

main { position: relative; z-index: 10; }

.hero {
  min-height: 100svh;
  padding: calc(var(--nav-h) + 2rem) var(--gutter) 3rem;
  display: grid;
  grid-template-columns: minmax(16rem, 30vw) minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(1.5rem, 4vw, 4rem);
}

.hero-portrait { position: relative; }
.hero-portrait img { width: 100%; }
/* damage: a red copy of the artwork fades over it, so only the strokes turn red */
.hero-portrait::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../assets/img/lucalix-portrait.webp") center / 100% 100% no-repeat;
  filter: grayscale(1) brightness(.55) sepia(1) hue-rotate(-52deg) saturate(12) brightness(1.5);
  opacity: 0;
  pointer-events: none;
}
.hero-portrait.is-hit::after { animation: damage .22s ease-out; }
.hero-portrait.is-hit img { animation: recoil .2s ease-out; }
@keyframes damage {
  0%   { opacity: .42; }
  100% { opacity: 0; }
}
@keyframes recoil {
  0%   { transform: translate(-4px, 2px); }
  30%  { transform: translate(3px, -2px); }
  60%  { transform: translate(-2px, 1px); }
  100% { transform: none; }
}

.name {
  width: fit-content;
  font-size: clamp(3.25rem, 9vw, 6rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -.01em;
}
.role {
  margin-top: .9rem;
  font-size: clamp(1.15rem, 2vw, 1.6rem);
  color: var(--text);
}
.tagline {
  margin-top: 1.75rem;
  font-size: clamp(2rem, 3.2vw, 3rem);
  line-height: 1.12;
  text-wrap: balance;
}

.tagline .gold { white-space: nowrap; }

.section {
  padding: clamp(4rem, 9vw, 7rem) var(--gutter);
}
.section-head { margin-bottom: clamp(1.75rem, 4vw, 3rem); }
.section-head h2, .talk {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 400;
  line-height: 1.05;
}
.section-head p {
  margin-top: .5rem;
  color: var(--text-dim);
  font-size: 1.15rem;
}

/* static impact mark: a three-pixel trail after each section title, fading out in size and colour */
.section-head h2, .talk { position: relative; width: fit-content; }
.section-head h2::after, .talk::after {
  content: "";
  position: absolute;
  left: calc(100% + .9rem);
  top: .55em;
  width: 10px; height: 10px;
  margin-top: -5px;
  background: var(--gold-hi);
  box-shadow:
    18px 0 0 -1px var(--gold),
    32px 0 0 -2px var(--gold-lo);
  pointer-events: none;
}

/* tiny recoil on anything a shot lands on (individual `translate`, so hover transforms keep working) */
.nudge { animation: nudge .22s ease-out; }
@keyframes nudge {
  0%   { translate: -1.5px 1px; }
  35%  { translate: 1.2px -.8px; }
  70%  { translate: -.6px .4px; }
  100% { translate: 0 0; }
}
@media (prefers-reduced-motion: reduce) { .nudge { animation: none; } }

/* ---------- Contact buttons ---------- */

.contact-list { display: flex; flex-direction: column; gap: .9rem; }

.btn {
  display: flex;
  align-items: center;
  gap: .9rem;
  width: 100%;
  min-width: 16.5rem;
  min-height: 3.75rem;
  padding: .7rem 1.25rem;
  background: var(--ink);
  color: var(--gold);
  border: 2px solid var(--gold);
  border-radius: 0;
  cursor: pointer;
  text-align: left;
  transition: background-color .25s var(--ease), color .25s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease);
}
.btn .icon { width: 1.6rem; height: 1.6rem; flex: none; }
.btn-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.btn-label { font-size: 1.15rem; }
.btn-value { font-size: .85rem; color: var(--text-dim); overflow-wrap: anywhere; transition: color .25s var(--ease); }
.btn:hover, .btn:focus-visible {
  background: var(--gold);
  color: var(--ink);
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .55);
}
.btn:hover .btn-value, .btn:focus-visible .btn-value { color: #3a2800; }
.btn:active { transform: translateY(0); }

/* ---------- Videos ---------- */

.grid { display: grid; gap: clamp(1rem, 2vw, 1.75rem); }
.grid-long { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-short { grid-template-columns: repeat(3, minmax(0, 17rem)); }

.split {
  display: grid;
  grid-template-columns: minmax(14rem, 24rem) minmax(0, 1fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
}
.split .section-head { margin: 0; }

.video {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  background: #000;
  border: 2px solid var(--gold);
  border-radius: 0;
  overflow: hidden;
  cursor: pointer;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.video-long { aspect-ratio: 16 / 9; }
.video-short { aspect-ratio: 9 / 16; }
.video img, .video iframe, .video video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  border: 0;
}
.video:hover, .video:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, .65), 0 0 0 1px rgba(255, 200, 61, .5);
}
.play {
  position: absolute;
  left: 50%; top: 50%;
  width: 4.25rem; height: 4.25rem;
  margin: -2.125rem 0 0 -2.125rem;
  display: grid; place-items: center;
  background: var(--ink);
  color: var(--gold);
  border: 2px solid var(--gold);
  transition: background-color .25s var(--ease), color .25s var(--ease), transform .35s var(--ease);
}
.play svg { width: 1.75rem; height: 1.75rem; margin-left: .15rem; }
.video:hover .play, .video:focus-visible .play { background: var(--gold); color: var(--ink); transform: scale(1.08); }
.video.is-playing { cursor: default; }
.video.is-playing .play, .video.is-playing img { display: none; }

/* ---------- Contact + footer ---------- */

.contact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2rem 4rem;
  padding-top: clamp(5rem, 12vw, 9rem);
  padding-bottom: clamp(5rem, 12vw, 9rem);
}
.talk { font-size: clamp(3rem, 9vw, 6rem); }
.contact-row { min-width: min(100%, 19rem); }

.foot {
  position: relative; z-index: 10;
  padding: 1.5rem var(--gutter) 2rem;
  font-size: .95rem;
}
.copy { width: 1.05em; height: 1.05em; vertical-align: -.15em; margin-right: .25em; }
.foot p { color: #fff; }

.toast {
  position: fixed;
  left: 50%; bottom: 1.5rem;
  z-index: 60;
  transform: translate(-50%, 140%);
  opacity: 0;
  visibility: hidden;
  padding: .8rem 1.25rem;
  background: var(--gold);
  color: var(--ink);
  border: 2px solid var(--ink);
  transition: transform .4s var(--ease), opacity .3s, visibility .4s;
}
.toast.is-on { transform: translate(-50%, 0); opacity: 1; visibility: visible; }

/* ---------- Scroll reveal: elements slide in as they enter, and slide back out when you scroll up past them ---------- */
/* uses the individual `translate` property, so hover/hit transforms keep working on the same elements */

:root {
  --rv-dur: .95s;
  --rv-dist: 72px;
  --rv-step: .11s;
}
[data-reveal] {
  opacity: 0;
  transition: opacity var(--rv-dur) var(--ease), translate var(--rv-dur) var(--ease);
  transition-delay: calc(var(--rv-step) * var(--n, 0));
  will-change: opacity, translate;
}
[data-reveal="left"]  { translate: calc(var(--rv-dist) * -1.3) 0; }
[data-reveal="right"] { translate: calc(var(--rv-dist) * 1.3) 0; }
[data-reveal="up"]    { translate: 0 calc(var(--rv-dist) * .8); }
[data-reveal="fade"]  { translate: 0 0; }
[data-reveal].is-in   { opacity: 1; translate: 0 0; }
[data-delay="1"] { --n: 1; } [data-delay="2"] { --n: 2; } [data-delay="3"] { --n: 3; }
[data-delay="4"] { --n: 4; } [data-delay="5"] { --n: 5; } [data-delay="6"] { --n: 6; }
@media (max-width: 760px) {
  :root { --rv-dur: .55s; --rv-dist: 32px; --rv-step: .05s; }
}
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; translate: 0 0; transition: none; }
}

/* ---------- Responsive ---------- */

@media (max-width: 1180px) {
  .hero { grid-template-columns: minmax(14rem, 38vw) minmax(0, 1fr); }
  .hero-contact { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
  .hero-contact li { flex: 1 1 15rem; }
  .split { grid-template-columns: 1fr; }
  .split .section-head { margin-bottom: clamp(1.75rem, 4vw, 3rem); }
}

@media (max-width: 760px) {
  :root { --nav-h: 3.5rem; }
  .waves { top: auto; height: 58%; }
  .nav-brand { display: none; }
  .nav { justify-content: center; }
  .nav ul { gap: 1.1rem; }
  .nav nav a { font-size: .9rem; }

  .hero { grid-template-columns: 1fr; padding-top: calc(var(--nav-h) + 1.5rem); }
  .hero-portrait { max-width: 22rem; width: 100%; justify-self: center; }
  .hero-copy { text-align: center; }
  .name { margin-inline: auto; }
  .tagline { margin-inline: auto; }
  .hero-contact li { flex-basis: 100%; }

  .grid-long { grid-template-columns: 1fr; }
  .grid-short {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin-inline: calc(var(--gutter) * -1);
    padding-inline: var(--gutter);
    padding-bottom: .5rem;
    scrollbar-width: none;
    cursor: grab;
    user-select: none;
  }
  .grid-short::-webkit-scrollbar { display: none; }
  .grid-short.is-dragging { cursor: grabbing; scroll-snap-type: none; }
  .grid-short img { pointer-events: none; -webkit-user-drag: none; }
  .grid-short li { flex: 0 0 68vw; max-width: 18rem; scroll-snap-align: center; }
  .grid-short { -webkit-mask-image: linear-gradient(90deg, #000 82%, transparent); mask-image: linear-gradient(90deg, #000 82%, transparent); }

  .contact { grid-template-columns: 1fr; text-align: center; }
  .contact-row { min-width: 0; }
}

@media (max-width: 400px) {
  .nav ul { gap: .75rem; }
  .nav nav a { font-size: .82rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .video, .play, .toast { transition: none; }
}

/* skip link: visible only on keyboard focus */
.skip {
  position: fixed;
  left: 1rem; top: -5rem;
  z-index: 100;
  padding: .7rem 1.1rem;
  background: var(--gold);
  color: var(--ink);
  transition: top .25s var(--ease);
}
.skip:focus { top: 1rem; }
main:focus { outline: none; }
.foot-note { padding: 1rem var(--gutter); color: #fff; }

/* ---------- HUD layer: quiet, looping game-interface details ---------- */

/* viewport corner brackets, with a recording light in the top-left one */
.hud { position: fixed; inset: 0; z-index: 45; pointer-events: none; }
.hud i {
  position: absolute;
  width: 26px; height: 26px;
  border: 0 solid rgba(255, 200, 61, .6);
}
.hud .tl { left: 12px;  top: 12px;    border-width: 2px 0 0 2px; }
.hud .tr { right: 12px; top: 12px;    border-width: 2px 2px 0 0; }
.hud .bl { left: 12px;  bottom: 12px; border-width: 0 0 2px 2px; }
.hud .br { right: 12px; bottom: 12px; border-width: 0 2px 2px 0; }
.hud .tl::after {
  content: "";
  position: absolute;
  left: 7px; top: 7px;
  width: 7px; height: 7px;
  background: var(--red);
  opacity: 0;
}

/* scroll progress as a segmented XP bar along the very top edge */
.xp {
  position: fixed;
  left: 0; top: 0;
  z-index: 70;
  height: 4px;
  width: calc(var(--p, 0) * 100%);
  background: var(--gold-grad);
  -webkit-mask-image: repeating-linear-gradient(90deg, #000 0 10px, transparent 10px 13px);
  mask-image: repeating-linear-gradient(90deg, #000 0 10px, transparent 10px 13px);
  transition: width .15s linear;
}

/* a small indicator light on every contact button */
.btn { position: relative; }
.btn::after {
  content: "";
  position: absolute;
  right: 8px; top: 8px;
  width: 5px; height: 5px;
  background: var(--gold);
  opacity: .55;
}
.btn:hover::after, .btn:focus-visible::after { background: var(--ink); }

/* the portrait gets a scanner pass: a band sweeps down and the strokes under it light up gold */
@property --scan { syntax: "<percentage>"; inherits: false; initial-value: -30%; }
.hero-portrait::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../assets/img/lucalix-portrait.webp") center / 100% 100% no-repeat;
  filter: grayscale(1) brightness(.55) sepia(1) hue-rotate(-12deg) saturate(9) brightness(1.9);
  -webkit-mask-image: linear-gradient(180deg, transparent calc(var(--scan) - 26%), rgba(0, 0, 0, .85) calc(var(--scan) - 2%), #000 var(--scan), transparent calc(var(--scan) + 1.5%));
  mask-image: linear-gradient(180deg, transparent calc(var(--scan) - 26%), rgba(0, 0, 0, .85) calc(var(--scan) - 2%), #000 var(--scan), transparent calc(var(--scan) + 1.5%));
  opacity: 0;
  pointer-events: none;
  z-index: 2;
}

@media (prefers-reduced-motion: no-preference) {
  .hud .tl::after { animation: rec 1.8s steps(1, end) infinite; }

  .btn::after { animation: light 3.2s ease-in-out infinite; }
  .contact-list li:nth-child(2) .btn::after { animation-delay: -1.1s; }
  .contact-list li:nth-child(3) .btn::after { animation-delay: -2.2s; }

  .hero-portrait::before { animation: scan 7s ease-in-out infinite; }

  .play::after {
    content: "";
    position: absolute;
    inset: -2px;
    border: 2px solid var(--gold);
    opacity: 0;
    animation: ping 3.2s ease-out infinite;
  }
  .grid li:nth-child(2) .play::after { animation-delay: -1s; }
  .grid li:nth-child(3) .play::after { animation-delay: -2s; }
  .video:hover .play::after, .video:focus-visible .play::after { animation: none; }

  .section-head h2::after, .talk::after { animation: trail 2.6s ease-in-out infinite; }
}

@keyframes rec { 0%, 55% { opacity: 1; } 56%, 100% { opacity: 0; } }
@keyframes light { 0%, 100% { opacity: .2; } 50% { opacity: .9; } }
@keyframes scan {
  0%   { --scan: -30%; opacity: 0; }
  4%   { opacity: 1; }
  40%  { --scan: 128%; opacity: 1; }
  46%  { --scan: 128%; opacity: 0; }
  100% { --scan: 128%; opacity: 0; }
}
@keyframes ping {
  0%   { opacity: .55; transform: scale(1); }
  70%  { opacity: 0;   transform: scale(1.7); }
  100% { opacity: 0;   transform: scale(1.7); }
}
@keyframes trail {
  0%, 100% { translate: 0 0; opacity: 1; }
  50%      { translate: 7px 0; opacity: .55; }
}

@media (max-width: 760px) {
  .hud i { width: 18px; height: 18px; }
  .hud .tl, .hud .tr { top: 8px; } .hud .bl, .hud .br { bottom: 8px; }
  .hud .tl, .hud .bl { left: 8px; } .hud .tr, .hud .br { right: 8px; }
}

/* ---------- Section titles: typed in letter by letter, undone as you scroll back up ---------- */
@media (prefers-reduced-motion: no-preference) {
  /* each letter carries its own gold (a transformed child cannot borrow its parent's text-clip) */
  h2 .gold.typed {
    background: none;
    -webkit-text-fill-color: initial;
    filter: drop-shadow(0 2px 10px rgba(255, 200, 61, .3));
  }
  .typed .ch {
    display: inline-block;
    background: var(--gold-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--gold);
    opacity: 0;
    translate: 0 .2em;
    transition: opacity .15s ease-in, translate .18s ease-in; /* quick when it undoes */
    padding-bottom: .08em;
  }
  .is-in .typed .ch, .is-in.talk .typed .ch {
    opacity: 1;
    translate: 0 0;
    transition: opacity .28s var(--ease), translate .34s var(--ease);
    transition-delay: calc(var(--i) * 30ms + .08s);
  }
  @media (max-width: 760px) {
    .is-in .typed .ch, .is-in.talk .typed .ch {
      transition: opacity .2s var(--ease), translate .24s var(--ease);
      transition-delay: calc(var(--i) * 20ms + .04s);
    }
  }
}

/* the titles slide in from close by: short travel, short wait */
.section-head[data-reveal="left"], .talk[data-reveal="left"] { translate: calc(var(--rv-dist) * -.5) 0; }
.section-head[data-reveal="left"].is-in, .talk[data-reveal="left"].is-in { translate: 0 0; }
.section-head[data-reveal], .talk[data-reveal] { transition-duration: .5s; }
