/* ============ RESET & TOKENS ============ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #070b14;
  --bg-2: #0b1120;
  --panel: rgba(17, 25, 44, 0.55);
  --panel-border: rgba(96, 165, 250, 0.14);
  --text: #d7e1f5;
  --text-dim: #8b9bb8;
  --cyan: #22d3ee;
  --violet: #a78bfa;
  --magenta: #f472b6;
  --green: #4ade80;
  --amber: #fbbf24;
  --grad: linear-gradient(100deg, var(--cyan), var(--violet) 55%, var(--magenta));
  --font-main: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --radius: 14px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-main);
  line-height: 1.65;
  overflow-x: hidden;
}

::selection { background: rgba(34, 211, 238, 0.35); }

.mono { font-family: var(--font-mono); }
.accent { color: var(--cyan); }
.accent-link { color: var(--cyan); text-decoration: none; border-bottom: 1px dashed rgba(34, 211, 238, 0.5); }
.accent-link:hover { color: var(--magenta); border-color: var(--magenta); }

/* subtle grid overlay on the whole page */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(96, 165, 250, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(96, 165, 250, 0.04) 1px, transparent 1px);
  background-size: 44px 44px;
  pointer-events: none;
  z-index: 0;
}

#particle-canvas { position: fixed; inset: 0; z-index: 0; }

.scanline {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(0,0,0,0.06) 3px 4px);
  opacity: .5;
}

main, header, nav, footer { position: relative; z-index: 2; }

/* ============ NAV ============ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  backdrop-filter: blur(14px);
  background: rgba(7, 11, 20, 0.7);
  border-bottom: 1px solid var(--panel-border);
}
.nav-inner {
  max-width: 1200px; margin: 0 auto; padding: 0.8rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
  font-family: var(--font-mono); font-weight: 600; font-size: 1.25rem;
  color: var(--text); text-decoration: none; letter-spacing: 1px;
}
.logo-bracket { color: var(--cyan); }
.nav-links { display: flex; gap: 1.6rem; list-style: none; }
.nav-links a {
  font-family: var(--font-mono); font-size: 0.85rem; color: var(--text-dim);
  text-decoration: none; transition: color .2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--cyan); }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--cyan); margin: 5px 0; transition: .3s; }

/* ============ HERO ============ */
.hero {
  min-height: 100vh; display: flex; flex-direction: column; justify-content: center;
  max-width: 1200px; margin: 0 auto; padding: 7rem 1.5rem 3rem;
}
.hero-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 3rem; align-items: center; }
.hero-kicker { color: var(--cyan); margin-bottom: 0.75rem; font-size: 0.95rem; }
.hero-name {
  font-size: clamp(2.6rem, 6vw, 4.5rem); line-height: 1.05; font-weight: 700;
  letter-spacing: -1px; margin-bottom: 1.2rem;
}
.gradient-text {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-role { font-size: 1rem; color: var(--text-dim); margin-bottom: 1.2rem; min-height: 3.2em; }
.role-output { color: var(--green); font-size: 1.1rem; }
.typed-cursor { color: var(--green); animation: blink 1s step-end infinite; }
.prompt { color: var(--magenta); }
@keyframes blink { 50% { opacity: 0; } }

.hero-sub { color: var(--text-dim); max-width: 34rem; margin-bottom: 1.8rem; }
.hero-sub strong { color: var(--text); }

.hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 2.2rem; }

.btn {
  display: inline-block; padding: 0.75rem 1.5rem; border-radius: 8px;
  font-family: var(--font-mono); font-size: 0.9rem; text-decoration: none;
  transition: transform .2s, box-shadow .2s; cursor: pointer;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: var(--grad); color: #06090f; font-weight: 600;
  box-shadow: 0 4px 24px rgba(167, 139, 250, 0.35);
}
.btn-primary:hover { box-shadow: 0 6px 32px rgba(34, 211, 238, 0.45); }
.btn-ghost {
  color: var(--cyan); border: 1px solid rgba(34, 211, 238, 0.4);
  background: rgba(34, 211, 238, 0.05);
}
.btn-ghost:hover { background: rgba(34, 211, 238, 0.12); border-color: var(--cyan); }

.hero-stats { display: flex; gap: 2.5rem; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; }
.stat-num {
  font-family: var(--font-mono); font-size: 2rem; font-weight: 600; color: var(--cyan);
}
.stat-num::after { content: '+'; color: var(--magenta); }
.stat:last-child .stat-num::after { content: ''; }
.stat-label { font-size: 0.8rem; color: var(--text-dim); }

/* terminal */
.glass {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
}
.terminal { overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 40px rgba(34,211,238,0.06); }
.terminal-bar {
  display: flex; align-items: center; gap: 7px; padding: 0.7rem 1rem;
  background: rgba(11, 17, 32, 0.9); border-bottom: 1px solid var(--panel-border);
}
.t-dot { width: 12px; height: 12px; border-radius: 50%; }
.t-dot.red { background: #ff5f57; } .t-dot.yellow { background: #febc2e; } .t-dot.green { background: #28c840; }
.terminal-title { margin-left: 0.8rem; font-size: 0.75rem; color: var(--text-dim); }
.terminal-body { padding: 1.2rem 1.3rem; font-size: 0.82rem; line-height: 1.9; }
.t-line .k { color: var(--violet); }
.t-line .v { color: var(--amber); }
.t-line .v.g { color: var(--green); }
.t-json { color: var(--text-dim); }
.t-ok { color: var(--green); }
.cursor-block { display: inline-block; width: 9px; height: 1.1em; background: var(--cyan); vertical-align: text-bottom; margin-left: 4px; }
.cursor-block.on { animation: blink 1s step-end infinite; }

.scroll-hint {
  margin: 3rem auto 0; color: var(--text-dim); text-decoration: none; font-size: 0.8rem;
  animation: bob 2s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translateY(6px); } }

/* ============ SECTIONS ============ */
.section { max-width: 1200px; margin: 0 auto; padding: 6rem 1.5rem 2rem; }
.section-title {
  display: flex; align-items: center; gap: 1rem;
  font-size: clamp(1.6rem, 3.5vw, 2.2rem); margin-bottom: 0.8rem; font-weight: 700;
}
.section-index { color: var(--cyan); font-size: 0.6em; font-weight: 400; }
.title-line { flex: 1; max-width: 280px; height: 1px; background: linear-gradient(90deg, var(--panel-border), transparent); }
.section-sub { color: var(--text-dim); font-size: 0.85rem; margin-bottom: 2.5rem; }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ============ ABOUT ============ */
.about-grid { display: grid; grid-template-columns: 320px 1fr; gap: 3.5rem; align-items: start; margin-top: 2rem; }
.about-photo { position: relative; text-align: center; }
.photo-frame { position: relative; display: inline-block; }
.photo-frame img {
  width: 260px; height: 260px; object-fit: cover; border-radius: 50%;
  border: 3px solid transparent;
  background: var(--grad) border-box;
  filter: saturate(1.05);
}
.photo-ring {
  position: absolute; inset: -14px; border-radius: 50%;
  border: 1px dashed rgba(34, 211, 238, 0.4);
  animation: spin 24s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.studio-logo { width: 64px; margin-top: 1.5rem; opacity: 0.9; }

.about-text p { margin-bottom: 1.1rem; color: var(--text-dim); }
.about-text strong { color: var(--text); }

.skills { margin-top: 2rem; }
.skills-title { color: var(--green); font-size: 0.9rem; margin-bottom: 1rem; }
.skill-group { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 0.9rem; }
.skill-cat { color: var(--magenta); font-size: 0.8rem; min-width: 64px; }
.chip {
  font-family: var(--font-mono); font-size: 0.75rem; padding: 0.3rem 0.7rem;
  border-radius: 999px; border: 1px solid var(--panel-border);
  background: rgba(96, 165, 250, 0.06); color: var(--text-dim);
  transition: all .2s;
}
.chip:hover { border-color: var(--cyan); color: var(--cyan); transform: translateY(-2px); }

/* career highlights */
.career { margin-top: 2rem; }
.career-list { list-style: none; }
.career-list li {
  padding: 0.55rem 0 0.55rem 1.4rem; position: relative;
  color: var(--text-dim); font-size: 0.92rem;
  border-left: 1px solid var(--panel-border); margin-left: 0.4rem;
}
.career-list li::before {
  content: ''; position: absolute; left: -5px; top: 1.15em;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--cyan);
}
.career-list strong { color: var(--text); }

/* awards */
.awards { margin-top: 2rem; }
.awards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1rem; }
.award-card { margin: 0; overflow: hidden; transition: transform .25s, border-color .25s; }
.award-card:hover { transform: translateY(-4px); border-color: rgba(251, 191, 36, 0.45); }
.award-media {
  position: relative; height: 230px;
  background: radial-gradient(ellipse at center, rgba(251,191,36,0.06), #0b0f1a 72%);
}
.award-media img { width: 100%; height: 100%; object-fit: contain; object-position: center; display: block; padding: 0.5rem; }
.award-fallback { display: none; }
.award-media.noimg img { display: none; }
.award-media.noimg .award-fallback {
  display: flex; align-items: center; justify-content: center;
  height: 100%; font-size: 3rem; opacity: 0.85;
}
.award-card { cursor: pointer; }
.award-card:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.award-zoom {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  width: 26px; height: 26px; display: flex; align-items: center; justify-content: center;
  border-radius: 6px; background: rgba(7, 11, 20, 0.6); color: var(--text);
  font-size: 0.9rem; opacity: 0; transition: opacity .2s; backdrop-filter: blur(4px);
}
.award-card:hover .award-zoom, .award-card:focus-visible .award-zoom { opacity: 1; }
.award-card figcaption { padding: 0.8rem 0.9rem 1rem; }

/* lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 3rem 1.5rem;
  background: rgba(4, 7, 13, 0.9); backdrop-filter: blur(10px);
  opacity: 0; visibility: hidden; transition: opacity .28s, visibility .28s;
}
.lightbox.open { opacity: 1; visibility: visible; }
.lightbox-inner {
  margin: 0; max-width: 620px; max-height: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
  transform: scale(0.96); transition: transform .28s;
}
.lightbox.open .lightbox-inner { transform: scale(1); }
.lightbox-inner img {
  max-width: 100%; max-height: 78vh; object-fit: contain;
  border-radius: 12px; box-shadow: 0 24px 70px rgba(0,0,0,0.6);
}
.lightbox-cap { text-align: center; color: var(--text-dim); font-size: 0.85rem; }
.lightbox-cap strong { display: block; color: var(--text); font-size: 1rem; margin-bottom: 0.15rem; }
.lightbox-cap span { color: var(--amber); font-size: 0.75rem; }
.lightbox-close {
  position: absolute; top: 1.2rem; right: 1.4rem;
  width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
  background: rgba(17, 25, 44, 0.7); border: 1px solid var(--panel-border);
  color: var(--text); font-size: 1.1rem; transition: background .2s, transform .2s;
}
.lightbox-close:hover { background: rgba(244, 114, 182, 0.2); transform: rotate(90deg); }
.award-card figcaption strong { display: block; font-size: 0.88rem; margin-bottom: 0.25rem; }
.award-org { font-size: 0.66rem; color: var(--amber); letter-spacing: 0.3px; }

/* ============ CARDS (AI LAB) ============ */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.4rem; }
.card {
  padding: 1.6rem; transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
  position: relative; overflow: hidden;
}
.card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--grad); opacity: 0; transition: opacity .25s;
}
.card:hover { transform: translateY(-6px); border-color: rgba(34, 211, 238, 0.35); box-shadow: 0 16px 40px rgba(0,0,0,0.45); }
.card:hover::before { opacity: 1; }
.card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.9rem; }
.card-icon { font-size: 1.9rem; }
.card-links a { color: var(--text-dim); font-size: 0.75rem; text-decoration: none; }
.card-links a:hover { color: var(--cyan); }
.card h3 { font-size: 1.15rem; margin-bottom: 0.6rem; }
.card p { font-size: 0.88rem; color: var(--text-dim); margin-bottom: 1rem; }
.tags { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.tags span {
  font-size: 0.68rem; color: var(--cyan); background: rgba(34, 211, 238, 0.08);
  padding: 0.2rem 0.55rem; border-radius: 4px;
}
.more-note { margin-top: 2rem; color: var(--text-dim); font-size: 0.85rem; text-align: center; }

/* status badges */
.badge {
  font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.5px;
  padding: 0.2rem 0.55rem; border-radius: 999px; white-space: nowrap;
  text-transform: uppercase; vertical-align: middle;
}
.badge-dev { color: var(--amber); border: 1px solid rgba(251, 191, 36, 0.4); background: rgba(251, 191, 36, 0.08); }
.badge-rnd { color: var(--violet); border: 1px solid rgba(167, 139, 250, 0.4); background: rgba(167, 139, 250, 0.08); }
.badge-oss { color: var(--green); border: 1px solid rgba(74, 222, 128, 0.4); background: rgba(74, 222, 128, 0.08); }

/* phone screenshot row (Ember) */
.phone-shots { display: flex; gap: 0.9rem; align-items: flex-start; }
.phone-shots img {
  width: calc(33.33% - 0.6rem); border-radius: 14px;
  border: 1px solid var(--panel-border);
  box-shadow: 0 12px 32px rgba(0,0,0,0.45);
}
.phone-shots img:nth-child(2) { transform: translateY(14px); }

/* card thumbnail image */
.card-img {
  width: calc(100% + 3.2rem); margin: -1.6rem -1.6rem 1rem;
  display: block; border-bottom: 1px solid var(--panel-border);
  height: 170px; object-fit: cover; object-position: center bottom;
}

/* measured project stats */
.card-stats {
  margin-top: 1rem; padding-top: 0.75rem;
  border-top: 1px dashed var(--panel-border);
  font-size: 0.68rem; color: var(--green); opacity: 0.85;
  letter-spacing: 0.3px;
}

/* feature fact list (RealSimulator) */
.feature-facts { list-style: none; margin-top: 1rem; font-size: 0.78rem; color: var(--text-dim); }
.feature-facts li { padding: 0.3rem 0 0.3rem 1.2rem; position: relative; }
.feature-facts li::before { content: '▹'; position: absolute; left: 0; color: var(--cyan); }
.game-info strong { color: var(--text); }

/* ============ GAMES ============ */
.game-feature {
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 2rem; padding: 2rem;
  margin-bottom: 2rem; align-items: center;
}
.game-shots .main-shot { width: 100%; border-radius: 10px; margin-bottom: 0.8rem; }
.shot-row { display: flex; gap: 0.8rem; }
.shot-row img { width: calc(50% - 0.4rem); border-radius: 8px; }
.shot { border: 1px solid var(--panel-border); }
.game-icon { width: 72px; border-radius: 18px; margin-bottom: 1rem; box-shadow: 0 8px 24px rgba(0,0,0,0.5); }
.game-info h3 { font-size: 1.6rem; margin-bottom: 0.3rem; }
.game-tag { color: var(--magenta); font-size: 0.75rem; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 0.9rem; }
.game-info p:last-child { color: var(--text-dim); }

.games-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.4rem; }
.game-card { overflow: hidden; transition: transform .25s, border-color .25s; }
.game-card:hover { transform: translateY(-6px); border-color: rgba(244, 114, 182, 0.4); }
.game-card > img { width: 100%; height: 190px; object-fit: cover; object-position: top; display: block; }
.game-card > img.portrait { object-fit: contain; background: #0d1322; padding: 0.6rem 0; }
.game-card-body { padding: 1.2rem 1.3rem 1.4rem; }
.game-card-body h3 { font-size: 1.1rem; margin-bottom: 0.2rem; }
.game-card-body p:last-child { font-size: 0.85rem; color: var(--text-dim); }

/* ============ PHOTOGRAPHY ============ */
.photo-grid { display: grid; grid-template-columns: 280px 1fr; gap: 3.5rem; align-items: center; margin-top: 2rem; }
.photo-rank { padding: 1.6rem 1.4rem; text-align: center; }
.rank-kicker { color: var(--text-dim); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 1rem; }
.rank-ladder { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.rank-ladder li {
  font-size: 0.8rem; padding: 0.5rem; border-radius: 6px; color: var(--text-dim);
  border: 1px solid transparent; background: rgba(96,165,250,0.04);
}
.rank-ladder li.above { color: var(--text-dim); opacity: 0.45; }
.rank-ladder li.current {
  color: #06090f; font-weight: 700; background: var(--grad);
  box-shadow: 0 4px 20px rgba(167,139,250,0.4); letter-spacing: 1px;
}
.rank-note { margin-top: 1rem; font-size: 0.7rem; color: var(--cyan); }

.photo-info h3 { font-size: clamp(1.6rem, 3.5vw, 2.1rem); margin-bottom: 0.8rem; }
.photo-info > p { color: var(--text-dim); margin-bottom: 1.5rem; }
.photo-info strong { color: var(--text); }
.photo-stats { display: flex; gap: 2.5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.photo-stats .stat-num { font-size: 1.7rem; }

/* ============ BOOK ============ */
.book-grid { display: grid; grid-template-columns: 340px 1fr; gap: 3.5rem; align-items: center; margin-top: 2rem; }
.book-cover { position: relative; text-align: center; }
.book-cover img {
  width: 300px; border-radius: 8px; position: relative; z-index: 1;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
  transition: transform .3s;
}
.book-cover:hover img { transform: rotate(-2deg) scale(1.03); }
.book-glow {
  position: absolute; inset: 10% 15%; z-index: 0;
  background: radial-gradient(ellipse, rgba(167, 139, 250, 0.35), transparent 70%);
  filter: blur(30px);
}
.book-kicker { color: var(--magenta); margin-bottom: 0.6rem; font-size: 0.9rem; }
.book-info h3 { font-size: clamp(1.8rem, 4vw, 2.4rem); line-height: 1.1; }
.book-subtitle { color: var(--violet); font-size: 1.1rem; margin: 0.3rem 0 1.2rem; font-style: italic; }
.book-info p { color: var(--text-dim); margin-bottom: 1rem; }
.book-links { display: flex; gap: 1rem; flex-wrap: wrap; margin: 1.5rem 0 1rem; }
.book-stores { font-size: 0.78rem; color: var(--text-dim); }
.book-stores a { color: var(--text-dim); }
.book-stores a:hover { color: var(--cyan); }

/* ============ CONTACT ============ */
.contact-box { text-align: center; padding: 3.5rem 2rem; }
.contact-kicker { color: var(--green); margin-bottom: 1rem; font-size: 0.9rem; }
.contact-box h3 { font-size: clamp(1.5rem, 3.5vw, 2.1rem); margin-bottom: 0.8rem; }
.contact-box > p { color: var(--text-dim); max-width: 34rem; margin: 0 auto 2rem; }
.contact-location { color: var(--green); font-size: 0.8rem; margin: -1rem auto 2rem !important; }
.contact-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ============ FOOTER ============ */
.footer { text-align: center; padding: 4rem 1.5rem 2.5rem; color: var(--text-dim); font-size: 0.8rem; }
.footer-quote { margin-top: 0.6rem; opacity: 0.6; font-style: italic; }

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  .hero-grid, .about-grid, .book-grid, .game-feature { grid-template-columns: 1fr; }
  .hero-terminal { order: -1; }
  .about-photo { text-align: center; }
  .book-cover { margin: 0 auto; }
}
@media (max-width: 700px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0; background: rgba(7, 11, 20, 0.97);
    border-bottom: 1px solid var(--panel-border);
    max-height: 0; overflow: hidden; transition: max-height .3s ease;
  }
  .nav-links.open { max-height: 320px; }
  .nav-links li { padding: 0.8rem 1.5rem; }
  .hero { padding-top: 5.5rem; }
  .hero-stats { gap: 1.5rem; }
  .section { padding-top: 4rem; }
}

