/* ==========================================================================
   AKP portfolio — design tokens
   Palette (justified against brief):
     --void    #05070E  page base: deep space blue-black, not flat #000
     --panel   #0C1322  raised surfaces: reads like an IDE sidebar
     --trace   #22304F  borders/lines: faint circuit traces
     --phos    #E8EDF7  primary text: cool terminal-phosphor white
     --cyan    #53C8FF  interactive accent: syntax-highlight cyan
     --amber   #FFB454  signature accent: from the Ayu editor theme (Ayu ≈ Ayush)
   ========================================================================== */

:root {
  --void:  #05070E;
  --panel: #0C1322;
  --trace: #22304F;
  --phos:  #E8EDF7;
  --muted: #93A0B8;
  --cyan:  #53C8FF;
  --amber: #FFB454;

  --font-display: "Space Grotesk", sans-serif;
  --font-mono: "JetBrains Mono", monospace;

  /* type scale — 1.25 ratio, clamped for fluidity */
  --fs-hero: clamp(2.6rem, 6.2vw, 4.6rem);
  --fs-h2:   clamp(1.9rem, 3.6vw, 2.9rem);
  --fs-h3:   clamp(1.15rem, 1.8vw, 1.4rem);
  --fs-body: clamp(0.98rem, 1.1vw, 1.08rem);
  --fs-small: 0.84rem;
  --fs-tiny: 0.72rem;

  --space-section: clamp(6rem, 12vh, 10rem);
  --gutter: clamp(1.25rem, 5vw, 5rem);
  --radius: 14px;

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

  /* pointer glow position, updated from JS */
  --mx: 50vw;
  --my: 30vh;
}

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

/* the hidden attribute must always win, even over display:grid/flex on the
   same element (author styles otherwise override the UA's [hidden] rule) */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; overflow-x: clip; }

body {
  background: var(--void);
  color: var(--phos);
  font-family: var(--font-display);
  font-size: var(--fs-body);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body.has-cursor, body.has-cursor a, body.has-cursor button,
body.has-cursor input, body.has-cursor textarea, body.has-cursor summary {
  cursor: none;
}

.mono { font-family: var(--font-mono); }
.accent-amber { color: var(--amber); }

::selection { background: rgba(83, 200, 255, 0.25); color: var(--phos); }

h1, h2, h3, h4 { font-weight: 600; line-height: 1.15; letter-spacing: -0.02em; }

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

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

/* ==========================================================================
   living background — node network canvas + pointer glow
   ========================================================================== */
#bg-net {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

#bg-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(560px circle at var(--mx) var(--my),
      rgba(83, 200, 255, 0.055), transparent 65%),
    radial-gradient(1100px circle at 85% -10%,
      rgba(255, 180, 84, 0.04), transparent 60%);
  transition: none;
}

main, #site-nav, #site-footer { position: relative; z-index: 2; }

/* ==========================================================================
   custom cursor — dot + lagging ring
   ========================================================================== */
#cursor-dot, #cursor-ring {
  position: fixed;
  top: 0; left: 0;
  z-index: 9999;
  pointer-events: none;
  border-radius: 50%;
  opacity: 0;
}
body.has-cursor #cursor-dot, body.has-cursor #cursor-ring { opacity: 1; }

#cursor-dot {
  width: 6px; height: 6px;
  background: var(--amber);
  transform: translate(-50%, -50%);
}
#cursor-ring {
  width: 38px; height: 38px;
  border: 1.5px solid rgba(83, 200, 255, 0.75);
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  transition: width 0.25s var(--ease-spring), height 0.25s var(--ease-spring),
              border-color 0.25s ease, background-color 0.25s ease;
}
#cursor-ring.is-hover {
  width: 58px; height: 58px;
  border-color: var(--amber);
  background: rgba(255, 180, 84, 0.06);
}
#cursor-ring.has-label {
  width: 66px; height: 66px;
  background: rgba(5, 7, 14, 0.75);
  border-color: var(--amber);
}
#cursor-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  color: var(--amber);
}
#cursor-ring.is-down { transform: translate(-50%, -50%) scale(0.8); }

/* ==========================================================================
   scroll progress + nav
   ========================================================================== */
#scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 100%;
  z-index: 100;
  background: linear-gradient(90deg, var(--cyan), var(--amber));
  transform-origin: left;
  transform: scaleX(0);
}

#site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 0.9rem var(--gutter);
  background: rgba(5, 7, 14, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(34, 48, 79, 0.5);
  transition: transform 0.4s var(--ease-out);
}
#site-nav.nav-hidden { transform: translateY(-100%); }

.nav-logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}
.logo-bracket { color: var(--cyan); }

#site-nav nav {
  display: flex;
  gap: 1.6rem;
  margin-left: auto;
}
#site-nav nav a {
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  color: var(--muted);
  position: relative;
  padding: 0.2rem 0;
  transition: color 0.25s ease;
}
#site-nav nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 100%; height: 1px;
  background: var(--cyan);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s var(--ease-out);
}
#site-nav nav a:hover, #site-nav nav a.active { color: var(--phos); }
#site-nav nav a:hover::after, #site-nav nav a.active::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav-cta {
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  color: var(--amber);
  border: 1px solid rgba(255, 180, 84, 0.4);
  border-radius: 8px;
  padding: 0.35rem 0.9rem;
  transition: background 0.25s ease, border-color 0.25s ease;
}
.nav-cta:hover { background: rgba(255, 180, 84, 0.1); border-color: var(--amber); }

#nav-burger {
  display: none;
  background: none;
  border: none;
  width: 34px; height: 30px;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  margin-left: auto;
}
#nav-burger span {
  display: block;
  height: 2px; width: 100%;
  background: var(--phos);
  transition: transform 0.3s var(--ease-out), opacity 0.3s;
}
#nav-burger[aria-expanded="true"] span:first-child { transform: translateY(4.5px) rotate(45deg); }
#nav-burger[aria-expanded="true"] span:last-child { transform: translateY(-4.5px) rotate(-45deg); }

#mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(5, 7, 14, 0.96);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.4rem;
  padding: 0 2rem;
}
#mobile-menu a {
  font-size: 1.7rem;
  font-weight: 600;
  border-bottom: 1px solid rgba(34, 48, 79, 0.5);
  padding-bottom: 0.8rem;
}

/* ==========================================================================
   layout scaffolding
   ========================================================================== */
.section {
  max-width: 1160px;
  margin: 0 auto;
  padding: var(--space-section) var(--gutter) 0;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 1.2rem;
  margin-bottom: clamp(2.2rem, 5vh, 3.6rem);
}
.section-index {
  color: var(--cyan);
  font-size: var(--fs-small);
}
.section-head h2 { font-size: var(--fs-h2); }
.section-rule {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--trace), transparent);
  align-self: center;
}

.sub-head {
  color: var(--muted);
  font-size: var(--fs-small);
  letter-spacing: 0.06em;
  margin: 4.5rem 0 1.4rem;
}

/* ==========================================================================
   buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  font-weight: 500;
  padding: 0.8rem 1.5rem;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: transform 0.25s var(--ease-spring), background 0.25s ease,
              border-color 0.25s ease, box-shadow 0.25s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn-ic { transition: transform 0.25s var(--ease-spring); }
.btn:hover .btn-ic { transform: translate(2px, -1px); }

.btn-primary {
  background: var(--amber);
  color: #1A1206;
  box-shadow: 0 0 0 rgba(255, 180, 84, 0);
}
.btn-primary:hover { box-shadow: 0 6px 28px rgba(255, 180, 84, 0.28); }

.btn-ghost {
  border-color: var(--trace);
  color: var(--phos);
  background: rgba(12, 19, 34, 0.5);
}
.btn-ghost:hover { border-color: var(--cyan); box-shadow: 0 6px 24px rgba(83, 200, 255, 0.12); }

/* ==========================================================================
   HERO
   ========================================================================== */
#hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 6rem var(--gutter) 6.5rem;
  max-width: 1220px;
  margin: 0 auto;
  position: relative;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.hero-kicker {
  color: var(--muted);
  font-size: var(--fs-small);
  margin-bottom: 1.4rem;
}
.prompt { color: var(--cyan); }

#hero h1 { font-size: var(--fs-hero); }
.h1-line { display: block; }
.h1-sub { color: var(--phos); }

.caret {
  display: inline-block;
  width: 0.09em;
  height: 0.85em;
  margin-left: 0.12em;
  background: var(--cyan);
  vertical-align: baseline;
  animation: caret-blink 1.1s steps(1) infinite;
}
@keyframes caret-blink { 50% { opacity: 0; } }

.hero-sub {
  color: var(--muted);
  max-width: 34rem;
  margin: 1.6rem 0 2.2rem;
}

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

.hero-meta {
  margin-top: 2.4rem;
  color: var(--muted);
  font-size: var(--fs-tiny);
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.dot-live {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #5AE8A0;
  box-shadow: 0 0 10px rgba(90, 232, 160, 0.8);
  animation: live-pulse 2.2s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes live-pulse { 50% { opacity: 0.45; } }

/* --- hero stage: 3D sphere + floating ID card --- */
.hero-stage {
  position: relative;
  min-height: clamp(340px, 46vw, 560px);
}
#hero-3d {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}
#hero-3d canvas { display: block; }
.webgl-fallback {
  font-size: clamp(5rem, 10vw, 9rem);
  color: rgba(83, 200, 255, 0.18);
  text-shadow: 0 0 60px rgba(83, 200, 255, 0.25);
  display: none;
}
#hero-3d.no-webgl .webgl-fallback { display: block; }

.hero-idcard {
  position: absolute;
  right: clamp(0rem, 2vw, 1.5rem);
  bottom: 6%;
  width: clamp(140px, 15vw, 190px);
  background: rgba(12, 19, 34, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--trace);
  border-radius: var(--radius);
  padding: 0.6rem;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  transform-style: preserve-3d;
  will-change: transform;
  z-index: 3;
}
.idcard-photo {
  aspect-ratio: 4 / 5;
  border-radius: 9px;
  overflow: hidden;
  background: linear-gradient(150deg, rgba(83, 200, 255, 0.12), rgba(255, 180, 84, 0.08));
  display: grid;
  place-items: center;
  position: relative;
}
.idcard-photo img { width: 100%; height: 100%; object-fit: cover; }
.photo-missing-glyph { display: none; }
.idcard-photo.photo-missing .photo-missing-glyph {
  display: block;
  font-size: var(--fs-tiny);
  color: var(--muted);
  text-align: center;
  line-height: 1.8;
}
.hero-idcard figcaption {
  padding: 0.55rem 0.2rem 0.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.idcard-name { font-size: var(--fs-tiny); color: var(--phos); font-weight: 700; }
.idcard-role { font-size: 0.62rem; color: var(--muted); }

.scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: var(--gutter);
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--muted);
  font-size: var(--fs-tiny);
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.scroll-hint-line {
  width: 56px; height: 1px;
  background: var(--trace);
  position: relative;
  overflow: hidden;
}
.scroll-hint-line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--cyan);
  transform: translateX(-100%);
  animation: hint-sweep 2.4s var(--ease-out) infinite;
}
@keyframes hint-sweep {
  0% { transform: translateX(-100%); }
  60%, 100% { transform: translateX(100%); }
}

/* ==========================================================================
   ABOUT
   ========================================================================== */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: start;
}

.about-lede {
  font-size: calc(var(--fs-body) * 1.18);
  color: var(--phos);
  margin-bottom: 1.2rem;
}
.about-text p + p { margin-top: 1.1rem; }
.about-text { color: var(--muted); }
.about-text em { color: var(--amber); font-style: normal; }

.about-panel {
  background: rgba(12, 19, 34, 0.6);
  border: 1px solid var(--trace);
  border-radius: var(--radius);
  padding: 1.6rem 1.5rem 2rem;
}
.panel-title { color: var(--cyan); font-size: var(--fs-small); margin-bottom: 0.4rem; }
.panel-sub { color: var(--muted); font-size: var(--fs-small); margin-bottom: 1.8rem; }

/* compact gaming timeline: connecting line draws in on scroll */
.game-timeline {
  list-style: none;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  padding-left: 0.4rem;
}
.game-timeline::before {
  content: "";
  position: absolute;
  left: calc(0.4rem + 3.05rem + 0.55rem + 4px);
  top: 10px; bottom: 10px;
  width: 1px;
  background: var(--trace);
}
.game-timeline::after {
  content: "";
  position: absolute;
  left: calc(0.4rem + 3.05rem + 0.55rem + 4px);
  top: 10px;
  width: 1px;
  height: calc(100% - 20px);
  background: linear-gradient(var(--cyan), var(--amber));
  transform: scaleY(var(--gt-progress, 0));
  transform-origin: top;
}
.gt-node {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  transition: transform 0.3s var(--ease-spring);
}
.gt-node:hover { transform: translateX(4px); }
.gt-year { color: var(--muted); font-size: var(--fs-tiny); width: 3.05rem; flex-shrink: 0; }
.gt-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--void);
  border: 1.5px solid var(--cyan);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}
.gt-node:hover .gt-dot { background: var(--cyan); box-shadow: 0 0 12px rgba(83, 200, 255, 0.7); }
.gt-founder .gt-dot { border-color: var(--amber); }
.gt-founder:hover .gt-dot { background: var(--amber); box-shadow: 0 0 12px rgba(255, 180, 84, 0.7); }
.gt-label { font-size: var(--fs-small); color: var(--phos); }
.gt-founder .gt-label { color: var(--amber); }

/* ==========================================================================
   SKILLS — icon chips
   ========================================================================== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.2rem 3rem;
}

.cat-title {
  color: var(--cyan);
  font-size: var(--fs-small);
  font-weight: 500;
  margin-bottom: 1rem;
  letter-spacing: 0.04em;
}

.chip-row {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: rgba(12, 19, 34, 0.75);
  border: 1px solid var(--trace);
  border-radius: 999px;
  padding: 0.42rem 0.95rem 0.42rem 0.6rem;
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  color: var(--phos);
  transition: transform 0.28s var(--ease-spring), border-color 0.28s ease,
              box-shadow 0.28s ease;
  will-change: transform;
}
.chip img {
  width: 20px; height: 20px;
  transition: transform 0.35s var(--ease-spring);
}
.chip:hover {
  transform: translateY(-3px);
  border-color: rgba(83, 200, 255, 0.6);
  box-shadow: 0 8px 22px rgba(83, 200, 255, 0.12);
}
.chip:hover img { transform: rotate(-12deg) scale(1.22); }
.chip.no-icon { padding-left: 0.95rem; }
.chip.no-icon::before {
  content: "◆";
  color: var(--cyan);
  font-size: 0.55rem;
}

/* ==========================================================================
   EXPERIENCE — vertical scroll-drawn timeline
   ========================================================================== */
.xp-timeline {
  position: relative;
  padding-left: 2.2rem;
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
}
.xp-line {
  position: absolute;
  left: 7px;
  top: 8px; bottom: 8px;
  width: 1px;
  background: var(--trace);
}
.xp-line-fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(var(--cyan), var(--amber));
  transform: scaleY(0);
  transform-origin: top;
}
.xp-item { position: relative; }
.xp-node {
  position: absolute;
  left: calc(-2.2rem + 3px);
  top: 1.7rem;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--void);
  border: 1.5px solid var(--trace);
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
}
.xp-item.node-lit .xp-node {
  border-color: var(--cyan);
  box-shadow: 0 0 14px rgba(83, 200, 255, 0.55);
}

.xp-card {
  background: rgba(12, 19, 34, 0.6);
  border: 1px solid var(--trace);
  border-radius: var(--radius);
  padding: 1.5rem 1.7rem;
  transition: border-color 0.3s ease, transform 0.3s var(--ease-out), box-shadow 0.3s ease;
}
.xp-card:hover {
  border-color: rgba(83, 200, 255, 0.45);
  transform: translateX(6px);
  box-shadow: -6px 0 0 -4px var(--cyan), 0 14px 40px rgba(0, 0, 0, 0.35);
}
.xp-when { color: var(--amber); font-size: var(--fs-tiny); letter-spacing: 0.06em; margin-bottom: 0.45rem; }
.xp-card h3 { font-size: var(--fs-h3); display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; }
.xp-tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cyan);
  border: 1px solid rgba(83, 200, 255, 0.35);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
}
.xp-org { color: var(--muted); font-size: var(--fs-small); margin: 0.3rem 0 0.7rem; }
.xp-desc { color: var(--muted); font-size: var(--fs-small); max-width: 46rem; }

/* --- education --- */
.edu-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.2rem;
}
.edu-card {
  background: rgba(12, 19, 34, 0.45);
  border: 1px solid var(--trace);
  border-radius: var(--radius);
  padding: 1.3rem 1.4rem;
  transition: border-color 0.3s ease, transform 0.3s var(--ease-out);
}
.edu-card:hover { border-color: rgba(255, 180, 84, 0.4); transform: translateY(-3px); }
.edu-when { color: var(--cyan); font-size: var(--fs-tiny); margin-bottom: 0.5rem; }
.edu-card h4 { font-size: 1.02rem; margin-bottom: 0.3rem; }
.edu-org { color: var(--muted); font-size: var(--fs-small); }

.todo-note { color: rgba(147, 160, 184, 0.55); font-size: 0.68rem; }

/* --- certifications accordions --- */
.cert-accordions { display: flex; flex-direction: column; gap: 0.7rem; }
.cert-group {
  background: rgba(12, 19, 34, 0.45);
  border: 1px solid var(--trace);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.3s ease;
}
.cert-group[open], .cert-group:hover { border-color: rgba(83, 200, 255, 0.4); }
.cert-group summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.4rem;
  user-select: none;
}
.cert-group summary::-webkit-details-marker { display: none; }
.cert-issuer { font-weight: 600; }
.cert-count { color: var(--muted); font-size: var(--fs-tiny); margin-left: auto; }
.cert-chevron {
  font-family: var(--font-mono);
  color: var(--cyan);
  transition: transform 0.3s var(--ease-spring);
}
.cert-group[open] .cert-chevron { transform: rotate(45deg); }
.cert-group ul {
  list-style: none;
  padding: 0 1.4rem 1.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.cert-group li {
  font-size: var(--fs-small);
  color: var(--muted);
  border: 1px solid var(--trace);
  border-radius: 999px;
  padding: 0.25rem 0.8rem;
}

/* ==========================================================================
   PROJECTS — flagship tilt cards
   ========================================================================== */
.flagship-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.6rem;
}

.proj-card {
  position: relative;
  background: linear-gradient(160deg, rgba(12, 19, 34, 0.9), rgba(12, 19, 34, 0.55));
  border: 1px solid var(--trace);
  border-radius: var(--radius);
  padding: 1.8rem 1.8rem 1.5rem;
  overflow: hidden;
  transform-style: preserve-3d;
  will-change: transform;
  transition: border-color 0.3s ease;
}
.proj-card:hover { border-color: rgba(83, 200, 255, 0.5); }

.proj-glare {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(420px circle at var(--gx, 50%) var(--gy, 50%),
    rgba(83, 200, 255, 0.09), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.proj-card:hover .proj-glare { opacity: 1; }

.proj-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.1rem;
}
.proj-glyph {
  font-size: 1.7rem;
  color: var(--cyan);
  text-shadow: 0 0 22px rgba(83, 200, 255, 0.4);
}
.proj-badge {
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--trace);
  border-radius: 999px;
  padding: 0.22rem 0.7rem;
}
.proj-badge.accent-amber-bg {
  color: #1A1206;
  background: var(--amber);
  border-color: var(--amber);
  font-weight: 700;
}

.proj-card h3 { font-size: var(--fs-h3); margin-bottom: 0.55rem; }
.proj-card > p { color: var(--muted); font-size: var(--fs-small); min-height: 3.6em; }

.tech-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 1.1rem 0 1.2rem;
}
.tech-tags li {
  font-size: var(--fs-tiny);
  color: var(--cyan);
  background: rgba(83, 200, 255, 0.07);
  border: 1px solid rgba(83, 200, 255, 0.22);
  border-radius: 6px;
  padding: 0.18rem 0.55rem;
  transition: transform 0.25s var(--ease-spring), background 0.25s ease;
}
.proj-card:hover .tech-tags li { background: rgba(83, 200, 255, 0.12); }
.tech-tags li:hover { transform: translateY(-2px); }

.proj-links {
  display: flex;
  gap: 1.3rem;
  border-top: 1px dashed var(--trace);
  padding-top: 1rem;
}
.proj-links a {
  font-size: var(--fs-small);
  color: var(--muted);
  transition: color 0.25s ease;
}
.proj-links a:hover { color: var(--amber); }

/* --- archive --- */
.archive-block { margin-top: 3rem; }
#archive-toggle { width: 100%; justify-content: center; }
#archive-toggle .when-open { display: none; }
#archive-toggle[aria-expanded="true"] .when-open { display: inline; }
#archive-toggle[aria-expanded="true"] .when-closed { display: none; }

.archive-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
  margin-top: 1.4rem;
}
.arch-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  background: rgba(12, 19, 34, 0.45);
  border: 1px solid var(--trace);
  border-radius: 12px;
  padding: 1rem 1.2rem;
  overflow: hidden;
  transition: border-color 0.3s ease, background 0.3s ease;
}
.arch-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(var(--cyan), var(--amber));
  transform: scaleY(0);
  transition: transform 0.35s var(--ease-out);
}
.arch-card:hover { border-color: rgba(83, 200, 255, 0.45); background: rgba(12, 19, 34, 0.8); }
.arch-card:hover::before { transform: scaleY(1); }
.arch-glyph { color: var(--amber); font-size: 1rem; }
.arch-name { font-size: 0.92rem; font-weight: 500; }
.arch-note { color: var(--muted); font-size: var(--fs-tiny); margin-left: auto; }
.arch-arrow {
  color: var(--cyan);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.3s ease, transform 0.3s var(--ease-spring);
}
.arch-card:hover .arch-arrow { opacity: 1; transform: translateX(0); }
.arch-design { border-style: dashed; }
.arch-static { cursor: default; }
.arch-static:hover { border-color: var(--trace); background: rgba(12, 19, 34, 0.45); }
.arch-static:hover::before { transform: scaleY(0); }

.links-pending { color: rgba(147, 160, 184, 0.55); font-size: var(--fs-tiny); letter-spacing: 0.04em; }

/* ==========================================================================
   CONTACT
   ========================================================================== */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 5vw, 4rem);
}
.contact-lede { font-size: calc(var(--fs-body) * 1.15); margin-bottom: 1.8rem; }

.contact-list { list-style: none; display: flex; flex-direction: column; gap: 0.9rem; font-size: var(--fs-small); }
.c-key { color: var(--cyan); margin-right: 0.4rem; }
.contact-list a { color: var(--muted); transition: color 0.25s ease; border-bottom: 1px dashed transparent; }
.contact-list a:hover { color: var(--amber); border-bottom-color: rgba(255, 180, 84, 0.4); }

.contact-form { display: flex; flex-direction: column; gap: 1.1rem; }
.contact-form label { display: flex; flex-direction: column; gap: 0.4rem; }
.contact-form label > span { color: var(--muted); font-size: var(--fs-tiny); letter-spacing: 0.08em; }
.contact-form input, .contact-form textarea {
  background: rgba(12, 19, 34, 0.65);
  border: 1px solid var(--trace);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  color: var(--phos);
  font-family: var(--font-display);
  font-size: var(--fs-small);
  resize: vertical;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.contact-form input:focus, .contact-form textarea:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(83, 200, 255, 0.12);
}
.contact-form .btn { align-self: flex-start; margin-top: 0.4rem; }

/* ---- inline form status (contact + admin login) ---- */
.form-status {
  font-size: var(--fs-tiny);
  color: #5AE8A0;
  min-height: 1.2em;
  letter-spacing: 0.03em;
}
.form-status.is-error { color: #FF7B72; }

/* ==========================================================================
   certificate thumbnails + lightbox
   ========================================================================== */
.cert-items.has-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.7rem;
}
.cert-items.has-thumbs li {
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  display: flex;
  align-items: center;
  text-align: left;
}
li.cert-thumb {
  flex-direction: column;
  align-items: stretch;
  gap: 0.55rem;
  padding: 0.55rem;
  background: rgba(12, 19, 34, 0.6);
  transition: transform 0.28s var(--ease-spring), border-color 0.28s ease, box-shadow 0.28s ease;
}
li.cert-thumb:hover, li.cert-thumb:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(83, 200, 255, 0.55);
  box-shadow: 0 8px 24px rgba(83, 200, 255, 0.12);
  outline: none;
}
.thumb-media {
  aspect-ratio: 4 / 3;
  border-radius: 7px;
  overflow: hidden;
  background: linear-gradient(150deg, rgba(83, 200, 255, 0.08), rgba(255, 180, 84, 0.06));
  display: grid;
  place-items: center;
}
.thumb-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.35s var(--ease-out);
}
li.cert-thumb:hover .thumb-media img { transform: scale(1.05); }
.thumb-pdf {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  color: var(--amber);
  font-size: var(--fs-tiny);
  letter-spacing: 0.2em;
}
.thumb-pdf em { font-style: normal; font-size: 1.6rem; color: var(--cyan); }
.thumb-label {
  font-size: var(--fs-tiny);
  color: var(--phos);
  line-height: 1.35;
}

#lightbox {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 3rem);
}
#lightbox .lb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 7, 14, 0.88);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.25s ease;
}
#lightbox .lb-frame {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--trace);
  border-radius: var(--radius);
  padding: 0.8rem;
  max-width: min(920px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  transform: scale(0.94) translateY(10px);
  opacity: 0;
  transition: transform 0.25s var(--ease-spring), opacity 0.25s ease;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
#lightbox.open .lb-backdrop { opacity: 1; }
#lightbox.open .lb-frame { transform: none; opacity: 1; }
.lb-media {
  overflow: auto;
  border-radius: 9px;
  display: grid;
  place-items: center;
  min-width: min(560px, 78vw);
  min-height: 200px;
}
.lb-media img { max-width: 100%; max-height: 72vh; border-radius: 9px; }
.lb-media embed { width: min(860px, 88vw); height: 72vh; border-radius: 9px; }
.lb-frame figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 0.2rem 0.2rem;
  font-size: var(--fs-tiny);
}
.lb-title { color: var(--phos); }
.lb-open { color: var(--cyan); }
.lb-open:hover { color: var(--amber); }
.lb-close {
  position: absolute;
  top: -2.4rem;
  right: 0;
  background: none;
  border: none;
  color: var(--muted);
  font-size: var(--fs-small);
  letter-spacing: 0.1em;
  transition: color 0.25s ease;
}
.lb-close:hover { color: var(--amber); }

/* ==========================================================================
   gallery pages (logos / animations / posters / promos)
   ========================================================================== */
.back-link {
  margin-left: auto;
  color: var(--muted);
  font-size: var(--fs-small);
  transition: color 0.25s ease;
}
.back-link:hover { color: var(--cyan); }

.gallery-main {
  max-width: 1160px;
  margin: 0 auto;
  padding: 7rem var(--gutter) 5rem;
  min-height: 100svh;
}
.gallery-main .section-head { margin-bottom: 0.8rem; }
.gallery-main h1 { font-size: var(--fs-h2); }
.gallery-count { color: var(--muted); font-size: var(--fs-tiny); white-space: nowrap; }
.gallery-sub { color: var(--muted); font-size: var(--fs-small); margin-bottom: 2.4rem; }
.gallery-status { color: var(--muted); font-size: var(--fs-small); }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1rem;
}
.g-card {
  background: rgba(12, 19, 34, 0.6);
  border: 1px solid var(--trace);
  border-radius: var(--radius);
  padding: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  opacity: 0;
  animation: g-in 0.55s var(--ease-out) forwards;
  transition: transform 0.28s var(--ease-spring), border-color 0.28s ease, box-shadow 0.28s ease;
}
@keyframes g-in {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}
.g-card:hover, .g-card:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(83, 200, 255, 0.55);
  box-shadow: 0 10px 30px rgba(83, 200, 255, 0.12);
  outline: none;
}
.g-media {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 9px;
  overflow: hidden;
  background: linear-gradient(150deg, rgba(83, 200, 255, 0.08), rgba(255, 180, 84, 0.06));
  display: grid;
  place-items: center;
}
.g-media img, .g-media video {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.35s var(--ease-out);
}
.g-card:hover .g-media img { transform: scale(1.05); }
.g-play {
  position: absolute;
  right: 8px; bottom: 8px;
  width: 30px; height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(5, 7, 14, 0.75);
  border: 1px solid rgba(255, 180, 84, 0.5);
  color: var(--amber);
  font-size: 0.6rem;
  transition: opacity 0.25s ease;
}
.g-card:hover .g-play { opacity: 0; }
.g-card figcaption {
  font-size: var(--fs-tiny);
  color: var(--muted);
  padding: 0 0.2rem 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-media video { max-width: min(860px, 88vw); max-height: 72vh; border-radius: 9px; }

@media (prefers-reduced-motion: reduce) {
  .g-card { opacity: 1; animation: none; }
}

/* ==========================================================================
   admin page — same system, quieter room
   ========================================================================== */
.admin-badge { color: var(--muted); font-size: var(--fs-small); }
.admin-page #site-nav { justify-content: space-between; }
.admin-main { padding-top: 5.5rem; min-height: 100svh; }

.link-btn {
  background: none;
  border: none;
  color: var(--cyan);
  font-size: var(--fs-tiny);
  letter-spacing: 0.05em;
  padding: 0.2rem 0;
  transition: color 0.25s ease;
}
.link-btn:hover { color: var(--amber); }

.auth-wrap {
  min-height: calc(100svh - 6rem);
  display: grid;
  place-items: center;
  padding: 0 var(--gutter);
}
.auth-card {
  width: min(420px, 100%);
  background: rgba(12, 19, 34, 0.75);
  border: 1px solid var(--trace);
  border-radius: var(--radius);
  padding: 2.2rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}
.auth-kicker { color: var(--muted); font-size: var(--fs-small); }
.auth-card h1 { font-size: clamp(1.6rem, 3vw, 2rem); }
.auth-sub { color: var(--muted); font-size: var(--fs-small); margin-bottom: 0.4rem; }
.auth-card label { display: flex; flex-direction: column; gap: 0.4rem; }
.auth-card label > span { color: var(--muted); font-size: var(--fs-tiny); letter-spacing: 0.08em; }
.auth-card input {
  background: rgba(5, 7, 14, 0.6);
  border: 1px solid var(--trace);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  color: var(--phos);
  font-family: var(--font-display);
  font-size: var(--fs-small);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.auth-card input:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(83, 200, 255, 0.12);
}
.auth-card .btn { justify-content: center; margin-top: 0.3rem; }

.inbox-count { color: var(--muted); font-size: var(--fs-tiny); white-space: nowrap; }

.msg-list { display: flex; flex-direction: column; gap: 1rem; padding-bottom: 5rem; }
.msg-empty { color: var(--muted); font-size: var(--fs-small); }
.msg-empty.is-error { color: #FF7B72; }
.msg-card {
  position: relative;
  background: rgba(12, 19, 34, 0.6);
  border: 1px solid var(--trace);
  border-radius: var(--radius);
  padding: 1.3rem 1.5rem;
  transition: border-color 0.3s ease, transform 0.3s var(--ease-out);
}
.msg-card:hover { border-color: rgba(83, 200, 255, 0.4); transform: translateX(4px); }
.msg-card.msg-unread::before {
  content: "";
  position: absolute;
  left: 0; top: 12px; bottom: 12px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(var(--cyan), var(--amber));
}
.msg-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.7rem;
}
.msg-who h3 { font-size: 1.05rem; }
.msg-who a { color: var(--muted); font-size: var(--fs-tiny); }
.msg-who a:hover { color: var(--amber); }
.msg-meta {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}
.msg-meta time { color: var(--amber); font-size: var(--fs-tiny); }
.msg-body {
  color: var(--muted);
  font-size: var(--fs-small);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-width: 60rem;
}

/* ==========================================================================
   footer
   ========================================================================== */
#site-footer {
  max-width: 1160px;
  margin: 0 auto;
  padding: 5rem var(--gutter) 2.2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  color: var(--muted);
  font-size: var(--fs-tiny);
}
#site-footer a { color: var(--cyan); }

/* ==========================================================================
   reveal pre-states (JS removes; no-JS stays visible via .no-anim fallback)
   ========================================================================== */
body.anim-ready [data-reveal] { opacity: 0; }

/* ==========================================================================
   responsive
   ========================================================================== */
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-stage { min-height: 320px; order: -1; }
  .hero-idcard { right: 8%; }
  .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; gap: 1.8rem; }
  .flagship-grid { grid-template-columns: 1fr; }
  .archive-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .edu-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  #site-nav nav, .nav-cta { display: none; }
  #nav-burger { display: flex; }
  .archive-grid { grid-template-columns: 1fr; }
  .scroll-hint { display: none; }
  .hero-idcard { width: 132px; bottom: 0; }
}

/* ==========================================================================
   reduced motion — kill everything nonessential
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  body.anim-ready [data-reveal] { opacity: 1; }
  #bg-net, #cursor-dot, #cursor-ring { display: none; }
  body.has-cursor, body.has-cursor a, body.has-cursor button,
  body.has-cursor input, body.has-cursor textarea, body.has-cursor summary { cursor: auto; }
}
