/* ===================================================
   Max Bucci — STYLE.CSS
   Inspired by galekto.com
   =================================================== */

/* ---------- CUSTOM PROPERTIES ---------- */
:root {
  --bg:            #1a1614;
  --bg-surface:    #1f1c1a;
  --bg-card:       #221f1d;
  --text:          #f0ede8;
  --text-dim:      #888480;
  --text-dimmer:   #555250;
  --accent:        #c8a96e;
  --accent-blue:   #4a7fa8;
  --border:        rgba(200,169,110,0.15);
  --border-dim:    rgba(255,255,255,0.06);

  --font-display:  'Bebas Neue', 'Arial Black', Impact, sans-serif;
  --font-name:     'Barlow Condensed', 'Arial Black', Impact, sans-serif;
  --font-ui:       'Space Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --font-mono:     'VT323', monospace;

  --name-fs:       clamp(100px, 14vw, 210px);
  --name-lh:       0.82;

  --ease-out:      cubic-bezier(0.22, 1, 0.36, 1);
  --ease-bounce:   cubic-bezier(0.34, 1.56, 0.64, 1);
}


/* ---------- RESET ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); scroll-behavior: smooth; }
body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { background: none; border: none; cursor: pointer; color: inherit; font: inherit; }

/* ---------- SR-ONLY ---------- */
.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;
}
.skip-to-content {
  position: absolute; top: -100px; left: 1rem; z-index: 99999;
  padding: 0.5rem 1rem; background: var(--accent); color: #000;
  font-family: var(--font-ui); font-weight: 700;
  transition: top 0.2s;
}
.skip-to-content:focus { top: 1rem; }

/* ===================================================
   BACKGROUND LAYER
   =================================================== */
.bg-layer {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none;
}
.bg-canvas, .fluid-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: 0.6;
}
.bg-noise {
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.08'/%3E%3C/svg%3E");
  opacity: 0.4;
}

/* ===================================================
   PRELOADER — TV / SMPTE
   =================================================== */
.preloader {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
}
html.skip-preloader .preloader { display: none !important; }

.tv-outer {
  width: 100vw; height: 100vh;
  display: flex; align-items: center; justify-content: center;
}
.tv-screen {
  position: relative;
  width: 100%; height: 100%;
  overflow: hidden;
  background: #0a0a0a;
}
.tv-inner {
  position: absolute; inset: 0;
}

/* SMPTE Color Bars */
.tv-bars {
  display: flex;
  width: 100%; height: 75%;
  position: absolute; top: 0; left: 0;
}
.tv-bar { flex: 1; }
.tv-bar--w { background: #c8c8c8; }
.tv-bar--y { background: #c8c800; }
.tv-bar--c { background: #00c8c8; }
.tv-bar--g { background: #00c800; }
.tv-bar--m { background: #c800c8; }
.tv-bar--r { background: #c80000; }
.tv-bar--b { background: #0000c8; }

/* Bottom strip */
.tv-bars-bottom {
  display: flex;
  width: 100%; height: 25%;
  position: absolute; bottom: 0; left: 0;
}
.tv-bar-b { flex: 1; }
.tv-bar-b--1 { background: #0000a8; }
.tv-bar-b--2 { background: #f0ede8; }
.tv-bar-b--3 { background: #2100a8; }
.tv-bar-b--4 { background: #0a0a0a; }
.tv-bar-b--5 { background: #090909; }
.tv-bar-b--6 { background: #131313; }
.tv-bar-b--7 { background: #0a0a0a; }

/* Barcodes */
.tv-barcode {
  position: absolute; top: 0; bottom: 0; width: 3%;
  background: repeating-linear-gradient(
    to bottom, #000 0px, #000 2px, #fff 2px, #fff 4px
  );
  opacity: 0.4;
}
.tv-barcode--left  { left: 0; }
.tv-barcode--right { right: 0; }

/* Chaos blocks */
.tv-chaos { position: absolute; inset: 0; pointer-events: none; }
.tv-cb {
  position: absolute;
  opacity: 0.85;
}
.tv-cb-1  { width:8%;  height:12%; top:63%; left:0;    background:#ff00ff; }
.tv-cb-2  { width:8%;  height:12%; top:63%; left:8%;   background:#0000ff; }
.tv-cb-3  { width:6%;  height:8%;  top:67%; left:0;    background:#00ffff; }
.tv-cb-4  { width:4%;  height:4%;  top:63%; right:0;   background:#ff69b4; }
.tv-cb-5  { width:6%;  height:4%;  top:67%; right:0;   background:#7f00ff; }
.tv-cb-6  { width:3%;  height:3%;  top:72%; left:15%;  background:#ff0000; }
.tv-cb-7  { width:2%;  height:6%;  top:69%; left:20%;  background:#ffff00; }
.tv-cb-8  { width:5%;  height:3%;  top:74%; left:3%;   background:#00ff7f; }
.tv-cb-9  { width:4%;  height:5%;  top:66%; left:25%;  background:#ff4500; }
.tv-cb-10 { width:3%;  height:3%;  top:70%; right:5%;  background:#1e90ff; }
.tv-cb-11 { width:4%;  height:4%;  top:75%; right:8%;  background:#ff1493; }
.tv-cb-12 { width:2%;  height:2%;  top:63%; left:30%;  background:#adff2f; }
.tv-cb-13 { width:6%;  height:3%;  top:78%; left:10%;  background:#00bfff; }
.tv-cb-14 { width:3%;  height:5%;  top:68%; left:40%;  background:#ffa500; }
.tv-cb-15 { width:2%;  height:3%;  top:73%; right:12%; background:#da70d6; }
.tv-cb-16 { width:5%;  height:2%;  top:80%; right:20%; background:#ff6347; }
.tv-cb-17 { width:3%;  height:4%;  top:65%; left:50%;  background:#7fff00; }
.tv-cb-18 { width:4%;  height:3%;  top:77%; left:55%;  background:#ff00ff; }
.tv-cb-19 { width:2%;  height:2%;  top:82%; left:35%;  background:#40e0d0; }
.tv-cb-20 { width:3%;  height:3%;  top:63%; right:20%; background:#ffd700; }
.tv-cb-21 { width:4%;  height:4%;  top:70%; left:60%;  background:#dc143c; }
.tv-cb-22 { width:3%;  height:5%;  top:75%; right:30%; background:#00fa9a; }
.tv-cb-23 { width:2%;  height:2%;  top:85%; left:5%;   background:#ff69b4; }
.tv-cb-24 { width:5%;  height:3%;  top:80%; left:45%;  background:#6495ed; }
.tv-cb-25 { width:3%;  height:4%;  top:63%; left:65%;  background:#ff8c00; }
.tv-cb-26 { width:2%;  height:2%;  top:88%; right:15%; background:#7b68ee; }
.tv-cb-27 { width:4%;  height:3%;  top:72%; right:40%; background:#20b2aa; }
.tv-cb-28 { width:3%;  height:5%;  top:66%; left:72%;  background:#ff4500; }
.tv-cb-29 { width:2%;  height:2%;  top:90%; left:50%;  background:#ff1493; }
.tv-cb-30 { width:4%;  height:4%;  top:82%; right:35%; background:#ffd700; }

/* Crosshairs */
.tv-cross {
  position: absolute;
  width: 32px; height: 32px;
  border: 2px solid #00ffff;
  border-radius: 50%;
  opacity: 0.6;
}
.tv-cross::before, .tv-cross::after {
  content: ''; position: absolute;
  background: #00ffff;
}
.tv-cross::before { width:1px; height:200%; top:-50%; left:50%; transform:translateX(-50%); }
.tv-cross::after  { height:1px; width:200%; top:50%; left:-50%; transform:translateY(-50%); }
.tv-cross-1 { top: 65%; left:  8%; }
.tv-cross-2 { top: 70%; right: 8%; }
.tv-cross-3 { top: 80%; left: 45%; }

/* Center content */
.tv-center {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
}
.tv-panel {
  background: rgba(0,0,0,0.82);
  border: 1px solid rgba(255,183,0,0.4);
  padding: 2rem 2.5rem;
  text-align: center;
  min-width: 280px;
}
.tv-msg {
  font-family: var(--font-mono);
  font-size: clamp(18px, 2.5vw, 28px);
  color: #ffb000;
  letter-spacing: 0.1em;
  line-height: 1.4;
  margin-bottom: 1.5rem;
}
.tv-panel-bar {
  display: flex; align-items: center; gap: 1rem;
  margin-bottom: 1rem;
}
.tv-progress {
  flex: 1; height: 4px;
  background: rgba(255,183,0,0.2);
  border: 1px solid rgba(255,183,0,0.4);
}
.tv-progress-fill {
  height: 100%; width: 0%;
  background: #ffb000;
  transition: width 0.1s linear;
}
.tv-pct {
  font-family: var(--font-mono);
  font-size: 16px; color: #ffb000;
  min-width: 3ch;
}
.tv-skip-hint {
  font-family: var(--font-mono);
  font-size: 11px; color: rgba(255,183,0,0.5);
  letter-spacing: 0.08em;
}
.tv-skip-mobile { display: none; }
@media (max-width: 600px) {
  .tv-skip-desktop { display: none; }
  .tv-skip-mobile  { display: inline; }
}

/* BIOS screen */
.tv-bios {
  position: absolute; inset: 0; z-index: 3;
  background: #0a0a0a;
  font-family: var(--font-mono);
  font-size: clamp(12px, 1.2vw, 16px);
  color: #ffb000;
  padding: 2rem;
  opacity: 0;
  pointer-events: none;
  white-space: pre;
  line-height: 1.6;
}

/* Preloader overlays */
.tv-scanlines, .page-scanlines {
  position: absolute; inset: 0; z-index: 10;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px, transparent 3px,
    rgba(0,0,0,0.15) 3px, rgba(0,0,0,0.15) 4px
  );
  pointer-events: none;
}
.tv-grain-canvas, .page-grain-canvas {
  position: absolute; inset: 0; z-index: 11;
  width: 100%; height: 100%;
  pointer-events: none;
  image-rendering: pixelated;
  opacity: 0.08;
}
.tv-glitch-canvas {
  position: absolute; inset: 0; z-index: 12;
  width: 100%; height: 100%;
  pointer-events: none;
  opacity: 0;
}
.tv-scanner-lines, .page-scanner-lines {
  position: absolute; inset: 0; z-index: 13;
  pointer-events: none;
}
.tv-scanner-lines span, .page-scanner-lines span {
  position: absolute; left: 0; right: 0;
  height: 1px;
  background: rgba(255,255,255,0.06);
  animation: scanline var(--dur, 10s) linear var(--del, 0s) infinite;
  opacity: var(--op, 0.1);
}
@keyframes scanline {
  0%   { top: -2px; }
  100% { top: 100%; }
}
/* Vertical scan lines (inner pages) */
.page-vscan-lines {
  position: absolute; inset: 0; z-index: 13;
  pointer-events: none;
}
.page-vscan-lines span {
  position: absolute; top: 0; bottom: 0;
  width: 1px;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(255,255,255,0.06) 20%,
    rgba(255,255,255,0.06) 80%,
    transparent 100%
  );
  animation: vscanline var(--dur, 14s) linear var(--del, 0s) infinite;
  opacity: var(--op, 0.08);
}
@keyframes vscanline {
  0%   { left: -2px; }
  100% { left: calc(100% + 2px); }
}
.tv-inner-glow, .page-inner-glow {
  position: absolute; inset: 0; z-index: 14;
  background: radial-gradient(ellipse at center, transparent 60%, rgba(255,183,0,0.04) 100%);
  pointer-events: none;
}
.tv-vignette, .page-vignette {
  position: absolute; inset: 0; z-index: 15;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.55) 100%);
  pointer-events: none;
}

/* ===================================================
   CUSTOM CURSOR
   =================================================== */
@media (pointer: fine) {
  body { cursor: none; }
  a, button { cursor: none; }
}
.cursor { position: fixed; z-index: 10003; pointer-events: none; }
.cursor-ring {
  position: fixed;
  width: 36px; height: 36px;
  border: 1.5px solid rgba(200,169,110,0.7);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: transform 0.08s var(--ease-out), width 0.2s, height 0.2s, border-color 0.2s;
  will-change: transform;
}
.cursor-dot {
  position: fixed;
  width: 5px; height: 5px;
  background: var(--accent);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  will-change: transform;
}
body:hover .cursor-ring { opacity: 1; }

/* ===================================================
   PAGE TV OVERLAY (persistent, on all pages)
   =================================================== */
.page-tv-overlay {
  position: fixed; inset: 0; z-index: 9920;
  pointer-events: none;
}
.page-scanlines {
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px, transparent 3px,
    rgba(0,0,0,0.10) 3px, rgba(0,0,0,0.10) 4px
  );
}
.page-grain-canvas { opacity: 0.05; }
.page-inner-glow {
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,0.3) 100%);
}
.page-vignette {
  background: radial-gradient(ellipse at center, transparent 45%, rgba(0,0,0,0.6) 100%);
}

/* ===================================================
   CRT FRAME
   =================================================== */
.page-crt-bevel {
  position: fixed; inset: 0; z-index: 10001;
  background: radial-gradient(ellipse at 30% 30%, rgba(255,240,200,0.03) 0%, transparent 60%);
  pointer-events: none;
}
.page-tv-frame {
  position: fixed; inset: 0; z-index: 10000;
  background: var(--bg);
  pointer-events: none;
  visibility: hidden;
}
.page-tv-stroke {
  position: fixed; inset: 0; z-index: 10002;
  width: 100%; height: 100%;
  pointer-events: none;
}

/* ===================================================
   PAGE TRANSITION OVERLAY
   =================================================== */
#pageOverlay {
  position: fixed; inset: 0; z-index: 9890;
  background: var(--bg);
  opacity: 0;
  pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.35s var(--ease-out);
}
#pageOverlay.is-active {
  opacity: 1;
  pointer-events: all;
}
.overlay-label {
  font-family: var(--font-name);
  font-size: clamp(24px, 5vw, 60px);
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.25s 0.1s, transform 0.35s var(--ease-out) 0.05s;
}
#pageOverlay.is-active .overlay-label {
  opacity: 1;
  transform: scale(1);
}

/* ===================================================
   HOMEPAGE LIGHT THEME
   =================================================== */
body.page-index {
  background: #ede0d4;
}
.page-index .bg-layer { background: #ede0d4; }

/* Portrait: centered fixed column, fluid multiplies colour into it */
.page-index .portrait-base {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: clamp(320px, 50vw, 720px);
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter: grayscale(70%) contrast(1.1) brightness(0.92);
  mask-image: linear-gradient(to top, transparent 0%, black 16%, black 88%, transparent 100%);
  -webkit-mask-image: linear-gradient(to top, transparent 0%, black 16%, black 88%, transparent 100%);
  opacity: 1;
  z-index: 4;
  transition: transform 0.65s cubic-bezier(0.22,1,0.36,1);
}
.page-index .portrait-base.shift-right {
  transform: translateX(calc(-50% + 5vw));
}
.page-index .portrait-base.shift-left {
  transform: translateX(calc(-50% - 5vw));
}

/* Main transparent so portrait and fluid show through */
.page-index main { background: transparent; }

/* Fluid WebGL canvas — multiply blend paints colour into the portrait */
.fluid-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 7;
  pointer-events: none;
  display: none;
  mix-blend-mode: multiply;
}
.page-index .fluid-canvas { display: block; }
/* Remove old colour-grade pseudo-element */
.page-index .portrait-frame::after { display: none; }
/* Name text: dark on light bg */
.page-index .name-char { color: #2b1a0e; }
.page-index .name-row--outline .name-char {
  -webkit-text-stroke-color: #2b1a0e;
  color: transparent;
}
/* Side nav + role tag + hero bottom */
.page-index .side        { color: #6a4e38; }
.page-index .side:hover  { color: #a07830; }
.page-index .side-nr     { color: #a07830; }
.page-index .role-tag    { color: #4a3020; border-color: rgba(42,26,16,0.22); }
.page-index .hero-bottom { color: #6a4e38; }
.page-index .hero-bottom a { color: #6a4e38; }
.page-index .hero-bottom-sep { color: #a07830; }
/* Lang toggle */
.page-index .lang-toggle { border-color: rgba(42,26,16,0.22); }
.page-index .lang-toggle button { color: #4a3020; }
.page-index .lang-toggle button.is-active { background: #a07830; color: #fff; }
/* Noise overlay lighter on light bg */
.page-index .bg-noise { opacity: 0.03; }

/* Fluid mode badge — proper pill */
.fluid-mode-badge {
  display: none;
}
.page-index .fluid-mode-badge {
  display: flex;
  align-items: center;
  gap: 0.45em;
  position: fixed;
  bottom: 1.6rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10020;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(160, 120, 48, 0.7);
  border: 1px solid rgba(160, 120, 48, 0.25);
  padding: 0.28em 0.75em 0.25em;
  pointer-events: none;
  transition: color 0.8s ease, border-color 0.8s ease;
  white-space: nowrap;
}
.page-index .fluid-mode-badge::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.7;
  flex-shrink: 0;
}
.page-index .fluid-mode-badge.mode-sea  {
  color: rgba(20, 140, 200, 0.7);
  border-color: rgba(20, 140, 200, 0.25);
}
.page-index .fluid-mode-badge.mode-wind {
  color: rgba(100, 120, 148, 0.7);
  border-color: rgba(100, 120, 148, 0.25);
}
.page-index .fluid-mode-badge.mode-fire {
  color: rgba(160, 120, 48, 0.7);
  border-color: rgba(160, 120, 48, 0.25);
}

/* ===================================================
   HOMEPAGE — HERO
   =================================================== */
.page-index main {
  position: fixed; inset: 0; z-index: 10;
  overflow: hidden;
}

/* Side navigation */
.side {
  position: fixed; top: 50%; z-index: 10010;
  display: flex; align-items: center; gap: 0.8rem;
  font-family: var(--font-name);
  font-size: clamp(13px, 1.3vw, 16px);
  font-weight: 900;
  letter-spacing: 0.18em;
  color: var(--text-dim);
  text-transform: uppercase;
  text-decoration: none;
  writing-mode: vertical-rl;
  transform-origin: center;
  transition: color 0.3s var(--ease-out), transform 0.3s var(--ease-out);
  padding: 1rem 0.5rem;
}
.side--left  {
  left: 0.4rem;
  transform: translateY(-50%) rotate(180deg);
}
.side--right {
  right: 0.4rem;
  transform: translateY(-50%);
}
.side:hover { color: var(--accent); }
.side-arrow { display: inline-block; }
.side--left  .side-arrow { transform: rotate(180deg); }
.side-nr {
  font-family: var(--font-name);
  font-size: clamp(32px, 4vw, 52px);
  font-weight: 900;
  color: var(--accent);
  line-height: 1;
  letter-spacing: -0.02em;
}

/* Slide group */
.slide-group {
  position: absolute; inset: 0;
  display: flex; align-items: flex-end; justify-content: center;
}

/* Portrait */
.portrait-section {
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: clamp(300px, 55vw, 780px);
  pointer-events: none;
  z-index: 5;
}
.portrait-frame {
  position: relative;
  width: 100%;
}
.portrait-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 40%,
    rgba(200,169,110,0.55) 0%,
    rgba(74,127,168,0.18) 60%,
    transparent 100%);
  mix-blend-mode: color;
  pointer-events: none;
  mask-image: linear-gradient(to top, transparent 0%, black 20%, black 85%, transparent 100%);
  -webkit-mask-image: linear-gradient(to top, transparent 0%, black 20%, black 85%, transparent 100%);
}
.portrait-base {
  width: 100%; height: auto;
  display: block;
  filter: grayscale(60%) contrast(1.08) brightness(0.95);
  mask-image: linear-gradient(to top, transparent 0%, black 20%, black 85%, transparent 100%);
  -webkit-mask-image: linear-gradient(to top, transparent 0%, black 20%, black 85%, transparent 100%);
}

/* Name section */
.name-section {
  position: absolute;
  bottom: -0.05em;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  pointer-events: none;
  width: 100%;
  display: flex; justify-content: center;
}
.name-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  line-height: var(--name-lh);
}
.name-row {
  display: flex;
  overflow: hidden;
}
.name-slot {
  overflow: hidden;
  display: inline-block;
}
.name-reel {
  display: inline-block;
  will-change: transform;
}
.name-char {
  display: block;
  font-family: var(--font-name);
  font-size: var(--name-fs);
  font-weight: 900;
  line-height: var(--name-lh);
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: -0.02em;
  user-select: none;
}
.name-char.is-accent { color: var(--accent); }

/* Name line 2 (BUCCI) — outlined */
.name-row--outline .name-char {
  -webkit-text-stroke: 1.5px var(--text);
  color: transparent;
}

/* Role tag */
.role-tag {
  position: absolute;
  bottom: calc(var(--name-fs) * var(--name-lh) * 2 + 1.5rem);
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: clamp(12px, 1.3vw, 16px);
  color: var(--accent);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  white-space: nowrap;
  z-index: 7;
  opacity: 0;
  transition: opacity 1s var(--ease-out) 2s;
}
.page-index.is-loaded .role-tag { opacity: 1; }

/* Subtle info bottom */
.hero-bottom {
  position: fixed;
  bottom: 1.8rem; left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex; align-items: center; gap: 2rem;
  font-family: var(--font-mono);
  font-size: clamp(10px, 1vw, 13px);
  color: var(--text-dimmer);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 1s var(--ease-out) 2.5s;
}
.page-index.is-loaded .hero-bottom { opacity: 1; }
.hero-bottom-sep { color: var(--accent); opacity: 0.4; }

/* i18n toggle */
.lang-toggle {
  position: fixed; top: 1.2rem; right: 1.8rem; z-index: 10010;
  display: flex; gap: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  border: 1px solid var(--border);
  overflow: hidden;
}
.lang-toggle button {
  padding: 0.3rem 0.6rem;
  color: var(--text-dim);
  transition: background 0.2s, color 0.2s;
  text-transform: uppercase;
}
.lang-toggle button.is-active {
  background: var(--accent);
  color: #000;
  font-weight: 700;
}

/* ===================================================
   INNER PAGE LAYOUT (projects, about, contact)
   =================================================== */
.inner-page {
  min-height: 100dvh;
  padding-top: 5rem;
  position: relative; z-index: 10;
}
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ===================================================
   SITE NAV (inner pages)
   =================================================== */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10010;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.2rem 2rem;
  background: linear-gradient(to bottom, rgba(26,22,20,0.95) 0%, transparent 100%);
}
.nav-left-text {
  font-family: var(--font-name);
  font-size: clamp(16px, 2vw, 22px);
  font-weight: 900;
  letter-spacing: 0.12em;
  color: var(--text);
  text-transform: uppercase;
  text-decoration: none;
  transition: color 0.2s;
}
.nav-left-text:hover { color: var(--accent); }
.nav-links { display: flex; gap: 2rem; align-items: center; padding-right: 5rem; }
.nav-link {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  text-transform: uppercase;
  text-decoration: none;
  transition: color 0.2s;
  position: relative;
}
.nav-link::after {
  content: ''; position: absolute; left: 0; bottom: -3px;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width 0.3s var(--ease-out);
}
.nav-link:hover, .nav-link.is-active { color: var(--text); }
.nav-link:hover::after, .nav-link.is-active::after { width: 100%; }

/* ===================================================
   FOOTER
   =================================================== */
.site-footer {
  padding: 4rem 0 2rem;
  border-top: 1px solid var(--border-dim);
  margin-top: 6rem;
}
.footer-inner { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }
.footer-main {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 2rem; margin-bottom: 2rem;
  flex-wrap: wrap;
}
.footer-nav { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.footer-nav-link {
  font-family: var(--font-ui);
  font-size: 13px; font-weight: 500;
  color: var(--text-dim); letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 0.2s;
}
.footer-nav-link:hover { color: var(--accent); }
.footer-right {
  display: flex; flex-direction: column; gap: 0.4rem;
  align-items: flex-end;
}
.footer-location {
  font-family: var(--font-mono);
  font-size: 12px; color: var(--text-dimmer);
  letter-spacing: 0.1em;
}
.footer-bottom {
  border-top: 1px solid var(--border-dim);
  padding-top: 1.5rem;
}
.footer-copy {
  font-family: var(--font-mono);
  font-size: 11px; color: var(--text-dimmer);
  letter-spacing: 0.1em;
}

/* ===================================================
   SCROLL HINT (about + projects)
   =================================================== */
.scroll-hint {
  position: fixed;
  bottom: 2.8rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.6s var(--ease-out);
}
.scroll-hint.is-hidden { opacity: 0; }
.scroll-hint-line {
  width: 1px;
  height: 44px;
  background: var(--border-dim);
  position: relative;
  overflow: hidden;
}
.scroll-hint-line::after {
  content: '';
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 60%;
  background: linear-gradient(to bottom, transparent, var(--accent));
  animation: scroll-drop 1.6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
@keyframes scroll-drop {
  0%   { top: -60%; opacity: 1; }
  80%  { top: 140%; opacity: 1; }
  100% { top: 140%; opacity: 0; }
}
.scroll-hint-label {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.28em;
  color: var(--text-dimmer);
  text-transform: uppercase;
}

/* ===================================================
   UTILITY
   =================================================== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===================================================
   HAMBURGER MENU
   =================================================== */
.burger-btn {
  display: none;
}
.burger-menu {
  display: none;
}

@media (max-width: 768px) {
  /* — button — */
  .burger-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 10010;
    width: 40px;
    height: 40px;
    padding: 8px;
    background: none;
    border: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .burger-bar {
    display: block;
    width: 100%;
    height: 1.5px;
    background: var(--accent);
    transition: transform 0.35s var(--ease-out), opacity 0.25s ease;
    transform-origin: center;
  }
  .burger-btn.is-open .burger-bar:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
  .burger-btn.is-open .burger-bar:nth-child(2) { opacity: 0; transform: scaleX(0); }
  .burger-btn.is-open .burger-bar:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

  /* — overlay — */
  .burger-menu {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 10005;
    background: rgba(4, 2, 10, 0.97);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s var(--ease-out);
  }
  .burger-menu.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  /* — nav links — */
  .burger-nav {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    height: 100%;
    padding: 0 2rem;
    gap: 0.5rem;
  }
  .burger-link {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    font-family: var(--font-name);
    font-size: clamp(48px, 14vw, 80px);
    font-weight: 900;
    color: var(--text);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: -0.01em;
    line-height: 1.05;
    opacity: 0;
    transform: translateX(-24px);
    transition: color 0.2s ease, opacity 0.4s ease calc(var(--i) * 0.07s + 0.1s),
                transform 0.4s var(--ease-out) calc(var(--i) * 0.07s + 0.1s);
    -webkit-tap-highlight-color: transparent;
  }
  .burger-menu.is-open .burger-link {
    opacity: 1;
    transform: translateX(0);
  }
  .burger-link:active { color: var(--accent); }
  .burger-link-nr {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent);
    opacity: 0.5;
    letter-spacing: 0.15em;
    flex-shrink: 0;
    padding-bottom: 0.3em;
  }
}

/* ===================================================
   RESPONSIVE
   =================================================== */
@media (max-width: 768px) {
  .side { display: none; }
  .name-char { font-size: clamp(72px, 18vw, 140px); }
  .portrait-section { width: 85vw; }
  .lang-toggle { top: 0.8rem; right: 1rem; }
  .nav-links { gap: 1rem; }
}
@media (max-width: 480px) {
  .nav-links .nav-link:not(.is-active) { display: none; }
}

/* ===================================================
   RE:ZERO easter egg — 死に戻り (shared, all pages)
   =================================================== */
.rz-overlay {
  position: fixed;
  inset: 0;
  z-index: 9870;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem 5rem;
  background: #06030f;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.7s ease;
  overflow-y: auto;
}
.rz-overlay.is-open { opacity: 1; pointer-events: auto; }
.rz-avatar {
  position: absolute;
  bottom: 0;
  right: 5%;
  height: 82%;
  width: auto;
  object-fit: contain;
  opacity: 0.88;
  filter: saturate(0.6) brightness(0.82);
  -webkit-mask-image: linear-gradient(to top, transparent 0%, black 22%);
  mask-image: linear-gradient(to top, transparent 0%, black 22%);
  pointer-events: none;
  z-index: 0;
}
@media (max-width: 768px) {
  .rz-avatar { right: 0; height: 55%; opacity: 0.35; }
}
.rz-content {
  width: min(560px, 90vw);
  position: relative;
  z-index: 1;
  animation: rz-fade-in 0.9s ease 0.3s both;
}
@keyframes rz-fade-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.rz-jp {
  font-family: "Hiragino Mincho ProN","Yu Mincho","Noto Serif JP",serif;
  font-size: 13px; letter-spacing: 0.45em;
  color: rgba(139,92,246,0.5); text-align: center; margin-bottom: 0.5rem;
}
.rz-title {
  font-family: var(--font-name);
  font-size: clamp(48px,9vw,88px); font-weight: 900;
  letter-spacing: 0.04em; text-align: center; line-height: 1;
  color: #fff; margin-bottom: 0.6rem;
  text-shadow: 0 0 40px rgba(139,92,246,0.6), 0 0 80px rgba(139,92,246,0.25);
}
.rz-loop {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.35em; color: rgba(139,92,246,0.6);
  text-align: center; text-transform: uppercase; margin-bottom: 2rem;
}
.rz-loop-num { color: rgba(220,38,38,0.8); }
.rz-divider { width: 60px; height: 1px; background: rgba(139,92,246,0.3); margin: 0 auto 2rem; }
.rz-quote {
  font-family: "Hiragino Mincho ProN","Yu Mincho","Noto Serif JP",Georgia,serif;
  font-size: clamp(14px,1.8vw,18px); color: rgba(255,255,255,0.7);
  text-align: center; margin-bottom: 0.4rem;
}
.rz-quote-tr {
  font-family: var(--font-ui); font-style: italic; font-size: 12px;
  color: rgba(255,255,255,0.25); text-align: center;
  margin-bottom: 2.5rem; letter-spacing: 0.04em;
}
.rz-stats { display: flex; flex-direction: column; border: 1px solid rgba(139,92,246,0.15); }
.rz-stat {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.65rem 1rem; border-bottom: 1px solid rgba(139,92,246,0.1); gap: 1rem;
}
.rz-stat:last-child { border-bottom: none; }
.rz-sl { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.22em; color: rgba(139,92,246,0.55); text-transform: uppercase; }
.rz-sv { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; color: rgba(255,255,255,0.7); text-align: right; }
.rz-close {
  position: fixed; bottom: 1.8rem; left: 50%; transform: translateX(-50%);
  background: none; border: 1px solid rgba(139,92,246,0.35);
  color: rgba(139,92,246,0.6); font-family: var(--font-mono);
  font-size: 9px; letter-spacing: 0.3em; text-transform: uppercase;
  padding: 0.5em 1.4em; cursor: pointer;
  transition: border-color 0.25s, color 0.25s, box-shadow 0.25s;
}
.rz-close:hover { border-color: rgba(139,92,246,0.8); color: rgba(139,92,246,1); box-shadow: 0 0 16px rgba(139,92,246,0.25); }
