:root {
  --paper: #F1EDE3;
  --paper-deep: #E7E1D2;
  --ink: #1E2A22;
  --ink-soft: #5B6459;
  --line: #D6CFBC;

  --layer-ui: #C77D2E;
  --layer-ui-tint: #F3E3CE;
  --layer-api: #2F5D50;
  --layer-api-tint: #DCE7E2;
  --layer-db: #4A3F73;
  --layer-db-tint: #E2DEEC;
  --layer-tools: #8A6A4B;

  --font-display: 'Fraunces', serif;
  --font-body: 'Archivo', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --max-width: 1120px;
  --gutter: clamp(1.25rem, 5vw, 4rem);
}

* { 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(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
:focus-visible { outline: 2px solid var(--layer-ui); outline-offset: 3px; }
img { display: block; max-width: 100%; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; margin: 0; color: var(--ink); }
p { margin: 0; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.75rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  z-index: 100;
}
.skip-link:focus { left: var(--gutter); top: 0.75rem; }

/* one-time reveal, respects reduced motion via the block above */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

.section { max-width: var(--max-width); margin: 0 auto; padding: 5.5rem var(--gutter); }
.section-kicker {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--layer-api);
  margin-bottom: 1rem;
}
.section-title { font-size: clamp(1.6rem, 3.5vw, 2.15rem); margin-bottom: 0.75rem; }
.section-note { color: var(--ink-soft); margin-bottom: 2.5rem; max-width: 52ch; }

/* header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem var(--gutter);
  background: rgba(241, 237, 227, 0.9);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--ink);
}

.logo-mark {
  display: inline-flex;
  flex-direction: column;
  width: 16px;
  height: 16px;
  gap: 2px;
}
.logo-mark span { display: block; flex: 1; border-radius: 1px; }
.logo-mark span:nth-child(1) { background: var(--layer-ui); }
.logo-mark span:nth-child(2) { background: var(--layer-api); }
.logo-mark span:nth-child(3) { background: var(--layer-db); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.nav-toggle span { display: block; height: 2px; background: var(--ink); border-radius: 1px; }

.nav-list { display: flex; align-items: center; gap: 2rem; }
.nav-list a {
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ink-soft);
  transition: color 0.15s ease;
}
.nav-list a:hover { color: var(--layer-ui); }
.nav-cta {
  color: var(--ink) !important;
  border: 1px solid var(--ink);
  border-radius: 2px;
  padding: 0.5rem 0.9rem;
}
.nav-cta:hover { border-color: var(--layer-ui); }

@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .nav-list {
    position: absolute;
    top: 100%;
    right: var(--gutter);
    left: var(--gutter);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--paper);
    border: 1px solid var(--line);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }
  .nav-list.is-open { max-height: 260px; }
  .nav-list li { border-top: 1px solid var(--line); }
  .nav-list li:first-child { border-top: none; }
  .nav-list a { display: block; padding: 1rem 1.25rem; }
  .nav-cta { border: none; padding: 1rem 1.25rem; }
}

/* hero */
.hero {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 3rem;
  align-items: center;
  min-height: 82vh;
  padding-top: 3.5rem;
  padding-bottom: 3.5rem;
}

.kicker {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin-bottom: 1.25rem;
}

.hero-title {
  font-size: clamp(2rem, 4.2vw, 3.4rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin-bottom: 1.5rem;
  max-width: 16ch;
}

.hero-lede {
  max-width: 44ch;
  font-size: clamp(1rem, 1.6vw, 1.1rem);
  color: var(--ink-soft);
  margin-bottom: 2.25rem;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; }

.btn {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-decoration: none;
  padding: 0.85rem 1.5rem;
  border: 1px solid var(--ink);
  border-radius: 2px;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}
.btn--primary { background: var(--ink); color: var(--paper); }
.btn--primary:hover { background: var(--layer-ui); border-color: var(--layer-ui); transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { border-color: var(--layer-ui); color: var(--layer-ui); transform: translateY(-1px); }

/* the signature stack cross-section */
.hero-stack {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}

.stack-band {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 1.5rem 1.5rem;
  border-bottom: 1px solid rgba(30, 42, 34, 0.08);
}
.stack-band:last-child { border-bottom: none; }

.stack-band--ui { background: var(--layer-ui-tint); }
.stack-band--api { background: var(--layer-api-tint); }
.stack-band--db { background: var(--layer-db-tint); }

.stack-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.stack-band--ui .stack-label { color: var(--layer-ui); }
.stack-band--api .stack-label { color: var(--layer-api); }
.stack-band--db .stack-label { color: var(--layer-db); }

.stack-detail { font-size: 0.9rem; color: var(--ink); }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; min-height: auto; padding-top: 2.5rem; }
  .hero-stack { flex-direction: row; }
  .stack-band { flex: 1; border-bottom: none; border-right: 1px solid rgba(30,42,34,0.08); padding: 1rem 1.1rem; }
  .stack-band:last-child { border-right: none; }
}

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

.about-photo-wrap {
  width: 200px;
  height: 200px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.about-photo { width: 100%; height: 100%; object-fit: cover; }

.about-copy h2 { font-size: clamp(1.4rem, 2.8vw, 1.75rem); margin-bottom: 1.1rem; max-width: 22ch; }
.about-copy p { color: var(--ink-soft); max-width: 58ch; margin-bottom: 1rem; }

.toolkit-heading {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.toolkit { display: flex; flex-direction: column; gap: 0.6rem; max-width: 44rem; }
.toolkit-group {
  display: grid;
  grid-template-columns: 14px 6rem 1fr;
  align-items: center;
  gap: 0.85rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
}
.toolkit-dot { width: 10px; height: 10px; border-radius: 50%; }
.toolkit-dot--ui { background: var(--layer-ui); }
.toolkit-dot--api { background: var(--layer-api); }
.toolkit-dot--db { background: var(--layer-db); }
.toolkit-dot--tools { background: var(--layer-tools); }
.toolkit-label { font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-soft); }
.toolkit-items { font-size: 0.9rem; }

@media (max-width: 640px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-photo-wrap { width: 140px; height: 140px; }
  .toolkit-group { grid-template-columns: 12px 5.2rem 1fr; }
}

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

.project-card--empty {
  border: 1px dashed var(--line);
  border-radius: 4px;
  padding: 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
  transition: border-color 0.15s ease;
}
.project-card--empty:hover { border-color: var(--layer-ui); }
.project-card__plus {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--layer-ui);
  border: 1px solid var(--layer-ui);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.4rem;
}
.project-card--empty h3 { font-size: 1.05rem; }
.project-card--empty p { color: var(--ink-soft); font-size: 0.88rem; }

/* contact */
.contact { border-top: 1px solid var(--line); }
.contact-lede { color: var(--ink-soft); max-width: 46ch; margin-bottom: 2rem; }

.contact-email {
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 4.5vw, 2.1rem);
  text-decoration: none;
  color: var(--ink);
  border-bottom: 2px solid var(--layer-ui);
  padding-bottom: 0.2rem;
  margin-bottom: 2.5rem;
  transition: color 0.15s ease;
}
.contact-email:hover { color: var(--layer-ui); }

.social-list { display: flex; flex-wrap: wrap; gap: 1.75rem; }
.social-list a { font-family: var(--font-mono); font-size: 0.85rem; text-decoration: none; color: var(--ink-soft); }
.social-list a:hover { color: var(--layer-ui); }

/* footer */
.site-footer {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 2rem var(--gutter);
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-soft);
}
.site-footer p { flex: 1; }
.site-footer a { text-decoration: none; color: var(--ink-soft); }
.site-footer a:hover { color: var(--layer-ui); }

.footer-mark { display: inline-flex; gap: 2px; }
.footer-mark span { width: 4px; height: 14px; border-radius: 1px; }
.footer-mark span:nth-child(1) { background: var(--layer-ui); }
.footer-mark span:nth-child(2) { background: var(--layer-api); }
.footer-mark span:nth-child(3) { background: var(--layer-db); }
