/* ---------------------------------------------
   Tokens
--------------------------------------------- */
:root {
  --ink:      #101B2D;
  --ink-2:    #16223A;
  --ink-3:    #1D2B47;
  --paper:    #F2EFE7;
  --muted:    #9FB0C8;
  --amber:    #E3A857;
  --teal:     #5EC8B8;
  --line:     rgba(242,239,231,0.12);
  --line-2:   rgba(242,239,231,0.22);

  --display: "Fraunces", Georgia, serif;
  --body:    "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --mono:    "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;

  --max: 920px;
  --pad: clamp(20px, 5vw, 64px);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.01em;
}

a { color: inherit; }

ul { padding-left: 1.1em; margin: 0.6em 0 0; }
li { margin-bottom: 0.5em; }
li:last-child { margin-bottom: 0; }

.eyebrow {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  color: var(--teal);
  margin: 0 0 14px;
}

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

/* ---------------------------------------------
   Signature: memory-page field
   A quiet grid of "pages" (from the Virtual Memory
   Manager / File System projects) that live behind
   the whole page and fault-in one at a time.
--------------------------------------------- */
.page-field {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, 34px);
  grid-auto-rows: 34px;
  justify-content: center;
  opacity: 0.5;
}

.page-cell {
  border: 1px solid rgba(242,239,231,0.045);
}

.page-cell.filled {
  background: rgba(94, 200, 184, 0.05);
  border-color: rgba(94, 200, 184, 0.14);
  transition: background 1.4s ease, border-color 1.4s ease;
}

.page-cell.fault {
  background: rgba(227, 168, 87, 0.16);
  border-color: rgba(227, 168, 87, 0.4);
  transition: background 0.15s ease, border-color 0.15s ease;
}

/* ---------------------------------------------
   Header / nav
--------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px var(--pad);
  background: linear-gradient(to bottom, var(--ink) 70%, transparent);
  backdrop-filter: blur(6px);
}

.brand {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 15px;
  text-decoration: none;
  letter-spacing: 0.04em;
}
.brand-dot { color: var(--amber); }

.nav {
  display: flex;
  gap: 28px;
  font-family: var(--mono);
  font-size: 13.5px;
}

.nav a {
  text-decoration: none;
  color: var(--muted);
  transition: color 0.2s ease;
}
.nav a:hover, .nav a:focus-visible { color: var(--paper); }

.nav-cta {
  color: var(--paper) !important;
  border: 1px solid var(--line-2);
  padding: 6px 14px;
  border-radius: 999px;
}
.nav-cta:hover { border-color: var(--amber); color: var(--amber) !important; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--paper);
  display: block;
}

/* ---------------------------------------------
   Layout helpers
--------------------------------------------- */
main { position: relative; z-index: 1; }

.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 96px var(--pad) 0;
}

.section-head h2 {
  font-size: clamp(26px, 3.6vw, 34px);
  max-width: 20ch;
}

/* ---------------------------------------------
   Hero
--------------------------------------------- */
.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: 100px var(--pad) 60px;
  min-height: 72vh;
  display: flex;
  align-items: center;
}

.hero-title {
  font-size: clamp(48px, 9vw, 92px);
  line-height: 0.98;
  margin: 6px 0 22px;
}

.hero-tagline {
  max-width: 52ch;
  font-size: clamp(16px, 1.6vw, 19px);
  color: var(--muted);
}

.hero-actions {
  display: flex;
  gap: 16px;
  margin-top: 36px;
  flex-wrap: wrap;
}

.btn {
  font-family: var(--mono);
  font-size: 13.5px;
  text-decoration: none;
  padding: 13px 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn-primary {
  background: var(--amber);
  color: var(--ink);
  font-weight: 500;
}
.btn-primary:hover { transform: translateY(-2px); }

.btn-ghost {
  border: 1px solid var(--line-2);
  color: var(--paper);
}
.btn-ghost:hover { border-color: var(--teal); color: var(--teal); transform: translateY(-2px); }

/* ---------------------------------------------
   About
--------------------------------------------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 56px;
  margin-top: 8px;
}

.lede {
  font-size: 17px;
  color: var(--paper);
  max-width: 56ch;
}

.about-facts {
  display: flex;
  flex-direction: column;
  gap: 22px;
  border-left: 1px solid var(--line);
  padding-left: 28px;
}

.fact { display: flex; flex-direction: column; gap: 4px; }

.fact-label {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--teal);
  text-transform: lowercase;
}

.fact-value { color: var(--muted); font-size: 14.5px; }

/* ---------------------------------------------
   Experience timeline
--------------------------------------------- */
.timeline {
  margin-top: 12px;
  border-top: 1px solid var(--line);
}

.entry {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 32px;
  padding: 34px 0;
  border-bottom: 1px solid var(--line);
}

.entry-date {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
}

.entry-body h3 { font-size: 19px; font-weight: 600; margin-bottom: 6px; }

.entry-org {
  font-family: var(--body);
  font-weight: 400;
  color: var(--muted);
  font-size: 15px;
}

.entry-body ul { color: var(--paper); font-size: 15px; max-width: 62ch; }

/* ---------------------------------------------
   Projects
--------------------------------------------- */
.project-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 12px;
}

.project-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px;
  background: var(--ink-2);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.project-card:hover { border-color: var(--line-2); transform: translateY(-3px); }

.project-card.featured {
  grid-column: 1 / -1;
  background: var(--ink-3);
}

.project-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.project-top h3 { font-size: 19px; }

.project-date {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.project-stack {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--amber);
  margin: 8px 0 0;
}

.project-card ul { font-size: 14.5px; color: var(--muted); margin-top: 14px; }

/* ---------------------------------------------
   Skills
--------------------------------------------- */
.skills-grid {
  display: flex;
  flex-direction: column;
  gap: 28px;
  margin-top: 8px;
}

.skill-label {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--teal);
  display: block;
  margin-bottom: 12px;
  text-transform: lowercase;
}

.tag-row { display: flex; flex-wrap: wrap; gap: 10px; }

.tag {
  font-family: var(--mono);
  font-size: 13px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  padding: 7px 12px;
  color: var(--paper);
}

/* ---------------------------------------------
   Resume CTA
--------------------------------------------- */
.resume-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  border: 1px solid var(--line-2);
  border-radius: 18px;
  padding: 44px;
  background: var(--ink-2);
}

.resume-card h2 { font-size: 26px; margin-top: 4px; }
.resume-card .lede { color: var(--muted); font-size: 15px; margin-top: 8px; }

/* ---------------------------------------------
   Contact
--------------------------------------------- */
.contact-row {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.contact-link {
  font-family: var(--mono);
  font-size: 15px;
  text-decoration: none;
  border-bottom: 1px solid var(--line-2);
  padding-bottom: 4px;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.contact-link:hover { color: var(--amber); border-color: var(--amber); }

/* ---------------------------------------------
   Footer
--------------------------------------------- */
.site-footer {
  position: relative;
  z-index: 1;
  max-width: var(--max);
  margin: 120px auto 0;
  padding: 28px var(--pad) 48px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

/* ---------------------------------------------
   Reveal-on-scroll
--------------------------------------------- */
.section, .hero-inner {
  opacity: 0;
  transform: translateY(16px);
}
.section.visible, .hero-inner.visible {
  opacity: 1;
  transform: none;
  transition: opacity 0.7s ease, transform 0.7s ease;
}

/* ---------------------------------------------
   Responsive
--------------------------------------------- */
@media (max-width: 760px) {
  .nav { display: none; }
  .nav-toggle { display: flex; }

  .nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    right: var(--pad);
    left: var(--pad);
    background: var(--ink-2);
    border: 1px solid var(--line-2);
    border-radius: 12px;
    padding: 18px;
    gap: 16px;
  }

  .about-grid { grid-template-columns: 1fr; gap: 32px; }
  .about-facts { border-left: none; padding-left: 0; border-top: 1px solid var(--line); padding-top: 24px; }

  .entry { grid-template-columns: 1fr; gap: 10px; }

  .project-grid { grid-template-columns: 1fr; }

  .resume-card { flex-direction: column; align-items: flex-start; }

  .page-field { opacity: 0.3; }
}
