/* ============================================================
   TECH ART PORTFOLIO — design tokens
   Concept: a DCC viewport / G-buffer readout, not a marketing page.
   Flat panels, hairline rules, sharp corners, no drop shadows.
   Accent colors are drawn from real buffer-visualization hues:
   emissive-orange (shaders), LUT-teal (post fx), GI-violet (ray tracer).
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Archivo:ital,wght@0,400;0,500;0,600;0,700;0,800;1,500&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root{
  --bg-void:    #0B0D10;
  --bg-panel:   #14171C;
  --bg-panel-2: #1B1F26;
  --line:       #262B33;
  --line-soft:  #1E222A;

  --text:       #E8E6E1;
  --text-dim:   #8A8F98;
  --text-faint: #565C67;

  --shader:     #fe468a;
  --shader-dim: #6B3527;
  --post:       #4AD9C7;
  --post-dim:   #285A53;
  --rt:         hsl(0, 92%, 58%);
  --rt-dim:     #473B6B;
  --gold:       #D4A94A;

  --font-display: 'Archivo', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  --nav-w: 220px;
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; color-scheme: dark; }

::-webkit-scrollbar{ width: 12px; height: 12px; }
::-webkit-scrollbar-track{ background: var(--bg-void); }
::-webkit-scrollbar-thumb{ background: var(--line); border: 3px solid var(--bg-void); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover{ background: var(--text-faint); }

body{
  margin: 0;
  overflow-x: hidden;
  background: var(--bg-void);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* faint wireframe grid — literal nod to a 3D viewport, not decoration */
.grid-bg{
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.35;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 40%, transparent 90%);
}

a{ color: inherit; text-decoration: none; }

h1,h2,h3,h4{
  font-family: var(--font-display);
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
}

p{ margin: 0; color: var(--text-dim); max-width: 62ch; }

code, .mono{ font-family: var(--font-mono); }

img, video{ max-width: 100%; display: block; }

::selection{ background: var(--shader); color: var(--bg-void); }

:focus-visible{
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

/* ---------- layout shell ---------- */

.shell{
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* left rail nav, like a DCC outliner panel */
.rail{
  width: var(--nav-w);
  flex-shrink: 0;
  border-right: 1px solid var(--line);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 40px;
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--bg-void);
}

.rail__brand{
  display: block;
}
.rail__brand .name{
  font-size: 18px;
  font-weight: 800;
}
.rail__brand .role{
  display: block;
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-faint);
}

.rail__nav{
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.rail__section-label{
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-faint);
  margin: 18px 0 8px;
}
.rail__nav a{
  font-size: 17px;
  color: var(--text-dim);
  padding: 7px 8px 7px 10px;
  border-left: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease, background-color .15s ease;
}
.rail__nav a:hover, .rail__nav a.active{
  color: var(--text);
  background: var(--bg-panel);
}
.rail__nav a[data-accent="shader"]:hover, .rail__nav a[data-accent="shader"].active{ border-left-color: var(--shader); }
.rail__nav a[data-accent="post"]:hover, .rail__nav a[data-accent="post"].active{ border-left-color: var(--post); }
.rail__nav a[data-accent="rt"]:hover, .rail__nav a[data-accent="rt"].active{ border-left-color: var(--rt); }
.rail__nav a[data-accent="neutral"]:hover, .rail__nav a[data-accent="neutral"].active{ border-left-color: var(--text-dim); }

.rail__footer{
  margin-top: auto;
}

.rail__links{
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rail__links .hero-link{
  flex: none;
  width: 100%;
  padding: 10px 12px;
  font-size: 13px;
  gap: 10px;
}
.rail__links .hero-link__icon{
  width: 18px;
  height: 18px;
}

.rail__toggle{
  display: none;
}

main{
  flex: 1;
  min-width: 0;
}

/* ---------- readout / hud stat ---------- */

.readout{
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
}
.readout__item{ display: flex; flex-direction: column; gap: 4px; }
.readout__item b{
  color: var(--text);
  font-size: 20px;
  font-weight: 500;
  font-family: var(--font-mono);
}

/* ---------- hero (condensed) ---------- */

.hero-compact__intro{ min-width: 0; }
.hero-compact__title{
  font-size: clamp(20px, 2.4vw, 28px);
  line-height: 1.2;
  margin-top: 10px;
  max-width: 72ch;
  font-weight: 700;
}
.hero-compact__lede{
  font-size: 20px;
  margin-top: 10px;
  max-width: 62ch;
}

.hero-compact__links{
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}
.hero-link{
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  background: var(--bg-panel);
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--text);
  flex: 1 1 200px;
  transition: border-color .15s ease, background-color .15s ease;
}
.hero-link:hover{ border-color: var(--text-dim); background: var(--bg-panel-2); }
.hero-link__icon{
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  transition: color .15s ease;
}
.hero-link__icon svg, .hero-link__icon img{ width: 100%; height: 100%; }
.hero-link:hover .hero-link__icon{ color: var(--text); }

/* ---------- work (featured category cards) ---------- */

.work-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.effects-grid-2up{
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.work-card{
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-top: 2px solid var(--line);
  transition: border-color .15s ease;
}
.work-card:hover{ border-color: var(--text-dim); }
.work-card[data-accent="shader"]{ border-top-color: var(--shader); }
.work-card[data-accent="post"]{ border-top-color: var(--post); }
.work-card[data-accent="rt"]{ border-top-color: var(--rt); }

.work-card__thumb{
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--bg-panel-2);
  overflow: hidden;
}
.work-card__thumb img, .work-card__thumb video{
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.work-card__thumb-fallback{
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px;
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  background:
    repeating-linear-gradient(45deg, var(--line-soft) 0 1px, transparent 1px 9px);
}

.work-card__body{ padding: 18px 20px 20px; }
.work-card__label{ font-size: 11px; }
.work-card__title{ font-size: 19px; margin-top: 10px; line-height: 1.25; }
.work-card__link{ margin-top: 16px; font-size: 14px; color: var(--text-dim); }

/* ---------- games (linked thumbnail grid) ---------- */

.game-grid{
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: 1536px;
  gap: 32px;
  margin-top: 24px;
}

.game-card{
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  transition: border-color .15s ease;
}
.game-card:hover{ border-color: var(--text-dim); }

.game-card__thumb{
  position: relative;
  width: 100%;
  min-width: 0;
  aspect-ratio: 130/103;
  background: #000;
  overflow: hidden;
  padding: 8px;
}
.game-card__thumb img{
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.game-card__thumb video{
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.game-card--fill .game-card__thumb{ padding: 0; }
.game-card--fill .game-card__thumb img{ object-fit: cover; }

.game-card__fallback{
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px;
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  background:
    repeating-linear-gradient(45deg, var(--line-soft) 0 1px, transparent 1px 9px);
}

.game-card__body{
  padding: 12px 14px;
  border-top: 1px solid var(--line);
}
.game-card__title-sm{
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.game-card__accolade{
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.4;
  color: var(--gold);
}
.game-card__accolade::before{
  content: '★';
  flex-shrink: 0;
}

/* ---------- now playing (small personality card) ---------- */

.now-playing{
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  background: var(--bg-panel);
}
.now-playing__dot{
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--post);
  box-shadow: 0 0 0 3px rgba(74, 217, 199, 0.15);
  margin-right: 10px;
  animation: now-playing-pulse 2s ease-in-out infinite;
}
@keyframes now-playing-pulse{
  0%, 100%{ opacity: 1; }
  50%{ opacity: 0.4; }
}
.now-playing__label{
  font-size: 10px;
  letter-spacing: 0.05em;
  color: var(--text-faint);
}
.now-playing__game{
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-top: 3px;
}

/* ---------- about (bio + tools columns) ---------- */

.about-row{
  display: flex;
  gap: 48px;
  flex-wrap: wrap;
}
.about-main{
  flex: 2 1 480px;
  max-width: 900px;
  min-width: 0;
}
.about-tools{
  flex: 1 1 200px;
  max-width: 320px;
  min-width: 0;
}

/* ---------- badge (tech / tag pill) ---------- */

.badge{
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border: 1px solid var(--line);
  background: var(--bg-panel);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
}
.badge[data-accent="shader"]{ border-color: var(--shader-dim); color: var(--shader); }
.badge[data-accent="post"]{ border-color: var(--post-dim); color: var(--post); }
.badge[data-accent="rt"]{ border-color: var(--rt-dim); color: var(--rt); }

/* ---------- compare slider (before / after drag) ---------- */

.compare-slider__frame{
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #000;
  --pos: 50%;
}
.compare-slider__frame img{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
.compare-slider__before{ z-index: 1; }
.compare-slider__after{
  z-index: 2;
  clip-path: inset(0 calc(100% - var(--pos)) 0 0);
}
.compare-slider__fallback{
  display: none;
  position: absolute;
  inset: 0;
  z-index: 1;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px;
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  background:
    repeating-linear-gradient(45deg, var(--line-soft) 0 1px, transparent 1px 9px);
}
.compare-slider__tag{
  position: absolute;
  top: 10px;
  z-index: 3;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  color: var(--text);
  background: rgba(0, 0, 0, 0.55);
  padding: 3px 8px;
  pointer-events: none;
}
.compare-slider__tag--before{ left: 10px; }
.compare-slider__tag--after{ right: 10px; }
.compare-slider__divider{
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos);
  width: 2px;
  background: var(--text);
  transform: translateX(-1px);
  z-index: 4;
  pointer-events: none;
}
.compare-slider__divider::before{
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--text);
  transform: translate(-50%, -50%);
}
.compare-slider__input{
  position: absolute;
  inset: 0;
  z-index: 5;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
  -webkit-appearance: none;
  appearance: none;
}

/* ---------- prose (body paragraphs on project pages) ---------- */

.prose{
  font-size: var(--prose-size, 17px);
}

@media (max-width: 1600px){
  .prose{
    font-size: calc(var(--prose-size, 17px) * 0.8);
  }
  :root{
    --nav-w: 180px;
  }
  .rail__brand .name{ font-size: 16px; }
  .rail__brand .role{ font-size: 12px; }
  .rail__section-label{ font-size: 11px; }
  .rail__nav a{ font-size: 14px; padding: 6px 6px 6px 8px; }
  .rail__links .hero-link{ font-size: 12px; padding: 8px 10px; gap: 8px; }
  .rail__links .hero-link__icon{ width: 16px; height: 16px; }
}

/* ---------- panel (replaces "card") ---------- */

.panel{
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-left: 2px solid var(--line);
  padding: 28px;
}
.panel[data-accent="shader"]{ border-left-color: var(--shader); }
.panel[data-accent="post"]{ border-left-color: var(--post); }
.panel[data-accent="rt"]{ border-left-color: var(--rt); }

/* ---------- buttons / links ---------- */

.btn{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  background: transparent;
  transition: border-color .15s ease, background-color .15s ease;
}
.btn:hover{ border-color: var(--text-dim); background: var(--bg-panel); }
.btn--solid{ background: var(--text); color: var(--bg-void); border-color: var(--text); }
.btn--solid:hover{ background: var(--text); opacity: .85; }

/* ---------- utility ---------- */

.section{ padding: 96px 64px; border-bottom: 1px solid var(--line); }
.section:last-of-type{ border-bottom: none; }
.eyebrow-num{
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--text-faint);
}

.card-carousel{ display: grid; }

.stack-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
}

@media (max-width: 860px){
  .stack-grid{
    grid-template-columns: 1fr;
  }
  .effects-grid-2up{
    grid-template-columns: 1fr;
  }
  .card-carousel{
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    padding-bottom: 10px;
    margin-left: -24px;
    margin-right: -24px;
    padding-left: 24px;
    padding-right: 24px;
  }
  .card-carousel > *{
    flex: 0 0 78%;
    scroll-snap-align: start;
  }

  .rail{
    position: fixed;
    left: 0; top: 0;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform .2s ease;
    z-index: 20;
    box-shadow: 40px 0 60px rgba(0,0,0,0.4);
  }
  .rail.open{ transform: translateX(0); }
  .rail__toggle{
    display: flex;
    position: fixed;
    top: 18px; left: 18px;
    z-index: 21;
    width: 40px; height: 40px;
    align-items: center; justify-content: center;
    background: var(--bg-panel);
    border: 1px solid var(--line);
    color: var(--text);
    font-family: var(--font-mono);
    cursor: pointer;
  }
  .section{ padding: 72px 24px; }
  .game-grid{ grid-template-columns: repeat(2, 1fr); }

  #about{
    display: flex;
    flex-direction: column;
  }
  #about .about-row{
    display: contents;
  }
  #about .about-main,
  #about .about-tools{
    flex: 0 0 auto;
    width: 100%;
    max-width: none;
  }
  #about .eyebrow-num.about-main{ order: 1; }
  #about .about-main:not(.eyebrow-num){ order: 2; margin-top: 8px; }
  #about .eyebrow-num.about-tools{ order: 3; margin-top: 32px; }
  #about .about-tools:not(.eyebrow-num){ order: 4; margin-top: 8px; }
}

@media (min-width: 861px) and (max-width: 1080px){
  .game-grid{ grid-template-columns: repeat(3, 1fr); }
}
