/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  --bg: #F3F1EC;
  --surface: #ECEAE4;
  --surface-2: #E4E2DA;
  --surface-3: #DDDAD1;
  --gold: #C8913A;
  --gold-text: #8A5E10;
  --gold-dim: rgba(138,94,16,0.08);
  --gold-border: rgba(138,94,16,0.25);
  --text: #17150F;
  --text-muted: #4A4742;
  --text-dim: #6B6560;
  --border: #D0CCC3;
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'Space Mono', 'Courier New', monospace;
  --ease-expo: cubic-bezier(0.16,1,0.3,1);
  --ease-in-out: cubic-bezier(0.4,0,0.2,1);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1rem;
  line-height: 1.6;
  overflow-x: clip; /* clip, not hidden — hidden creates a scroll container that breaks position:sticky */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ============================================================
   TYPOGRAPHY UTILITIES
   ============================================================ */
.mono {
  font-family: var(--font-mono);
  letter-spacing: 0.1em;
  font-size: 0.65rem;
  text-transform: uppercase;
}
.gold { color: var(--gold-text); }
.muted { color: var(--text-muted); }

/* ============================================================
   LAYOUT
   ============================================================ */
.container {
  width: 100%;
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ============================================================
   CORNER BRACKET MOTIF
   ============================================================ */
.bracketed { position: relative; }
.bracketed::before,
.bracketed::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-color: var(--gold-border);
  border-style: solid;
  transition: border-color 0.3s ease, width 0.3s ease, height 0.3s ease;
  pointer-events: none;
}
.bracketed::before { top: 0; left: 0; border-width: 1.5px 0 0 1.5px; }
.bracketed::after  { bottom: 0; right: 0; border-width: 0 1.5px 1.5px 0; }
.bracketed:hover::before,
.bracketed:hover::after { border-color: var(--gold-text); width: 22px; height: 22px; }

/* ============================================================
   IMAGE PLACEHOLDERS
   ============================================================ */
.img-ph {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2rem;
  background: var(--surface-2);
  border: 1px dashed var(--border);
  min-height: 200px;
}
.img-ph-icon {
  width: 32px;
  height: 32px;
  color: #B8B4AB;
}
.img-ph-text {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.1em;
  color: #9B9690;
  text-align: center;
  line-height: 1.7;
  white-space: pre-line;
}

/* ============================================================
   INTRO OVERLAY
   ============================================================ */

body.intro-active { overflow: hidden; }

#intro {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #F3F1EC;
  overflow: hidden;
  transition: opacity 0.25s ease;
  /* nudge tuna's final-frame resting position to screen center */
  --tuna-offset-x: 0%;
  --tuna-offset-y: 0%;
}
#intro.gone { display: none; }

.intro-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: translate(var(--tuna-offset-x), var(--tuna-offset-y));
  transform-origin: center center;
  transition: opacity 0.25s ease;
}

/* Site reveals via a clip-path circle growing from screen center */
#site-wrap {
  clip-path: circle(0vmax at 50% 50%);
}
#site-wrap.revealing {
  clip-path: circle(200vmax at 50% 50%);
  transition: clip-path 1.0s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
#site-wrap.revealed {
  clip-path: none;
}

/* Center bloom: seeds the ripple at splash moment */
.intro-bloom {
  position: absolute;
  top: 50%;
  left: 50%;
  margin-left: -50px;
  margin-top: -50px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200,145,58,0.65) 0%, rgba(138,94,16,0.22) 40%, transparent 70%);
  opacity: 0;
  will-change: transform, opacity;
}
.intro-bloom.splashed { animation: iBloom 0.7s ease-out forwards; }
@keyframes iBloom {
  0%   { transform: translateZ(0) scale(0.05); opacity: 1; }
  100% { transform: translateZ(0) scale(4);    opacity: 0; }
}

/* Water ripple rings: live outside #intro so they linger as the site reveals */
#splash-rings {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 999;
  pointer-events: none;
  filter: blur(1.5px);
}
.intro-ring {
  position: absolute;
  top: -40px;
  left: -40px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  opacity: 0;
  will-change: transform, opacity;
}
#splash-rings.splashed .r1 { border: 5px solid rgba(138, 94, 16, 0.35); animation: iRing 2.2s cubic-bezier(0,0,0.28,1) forwards   0ms; }
#splash-rings.splashed .r2 { border: 3px solid rgba(60,  96,115, 0.25); animation: iRing 2.4s cubic-bezier(0,0,0.28,1) forwards 140ms; }
#splash-rings.splashed .r3 { border: 5px solid rgba(200,145, 58, 0.28); animation: iRing 2.2s cubic-bezier(0,0,0.28,1) forwards 280ms; }
#splash-rings.splashed .r4 { border: 3px solid rgba(75, 100,118, 0.20); animation: iRing 2.5s cubic-bezier(0,0,0.28,1) forwards 420ms; }
#splash-rings.splashed .r5 { border: 4px solid rgba(178,142, 78, 0.18); animation: iRing 2.3s cubic-bezier(0,0,0.28,1) forwards 560ms; }
#splash-rings.splashed .r6 { border: 2px solid rgba(85, 110,125, 0.14); animation: iRing 2.6s cubic-bezier(0,0,0.28,1) forwards 700ms; }
@keyframes iRing {
  0%   { transform: translateZ(0) scale(1);  opacity: 0; }
  5%   { opacity: 1; }
  100% { transform: translateZ(0) scale(15); opacity: 0; }
}

/* Three-element parabolic hop ─────────────────────────────── */
/*
   Anchor at screen center (50%, 50%) = the landing / splash point.
   tunaX: -6vw → 0  (linear, constant horizontal velocity)
   tunaY: 0 → -5vh → 0  (ease-out rise, ease-in fall = parabolic)
   tunaRot: ±15° nose tilt tracking the tangent; scaleX(-1) faces fish right

   animation-iteration-count: infinite — JS stops the loop via .landed class
   at an animationiteration boundary when the fish is invisible (opacity: 0).
*/
.intro-tuna {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}
.intro-tuna.landed { opacity: 0 !important; }

.intro-tuna-x {
  position: absolute;
  top: 50%;
  left: 50%;
  will-change: transform;
  animation: tunaX 0.7s linear infinite;
}
.intro-tuna-y {
  margin-left: -40px;
  margin-top: -20px;
  will-change: transform;
  animation: tunaY 0.7s linear infinite;
}
.intro-tuna-img {
  width: 80px;
  display: block;
  opacity: 0;           /* hidden at rest; animation ramps opacity in */
  will-change: transform, opacity;
  animation: tunaRot 0.7s linear infinite;
}

/* Horizontal: linear left-to-center travel each hop */
@keyframes tunaX {
  0%   { transform: translate3d(-6vw, 0, 0); }
  92%  { transform: translate3d(0,    0, 0); }
  100% { transform: translate3d(0,    0, 0); }
}

/* Vertical: ease-out rise, ease-in fall, brief submerge */
@keyframes tunaY {
  0% {
    transform: translate3d(0, 0, 0);
    animation-timing-function: ease-out;
  }
  50% {
    transform: translate3d(0, -5vh, 0);
    animation-timing-function: ease-in;
  }
  92% {
    transform: translate3d(0, 0, 0);
    animation-timing-function: linear;
  }
  100% { transform: translate3d(0, 1vh, 0); }
}

/* Rotation: +15° = nose UP (scaleX-1 inverts visual direction) */
@keyframes tunaRot {
  0%   { transform: scaleX(-1) rotate(15deg);  opacity: 0; }
  6%   { transform: scaleX(-1) rotate(15deg);  opacity: 1; }
  50%  { transform: scaleX(-1) rotate(0deg);   opacity: 1; }
  92%  { transform: scaleX(-1) rotate(-15deg); opacity: 1; }
  96%  { transform: scaleX(-1) rotate(-15deg); opacity: 0; }
  100% { transform: scaleX(-1) rotate(-15deg); opacity: 0; }
}

@media (max-width: 640px) {
  .intro-tuna-img { width: 52px; }
  .intro-tuna-y { margin-left: -26px; margin-top: -13px; }
}

.intro-skip {
  position: absolute;
  bottom: 2rem;
  right: 2rem;
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s;
}
.intro-skip:hover { color: var(--gold-text); }

/* ============================================================
   NAV
   ============================================================ */
#nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.6rem 2rem;
  transition: background 0.3s ease, padding 0.3s ease, border-color 0.3s ease;
  border-bottom: 1px solid transparent;
}
#nav.scrolled {
  background: rgba(243,241,236,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 1rem 2rem;
  border-color: var(--border);
}

.nav-name {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: var(--text);
  transition: color 0.2s;
}
.nav-name:hover { color: var(--gold-text); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}
.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.nav-resume {
  color: var(--gold-text);
  border: 1px solid var(--gold-border);
  padding: 0.35rem 0.8rem;
  transition: background 0.2s, border-color 0.2s;
}
.nav-links a.nav-resume:hover {
  background: var(--gold-dim);
  border-color: var(--gold-text);
}

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
}
.nav-hamburger span {
  width: 22px; height: 1.5px;
  background: var(--text);
  transition: all 0.3s ease;
  display: block;
}
.nav-hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

@media (max-width: 640px) {
  .nav-hamburger { display: flex; }
  .nav-links {
    display: none;
    position: fixed;
    inset: 62px 0 0;
    background: var(--bg);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
    z-index: 490;
  }
  .nav-links.open { display: flex; }
  .nav-links a { font-size: 0.75rem; }
}

/* ============================================================
   HERO
   ============================================================ */
#hero {
  position: sticky;
  top: 0;
  height: 100svh;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8rem 2rem 6rem;
  overflow: hidden;
}

/* ── HERO AMBIENT RIPPLE ──────────────────────────────── */
#hero-ripple {
  position: absolute;
  top: 50%;
  left: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(1.5px);
  transition: opacity 1.5s ease;
}
#hero-ripple.ambient { opacity: 0.65; }
.pulse-slot {
  position: absolute;
  top: 0;
  left: 0;
}
.pulse-bloom {
  position: absolute;
  top: -50px;
  left: -50px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200,145,58,0.50) 0%, rgba(138,94,16,0.18) 40%, transparent 70%);
  opacity: 0;
  will-change: transform, opacity;
}
.pulse-slot.firing .pulse-bloom { animation: iBloom 0.7s ease-out forwards; }
.pulse-ring {
  position: absolute;
  top: -40px;
  left: -40px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  opacity: 0;
  will-change: transform, opacity;
}
.pulse-slot.firing .r1 { border: 5px solid rgba(138, 94, 16, 0.28); animation: iRing 2.2s cubic-bezier(0,0,0.28,1) forwards   0ms; }
.pulse-slot.firing .r2 { border: 3px solid rgba(60,  96,115, 0.20); animation: iRing 2.4s cubic-bezier(0,0,0.28,1) forwards 140ms; }
.pulse-slot.firing .r3 { border: 5px solid rgba(200,145, 58, 0.22); animation: iRing 2.2s cubic-bezier(0,0,0.28,1) forwards 280ms; }
.pulse-slot.firing .r4 { border: 3px solid rgba(75, 100,118, 0.16); animation: iRing 2.5s cubic-bezier(0,0,0.28,1) forwards 420ms; }
.pulse-slot.firing .r5 { border: 4px solid rgba(178,142, 78, 0.14); animation: iRing 2.3s cubic-bezier(0,0,0.28,1) forwards 560ms; }
.pulse-slot.firing .r6 { border: 2px solid rgba(85, 110,125, 0.11); animation: iRing 2.6s cubic-bezier(0,0,0.28,1) forwards 700ms; }

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 1300px;
  width: 100%;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.35em;
  color: var(--gold-text);
  margin-bottom: 2.5rem;
  display: block;
}

.hero-name {
  font-size: clamp(3.2rem, 11vw, 14.5rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 0.88;
  color: var(--text);
  margin-bottom: 2.5rem;
}

.hero-sub {
  font-family: var(--font-mono);
  font-size: clamp(0.6rem, 1.4vw, 0.85rem);
  letter-spacing: 0.2em;
  color: var(--text-muted);
  margin-bottom: 3.5rem;
  display: block;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 2.2rem;
  background: var(--gold);
  color: #000;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  transition: background 0.2s, transform 0.2s;
}
.btn-primary:hover { background: #b07a28; transform: translateY(-2px); }

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 2.2rem;
  border: 1px solid var(--gold-border);
  color: var(--gold-text);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}
.btn-outline:hover { background: var(--gold-dim); border-color: var(--gold-text); transform: translateY(-2px); }

.hero-scroll {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  animation: scrollBob 2.5s ease-in-out infinite;
}
.hero-scroll span {
  font-family: var(--font-mono);
  font-size: 0.5rem;
  letter-spacing: 0.2em;
  color: var(--text-muted);
}
.hero-scroll-line {
  width: 1px;
  height: 36px;
  background: linear-gradient(to bottom, var(--gold-border), transparent);
}
@keyframes scrollBob {
  0%,100% { transform: translateX(-50%) translateY(0); opacity: 0.6; }
  50%      { transform: translateX(-50%) translateY(6px); opacity: 1; }
}

/* ============================================================
   SECTION DIVIDERS
   ============================================================ */
.sec-div {
  position: relative;
  z-index: 1;
  background: var(--bg);
  padding: 5rem 2rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: baseline;
  gap: 1.2rem;
  overflow: hidden;
  max-width: calc(1300px + 4rem);
  margin: 0 auto;
}
.sec-div-word {
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 0.88;
  white-space: nowrap;
  color: var(--text);
}
.sec-div-slash { color: var(--gold); }
.sec-div-sub {
  font-family: var(--font-mono) !important;
  font-size: 0.6rem !important;
  font-weight: 400 !important;
  letter-spacing: 0.2em !important;
  line-height: 1 !important;
  color: var(--text-muted) !important;
  align-self: flex-end;
  margin-bottom: 0.8rem;
}

/* ============================================================
   WORK / PROJECT CARDS
   ============================================================ */

#work {
  position: relative;
  z-index: 1;
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding-top: 5rem;
  padding-bottom: 8rem;
  scroll-margin-top: 80px;
}

/* Section heading row */
.work-head {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}
.work-h-title {
  font-size: clamp(1.75rem, 4.5vw, 3.25rem);
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
  color: var(--text);
  letter-spacing: -0.02em;
}
.work-h-slash { color: var(--gold); }
.work-h-meta {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Two-column grid, single column below 768 px */
.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.5rem;
}
@media (max-width: 767px) {
  .work-grid { grid-template-columns: 1fr; }
}

/* Card: full flex column, no background */
.project-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  outline-offset: 3px;
}
.project-card:focus-visible { outline: 2px solid var(--gold-text); }

/* Media frame: portrait 4/5, hairline border, off-white bg */
.card-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 6px;
  border: 1px solid #DDD9CF;
  background: #F3F1EC;
  flex-shrink: 0;
}

/* Both images fill the frame; only one visible at a time */
.card-default,
.card-hover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  transition: opacity 0.4s ease;
}
.card-default { opacity: 1; }
.card-hover   { opacity: 0; }

.project-card:hover .card-default,
.project-card.tapped .card-default { opacity: 0; }
.project-card:hover .card-hover,
.project-card.tapped .card-hover   { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .card-default, .card-hover { transition: none; }
}

/* Touch/no-hover: show default image unless card is tapped */
@media (hover: none) and (pointer: coarse) {
  .project-card:not(.tapped) .card-default { opacity: 1 !important; }
  .project-card:not(.tapped) .card-hover   { opacity: 0 !important; }
}

/* "HOVER — X VIEW" chip, top-right; hides on hover */
.card-hover-chip {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 10;
  background: rgba(243, 241, 236, 0.9);
  border: 1px solid #DDD9CF;
  border-radius: 3px;
  padding: 0.25rem 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.5rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  pointer-events: none;
  transition: opacity 0.3s;
}
.project-card:hover .card-hover-chip { opacity: 0; }

/* Text below the frame */
.card-body { padding: 1.5rem 0 0; }

.card-meta {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.75rem;
}
.card-num {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  color: var(--gold-text);
}
.card-tag {
  font-family: var(--font-mono);
  font-size: 0.5rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 0.18rem 0.5rem;
}
.card-title {
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 0.65rem;
  color: var(--text);
}
.card-desc {
  font-size: 0.875rem;
  color: var(--text-dim);
  line-height: 1.7;
  margin-bottom: 1.4rem;
}
.card-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  color: var(--gold-text);
  border-bottom: 1px solid var(--gold-border);
  padding-bottom: 2px;
  transition: border-color 0.2s;
}
.project-card:hover .card-cta { border-color: var(--gold-text); }

/* ============================================================
   ABOUT
   ============================================================ */
#about { position: relative; z-index: 1; background: var(--bg); padding: 2rem 2rem 8rem; }

.about-grid {
  max-width: 1300px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 6rem;
  align-items: start;
}
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; gap: 3.5rem; }
}

.about-text p {
  font-size: 1rem;
  color: var(--text-dim);
  line-height: 1.85;
  margin-bottom: 1.4rem;
}
.about-text p strong { color: var(--text); font-weight: 500; }
.about-text p em { color: var(--gold-text); font-style: normal; }

.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  margin-top: 2.5rem;
}
.stat {
  padding: 1.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.stat::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 2px; height: 100%;
  background: var(--gold);
}
.stat-val {
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 0.3rem;
}
.stat-lbl {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.about-portrait { position: relative; }
.portrait-box {
  aspect-ratio: 3/4;
  background: var(--surface-2);
  border: 1px solid var(--border);
  overflow: hidden;
  position: relative;
}
.portrait-box img { width: 100%; height: 100%; object-fit: cover; }
.portrait-caption {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 0.6rem 1rem;
  background: rgba(243,241,236,0.92);
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.15em;
  color: var(--gold-text);
}

/* ============================================================
   SKILLS
   ============================================================ */
#skills { position: relative; z-index: 1; background: var(--bg); padding: 2rem 2rem 8rem; }

.skills-grid {
  max-width: 1300px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2px;
}

.skill-group {
  padding: 2.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: border-color 0.3s;
}
.skill-group:hover { border-color: var(--gold-border); }

.skill-group-meta {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.2em;
  color: var(--gold-text);
  margin-bottom: 0.5rem;
}
.skill-group-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--border);
}

.skill-list { list-style: none; display: flex; flex-direction: column; gap: 0.7rem; }
.skill-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--text-dim);
}
.skill-list li::before {
  content: '';
  width: 3px; height: 3px;
  background: var(--gold);
  flex-shrink: 0;
}

/* ============================================================
   CONTACT
   ============================================================ */
#contact {
  position: relative;
  z-index: 1;
  background: var(--bg);
  padding: 2rem 2rem 8rem;
  border-top: 1px solid var(--border);
}
.contact-inner {
  max-width: 1300px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6rem;
  align-items: center;
}
@media (max-width: 768px) {
  .contact-inner { grid-template-columns: 1fr; gap: 3rem; }
}

.contact-heading {
  font-size: clamp(2.5rem, 5vw, 5.5rem);
  font-weight: 700;
  line-height: 0.95;
  margin-bottom: 1.5rem;
}
.contact-heading em { color: var(--gold-text); font-style: normal; }
.contact-sub {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.75;
}

.contact-stack { display: flex; flex-direction: column; gap: 2px; }

.contact-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: border-color 0.2s, background 0.2s;
  text-decoration: none;
}
.contact-item:hover { border-color: var(--gold-border); background: var(--gold-dim); }

.contact-item-left { flex: 1; }
.contact-item-lbl {
  font-family: var(--font-mono);
  font-size: 0.52rem;
  letter-spacing: 0.16em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}
.contact-item-val { font-size: 0.95rem; color: var(--text); }

.contact-item-right { display: flex; align-items: center; gap: 0.75rem; }
.contact-arrow {
  color: var(--gold-text);
  font-size: 1.1rem;
  transition: transform 0.2s;
}
.contact-item:hover .contact-arrow { transform: translate(3px,-3px); }

.copy-btn {
  background: none;
  border: 1px solid var(--gold-border);
  padding: 0.3rem 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.5rem;
  letter-spacing: 0.1em;
  color: var(--gold-text);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.copy-btn:hover { background: var(--gold-dim); border-color: var(--gold-text); }
.copy-btn.copied { color: #2d8a4a; border-color: #2d8a4a; }

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  position: relative;
  z-index: 1;
  background: var(--bg);
  padding: 5rem 2rem 3rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  text-align: center;
}
.footer-logo { width: 180px; opacity: 0.55; transition: opacity 0.3s; }
.footer-logo:hover { opacity: 0.9; }
.footer-lockup {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  color: var(--text-muted);
}
.footer-links { display: flex; gap: 2rem; }
.footer-links a {
  font-family: var(--font-mono);
  font-size: 0.52rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--gold-text); }

/* ============================================================
   SCROLL REVEAL
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--ease-expo), transform 0.7s var(--ease-expo);
}
.reveal.visible { opacity: 1; transform: none; }
.reveal-d1 { transition-delay: 0.1s; }
.reveal-d2 { transition-delay: 0.2s; }
.reveal-d3 { transition-delay: 0.3s; }
.reveal-d4 { transition-delay: 0.4s; }

/* ============================================================
   PROJECT PAGES — SHARED
   ============================================================ */
.proj-hero {
  position: relative;
  min-height: 72vh;
  display: flex;
  align-items: flex-end;
  padding: 9rem 2rem 4rem;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.proj-hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  overflow: hidden;
  opacity: 0.07;
}
.proj-hero-bg img { height: 100%; width: auto; object-fit: contain; }

.proj-hero-content {
  position: relative;
  z-index: 1;
  max-width: 1300px;
  width: 100%;
  margin: 0 auto;
}
.proj-breadcrumb {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  margin-bottom: 2rem;
}
.proj-breadcrumb a { color: var(--gold-text); }
.proj-breadcrumb a:hover { text-decoration: underline; }

.proj-title {
  font-size: clamp(2.5rem, 6.5vw, 8rem);
  font-weight: 700;
  line-height: 0.92;
  margin-bottom: 2rem;
}

.tag-row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 2rem; }
.tag {
  font-family: var(--font-mono);
  font-size: 0.52rem;
  letter-spacing: 0.1em;
  padding: 0.22rem 0.6rem;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.tag-gold { border-color: var(--gold-border); color: var(--gold-text); }

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.32rem 0.85rem;
  background: rgba(138,94,16,0.08);
  border: 1px solid rgba(138,94,16,0.28);
  font-family: var(--font-mono);
  font-size: 0.52rem;
  letter-spacing: 0.1em;
  color: #8A5E10;
}
.status-dot {
  width: 5px; height: 5px;
  background: #8A5E10;
  border-radius: 50%;
  animation: pulseDot 2s ease-in-out infinite;
}
@keyframes pulseDot { 0%,100% { opacity:1; } 50% { opacity:0.25; } }

/* section blocks */
.sec-block {
  padding: 5rem 2rem;
  border-bottom: 1px solid var(--border);
}
.sec-block-inner {
  max-width: 1300px;
  margin: 0 auto;
}
.sec-lbl {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.22em;
  color: var(--gold-text);
  margin-bottom: 2.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.sec-lbl::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* system at a glance */
.sys-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 2px;
}
.sys-cell {
  padding: 1.6rem;
  background: var(--surface);
  border: 1px solid var(--border);
}
.sys-cell-lbl {
  font-family: var(--font-mono);
  font-size: 0.52rem;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}
.sys-cell-val { font-size: 0.95rem; font-weight: 600; color: var(--text); }
.sys-cell-sub { font-size: 0.72rem; color: var(--text-dim); margin-top: 0.15rem; }

/* architecture */
.arch-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: start;
}
@media (max-width: 900px) { .arch-grid { grid-template-columns: 1fr; gap: 2.5rem; } }

.arch-text p { font-size: 0.9rem; color: var(--text-dim); line-height: 1.85; margin-bottom: 1.2rem; }

.arch-nodes { display: flex; flex-direction: column; gap: 2px; }
.arch-node {
  display: grid;
  grid-template-columns: 80px 1fr;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
}
.arch-node-key {
  font-family: var(--font-mono);
  font-size: 0.52rem;
  letter-spacing: 0.12em;
  color: var(--gold-text);
}
.arch-node-val { font-size: 0.875rem; color: var(--text); }

/* ============================================================
   HOTSPOTS
   ============================================================ */
.hotspot-wrap { position: relative; display: inline-block; width: 100%; }
.hotspot-board { width: 100%; display: block; border: 1px solid var(--border); }

.hotspot-pt {
  position: absolute;
  transform: translate(-50%,-50%);
  z-index: 10;
  cursor: pointer;
}
.hotspot-dot {
  width: 13px; height: 13px;
  background: var(--gold);
  border-radius: 50%;
  position: relative;
  transition: transform 0.2s;
}
.hotspot-dot::before {
  content: '';
  position: absolute;
  inset: -4px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  opacity: 0.4;
  animation: hRing 2.2s ease-out infinite;
}
@keyframes hRing { 0% { transform:scale(1); opacity:0.6; } 100% { transform:scale(2.6); opacity:0; } }
.hotspot-pt:hover .hotspot-dot,
.hotspot-pt.active .hotspot-dot { transform: scale(1.35); }

.hotspot-callout {
  position: absolute;
  bottom: calc(100% + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  background: var(--surface);
  border: 1px solid var(--gold-border);
  padding: 1rem 1.1rem;
  min-width: 170px;
  max-width: 220px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 20;
  box-shadow: 0 4px 16px rgba(23,21,15,0.1);
}
.hotspot-pt:hover .hotspot-callout,
.hotspot-pt.active .hotspot-callout {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.hotspot-callout::after {
  content: '';
  position: absolute;
  top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--gold-border);
}
.hc-lbl {
  font-family: var(--font-mono);
  font-size: 0.52rem;
  letter-spacing: 0.14em;
  color: var(--gold-text);
  margin-bottom: 0.25rem;
}
.hc-val { font-size: 0.875rem; font-weight: 600; color: var(--text); margin-bottom: 0.25rem; }
.hc-desc { font-size: 0.72rem; color: var(--text-dim); line-height: 1.55; }

/* flip callout above edge */
.hotspot-pt[data-flip="down"] .hotspot-callout {
  bottom: auto;
  top: calc(100% + 16px);
  transform: translateX(-50%) translateY(-6px);
}
.hotspot-pt[data-flip="down"]:hover .hotspot-callout,
.hotspot-pt[data-flip="down"].active .hotspot-callout {
  transform: translateX(-50%) translateY(0);
}
.hotspot-pt[data-flip="down"] .hotspot-callout::after {
  top: auto; bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: var(--gold-border);
}

/* ============================================================
   COMPARISON SLIDER
   ============================================================ */
.compare-wrap {
  position: relative;
  overflow: hidden;
  cursor: ew-resize;
  user-select: none;
  -webkit-user-select: none;
  border: 1px solid var(--border);
}
.compare-before { display: block; width: 100%; }
.compare-after-clip {
  position: absolute;
  inset: 0;
  clip-path: inset(0 50% 0 0);
  pointer-events: none;
}
.compare-after-clip img,
.compare-after-clip .img-ph {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.compare-handle {
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  width: 2px;
  background: var(--gold);
  transform: translateX(-50%);
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.compare-knob {
  width: 38px; height: 38px;
  background: var(--gold);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #000;
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: 0 2px 14px rgba(138,94,16,0.28), 0 0 0 2px rgba(138,94,16,0.12);
  flex-shrink: 0;
}
.compare-lbl {
  position: absolute;
  bottom: 1rem;
  font-family: var(--font-mono);
  font-size: 0.52rem;
  letter-spacing: 0.1em;
  background: rgba(243,241,236,0.88);
  padding: 0.28rem 0.6rem;
  z-index: 20;
  pointer-events: none;
}
.compare-lbl-l { left: 1rem; color: var(--text-muted); }
.compare-lbl-r { right: 1rem; color: var(--gold-text); }

/* ============================================================
   BUILD LOG GALLERY
   ============================================================ */
.build-log {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 1rem;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-border) var(--surface);
}
.build-log::-webkit-scrollbar { height: 3px; }
.build-log::-webkit-scrollbar-track { background: var(--surface); }
.build-log::-webkit-scrollbar-thumb { background: var(--gold-border); }

.build-item {
  flex: 0 0 clamp(280px, 45vw, 500px);
  scroll-snap-align: start;
  position: relative;
}
.build-item .img-ph { aspect-ratio: 4/3; min-height: 0; }
.build-caption {
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  font-family: var(--font-mono);
  font-size: 0.52rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  line-height: 1.5;
}
.build-caption .cap-num { color: var(--gold-text); margin-right: 0.5rem; }

/* ============================================================
   FIRMWARE / ROADMAP
   ============================================================ */
.firmware-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 2px;
  margin-top: 1.5rem;
}
.fw-item {
  padding: 1.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}
.fw-step {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--gold-text);
  flex-shrink: 0;
  padding-top: 0.1rem;
}
.fw-title { font-size: 0.875rem; font-weight: 600; color: var(--text); margin-bottom: 0.22rem; }
.fw-desc  { font-size: 0.72rem; color: var(--text-dim); line-height: 1.55; }

/* ============================================================
   SKILLS DEMONSTRATED
   ============================================================ */
.skills-dem {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 2px;
  margin-top: 1.5rem;
}
.skill-chip {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-dim);
}
.skill-chip::before { content:''; width:3px; height:3px; background:var(--gold); flex-shrink:0; }

/* ============================================================
   DOWNLOAD BUTTON
   ============================================================ */
.btn-dl {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem 2.2rem;
  border: 1px solid var(--gold-border);
  color: var(--gold-text);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}
.btn-dl:hover { background: var(--gold-dim); border-color: var(--gold-text); transform: translateY(-2px); }

/* ============================================================
   TOOTHPASTE — ROLE TABLE
   ============================================================ */
.role-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
}
@media (max-width: 640px) { .role-grid { grid-template-columns: 1fr; } }
.role-col {
  padding: 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
}
.role-col-lbl {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.16em;
  color: var(--gold-text);
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.role-list { list-style: none; display: flex; flex-direction: column; gap: 0.6rem; }
.role-list li { font-size: 0.85rem; color: var(--text-dim); display: flex; gap: 0.6rem; align-items: flex-start; }
.role-list li::before { content: '—'; color: var(--gold-text); flex-shrink:0; }

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.05ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }

  /* Intro: JS calls skipNow() immediately; these are CSS-side insurance */
  #site-wrap    { clip-path: none !important; }
  #splash-rings { display: none !important; }
  #hero-ripple  { display: none !important; }
  .intro-video  { display: none !important; }
  .intro-tuna-x,
  .intro-tuna-y,
  .intro-tuna-img { animation: none !important; opacity: 0 !important; }
}
