/* =========================================================
   A portfolio with a point of view.
   Palette: paper, ink, rust. Type: Fraunces / Inter / Mono.
   ========================================================= */

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

:root {
  --paper:   #f6f3ec;   /* warm off-white */
  --paper-2: #efeae0;   /* slightly deeper paper for alt rows */
  --ink:     #1a1a1a;
  --ink-2:   #4a4a48;
  --ink-3:   #8a8782;
  --rule:    #d9d3c6;
  --rust:    #b8472b;   /* single accent */
  --rust-2:  #8f3620;

  --serif: "Fraunces", Georgia, serif;
  --sans:  "Inter", system-ui, sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, monospace;

  --maxw: 1080px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  /* faint paper grain */
  background-image:
    radial-gradient(rgba(0,0,0,0.018) 1px, transparent 1px);
  background-size: 3px 3px;
}

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

::selection { background: var(--rust); color: var(--paper); }

/* ---------- masthead ---------- */
.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(246, 243, 236, 0.85);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--rule);
}

.masthead-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;   /* ← was: baseline */
  gap: 2rem;
}

.wordmark {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  font-style: italic;
}
/* ---------- nav (desktop) ---------- */
.nav {
  display: flex;
  gap: 1.75rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

.nav a {
  text-decoration: none;
  color: var(--ink-2);
  position: relative;
  padding-bottom: 2px;
  white-space: nowrap;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 1px;
  background: var(--ink);
  transition: width 0.25s ease;
}

.nav a:hover { color: var(--ink); }
.nav a:hover::after { width: 100%; }

/* ---------- hamburger button (hidden on desktop) ---------- */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  margin: -0.5rem -0.5rem -0.5rem 0;
  flex-direction: column;
  gap: 5px;
  z-index: 60;
}

.menu-bar {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.25s ease, opacity 0.2s ease;
}

/* animate ☰ → ✕ when open */
.menu-toggle[aria-expanded="true"] .menu-bar:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}
.menu-toggle[aria-expanded="true"] .menu-bar:nth-child(2) {
  opacity: 0;
}
.menu-toggle[aria-expanded="true"] .menu-bar:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* ---------- mobile nav ---------- */
@media (max-width: 820px) {
  .menu-toggle { display: flex; }

  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    padding: 0.5rem 1.25rem 1rem;
    /* hidden state */
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.2s ease, padding 0.3s ease;
    padding-top: 0;
    padding-bottom: 0;
  }

  .nav.open {
    max-height: 400px;
    opacity: 1;
    padding-top: 0.5rem;
    padding-bottom: 1rem;
  }

  .nav a {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--rule);
    font-size: 0.85rem;
    color: var(--ink);
  }

  .nav a:last-child { border-bottom: none; }
  .nav a::after { display: none; } /* no underline animation on touch */
}

/* ---------- layout ---------- */
main { max-width: var(--maxw); margin: 0 auto; padding: 0 2rem; }

section { padding: 6rem 0; border-top: 1px solid var(--rule); }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 3rem;
}

.section-num {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-3);
  letter-spacing: 0.05em;
}

.section-head h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  letter-spacing: -0.015em;
}

/* ---------- hero ---------- */
.hero {
  padding: 5rem 0 6rem;
  border-top: none;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3rem;
  align-items: end;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.hero-name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3rem, 9vw, 6.5rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
}

.hero-name em {
  font-style: italic;
  color: var(--rust);
}

.hero-title {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  color: var(--ink-2);
  margin-bottom: 1.5rem;
  max-width: 32ch;
}

.hero-desc {
  max-width: 52ch;
  color: var(--ink-2);
  margin-bottom: 2.5rem;
}

.hero-links {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.link-arrow {
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 2px;
  transition: color 0.2s, border-color 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.link-arrow span { transition: transform 0.2s; }
.link-arrow:hover { color: var(--rust); border-color: var(--rust); }
.link-arrow:hover span { transform: translateX(4px); }

/* hand-drawn-ish stamp in the hero corner */
.hero-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.stamp {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 0.7rem;
  text-align: center;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  transform: rotate(-8deg);
  background: var(--paper);
  box-shadow: 3px 3px 0 var(--rule);
}

.stamp-caption {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.85rem;
  color: var(--ink-3);
  text-align: center;
  line-height: 1.4;
}

/* ---------- about ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 4rem;
  align-items: start;
}

.about-body p {
  color: var(--ink-2);
  margin-bottom: 1.25rem;
  max-width: 60ch;
}

/* drop cap — the small human flourish */
.dropcap::first-letter {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 4rem;
  line-height: 0.9;
  float: left;
  padding: 0.35rem 0.5rem 0 0;
  color: var(--rust);
}

.facts {
  list-style: none;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--ink-2);
}

.facts li {
  padding: 0.7rem 0;
  border-bottom: 1px dashed var(--rule);
  display: flex;
  gap: 0.75rem;
}

.facts li::before {
  content: "→";
  color: var(--rust);
  flex-shrink: 0;
}

/* ---------- skills (numbered rows, not cards) ---------- */
.skills {
  display: grid;
  gap: 0;
}

.skill-row {
  display: grid;
  grid-template-columns: 3rem 10rem 1fr;
  gap: 2rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
}

.skill-row:last-child { border-bottom: none; }

.skill-index {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-3);
}

.skill-label {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.skill-items {
  color: var(--ink-2);
  font-size: 0.95rem;
}

.skill-items span::after {
  content: " · ";
  color: var(--ink-3);
  margin: 0 0.35rem;
}

.skill-items span:last-child::after { content: ""; }

/* ---------- projects (editorial list) ---------- */
.project-list {
  list-style: none;
  counter-reset: proj;
}

.project {
  border-top: 1px solid var(--rule);
  padding: 2rem 0;
  position: relative;
}

.project:first-child { border-top: none; }

.project-head {
  display: grid;
  grid-template-columns: 3rem 1fr auto;
  gap: 2rem;
  align-items: baseline;
  cursor: default;
}

.project-num {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-3);
}

.project-title {
  font-family: var(--serif);
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.15;
  position: relative;
  display: inline-block;
}

.project-title::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  height: 1px; width: 0;
  background: var(--rust);
  transition: width 0.35s ease;
}

.project:hover .project-title::after { width: 100%; }

.project-year {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink-3);
}

.project-meta {
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: 2rem;
  margin-top: 1rem;
}

.project-meta-body {
  max-width: 60ch;
  color: var(--ink-2);
  font-size: 0.95rem;
}

.project-meta-body .desc { margin-bottom: 0.75rem; }

.project-meta-body .kv {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink-3);
  display: flex;
  gap: 0.6rem;
  margin-bottom: 0.25rem;
  flex-wrap: wrap;
}

.project-meta-body .kv strong {
  color: var(--ink-2);
  font-weight: 500;
}

.project-tech {
  margin-top: 0.9rem;
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--ink-3);
  letter-spacing: 0.02em;
}

.project-tech span { margin-right: 1rem; }

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 1rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  text-decoration: none;
  color: var(--rust);
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
  transition: border-color 0.2s;
}

.project-link:hover { border-color: var(--rust); }

/* hover preview image — appears when hovering a row */
.project-preview {
  position: fixed;
  width: 280px;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--ink);
  background: var(--paper-2);
  background-size: cover;
  background-position: center;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) rotate(-2deg);
  transition: opacity 0.2s;
  z-index: 40;
  box-shadow: 6px 6px 0 rgba(26,26,26,0.12);
}

.project-preview.on { opacity: 1; }

/* ---------- experience timeline ---------- */
.timeline {
  list-style: none;
  border-left: 1px solid var(--rule);
  margin-left: 0.4rem;
  padding-left: 2.25rem;
}

.timeline-item {
  position: relative;
  padding-bottom: 2.5rem;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-item::before {
  content: "";
  position: absolute;
  left: -2.55rem;
  top: 0.45rem;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--paper);
  border: 1.5px solid var(--ink);
}

.exp-title {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 400;
  margin-bottom: 0.25rem;
  letter-spacing: -0.01em;
}

.exp-company {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--rust);
  letter-spacing: 0.03em;
  margin-bottom: 0.6rem;
  display: block;
}

.exp-desc {
  color: var(--ink-2);
  font-size: 0.95rem;
  max-width: 60ch;
  margin-bottom: 0.6rem;
}

.exp-meta {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--ink-3);
  margin-bottom: 0.25rem;
}

.exp-meta strong { color: var(--ink-2); font-weight: 500; }

.exp-tech {
  margin-top: 0.6rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--ink-3);
}

.exp-tech span { margin-right: 1rem; }

/* ---------- contact ---------- */
.contact-lead {
  font-family: var(--serif);
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  color: var(--ink-2);
  max-width: 48ch;
  margin-bottom: 2rem;
  line-height: 1.5;
}

.email-link {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  text-decoration: none;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 4px;
  display: inline-block;
  margin-bottom: 3rem;
  transition: color 0.2s, border-color 0.2s;
  word-break: break-word;
}

.email-link:hover { color: var(--rust); border-color: var(--rust); }

.contact-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0;
  border-top: 1px solid var(--rule);
}

.contact-list li { border-bottom: 1px solid var(--rule); }

.contact-list a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 1rem 0;
  text-decoration: none;
  transition: padding 0.25s, color 0.2s;
}

.contact-list a:hover { padding-left: 0.75rem; color: var(--rust); }

.contact-label {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-3);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.contact-value {
  font-size: 0.9rem;
  color: var(--ink-2);
}

/* ---------- footer ---------- */
.footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 3rem 2rem 4rem;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--ink-3);
}

.footer-note { font-style: italic; }

/* ---------- responsive ---------- */
@media (max-width: 820px) {
  main { padding: 0 1.25rem; }

  .hero {
    grid-template-columns: 1fr;
    padding: 3.5rem 0 4rem;
    gap: 2.5rem;
  }

  .hero-side {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 1.25rem;
  }

  .stamp { width: 82px; height: 82px; font-size: 0.6rem; }
  .stamp-caption { text-align: left; }

  .about-grid { grid-template-columns: 1fr; gap: 2.5rem; }

  .skill-row {
    grid-template-columns: 2rem 1fr;
    gap: 1rem;
    row-gap: 0.4rem;
  }
  .skill-items { grid-column: 2; }

  .project-head { grid-template-columns: 2rem 1fr; gap: 1rem; }
  .project-year { grid-column: 2; margin-top: 0.25rem; }
  .project-meta { grid-template-columns: 1fr; }

  .section { padding: 4rem 0; }

  .masthead-inner { padding: 1rem 1.25rem; }
  .nav { gap: 1.1rem; font-size: 0.72rem; }

  .project-preview { display: none; } /* no hover on touch */
}