/* =============================================
   PORTFOLIO — TouchDesigner / New Media Artist
   Design: Terminal-minimal with glitch accents
   ============================================= */

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

:root {
  --bg:        #080808;
  --bg-2:      #111111;
  --bg-3:      #1a1a1a;
  --fg:        #e8e4dc;
  --fg-muted:  #888880;
  --fg-dim:    #444440;
  --accent:    #ff4800;        /* neon chartreuse */
  --accent-2:  #ff3c3c;        /* glitch red */
  --accent-3:  #00d4ff;        /* signal blue */
  --border:    rgba(232,228,220,0.08);
  --border-hover: rgba(255, 119, 0, 0.25);

  --font-display: 'Syne', sans-serif;
  --font-mono:    'DM Mono', monospace;

  --nav-h: 56px;
  --max-w: 1100px;
  --pad:   clamp(1.25rem, 5vw, 3rem);

  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: clamp(13px, 1.5vw, 15px);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── SCROLLBAR ─────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--fg-dim); border-radius: 2px; }

/* ── SELECTION ─────────────────────────────── */
::selection { background: var(--accent); color: var(--bg); }

/* ── CANVAS LAYER ──────────────────────────── */
#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.85;
  pointer-events: none;
}

/* ── NAV ───────────────────────────────────── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--pad);
  border-bottom: 1px solid var(--border);
  background: rgba(8,8,8,0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav-logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  letter-spacing: -0.02em;
  color: var(--fg);
  text-decoration: none;
}
.nav-logo span { color: var(--accent); }

.nav-links {
  display: flex;
  gap: clamp(1rem, 3vw, 2.5rem);
  list-style: none;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
  text-decoration: none;
  transition: color 0.2s;
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -3px; left: 0; right: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease-out-expo);
}
.nav-links a:hover { color: var(--fg); }
.nav-links a:hover::after,
.nav-links a.active::after { transform: scaleX(1); }
.nav-links a.active { color: var(--fg); }

/* hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 1px;
  background: var(--fg);
  transition: transform 0.3s, opacity 0.3s;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* mobile nav */
@media (max-width: 640px) {
  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    position: fixed;
    top: var(--nav-h); left: 0; right: 0;
    background: rgba(8,8,8,0.97);
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    gap: 1.5rem;
    border-bottom: 1px solid var(--border);
  }
  .nav-links.open { display: flex; }
  .nav-links a { font-size: 14px; }
}

/* ── PAGE WRAPPER ──────────────────────────── */
main {
  position: relative;
  z-index: 1;
  padding-top: var(--nav-h);
  min-height: 100dvh;
}

/* ── SECTION CONTAINER ─────────────────────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad);
}

/* ── HERO ──────────────────────────────────── */
.hero {
  min-height: calc(100dvh - var(--nav-h));
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 var(--pad) clamp(2rem, 6vw, 4rem);
}

.hero-tag {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.8rem, 6vw, 7.5rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
}
.hero-title em {
  font-style: normal;
  color: var(--accent);
}

.hero-sub {
  max-width: 480px;
  color: var(--fg-muted);
  font-size: clamp(13px, 1.6vw, 15px);
  margin-bottom: 2.5rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ── BUTTONS ───────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.4rem;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid currentColor;
  transition: background 0.2s, color 0.2s, transform 0.15s;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}
.btn-primary:hover { background: #e85100; border-color: #e80000; }

.btn-ghost {
  background: transparent;
  color: var(--fg-muted);
  border-color: var(--border);
}
.btn-ghost:hover { color: var(--fg); border-color: var(--fg); }

/* ── SECTION HEADERS ───────────────────────── */
.section { padding: clamp(4rem, 10vw, 8rem) 0; }

.section-label {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.8rem, 5vw, 3.5rem);
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin-bottom: 1.5rem;
}

.section-body {
  color: var(--fg-muted);
  max-width: 560px;
  line-height: 1.8;
}

/* ── DIVIDER LINE ──────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0;
}

/* ── PROJECT GRID ──────────────────────────── */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  margin-top: 3rem;
}

.project-card {
  background: var(--bg);
  padding: clamp(1.5rem, 3vw, 2rem);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: background 0.2s;
  position: relative;
  overflow: hidden;
}
.project-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 0;
  background: var(--accent);
  transition: height 0.3s var(--ease-out-expo);
}
.project-card:hover { background: var(--bg-2); }
.project-card:hover::before { height: 100%; }

.card-year {
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--fg-dim);
}

.card-title {
  font-family: var(--font-display);
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.card-desc {
  color: var(--fg-muted);
  font-size: 12px;
  line-height: 1.7;
  flex: 1;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.25rem;
}

.tag {
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 8px;
  border: 1px solid var(--fg-dim);
  color: var(--fg-dim);
  transition: border-color 0.2s, color 0.2s;
}
.project-card:hover .tag { border-color: var(--accent); color: var(--accent); }

/* ── ABOUT LAYOUT ──────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
  margin-top: 3rem;
}

@media (max-width: 700px) {
  .about-grid { grid-template-columns: 1fr; }
}

.about-img-wrap {
  aspect-ratio: 3/4;
  overflow: hidden;
  position: relative;
}
.about-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%) contrast(1.1);
  transition: filter 0.4s;
}
.about-img-wrap:hover img { filter: grayscale(0%) contrast(1); }

.about-img-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid var(--border);
  pointer-events: none;
}

.about-text { padding-top: 0.5rem; }

.about-text p { color: var(--fg-muted); margin-bottom: 1.25rem; }

.skills-list {
  list-style: none;
  margin-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.skills-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--fg-muted);
}
.skills-list li span:last-child {
  color: var(--fg-dim);
  font-size: 10px;
  letter-spacing: 0.1em;
}

/* ── ART MASONRY ───────────────────────────── */
.art-grid {
  columns: clamp(240px, 30vw, 360px) 3;
  column-gap: 1px;
  margin-top: 3rem;
  background: var(--border);
}

.art-item {
  break-inside: avoid;
  margin-bottom: 1px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
}
.art-item img, .art-item canvas {
  display: block;
  width: 100%;
  transition: transform 0.5s var(--ease-out-expo);
}
.art-item:hover img, .art-item:hover canvas { transform: scale(1.03); }

.art-item-overlay {
  position: absolute;
  inset: 0;
  background: rgba(8,8,8,0.8);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.25s;
}
.art-item:hover .art-item-overlay { opacity: 1; }
.art-item-overlay h3 {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
}
.art-item-overlay p {
  font-size: 11px;
  color: var(--fg-muted);
  margin-top: 2px;
}

/* ── AUDIO INDICATOR ───────────────────────── */
.audio-btn {
  position: fixed;
  bottom: 1.5rem;
  right: var(--pad);
  z-index: 50;
  width: 44px;
  height: 44px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 0;
  transition: border-color 0.2s;
}
.audio-btn:hover { border-color: var(--accent); }

.audio-btn .bar {
  width: 3px;
  background: var(--fg-dim);
  border-radius: 1px;
  transition: background 0.2s;
  animation: none;
}
.audio-btn.active .bar { background: var(--accent); }
.audio-btn.active .bar:nth-child(1) { animation: eq 0.8s ease-in-out infinite; }
.audio-btn.active .bar:nth-child(2) { animation: eq 0.8s ease-in-out 0.15s infinite; }
.audio-btn.active .bar:nth-child(3) { animation: eq 0.8s ease-in-out 0.3s infinite; }
.audio-btn.active .bar:nth-child(4) { animation: eq 0.8s ease-in-out 0.45s infinite; }

@keyframes eq {
  0%, 100% { height: 8px; }
  50%       { height: 22px; }
}

/* ── FOOTER ────────────────────────────────── */
footer {
  position: relative;
  z-index: 1;
  padding: clamp(2rem, 5vw, 3.5rem) var(--pad);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-copy {
  font-size: 11px;
  color: var(--fg-dim);
  letter-spacing: 0.06em;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}
.footer-links a {
  font-size: 11px;
  color: var(--fg-dim);
  text-decoration: none;
  letter-spacing: 0.08em;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--accent); }

/* ── PAGE TRANSITIONS ──────────────────────── */
.page-content {
  animation: fadein 0.4s var(--ease-out-expo);
}
@keyframes fadein {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── UTILITY ───────────────────────────────── */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

.text-accent  { color: var(--accent); }
.text-muted   { color: var(--fg-muted); }
.mt-sm  { margin-top: 0.75rem; }
.mt-md  { margin-top: 1.5rem; }
.mt-lg  { margin-top: 3rem; }
