/* ============================================
   TOKENS
   ============================================ */
:root {
  --ink:        #0D1613;
  --ink-2:      #16211D;
  --ink-3:      #1F2C27;
  --panel-line: #2A3A33;
  --paper:      #ECE7DA;
  --muted:      #9CA8A0;
  --amber:      #E3A857;
  --periwinkle: #8FA6E0;
  --rust:       #C1573A;

  --font-display: "Space Grotesk", sans-serif;
  --font-body: "IBM Plex Sans", -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;

  --wrap: 1180px;
  --radius: 10px;
  --ease: cubic-bezier(.16,.8,.24,1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@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 {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 32px;
}

em { color: var(--amber); font-style: normal; }

/* ============================================
   HEADER
   ============================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 22, 19, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--panel-line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.brand-mark { border-radius: 8px; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--paper);
}
.brand--small .brand-name { font-size: 0.95rem; }

.main-nav {
  display: flex;
  gap: 32px;
  font-size: 0.92rem;
  font-weight: 500;
  margin-right: auto;
  margin-left: 48px;
}
.main-nav a {
  position: relative;
  padding: 4px 0;
  color: var(--muted);
  transition: color 0.2s var(--ease);
}
.main-nav a:hover { color: var(--paper); }
.main-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1px;
  background: var(--amber);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease);
}
.main-nav a:hover::after { transform: scaleX(1); }

.nav-toggle { display: none; }

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.9rem;
  padding: 13px 24px;
  border-radius: 7px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease), color .2s var(--ease);
}
.btn-primary {
  background: var(--amber);
  color: var(--ink);
  font-weight: 600;
}
.btn-primary:hover { background: #EFBB78; transform: translateY(-1px); }

.btn-ghost {
  border-color: var(--panel-line);
  color: var(--paper);
  padding: 10px 20px;
}
.btn-ghost:hover { border-color: var(--amber); color: var(--amber); }

.btn-text {
  padding: 13px 4px;
  color: var(--muted);
}
.btn-text:hover { color: var(--periwinkle); }

.btn-large { padding: 17px 30px; font-size: 0.98rem; }

.header-cta { flex-shrink: 0; }

/* ============================================
   HERO
   ============================================ */
.hero {
  padding: 88px 0 100px;
  background:
    radial-gradient(ellipse 900px 500px at 15% -10%, rgba(227,168,87,0.08), transparent),
    radial-gradient(ellipse 700px 500px at 100% 10%, rgba(143,166,224,0.07), transparent);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  margin: 0 0 24px;
}
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #6FCF8E;
  box-shadow: 0 0 0 3px rgba(111,207,142,0.18);
}

.hero-headline {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.3rem, 4.4vw, 3.4rem);
  line-height: 1.14;
  letter-spacing: -0.01em;
  margin: 0 0 24px;
  color: var(--paper);
}

.hero-sub {
  font-size: 1.08rem;
  line-height: 1.65;
  color: var(--muted);
  max-width: 480px;
  margin: 0 0 36px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

/* terminal */
.hero-terminal {
  background: var(--ink-2);
  border: 1px solid var(--panel-line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.5);
}
.terminal-chrome {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 13px 16px;
  background: var(--ink-3);
  border-bottom: 1px solid var(--panel-line);
}
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot-red { background: var(--rust); }
.dot-amber { background: var(--amber); }
.dot-blue { background: var(--periwinkle); }
.terminal-title {
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
}
.terminal-body {
  margin: 0;
  padding: 22px 22px 28px;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  line-height: 1.75;
  color: var(--paper);
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 260px;
}
.cursor {
  color: var(--amber);
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ============================================
   SECTION HEADS (shared)
   ============================================ */
.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber);
  margin: 0 0 14px;
}
.section-eyebrow--light { color: var(--amber); }

.section-heading {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  line-height: 1.2;
  margin: 0 0 16px;
  max-width: 640px;
  color: var(--paper);
}

.section-lead {
  color: var(--muted);
  max-width: 520px;
  margin: 0 0 56px;
  font-size: 1.02rem;
}

/* ============================================
   STACK LAYERS
   ============================================ */
.stack-section { padding: 110px 0; border-top: 1px solid var(--panel-line); }

.layers {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--panel-line);
  border: 1px solid var(--panel-line);
  border-radius: var(--radius);
  overflow: hidden;
}

.layer {
  background: var(--ink-2);
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  align-items: center;
  padding: 30px 32px;
  transition: background 0.25s var(--ease);
}
.layer:hover { background: var(--ink-3); }

.layer-head { display: flex; flex-direction: column; gap: 6px; }
.layer-index {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--muted);
}
.layer-head h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  margin: 0;
  color: var(--paper);
}
.layer-head p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.layer-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}
.layer-tags li {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--paper);
  background: var(--ink-3);
  border: 1px solid var(--panel-line);
  padding: 7px 14px;
  border-radius: 999px;
}
.layer[data-layer="frontend"] .layer-tags li:nth-child(1) { border-color: var(--amber); color: var(--amber); }
.layer[data-layer="backend"] .layer-tags li:nth-child(1) { border-color: var(--periwinkle); color: var(--periwinkle); }
.layer[data-layer="data"] .layer-tags li:nth-child(1) { border-color: var(--periwinkle); color: var(--periwinkle); }
.layer[data-layer="infra"] .layer-tags li:nth-child(1) { border-color: var(--muted); }

/* ============================================
   WORK / PROJECTS
   ============================================ */
.work-section { padding: 110px 0; border-top: 1px solid var(--panel-line); }

.project-list {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.project-card {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 0;
  background: var(--ink-2);
  border: 1px solid var(--panel-line);
  border-radius: var(--radius);
  overflow: hidden;
}
.project-card:nth-child(even) { grid-template-columns: 1fr 1.15fr; }
.project-card:nth-child(even) .project-media { order: 2; }
.project-card:nth-child(even) .project-copy { order: 1; }

.project-media {
  background: var(--ink-3);
  display: flex;
  align-items: center;
  padding: 20px;
}
.project-media img { border-radius: 6px; width: 100%; height: auto; }

.project-copy {
  padding: 40px 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}
.project-copy h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.5rem;
  margin: 0;
  color: var(--paper);
}
.project-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.65;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.project-tags li {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--periwinkle);
  background: rgba(143,166,224,0.1);
  padding: 5px 11px;
  border-radius: 999px;
}

/* ============================================
   ABOUT
   ============================================ */
.about-section { padding: 110px 0; border-top: 1px solid var(--panel-line); }

.about-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 64px;
  align-items: start;
}

.about-media img { border-radius: 50%; }

.about-copy p {
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.7;
  max-width: 620px;
}

.about-facts {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 28px;
  margin: 36px 0 0;
  padding-top: 28px;
  border-top: 1px solid var(--panel-line);
}
.about-facts dt {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 8px;
}
.about-facts dd {
  margin: 0;
  font-size: 0.92rem;
  color: var(--paper);
  line-height: 1.5;
}

/* ============================================
   CTA / CONTACT
   ============================================ */
.cta-section {
  padding: 120px 0 100px;
  text-align: center;
  border-top: 1px solid var(--panel-line);
  background: radial-gradient(ellipse 800px 400px at 50% 0%, rgba(227,168,87,0.07), transparent);
}

.cta-inner { display: flex; flex-direction: column; align-items: center; }

.cta-heading {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 3.8vw, 2.9rem);
  line-height: 1.15;
  margin: 0 0 18px;
  max-width: 620px;
}

.cta-sub {
  color: var(--muted);
  max-width: 460px;
  margin: 0 0 40px;
}

.social-row {
  display: flex;
  gap: 28px;
  margin-top: 32px;
  font-family: var(--font-mono);
  font-size: 0.88rem;
}
.social-row a { color: var(--muted); transition: color 0.2s var(--ease); }
.social-row a:hover { color: var(--periwinkle); }

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  padding: 36px 0 44px;
  border-top: 1px solid var(--panel-line);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-fine {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  font-family: var(--font-mono);
}

/* ============================================
   SCROLL REVEAL
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-terminal { max-width: 560px; }
  .about-grid { grid-template-columns: 1fr; }
  .about-media img { width: 140px; height: 140px; }
  .about-facts { grid-template-columns: 1fr 1fr; }
  .project-card, .project-card:nth-child(even) { grid-template-columns: 1fr; }
  .project-card:nth-child(even) .project-media,
  .project-card:nth-child(even) .project-copy { order: initial; }
}

@media (max-width: 720px) {
  .main-nav {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 76px; left: 0; right: 0;
    background: var(--ink);
    border-bottom: 1px solid var(--panel-line);
    padding: 8px 22px 20px;
    gap: 4px;
    margin: 0;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
  }
  .main-nav.is-open { opacity: 1; transform: translateY(0); pointer-events: auto; }
  .main-nav a { padding: 10px 0; }
  .header-cta { display: none; }
  .nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px; height: 36px;
    background: none; border: none; cursor: pointer;
  }
  .nav-toggle span { height: 2px; background: var(--paper); border-radius: 2px; transition: transform 0.2s var(--ease), opacity 0.2s var(--ease); }
  .nav-toggle.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle.is-active span:nth-child(2) { opacity: 0; }
  .nav-toggle.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .wrap { padding: 0 22px; }
  .hero { padding: 56px 0 72px; }
  .stack-section, .work-section, .about-section { padding: 72px 0; }
  .cta-section { padding: 88px 0 72px; }

  .layer { grid-template-columns: 1fr; gap: 16px; }
  .layer-tags { justify-content: flex-start; }
  .project-copy { padding: 28px 24px; }
  .about-facts { grid-template-columns: 1fr; gap: 20px; }
  .social-row { flex-wrap: wrap; gap: 18px; }
}
