/* =========================================================
   style.css — Ko0 3D Portfolio
   Aesthetic: Deep Space HUD / Obsidian Terminal
   Fonts: COSMO.otf (display) + Syne (body/UI)
   ========================================================= */

@import "tailwindcss";

/* ── Custom Display Font ── */
@font-face {
  font-family: "Space";
  src: url("/font/galaxy/COSMO.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
}

/* ── Design Tokens ── */
:root {
  --bg0: #04040a;

  /* text — brightened so --muted is legible against obsidian stars */
  --text:  #eef0ff;
  --muted: #9da8d8;   /* was #7a82b8 — now clearly visible on dark bg */
  --dim:   #6b75a8;

  /* card surface */
  --card:    rgba(10, 12, 32, 0.68);
  --card-b:  rgba(16, 18, 48, 0.82);

  /* strokes */
  --stroke:  rgba(120, 140, 255, 0.14);
  --stroke2: rgba(160, 100, 255, 0.28);

  /* accents */
  --violet:   #7c3aed;
  --violet-l: #a78bfa;
  --cyan:     #22d3ee;
  --cyan-d:   #0e9ab8;

  /* glows */
  --glow-v: rgba(124, 58, 237, 0.5);
  --glow-c: rgba(34, 211, 238, 0.45);

  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 18px;
}

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

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--bg0);
  color: var(--text);
  font-family: "Syne", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ── Starfield Canvas ── */
#starlight-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  width: 100vw;
  height: 100vh;
}

/* ── Scanlines ── */
#scanlines {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent, transparent 2px,
    rgba(0,0,0,0.055) 2px, rgba(0,0,0,0.055) 4px
  );
  opacity: 0.55;
}

/* ── Corner Brackets ── */
.corner {
  position: fixed; z-index: 50;
  width: 22px; height: 22px;
  pointer-events: none; opacity: 0.5;
}
.corner.tl { top:16px;    left:16px;   border-top:  1.5px solid var(--cyan); border-left:  1.5px solid var(--cyan); }
.corner.tr { top:16px;    right:16px;  border-top:  1.5px solid var(--cyan); border-right: 1.5px solid var(--cyan); }
.corner.bl { bottom:16px; left:16px;   border-bottom:1.5px solid var(--cyan); border-left: 1.5px solid var(--cyan); }
.corner.br { bottom:16px; right:16px;  border-bottom:1.5px solid var(--cyan); border-right:1.5px solid var(--cyan); }

/* ══════════════════════════════════════
   NAV
══════════════════════════════════════ */
#nav {
  position: fixed; top:0; left:0; right:0;
  z-index: 100; height: 52px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px;
  background: linear-gradient(180deg, rgba(4,4,10,.92) 0%, transparent 100%);
  border-bottom: 1px solid var(--stroke);
}

#nav-logo {
  font-family: "Space", monospace;
  font-size: 1.3rem;
  letter-spacing: 0.12em;
  color: var(--text);
  text-shadow: 0 0 20px var(--glow-v);
  user-select: none;
  min-width: 56px;
}

#nav-links {
  display: flex; gap: 4px; list-style: none;
}

.nav-btn {
  position: relative; background: none; border: none;
  color: var(--muted);
  font-family: "Syne", sans-serif;
  font-size: 0.68rem; font-weight: 600;
  letter-spacing: 0.2em;
  padding: 6px 18px; cursor: pointer; outline: none;
  transition: color 0.2s;
}
.nav-btn::after {
  content: '';
  position: absolute; bottom: 0; left: 50%;
  width: 0; height: 1.5px;
  background: var(--cyan);
  transform: translateX(-50%);
  transition: width 0.25s ease;
  box-shadow: 0 0 8px var(--cyan);
}
.nav-btn:hover { color: var(--text); }
.nav-btn:hover::after { width: 60%; }
.nav-btn.active { color: var(--cyan); text-shadow: 0 0 10px var(--glow-c); }
.nav-btn.active::after { width: 60%; }

#nav-status {
  display: flex; align-items: center; gap: 7px;
  font-size: 0.6rem; letter-spacing: 0.18em; color: var(--muted);
}
.dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #22c55e; box-shadow: 0 0 8px #22c55e;
  animation: pulse 2.4s ease infinite;
}
@keyframes pulse {
  0%,100%{opacity:1} 50%{opacity:0.35}
}

/* ══════════════════════════════════════
   VIEWPORT + PANELS
══════════════════════════════════════ */
#viewport {
  position: fixed;
  inset: 52px 0 44px 0;
  z-index: 10;
  overflow: hidden;
}

.panel {
  position: absolute; inset: 0;
  display: none; opacity: 0;
}
.panel.active {
  display: flex;
  animation: fadePanel 0.4s ease forwards;
}
@keyframes fadePanel {
  from { opacity:0; transform:translateY(8px); }
  to   { opacity:1; transform:translateY(0); }
}

.panel-inner {
  width: 100%; height: 100%;
  padding: 24px 44px;
  display: flex; flex-direction: column;
  justify-content: center;
}

/* ══════════════════════════════════════
   HOME
══════════════════════════════════════ */
.home-layout {
  flex-direction: row !important;
  align-items: center;
  gap: 40px;
}
.home-left {
  flex: 1; display: flex; flex-direction: column;
  gap: 18px; min-width: 0;
}
.home-right {
  position: relative; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
}

/* Eyebrow */
.eyebrow {
  font-size: 0.62rem; font-weight: 600;
  letter-spacing: 0.24em; color: var(--cyan);
  margin-bottom: 4px;
}
.sep { color: var(--dim); margin: 0 3px; }

/* Hero */
.hero-title {
  font-family: "Space", serif;
  font-size: clamp(2rem, 4.5vw, 3.6rem);
  line-height: 1.08;
  color: var(--text);
  text-shadow: 0 0 40px var(--glow-v);
}
.hero-sub {
  color: var(--muted);
  font-size: 0.88rem; line-height: 1.65;
  max-width: 400px; margin-top: 6px;
}

/* Typewriter chars */
.char-anim, .caret-anim {
  display: inline-block; cursor: default;
  transition: transform 0.25s ease, text-shadow 0.25s ease;
}
.char-anim:hover { text-shadow: 0 0 12px #fff; transform: scale(1.3); }
.caret-anim { color: var(--cyan); }

/* Character art */
.char-canvas {
  max-height: min(72vh, 520px); width: auto;
  filter: drop-shadow(0 0 36px var(--glow-v));
  transition: filter 0.4s ease, transform 0.4s ease;
}
.char-canvas:hover {
  filter: drop-shadow(0 0 56px var(--glow-c));
  transform: scale(1.03) translateY(-4px);
}
.char-glow {
  position: absolute; bottom: -16px;
  left: 50%; transform: translateX(-50%);
  width: 180px; height: 36px;
  background: var(--glow-v);
  filter: blur(28px); border-radius: 50%;
  pointer-events: none;
  animation: breathe 3.2s ease infinite;
}
@keyframes breathe {
  0%,100%{opacity:.55;transform:translateX(-50%) scaleX(1)}
  50%{opacity:.9;transform:translateX(-50%) scaleX(1.25)}
}

/* ══════════════════════════════════════
   GITHUB CARD
══════════════════════════════════════ */
#github-card-container {
  position: relative;
}

.g-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--stroke2);
  border-radius: var(--r-lg);
  padding: 18px 22px;
  display: flex; flex-direction: column; gap: 14px;
  overflow: hidden;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    0 0 0 1px rgba(124,58,237,0.08),
    0 24px 64px rgba(0,0,0,0.55);
  transition: box-shadow 0.3s ease, transform 0.3s cubic-bezier(0.34,1.4,0.64,1);
}
.g-card:hover {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 0 0 1px rgba(34,211,238,0.25),
    0 0 40px rgba(34,211,238,0.1),
    0 24px 64px rgba(0,0,0,0.6);
  transform: translateY(-2px);
}

/* top shimmer line */
.g-card::before {
  content: '';
  position: absolute; top: 0; left: 10%; right: 10%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(34,211,238,0.5), transparent);
  border-radius: 1px;
}

/* scan sweep */
.g-card-scan {
  position: absolute; left: 0; right: 0; height: 80px;
  background: linear-gradient(180deg, transparent, rgba(34,211,238,0.03), transparent);
  pointer-events: none; top: -80px;
  animation: cardScan 6s ease-in-out infinite;
}
@keyframes cardScan {
  0%   { top: -80px; }
  100% { top: 110%; }
}

/* ── Header ── */
.g-card-header {
  display: flex; align-items: center; gap: 14px;
}

.g-avatar-wrap {
  position: relative; flex: 0 0 100px;
  width: 100px; height: 100px;
}

/* transparent bg — card shows through, only the image renders */
.g-avatar {
  width: 100%; height: 100%;
  border-radius: 50%;
  background: transparent;   /* no fill, no color — card bg shows through */
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.g-avatar canvas,
.g-avatar img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  border-radius: 50%;
}

.g-avatar-ring {
  position: absolute; inset: -3px;
  border-radius: 50%;
  border: 1.5px solid var(--cyan);
  opacity: 0.55;
  animation: ringPulse 3s ease infinite;
}
@keyframes ringPulse {
  0%,100%{opacity:.35;transform:scale(1)}
  50%{opacity:.85;transform:scale(1.07)}
}

.g-identity {
  flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0;
}
.g-name {
  font-size: 1rem; font-weight: 700;
  color: var(--text); letter-spacing: 0.04em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.g-handle {
  font-size: 0.7rem; color: var(--muted); letter-spacing: 0.08em;
}

.g-badge {
  flex: 0 0 auto;
  font-size: 0.58rem; font-weight: 700;
  letter-spacing: 0.18em; color: var(--cyan);
  border: 1px solid rgba(34,211,238,0.35);
  border-radius: 20px; padding: 3px 10px;
  background: rgba(34,211,238,0.07);
}

/* ── Bio ── */
.g-bio {
  font-size: 0.78rem; line-height: 1.6; color: var(--muted);
  border-left: 2px solid rgba(124,58,237,0.4);
  padding-left: 10px;
}

/* ── Stats ── */
.g-stats {
  display: grid; grid-template-columns: repeat(6,1fr); gap: 6px;
}
.g-stat {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 9px 4px;
  border-radius: var(--r-sm);
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.018);
  cursor: default;
  transition: border-color 0.2s, background 0.2s, transform 0.2s, box-shadow 0.2s;
}
.g-stat:hover {
  border-color: rgba(34,211,238,0.4);
  background: rgba(34,211,238,0.06);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(34,211,238,0.12);
}
.g-stat svg {
  width: 13px; height: 13px;
  color: var(--cyan); opacity: 0.75;
  flex-shrink: 0;
}
.g-val {
  font-size: 0.95rem; font-weight: 700;
  color: var(--text); font-variant-numeric: tabular-nums;
  line-height: 1;
}
.g-lbl {
  font-size: 0.55rem; letter-spacing: 0.1em;
  color: var(--muted); text-transform: uppercase;
  line-height: 1;
}

/* ── Footer / Languages ── */
.g-footer {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.g-langs-label {
  font-size: 0.6rem; font-weight: 600;
  letter-spacing: 0.15em; color: var(--dim);
  text-transform: uppercase; white-space: nowrap;
}
.g-lang-list {
  display: flex; flex-wrap: wrap; gap: 5px; list-style: none;
}
.g-lang-tag {
  font-size: 0.62rem; font-weight: 600; letter-spacing: 0.09em;
  color: var(--cyan);
  background: rgba(34,211,238,0.08);
  border: 1px solid rgba(34,211,238,0.28);
  border-radius: 20px; padding: 3px 10px;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
  cursor: default;
}
.g-lang-tag:hover {
  background: rgba(34,211,238,0.18);
  transform: scale(1.07);
  box-shadow: 0 0 10px rgba(34,211,238,0.2);
}

/* ── Card nav (prev/next + dots) ── */
.g-nav {
  display: flex; align-items: center; gap: 12px; margin-top: 4px;
}
.g-nav-btn {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--stroke2);
  color: var(--muted);
  border-radius: var(--r-sm);
  width: 32px; height: 28px;
  cursor: pointer; font-size: 0.9rem;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  line-height: 1;
}
.g-nav-btn:hover {
  color: var(--cyan);
  border-color: rgba(34,211,238,0.45);
  background: rgba(34,211,238,0.07);
}
#g-nav-dots {
  display: flex; gap: 6px; align-items: center;
}
.g-dot {
  width: 22px; height: 3px; border-radius: 2px;
  background: var(--stroke2); cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
}
.g-dot.active {
  background: var(--cyan);
  box-shadow: 0 0 8px var(--glow-c);
}

/* ══════════════════════════════════════
   SECTION HEADER
══════════════════════════════════════ */
.section-header { margin-bottom: 26px; }
.section-title {
  font-family: "Space", serif;
  font-size: clamp(1.9rem, 4vw, 3rem);
  color: var(--text); line-height: 1.1;
  text-shadow: 0 0 30px var(--glow-v);
  margin: 4px 0 6px;
}
.section-sub {
  color: var(--muted); font-size: 0.87rem; line-height: 1.6;
}

/* ══════════════════════════════════════
   PROJECTS
══════════════════════════════════════ */
.project-grid {
  display: grid; grid-template-columns: repeat(auto-fill,minmax(240px,1fr));
  gap: 14px; overflow-y: auto;
  max-height: calc(100vh - 260px); padding-right: 6px;
}
.project-grid::-webkit-scrollbar { width: 3px; }
.project-grid::-webkit-scrollbar-thumb { background: var(--stroke2); border-radius: 3px; }

.proj-card {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--r-md);
  padding: 20px;
  transition: border-color 0.2s, transform 0.25s cubic-bezier(0.34,1.4,0.64,1), box-shadow 0.2s;
  cursor: default;
}
.proj-card:hover {
  border-color: rgba(124,58,237,0.45);
  transform: translateY(-3px);
  box-shadow: 0 0 28px var(--glow-v);
}
.proj-num {
  font-size: 0.58rem; font-weight: 700;
  letter-spacing: 0.22em; color: var(--cyan); margin-bottom: 8px;
}
.proj-card h3 { font-size: 0.95rem; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.proj-card p  { font-size: 0.76rem; color: var(--muted); line-height: 1.55; }

/* ══════════════════════════════════════
   SKILLS
══════════════════════════════════════ */
.skills-grid { display: flex; flex-wrap: wrap; gap: 10px; align-content: flex-start; }
.skill-chip {
  font-size: 0.76rem; font-weight: 600; letter-spacing: 0.08em;
  color: var(--text);
  background: rgba(124,58,237,0.1);
  border: 1px solid rgba(124,58,237,0.32);
  border-radius: var(--r-md); padding: 9px 18px;
  cursor: default;
  transition: background 0.2s, border-color 0.2s, transform 0.2s, box-shadow 0.2s, color 0.2s;
}
.skill-chip:hover {
  background: rgba(34,211,238,0.12);
  border-color: rgba(34,211,238,0.5);
  color: var(--cyan);
  transform: scale(1.06);
  box-shadow: 0 0 20px var(--glow-c);
}

/* ══════════════════════════════════════
   ABOUT
══════════════════════════════════════ */
.about-layout { justify-content: center !important; position: relative; }
.about-body { display: flex; flex-direction: column; gap: 14px; max-width: 500px; }
.about-body p { font-size: 0.93rem; line-height: 1.72; color: var(--muted); }

.about-deco {
  position: absolute; right: 60px; top: 50%; transform: translateY(-50%);
  width: 240px; height: 240px; pointer-events: none;
}
.deco-ring {
  position: absolute; border-radius: 50%; border: 1px solid;
  top:50%; left:50%; transform: translate(-50%,-50%);
}
.r1 { width:100%; height:100%; border-color: rgba(124,58,237,.18); animation: spin 22s linear infinite; }
.r2 { width:68%;  height:68%;  border-color: rgba(34,211,238,.15); animation: spin 15s linear infinite reverse; }
.r3 { width:38%;  height:38%;  border-color: rgba(167,139,250,.22); animation: spin 8s linear infinite; }
@keyframes spin {
  from { transform: translate(-50%,-50%) rotate(0deg); }
  to   { transform: translate(-50%,-50%) rotate(360deg); }
}

/* ══════════════════════════════════════
   HUD BAR
══════════════════════════════════════ */
#hud-bar {
  position: fixed; bottom:0; left:0; right:0;
  z-index: 100; height: 44px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px;
  background: linear-gradient(0deg, rgba(4,4,10,.9) 0%, transparent 100%);
  border-top: 1px solid var(--stroke);
}
#hud-section {
  font-size: 0.58rem; font-weight: 700;
  letter-spacing: 0.26em; color: var(--cyan);
  text-shadow: 0 0 10px var(--glow-c); min-width: 76px;
}
#hud-dots { display: flex; gap: 8px; align-items: center; }
.hud-dot {
  width: 26px; height: 3px; border-radius: 2px;
  background: var(--stroke2); cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, transform 0.2s;
}
.hud-dot:hover { background: var(--muted); transform: scaleX(1.1); }
.hud-dot.active { background: var(--cyan); box-shadow: 0 0 8px var(--glow-c); }
#hud-coords {
  font-size: 0.56rem; letter-spacing: 0.1em;
  color: var(--dim); font-variant-numeric: tabular-nums;
  min-width: 110px; text-align: right;
}

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */
@media (max-width: 768px) {
  .home-layout { flex-direction: column !important; padding: 14px 18px; gap: 16px; }
  .home-right { display: none; }
  .g-stats { grid-template-columns: repeat(3,1fr); }
  .about-deco { display: none; }
  .nav-btn { font-size: 0.58rem; padding: 5px 10px; }
  #nav-status { display: none; }
  .panel-inner { padding: 16px 18px; }
}