/* =========================================
   DESIGN TOKENS
   ========================================= */
:root {
  /* Backgrounds */
  --bg:          #09090b;
  --surface:     #18181b;
  --surface-2:   #27272a;
  --surface-3:   #3f3f46;

  /* Text */
  --text:        #fafafa;
  --text-2:      #d4d4d8;
  --text-muted:  #a1a1aa;
  --text-dim:    #71717a;

  /* Accent — cyan */
  --accent:      #22d3ee;
  --accent-2:    #06b6d4;
  --accent-dim:  rgba(34, 211, 238, 0.1);
  --accent-ring: rgba(34, 211, 238, 0.2);

  /* Borders */
  --border:      rgba(255, 255, 255, 0.07);
  --border-2:    rgba(255, 255, 255, 0.12);

  /* Type */
  --font-head: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Misc */
  --radius:    6px;
  --radius-lg: 10px;
  --shadow:    0 1px 3px rgba(0, 0, 0, 0.5), 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* =========================================
   RESET & BASE
   ========================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
img, canvas, svg { display: block; }
button { font-family: inherit; }

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

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface-2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-2); }

:focus-visible {
  outline: 1.5px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

/* =========================================
   LAYOUT
   ========================================= */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section        { padding: 7rem 0; }
.section-alt    { background: var(--surface); }

/* =========================================
   TYPOGRAPHY UTILITIES
   ========================================= */
.section-head  { margin-bottom: 3.5rem; }

.work-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.section-title {
  font-family: var(--font-head);
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--text);
  padding-left: 1rem;
  border-left: 2px solid var(--accent);
}

/* =========================================
   BUTTONS
   ========================================= */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  letter-spacing: -0.01em;
  transition: opacity 0.15s, transform 0.15s;
}
.btn-primary:hover { opacity: 0.85; transform: translateY(-1px); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-2);
  transition: color 0.15s, border-color 0.15s;
}
.btn-ghost:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.25); }

.btn-nav {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--bg);
  background: var(--accent);
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius);
  letter-spacing: -0.01em;
  transition: opacity 0.15s;
}
.btn-nav:hover { opacity: 0.85; }

/* =========================================
   NAVIGATION
   ========================================= */
#nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.3s, border-color 0.3s, backdrop-filter 0.3s;
}

#nav.scrolled {
  background: rgba(9, 9, 11, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-color: var(--border);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-logo {
  font-family: var(--font-head);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-right: auto;
  letter-spacing: -0.03em;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-links a {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-dim);
  transition: color 0.15s;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}

/* =========================================
   HERO
   ========================================= */
#hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  padding-top: 5rem;
  position: relative;
}

.hero-inner {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 4rem 2rem;
  display: grid;
  grid-template-columns: 1fr 460px;
  gap: 5rem;
  align-items: start;
}

/* Left column */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 100px;
  padding: 0.35rem 0.9rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeUp 0.5s 0.05s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.status-dot {
  width: 7px;
  height: 7px;
  background: #4ade80;
  border-radius: 50%;
  flex-shrink: 0;
  animation: pulseDot 2.5s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.35; }
}

.hero-name {
  font-family: var(--font-head);
  font-size: clamp(3.5rem, 7vw, 5.75rem);
  font-weight: 700;
  line-height: 0.97;
  letter-spacing: -0.035em;
  color: var(--text);
  margin-bottom: 1.25rem;
  opacity: 0;
  animation: fadeUp 0.5s 0.15s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-role {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.04em;
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeUp 0.5s 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-bio {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.75;
  max-width: 44ch;
  margin-bottom: 2rem;
  opacity: 0;
  animation: fadeUp 0.5s 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-cta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 2.25rem;
  opacity: 0;
  animation: fadeUp 0.5s 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-social {
  display: flex;
  gap: 0.6rem;
  opacity: 0;
  animation: fadeUp 0.5s 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: color 0.15s, border-color 0.15s;
}
.hero-social a:hover { color: var(--text); border-color: var(--border-2); }

/* Right column */
.hero-right {
  opacity: 0;
  animation: fadeUp 0.6s 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  padding-top: 0.25rem;
}

/* Terminal widget */
.terminal {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.8rem 1.1rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.t-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.t-red    { background: #ff5f57; }
.t-yellow { background: #febc2e; }
.t-green  { background: #28c840; }

.t-title {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  margin-left: auto;
  margin-right: auto;
  letter-spacing: 0.02em;
}

.terminal-body {
  padding: 1.1rem 1.4rem 1.4rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.85;
  min-height: 180px;
}

/* Terminal text classes */
.t-line     { display: block; }
.t-prompt   { color: var(--accent); user-select: none; }
.t-cmd      { color: var(--text); }
.t-dim      { color: var(--text-dim); }
.t-muted    { color: var(--text-muted); }
.t-success  { color: #4ade80; }
.t-warn     { color: #fb923c; }

.t-cursor {
  display: inline-block;
  width: 7px;
  height: 13px;
  background: var(--accent);
  vertical-align: text-bottom;
  border-radius: 1px;
  animation: blink 1.1s step-start infinite;
}

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

/* Hero stats strip */
.hero-stats {
  display: flex;
  align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.stat {
  flex: 1;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.stat-val {
  font-family: var(--font-head);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1;
}
.stat-unit {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-dim);
}
.stat-label {
  font-size: 0.68rem;
  color: var(--text-dim);
  font-weight: 500;
  margin-top: 0.2rem;
  letter-spacing: 0.02em;
}

.stat-div {
  width: 1px;
  background: var(--border);
  align-self: stretch;
}

/* Scroll hint */
.scroll-hint {
  position: absolute;
  bottom: 2.25rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  opacity: 0;
  animation: fadeIn 0.4s 1.4s forwards;
}
.scroll-hint span {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-dim);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.scroll-line {
  width: 1px;
  height: 28px;
  background: linear-gradient(to bottom, var(--text-dim), transparent);
  animation: scrollDrop 1.8s ease-in-out 1.6s infinite;
}

/* =========================================
   STACK
   ========================================= */
.stack-grid {
  display: flex;
  flex-direction: column;
}

.stack-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  align-items: baseline;
  gap: 2.5rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
}
.stack-row:first-child { border-top: 1px solid var(--border); }

.stack-cat {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding-top: 0.2rem;
}

.stack-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pill {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 0.3rem 0.75rem;
  border-radius: 4px;
  transition: color 0.15s, border-color 0.15s;
  cursor: default;
}
.pill:hover { color: var(--text-2); border-color: var(--border-2); }

.pill-hi {
  color: var(--text-2);
  background: rgba(34, 211, 238, 0.06);
  border-color: var(--accent-ring);
}
.pill-hi:hover { color: var(--accent); border-color: rgba(34, 211, 238, 0.35); }

/* =========================================
   WORK / PROJECTS
   ========================================= */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.project-card {
  background: var(--surface);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
  transition: background 0.2s;
}
.project-card:hover { background: var(--surface-2); }

/* Accent top rule on hover */
.project-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.project-card:hover::before { transform: scaleX(1); }

.project-card.hidden { display: none; }


.project-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.project-title {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.project-tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 3px;
  flex-shrink: 0;
}
.tag-eng { background: rgba(34, 211, 238, 0.1);  color: var(--accent); }
.tag-ana { background: rgba(74, 222, 128, 0.1);  color: #4ade80; }
.tag-ml  { background: rgba(167, 139, 250, 0.1); color: #a78bfa; }

.project-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.project-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: auto;
  padding-top: 0.25rem;
}

/* chip — mono, smaller than pill */
.chip {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 400;
  color: var(--text-dim);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
}
.section-alt .chip { background: var(--surface-2); }

.project-links {
  display: flex;
  gap: 1.25rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  margin-top: 0.25rem;
}

.proj-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--accent);
  transition: opacity 0.15s;
}
.proj-link:hover { opacity: 0.7; }

.proj-link-dim { color: var(--text-dim); }
.proj-link-dim:hover { color: var(--text-muted); opacity: 1; }

/* Filter */
.filter-group {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.filter {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.07em;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.45rem 0.875rem;
  cursor: pointer;
  min-height: 36px;
  text-transform: uppercase;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.filter:hover { color: var(--text-muted); border-color: var(--border-2); }
.filter.active { background: var(--surface-2); color: var(--text-2); border-color: var(--border-2); }

/* =========================================
   EXPERIENCE
   ========================================= */
.exp-list {
  display: flex;
  flex-direction: column;
}

.exp-item {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 3rem;
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--border);
}
.exp-item:last-child { border-bottom: none; }

.exp-left { padding-top: 0.15rem; }

.exp-date {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: 0.06em;
}

.exp-header {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.exp-role {
  font-family: var(--font-head);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
}

.exp-sep {
  color: var(--text-dim);
  font-size: 0.9rem;
}

.exp-company {
  font-size: 0.875rem;
  color: var(--text-dim);
}

.exp-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 1rem;
  max-width: 60ch;
}

.exp-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

/* =========================================
   CONTACT
   ========================================= */
.contact-inner {
  max-width: 520px;
}

.contact-inner .section-title { margin-top: 0.25rem; margin-bottom: 1.25rem; }

.contact-bio {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 2rem;
  max-width: 50ch;
}

.email-link {
  display: inline-block;
  font-family: var(--font-head);
  font-size: clamp(1.15rem, 2.5vw, 1.5rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--text);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 0.1rem;
  margin-bottom: 2.25rem;
  transition: color 0.15s;
}
.email-link:hover { color: var(--accent); }

.contact-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.social-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 0.55rem 1rem;
  border-radius: var(--radius);
  transition: color 0.15s, border-color 0.15s;
}
.social-btn:hover { color: var(--text); border-color: var(--border-2); }

/* =========================================
   FOOTER
   ========================================= */
.footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-copy {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
}

.footer-top {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-dim);
  transition: color 0.15s;
}
.footer-top:hover { color: var(--text-muted); }

/* =========================================
   REVEAL ANIMATIONS
   ========================================= */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes scrollDrop {
  0%   { opacity: 0.8; transform: translateY(0); }
  80%  { opacity: 0; }
  100% { opacity: 0; transform: translateY(14px); }
}

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

/* =========================================
   RESPONSIVE — 1024px
   ========================================= */
@media (max-width: 1024px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 3.5rem;
  }
  .hero-right { max-width: 520px; }
  .hero-bio   { max-width: 100%; }
}

/* =========================================
   RESPONSIVE — 768px
   ========================================= */
@media (max-width: 768px) {
  .section { padding: 5rem 0; }

  /* Nav */
  .nav-links, .btn-nav { display: none; }
  .hamburger { display: flex; }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: rgba(9, 9, 11, 0.97);
    backdrop-filter: blur(20px);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
    gap: 1.25rem;
  }
  .nav-links.open a { font-size: 1rem; color: var(--text-muted); }

  /* Hero */
  .hero-name  { font-size: clamp(3rem, 14vw, 4.5rem); }
  .scroll-hint { display: none; }

  /* Projects */
  .projects-grid { grid-template-columns: 1fr; }

  /* Stack */
  .stack-row { grid-template-columns: 1fr; gap: 0.75rem; }

  /* Experience */
  .exp-item { grid-template-columns: 1fr; gap: 0.35rem; }

  /* Work head */
  .work-head { flex-direction: column; align-items: flex-start; }

  /* Footer */
  .footer-inner { flex-direction: column; gap: 0.5rem; text-align: center; }
}

/* =========================================
   RESPONSIVE — 480px
   ========================================= */
@media (max-width: 480px) {
  .container  { padding: 0 1.25rem; }
  .hero-cta   { flex-direction: column; align-items: flex-start; }
  .hero-stats { flex-direction: column; }
  .stat-div   { width: auto; height: 1px; align-self: stretch; }
  .exp-item   { padding: 2rem 0; }
}
