/* ===== Tokens ===== */
:root{
  --bg: #16161b;
  --surface: #1d1e24;
  --surface-alt: #24252d;
  --border: #33343d;
  --text: #ecece5;
  --text-muted: #8b8d97;
  --gold: #e7b75f;
  --plum: #b98cce;
  --teal: #6fbfae;
  --red: #e06c75;

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius: 10px;
  --max-w: 1080px;
}

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

html{ scroll-behavior: smooth; }

body{
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *{ animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

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

:focus-visible{
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

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

.section{
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 6rem 1.5rem;
}

.section__title{
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 600;
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  margin-bottom: 0.5rem;
}

.section__num{
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--gold);
}

.section__sub{
  color: var(--text-muted);
  margin-bottom: 3rem;
  font-size: 1.02rem;
}

/* ===== Editor top bar ===== */
.editor-bar{
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.editor-bar__inner{
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 0.9rem 1.5rem;
}

.traffic-lights{ display: flex; gap: 0.4rem; flex-shrink: 0; }

.dot{ width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.dot--red{ background: var(--red); }
.dot--yellow{ background: var(--gold); }
.dot--green{ background: var(--teal); }

.tabs{ display: flex; gap: 0.3rem; }

.tab{
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 0.5rem 0.9rem;
  border-radius: 6px 6px 0 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.tab:hover{ color: var(--text); background: var(--surface-alt); }

.tab.is-active{
  color: var(--gold);
  border-bottom-color: var(--gold);
  background: var(--surface-alt);
}

.menu-toggle{
  display: none;
  margin-left: auto;
  background: none;
  border: none;
  width: 32px;
  height: 24px;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
}

.menu-toggle span{
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

.tabs--mobile{
  display: none;
  flex-direction: column;
  padding: 0 1.5rem 1rem;
}

.tabs--mobile .tab{ padding: 0.7rem 0.5rem; border-bottom: 1px solid var(--border); border-radius: 0; }

@media (max-width: 720px){
  .editor-bar__inner .tabs{ display: none; }
  .menu-toggle{ display: flex; }
  .tabs--mobile.is-open{ display: flex; }
}

/* ===== Hero ===== */
.hero{
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 3rem;
  align-items: center;
  padding-top: 5rem;
}

@media (max-width: 860px){
  .hero{ grid-template-columns: 1fr; padding-top: 3rem; }
  .hero__portrait{ order: -1; display: flex; justify-content: center; }
}

.code-line{
  font-family: var(--font-mono);
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  white-space: pre-wrap;
  word-break: break-word;
}

.code-line--indent{ padding-left: 1.6rem; }

.kw{ color: var(--plum); }
.var{ color: var(--text); }
.op{ color: var(--text-muted); }
.brace{ color: var(--text-muted); }
.prop{ color: var(--teal); }
.str{ color: var(--gold); }

.cursor{
  display: inline-block;
  width: 8px;
  height: 1.1em;
  background: var(--gold);
  margin-left: 4px;
  vertical-align: text-bottom;
  animation: blink 1s steps(1) infinite;
}

@keyframes blink{
  50%{ opacity: 0; }
}

.hero__lede{
  margin-top: 2rem;
  max-width: 46ch;
  font-size: 1.08rem;
  color: var(--text-muted);
}

.hero__cta{
  display: flex;
  gap: 1rem;
  margin-top: 2.2rem;
  flex-wrap: wrap;
}

.btn{
  font-family: var(--font-mono);
  font-size: 0.9rem;
  padding: 0.8rem 1.4rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.btn--primary{
  background: var(--gold);
  color: var(--bg);
  border-color: var(--gold);
  font-weight: 600;
}

.btn--primary:hover{ transform: translateY(-2px); }

.btn--ghost:hover{
  border-color: var(--gold);
  color: var(--gold);
  transform: translateY(-2px);
}

.hero__portrait{ display: flex; justify-content: center; }

.portrait-frame{
  position: relative;
  width: min(340px, 80vw);
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
}

.portrait-frame img{
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.status-badge{
  position: absolute;
  bottom: 12px;
  left: 12px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(29, 30, 36, 0.9);
  backdrop-filter: blur(4px);
  border: 1px solid var(--border);
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.status-dot{
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 3px rgba(111, 191, 174, 0.2);
}

/* ===== Skills ===== */
.skill-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  list-style: none;
}

@media (max-width: 720px){
  .skill-grid{ grid-template-columns: 1fr; }
}

.skill-card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.8rem;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.skill-card:hover{ border-color: var(--gold); transform: translateY(-3px); }

.skill-card__tag{
  font-family: var(--font-mono);
  color: var(--gold);
  font-size: 0.85rem;
}

.skill-card h3{
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin: 0.6rem 0 0.5rem;
}

.skill-card p{ color: var(--text-muted); font-size: 0.95rem; }

/* ===== Projects ===== */
.project-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.project-card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.project-card:hover{ transform: translateY(-4px); border-color: var(--gold); }

.project-card__bar{
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 1rem;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
}

.project-card__filename{
  margin-left: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.project-card__body{
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  flex: 1;
}

.project-card__body h3{
  font-family: var(--font-display);
  font-size: 1.15rem;
}

.project-card__body p{ color: var(--text-muted); font-size: 0.92rem; flex: 1; }

.project-card__tags{
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.project-card__tags span{
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--plum);
  border: 1px solid var(--border);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}

.project-card__link{
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--gold);
  margin-top: 0.4rem;
}

.project-card__link:hover{ text-decoration: underline; }

/* ===== Contact / terminal ===== */
.terminal{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 640px;
}

.terminal__bar{
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 1rem;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
}

.terminal__title{
  margin-left: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.terminal__body{
  padding: 1.6rem;
  font-family: var(--font-mono);
  font-size: 0.92rem;
}

.terminal__line{ color: var(--text-muted); margin-top: 1rem; }
.terminal__line:first-child{ margin-top: 0; }

.prompt{ color: var(--teal); margin-right: 0.5rem; }

.terminal__result{ margin-left: 1.6rem; }

.terminal__result a{ color: var(--gold); }
.terminal__result a:hover{ text-decoration: underline; }

.cursor--terminal{
  width: 8px;
  height: 1em;
  background: var(--teal);
}

/* ===== Footer ===== */
.footer{
  text-align: center;
  padding: 2.5rem 1.5rem 3rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
}
