/* DENYA SONATA PORTFOLIO */

:root {
  --bg-dark:    #050a05;
  --bg-mid:     #0a120a;
  --bg-panel:   #0d1a0d;
  --bg-card:    #0f1f0f;
  --green:      #00ff41;
  --green-dim:  #00cc33;
  --green-dark: #004d14;
  --blue:       #00cfff;
  --blue-dim:   #0099cc;
  --blue-dark:  #003344;
  --white:      #e8f5e8;
  --gray:       #557755;
  --border:     #1a3320;
  --border-glow:#00ff4133;
  --font-pixel: 'Press Start 2P', monospace;
  --font-vt:    'VT323', monospace;
  --font-mono:  'Share Tech Mono', monospace;
}

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

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  background: var(--bg-dark);
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.7;
  overflow-x: hidden;
  cursor: default;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, video { -webkit-user-drag: none; }

/* SCANLINES */
.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.08) 2px,
    rgba(0,0,0,0.08) 4px
  );
}

/* NAV */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: rgba(5, 10, 5, 0.95);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  z-index: 100;
  backdrop-filter: blur(4px);
}

.nav-logo { font-family: var(--font-pixel); font-size: 10px; color: var(--green); white-space: nowrap; }
.pixel-bracket { color: var(--green-dim); }
.nav-name { color: var(--green); margin: 0 4px; }
.nav-links { display: flex; gap: 24px; }

.nav-link {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--gray);
  text-decoration: none;
  letter-spacing: 1px;
  transition: color 0.2s;
  position: relative;
  display: inline-block;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 1px;
  background: var(--green);
  transition: width 0.2s;
}

.nav-link:hover { color: var(--green); }
.nav-link:hover::after { width: 100%; }

.nav-status { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--gray); }

.status-dot {
  width: 6px; height: 6px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

/* HERO */
.hero {
  min-height: 100vh;
  padding: 80px 80px 60px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 60px;
  position: relative;
  overflow: hidden;
}

.hero-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.4;
  pointer-events: none;
}

.hero-content { position: relative; z-index: 2; }

.hero-tag {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--blue);
  margin-bottom: 24px;
  animation: typeIn 0.5s ease both 0.2s;
}

.hero-title { display: flex; flex-direction: column; gap: 0; margin-bottom: 16px; }

.title-line {
  font-family: var(--font-pixel);
  font-size: clamp(28px, 5vw, 52px);
  color: var(--white);
  line-height: 1.3;
  animation: slideUp 0.6s ease both;
}

.title-line.accent {
  color: var(--green);
  text-shadow: 0 0 20px var(--green-dim);
  animation-delay: 0.15s;
}

.hero-sub {
  font-family: var(--font-vt);
  font-size: 22px;
  color: var(--blue);
  margin-bottom: 20px;
  letter-spacing: 2px;
  animation: slideUp 0.6s ease both 0.3s;
}

.hero-desc {
  font-size: 13px;
  color: var(--gray);
  margin-bottom: 36px;
  min-height: 40px;
  animation: slideUp 0.6s ease both 0.45s;
}

.cursor-prefix { color: var(--green); margin-right: 8px; }
.blink-cursor { color: var(--green); animation: blink 0.8s step-end infinite; }

.hero-ctas {
  display: flex;
  gap: 16px;
  animation: slideUp 0.6s ease both 0.6s;
}

.btn {
  font-family: var(--font-pixel);
  font-size: 8px;
  padding: 14px 20px;
  text-decoration: none;
  letter-spacing: 1px;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  cursor: crosshair;
  display: inline-block;
}

.btn-primary { background: var(--green); color: var(--bg-dark); border: 2px solid var(--green); }
.btn-primary:hover { background: transparent; color: var(--green); box-shadow: 0 0 14px rgba(0,255,65,0.25), inset 0 0 8px rgba(0,255,65,0.15); }
.btn-secondary { background: transparent; color: var(--green); border: 2px solid var(--green-dark); }
.btn-secondary:hover { border-color: var(--green); box-shadow: 0 0 12px var(--green-dark); }

/* HERO DECO */
.hero-deco {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  animation: slideUp 0.8s ease both 0.4s;
}

.deco-frame {
  border: 2px solid var(--green-dark);
  position: relative;
  max-width: 360px;
  width: 100%;
  cursor: crosshair;
}

.deco-frame::before {
  content: '';
  position: absolute;
  inset: -6px;
  border: 1px solid var(--border);
  pointer-events: none;
}

.deco-inner {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--bg-panel);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  isolation: isolate;
}

.deco-inner::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(90deg, rgba(0,255,65,0.08) 1px, transparent 1px),
    linear-gradient(rgba(0,255,65,0.08) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.26;
  pointer-events: none;
  animation: decoGridMove 3s linear infinite;
}

.deco-inner img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: saturate(0.8) contrast(1.1);
  transition: filter 0.3s, transform 0.3s;
  border: 1px solid rgba(0,255,65,0.12);
  box-shadow: 0 0 18px rgba(0,255,65,0.12);
}

.deco-inner:hover img { filter: saturate(1.1) contrast(1.1); box-shadow: 0 0 24px rgba(0,255,65,0.25); }

.deco-label {
  background: var(--bg-dark);
  border-top: 1px solid var(--green-dark);
  padding: 6px 12px;
  font-size: 10px;
  color: var(--green-dim);
  text-align: center;
}

.deco-flip-hint {
  font-family: var(--font-pixel);
  font-size: 7px;
  color: var(--green);
  text-align: center;
  padding: 5px 0;
  border-top: 1px solid var(--green-dark);
  background: var(--bg-dark);
  letter-spacing: 1px;
  animation: blink 1.2s step-end infinite;
}

.hero-img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: saturate(0.8) contrast(1.1);
  transition: opacity 0.2s ease;
}

.hero-img.deco-flip { opacity: 0; }

/* SECTIONS */
.section { padding: 80px 80px; border-top: 1px solid var(--border); }

.section-header { display: flex; align-items: center; gap: 20px; margin-bottom: 40px; }

.section-tag { font-family: var(--font-pixel); font-size: 10px; color: var(--green); white-space: nowrap; }
.section-line { flex: 1; height: 1px; background: linear-gradient(90deg, var(--border), transparent); }

/* ABOUT */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }

.terminal-box { border: 1px solid var(--green-dark); background: var(--bg-panel); }

.terminal-topbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--green-dark);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tb-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.tb-dot.red    { background: #ff5555; }
.tb-dot.yellow { background: #ffcc00; }
.tb-dot.green  { background: var(--green); }
.tb-title { margin-left: auto; font-size: 11px; color: var(--gray); font-family: var(--font-mono); }

.terminal-body { padding: 20px; font-family: var(--font-mono); font-size: 13px; line-height: 1.8; }
.t-label { color: var(--green); margin-right: 8px; }
.t-desc { color: var(--gray); }

.about-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.stat-card {
  border: 1px solid var(--border);
  background: var(--bg-panel);
  padding: 20px;
  text-align: center;
  transition: border-color 0.2s;
}

.stat-card:hover { border-color: var(--green-dark); }

.stat-num { font-family: var(--font-pixel); font-size: 24px; color: var(--green); text-shadow: 0 0 12px var(--green-dim); display: block; margin-bottom: 8px; }
.stat-label { font-size: 10px; color: var(--gray); font-family: var(--font-pixel); letter-spacing: 1px; }

/* GALLERY */
.filter-bar { display: flex; gap: 12px; margin-bottom: 32px; flex-wrap: wrap; }

.filter-btn {
  font-family: var(--font-pixel);
  font-size: 8px;
  padding: 8px 14px;
  background: transparent;
  color: var(--gray);
  border: 1px solid var(--border);
  cursor: crosshair;
  letter-spacing: 1px;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.filter-btn:hover, .filter-btn.active { background: var(--green-dark); color: var(--green); border-color: var(--green-dim); }

.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }

.gallery-item { cursor: crosshair; transition: transform 0.2s; }
.gallery-item:hover { transform: translateY(-4px); }
.gallery-item.hidden { display: none; }

.gallery-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: crosshair;
  isolation: isolate;
}

/* loading state */
.gallery-img-wrap.loading::before,
.anim-preview.loading::before,
.sv-preview-wrap.loading::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.35);
  pointer-events: none;
}

.gallery-img-wrap.loading::after,
.anim-preview.loading::after,
.sv-preview-wrap.loading::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 30px; height: 30px;
  border: 3px solid rgba(255,255,255,0.18);
  border-top-color: var(--green);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: spinner 0.85s linear infinite;
  pointer-events: none;
}

.gallery-img-wrap.loading img,
.anim-preview.loading video,
.sv-preview-wrap.loading img,
.sv-preview-wrap.loading video { opacity: 0.25; }

@keyframes spinner {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.gallery-img-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.75);
  transition: filter 0.2s, transform 0.2s;
}

.gallery-item:hover .gallery-img-wrap img { filter: saturate(1.1) contrast(1.05); transform: scale(1.04); }

.gallery-img-wrap.img-error::after {
  content: 'IMAGE NOT FOUND';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: var(--gray);
  font-family: var(--font-pixel);
  text-align: center;
  padding: 8px;
}

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.2s;
}

.gallery-img-wrap:hover .gallery-overlay { opacity: 1; }

.overlay-title { font-family: var(--font-pixel); font-size: 8px; color: var(--green); text-align: center; padding: 0 8px; line-height: 1.6; }
.overlay-tag { font-size: 10px; color: var(--blue); border: 1px solid var(--blue-dark); padding: 2px 8px; }

.gallery-meta { padding: 8px 4px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.meta-title { font-size: 11px; color: var(--white); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta-sub { font-size: 10px; color: var(--gray); }
.credit { font-size: 9px; color: var(--gray); }
.meta-cat { font-family: var(--font-pixel); font-size: 7px; padding: 2px 6px; flex-shrink: 0; }
.cat-oc     { color: var(--green); border: 1px solid var(--green-dark); }
.cat-fanart { color: var(--blue);  border: 1px solid var(--blue-dark); }
.cat-comm   { color: #ffcc00;      border: 1px solid #664400; }

/* ANIMATIONS SECTION */
.anim-tabs { display: flex; gap: 0; margin-bottom: 32px; border-bottom: 1px solid var(--border); }

.anim-tab {
  font-family: var(--font-pixel);
  font-size: 8px;
  padding: 12px 20px;
  background: transparent;
  color: var(--gray);
  border: none;
  border-bottom: 2px solid transparent;
  cursor: crosshair;
  letter-spacing: 1px;
  transition: color 0.2s, border-bottom-color 0.2s;
  margin-bottom: -1px;
}

.anim-tab:hover { color: var(--green); }
.anim-tab.active { color: var(--green); border-bottom-color: var(--green); }

.anim-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }

.anim-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: border-color 0.2s, transform 0.2s;
}

.anim-card:hover { border-color: var(--green-dark); transform: translateY(-4px); }
.anim-card.wide { grid-column: span 2; }

.anim-preview { position: relative; width: 100%; aspect-ratio: 16/9; background: var(--bg-dark); overflow: hidden; cursor: crosshair; }
.anim-video { width: 100%; height: 100%; object-fit: cover; display: block; }
.anim-info { padding: 12px; display: flex; justify-content: space-between; align-items: center; }
.anim-title { font-family: var(--font-pixel); font-size: 8px; color: var(--white); line-height: 1.6; }
.anim-tag { font-size: 10px; color: var(--blue); border: 1px solid var(--blue-dark); padding: 2px 8px; flex-shrink: 0; }

/* COLLAB */
.collab-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.collab-card { cursor: crosshair; }
.collab-card .gallery-img-wrap { aspect-ratio: 4/3; }

/* CONTACT */
.contact-wrap { max-width: 600px; }
.contact-terminal .terminal-body { font-size: 14px; }
.contact-links { display: flex; flex-direction: column; gap: 12px; }

.contact-link {
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--green);
  text-decoration: none;
  letter-spacing: 1px;
  transition: color 0.2s, text-shadow 0.2s;
}

.contact-link:hover { color: var(--blue); text-shadow: 0 0 8px var(--blue-dim); }

/* FOOTER */
.footer {
  padding: 24px 80px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--gray);
  background: var(--bg-mid);
}

.footer-left { font-family: var(--font-pixel); font-size: 8px; color: var(--green); }
.footer-right { display: flex; align-items: center; gap: 6px; font-size: 10px; }

/* LIGHTBOX */
.lightbox { position: fixed; inset: 0; z-index: 500; display: flex; align-items: center; justify-content: center; }
.lightbox.hidden { display: none; }
.lightbox-bg { position: absolute; inset: 0; background: rgba(0,0,0,0.92); cursor: crosshair; }

.lightbox-content {
  position: relative;
  z-index: 1;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.lightbox-content img { max-width: 100%; max-height: 80vh; object-fit: contain; border: 2px solid var(--green-dark); }
.lb-close { font-family: var(--font-pixel); font-size: 9px; color: var(--green); cursor: crosshair; letter-spacing: 2px; }
.lb-label { font-size: 12px; color: var(--gray); }

/* SCROLL REVEAL */
.stat-card, .section-header, .terminal-box, .steam-viewer {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.stat-card.revealed, .section-header.revealed, .terminal-box.revealed, .steam-viewer.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* STEAM VIEWER */
.steam-viewer { width: 100%; margin-bottom: 0; }

.sv-main {
  display: flex;
  align-items: stretch;
  width: 100%;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  margin-bottom: 8px;
}

.sv-preview-wrap {
  flex: 1;
  position: relative;
  min-height: 320px;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  isolation: isolate;
}

.sv-big-img { width: 100%; height: 100%; max-height: 520px; object-fit: contain; display: block; transition: opacity 0.15s ease; }
.sv-big-video { width: 100%; max-height: 520px; display: block; background: #000; cursor: crosshair; }

.sv-img-label {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 8px 14px;
  background: rgba(0,0,0,0.75);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--white);
  letter-spacing: 1px;
}

.sv-arrow {
  width: 44px;
  flex-shrink: 0;
  background: rgba(0,0,0,0.7);
  color: var(--gray);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: crosshair;
  transition: background 0.15s, color 0.15s;
  user-select: none;
  border: none;
  z-index: 2;
}

.sv-arrow:hover { background: var(--green-dark); color: var(--green); }

.sv-strip-wrap {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--green-dark) var(--bg-card);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: none;
}

.sv-strip-wrap::-webkit-scrollbar { height: 4px; }
.sv-strip-wrap::-webkit-scrollbar-track { background: var(--bg-dark); }
.sv-strip-wrap::-webkit-scrollbar-thumb { background: var(--green-dark); }

.sv-strip { display: flex; gap: 4px; padding: 4px; width: max-content; }

.sv-thumb {
  width: 116px; height: 66px;
  flex-shrink: 0;
  cursor: crosshair;
  border: 2px solid transparent;
  overflow: hidden;
  background: var(--bg-dark);
  transition: border-color 0.1s;
  position: relative;
}

.sv-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; filter: saturate(0.6) contrast(0.98); }
.sv-thumb.active { border-color: var(--green); }
.sv-thumb:hover  { border-color: var(--green-dim); }

.sv-thumb-vid { width: 140px; height: 66px; }

.sv-thumb-vid-inner {
  width: 100%; height: 100%;
  background: var(--bg-panel);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px;
  transition: background 0.15s;
}

.sv-play-icon { font-size: 16px; color: var(--green); }
.sv-thumb-vid.active .sv-thumb-vid-inner { background: var(--green-dark); }

.sv-thumb-title { font-family: var(--font-pixel); font-size: 6px; color: var(--gray); text-align: center; line-height: 1.5; word-break: break-word; }
.sv-thumb-vid.active .sv-thumb-title { color: var(--green); }

.sv-vid-loops {
  position: absolute;
  top: 10px; right: 10px;
  font-family: var(--font-pixel);
  font-size: 7px;
  color: var(--green);
  background: rgba(0,0,0,0.7);
  padding: 3px 7px;
  border: 1px solid var(--green-dark);
  pointer-events: none;
}

.sv-unmute-hint {
  position: absolute;
  top: 10px; left: 10px;
  font-family: var(--font-pixel);
  font-size: 7px;
  color: var(--green);
  background: rgba(0,0,0,0.75);
  padding: 3px 7px;
  border: 1px solid var(--green-dark);
  pointer-events: none;
  letter-spacing: 1px;
}

/* UTILS */
.hidden { display: none !important; }

/* KEYFRAMES */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.8); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes typeIn {
  from { opacity: 0; letter-spacing: -4px; }
  to   { opacity: 1; letter-spacing: normal; }
}

@keyframes glitch {
  0%, 95%, 100% { text-shadow: 0 0 20px var(--green), 0 0 40px var(--green-dim); transform: none; }
  96% { transform: translate(-2px, 1px); text-shadow: -2px 0 var(--blue), 2px 0 #ff0; }
  97% { transform: translate(2px, -1px); text-shadow: 2px 0 var(--blue), -2px 0 #ff0; }
  98% { transform: none; }
}

@keyframes decoGridMove {
  from { background-position: 0 0, 0 0; }
  to   { background-position: 24px 24px, -24px -24px; }
}

/* RESPONSIVE */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding: 80px 32px 60px; }
  .hero-deco { display: none; }
  .about-grid { grid-template-columns: 1fr; }
  .section { padding: 60px 32px; }
  .footer { flex-direction: column; gap: 12px; text-align: center; padding: 20px 32px; }
  .nav { padding: 0 20px; }
  .nav-links { gap: 12px; }
  .nav-link { font-size: 7px; }
  .anim-card.wide { grid-column: span 1; }
}

@media (max-width: 600px) {
  .nav-links { display: none; }
  .hero-title .title-line { font-size: 22px; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .sv-thumb { width: 92px; height: 52px; }
  .sv-thumb-vid { width: 110px; height: 52px; }
}
