/* ============================================
   TOKENS
   ============================================ */
:root {
  --bg: #0A0C10;
  --bg-alt: #0E1117;
  --surface: #12151C;
  --border: #1F242E;
  --border-bright: #2A3140;

  --text: #ECEEF1;
  --text-dim: #9AA2B1;
  --text-faint: #5C6373;

  --accent: #5EEAD4;
  --accent-dim: #2DD4BF;
  --amber: #FBBF24;

  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --sans: 'Inter', -apple-system, sans-serif;

  --maxw: 1120px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: var(--bg); }

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

button { font-family: inherit; cursor: pointer; background: none; border: none; color: inherit; }

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

/* subtle film-grain texture for depth */
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 1;
  opacity: 0.025; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ============================================
   TOPBAR
   ============================================ */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10, 12, 16, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: var(--maxw); margin: 0 auto;
  padding: 18px 24px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
}

.logo {
  font-family: var(--mono); font-weight: 700; font-size: 15px;
  letter-spacing: 0.02em; color: var(--text);
  display: flex; align-items: baseline; gap: 4px;
}
.logo-dot { color: var(--accent); }
.logo-sub { color: var(--text-faint); font-weight: 400; font-size: 12px; }

.topnav { display: flex; gap: 28px; }
.topnav a {
  font-family: var(--mono); font-size: 13px; color: var(--text-dim);
  position: relative; padding: 4px 0;
  transition: color 0.2s;
}
.topnav a::before { content: '/'; color: var(--text-faint); margin-right: 2px; }
.topnav a:hover { color: var(--accent); }

.snake-toggle {
  font-family: var(--mono); font-size: 12px; color: var(--text-faint);
  display: flex; align-items: center; gap: 7px;
  padding: 7px 12px; border: 1px solid var(--border); border-radius: 100px;
  transition: all 0.2s;
}
.snake-toggle:hover { color: var(--accent); border-color: var(--border-bright); }
.snake-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

@media (max-width: 760px) {
  .topnav { display: none; }
  .snake-toggle span:last-child { display: none; }
}

/* ============================================
   SNAKE PANEL
   ============================================ */
.snake-panel {
  position: fixed; top: 70px; right: 24px; z-index: 200;
  display: none;
}
.snake-panel.open { display: block; animation: slideIn 0.25s ease; }
@keyframes slideIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

.snake-panel-inner {
  background: var(--surface); border: 1px solid var(--border-bright);
  border-radius: 12px; padding: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.snake-meta {
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--mono); font-size: 11px; color: var(--text-dim);
  margin-bottom: 10px; letter-spacing: 0.05em;
}
.snake-meta #snakeClose { font-size: 18px; line-height: 1; color: var(--text-faint); padding: 0 4px; }
.snake-meta #snakeClose:hover { color: var(--accent); }

#snakeCanvas {
  background: var(--bg); border-radius: 6px; display: block;
  border: 1px solid var(--border);
}

.snake-hint {
  font-family: var(--mono); font-size: 10px; color: var(--text-faint);
  text-align: center; margin-top: 8px;
}

@media (max-width: 480px) {
  .snake-panel { left: 12px; right: 12px; }
  #snakeCanvas { width: 100%; height: auto; aspect-ratio: 1; }
}

/* ============================================
   HERO
   ============================================ */
.hero {
  position: relative; z-index: 2;
  padding: 96px 24px 64px;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(ellipse 800px 400px at 50% -10%, rgba(94,234,212,0.08), transparent);
}

.hero-inner { max-width: var(--maxw); margin: 0 auto; }

.hero-eyebrow {
  font-family: var(--mono); font-size: 13px; color: var(--text-dim);
  display: inline-flex; align-items: center; gap: 8px;
  margin-bottom: 28px;
  padding: 6px 14px; border: 1px solid var(--border); border-radius: 100px;
}
.dot-live {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.hero-title {
  font-family: var(--sans); font-weight: 800;
  font-size: clamp(2.4rem, 6vw, 4.6rem);
  line-height: 1.04; letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 28px;
}
.hero-accent { color: var(--accent); }

.hero-sub {
  font-size: clamp(1rem, 2vw, 1.2rem); color: var(--text-dim);
  max-width: 640px; line-height: 1.6;
  margin-bottom: 40px;
}

.hero-cta { display: flex; gap: 14px; margin-bottom: 64px; flex-wrap: wrap; }

.btn {
  font-family: var(--mono); font-size: 14px; font-weight: 500;
  padding: 13px 24px; border-radius: 8px;
  transition: all 0.2s;
}
.btn-primary { background: var(--accent); color: var(--bg); }
.btn-primary:hover { background: var(--accent-dim); transform: translateY(-1px); }
.btn-ghost { border: 1px solid var(--border-bright); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.hero-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
}
.stat {
  background: var(--bg-alt); padding: 24px 20px;
  display: flex; flex-direction: column; gap: 6px;
}
.stat-num {
  font-family: var(--mono); font-size: 2rem; font-weight: 700; color: var(--accent);
}
.stat-label {
  font-size: 12.5px; color: var(--text-faint); line-height: 1.3;
}

@media (max-width: 700px) {
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================
   SECTIONS — SHARED
   ============================================ */
.section { padding: 88px 24px; position: relative; z-index: 2; }
.section-alt { background: var(--bg-alt); }
.section-inner { max-width: var(--maxw); margin: 0 auto; }

.section-head { margin-bottom: 48px; }
.section-tag {
  font-family: var(--mono); font-size: 13px; color: var(--accent);
  display: block; margin-bottom: 12px;
}
.section-title {
  font-size: clamp(1.6rem, 3.4vw, 2.4rem); font-weight: 800;
  letter-spacing: -0.02em;
}

/* ============================================
   ABOUT
   ============================================ */
.about-grid {
  display: grid; grid-template-columns: 1.5fr 1fr; gap: 56px;
  margin-bottom: 56px;
}
.about-copy p {
  color: var(--text-dim); font-size: 1.05rem; line-height: 1.75;
  margin-bottom: 18px;
}
.about-copy strong { color: var(--text); font-weight: 600; }

.about-facts {
  display: flex; flex-direction: column; gap: 0;
  border-top: 1px solid var(--border);
}
.fact-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 0; border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.fact-row span { color: var(--text-faint); font-family: var(--mono); font-size: 12.5px; }
.fact-row strong { color: var(--text); font-weight: 500; text-align: right; }
.fact-open { color: var(--accent) !important; }

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

.skill-strip {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px;
  padding-top: 40px; border-top: 1px solid var(--border);
}
.skill-group h4 {
  font-family: var(--mono); font-size: 11.5px; color: var(--text-faint);
  letter-spacing: 0.06em; margin-bottom: 14px;
}
.skill-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.skill-tags span {
  font-size: 12.5px; padding: 6px 11px; border-radius: 6px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-dim);
}

@media (max-width: 800px) {
  .skill-strip { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================
   EXPERIENCE TIMELINE
   ============================================ */
.timeline { display: flex; flex-direction: column; }

.tl-row {
  display: grid; grid-template-columns: 180px 1fr; gap: 40px;
  padding: 36px 0; border-bottom: 1px solid var(--border);
}
.tl-row:first-child { padding-top: 0; }
.tl-row:last-child { border-bottom: none; }

.tl-when { display: flex; flex-direction: column; gap: 4px; }
.tl-date { font-family: var(--mono); font-size: 13px; color: var(--accent); }
.tl-loc { font-family: var(--mono); font-size: 12px; color: var(--text-faint); }

.tl-content h3 {
  font-size: 1.2rem; font-weight: 700; margin-bottom: 12px; letter-spacing: -0.01em;
}
.tl-co { color: var(--text-faint); font-weight: 400; font-size: 0.95rem; }
.tl-content p { color: var(--text-dim); line-height: 1.7; font-size: 0.96rem; margin-bottom: 16px; }

.tl-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.tl-tags span {
  font-family: var(--mono); font-size: 11px; padding: 4px 9px; border-radius: 5px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-faint);
}

.tl-badges { display: flex; flex-wrap: wrap; gap: 10px; }
.badge {
  font-size: 12px; padding: 6px 12px; border-radius: 6px;
  background: rgba(94,234,212,0.08); border: 1px solid rgba(94,234,212,0.2);
  color: var(--accent);
}
.badge-amber { background: rgba(251,191,36,0.08); border-color: rgba(251,191,36,0.25); color: var(--amber); }
.badge-teal { background: rgba(94,234,212,0.08); border-color: rgba(94,234,212,0.2); color: var(--accent); }

@media (max-width: 700px) {
  .tl-row { grid-template-columns: 1fr; gap: 10px; }
}

/* ============================================
   PROJECTS
   ============================================ */
.project-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
.proj-feature { grid-column: span 2; }
.proj-more {
  display: flex; flex-direction: column; justify-content: center;
  background: transparent; border: 1px dashed var(--border-bright);
}

.proj-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 28px;
  display: flex; flex-direction: column; gap: 14px;
  transition: border-color 0.2s, transform 0.2s;
}
.proj-card:hover { border-color: var(--border-bright); transform: translateY(-2px); }

.proj-top { display: flex; align-items: center; justify-content: space-between; }
.proj-icon { font-size: 1.6rem; }
.proj-result { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.proj-rank { font-family: var(--mono); font-weight: 700; color: var(--amber); font-size: 0.95rem; }
.proj-event { font-size: 11px; color: var(--text-faint); }

.proj-card h3 { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.01em; }
.proj-card p { color: var(--text-dim); font-size: 0.92rem; line-height: 1.65; flex-grow: 1; }

.proj-link {
  font-family: var(--mono); font-size: 12.5px; color: var(--accent);
  align-self: flex-start; padding-top: 4px;
}
.proj-link:hover { text-decoration: underline; }

@media (max-width: 900px) {
  .project-grid { grid-template-columns: 1fr; }
  .proj-feature { grid-column: span 1; }
}

/* ============================================
   PROOF
   ============================================ */
.proof-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px;
}
.proof-block h4 {
  font-size: 13px; color: var(--text-faint); margin-bottom: 18px;
  font-family: var(--mono); letter-spacing: 0.03em;
}
.proof-item {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.proof-item strong { font-size: 0.92rem; font-weight: 600; }
.proof-item span { font-size: 0.82rem; color: var(--text-faint); }
.proof-item a { font-family: var(--mono); font-size: 0.78rem; color: var(--accent); margin-top: 4px; }
.proof-item a:hover { text-decoration: underline; }
.proof-muted strong { color: var(--text-dim); }

.proof-list { list-style: none; }
.proof-list li {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.proof-list li span { color: var(--text-dim); }
.proof-list li strong {
  font-family: var(--mono); color: var(--amber); font-size: 0.78rem;
  white-space: nowrap; flex-shrink: 0;
}

@media (max-width: 900px) {
  .proof-grid { grid-template-columns: repeat(2, 1fr); gap: 36px 24px; }
}
@media (max-width: 560px) {
  .proof-grid { grid-template-columns: 1fr; }
}

/* ============================================
   CONTACT
   ============================================ */
.contact-section { padding-bottom: 40px; }

.contact-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 64px;
  padding-bottom: 64px;
}

.contact-title {
  font-size: clamp(1.7rem, 3.6vw, 2.6rem); font-weight: 800;
  letter-spacing: -0.02em; line-height: 1.15;
  margin: 14px 0 18px;
}
.contact-sub { color: var(--text-dim); line-height: 1.6; max-width: 420px; margin-bottom: 36px; }

.contact-links { display: flex; flex-direction: column; gap: 0; }
.contact-link {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 0; border-bottom: 1px solid var(--border);
  transition: padding-left 0.2s;
}
.contact-link:hover { padding-left: 6px; }
.cl-label { font-family: var(--mono); font-size: 12px; color: var(--text-faint); }
.cl-value { font-size: 0.95rem; color: var(--text); }
.contact-link:hover .cl-value { color: var(--accent); }

.contact-form { display: flex; flex-direction: column; gap: 18px; }
.contact-form label { display: flex; flex-direction: column; gap: 8px; }
.contact-form span {
  font-family: var(--mono); font-size: 11.5px; color: var(--text-faint);
  letter-spacing: 0.04em;
}
.contact-form input, .contact-form textarea {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 12px 14px;
  color: var(--text); font-family: var(--sans); font-size: 0.92rem;
  resize: vertical; transition: border-color 0.2s;
}
.contact-form input:focus, .contact-form textarea:focus {
  outline: none; border-color: var(--accent);
}
.contact-form button[type="submit"] {
  font-family: var(--mono); font-size: 14px; font-weight: 500;
  background: var(--accent); color: var(--bg);
  padding: 13px 24px; border-radius: 8px; margin-top: 4px;
  transition: background 0.2s;
}
.contact-form button[type="submit"]:hover { background: var(--accent-dim); }
.form-note { font-size: 12.5px; color: var(--text-faint); min-height: 16px; }

@media (max-width: 800px) {
  .contact-grid { grid-template-columns: 1fr; gap: 40px; }
}

.site-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 32px; border-top: 1px solid var(--border);
  font-family: var(--mono); font-size: 12px; color: var(--text-faint);
}

@media (max-width: 500px) {
  .site-footer { flex-direction: column; gap: 8px; text-align: center; }
}

/* focus visibility for accessibility */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
