/* ============================================================
   Leyton — personal site
   Distinct, premium-minimal. Fraunces + Inter + JetBrains Mono.
   ============================================================ */

:root {
  --ink:        #16161a;
  --ink-soft:   #3c3c44;
  --muted:      #6b6b75;
  --faint:      #9a9aa3;
  --line:       #e6e2d9;
  --line-soft:  #efece4;
  --bg:         #faf8f3;
  --bg-raised:  #ffffff;
  --accent:     #b8472f;   /* burnt sienna — warm, distinct, not Happyglow */
  --accent-ink: #8f3623;
  --shadow:     0 1px 2px rgba(20,20,26,.04), 0 8px 28px rgba(20,20,26,.06);

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --wrap: 720px;
  --wrap-wide: 1080px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink:       #ece9e1;
    --ink-soft:  #c9c6bd;
    --muted:     #9b988f;
    --faint:     #6e6c66;
    --line:      #2a2a30;
    --line-soft: #232329;
    --bg:        #131316;
    --bg-raised: #1a1a1f;
    --accent:    #e0795f;
    --accent-ink:#eb8e76;
    --shadow:    0 1px 2px rgba(0,0,0,.3), 0 8px 28px rgba(0,0,0,.35);
  }
}

/* --- reset --- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 24px; }

/* ============================================================
   Header / nav
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.nav {
  max-width: var(--wrap-wide);
  display: flex; align-items: center; justify-content: space-between;
  height: 68px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 600; }
.brand:hover { text-decoration: none; color: var(--ink); }
.brand-mark {
  display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--ink); color: var(--bg);
  font-family: var(--serif); font-style: italic; font-size: 18px;
  line-height: 1;
}
.brand-name { font-family: var(--serif); font-size: 18px; letter-spacing: -.01em; }

.nav-links { display: flex; gap: 28px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  color: var(--ink-soft); font-size: 15px; font-weight: 500;
  letter-spacing: .01em; padding: 4px 0; position: relative;
}
.nav-links a:hover { color: var(--ink); text-decoration: none; }
.nav-links a.active { color: var(--ink); }
.nav-links a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 2px; background: var(--accent); border-radius: 2px;
}

/* mobile menu */
.nav-toggle, .nav-burger { display: none; }

@media (max-width: 640px) {
  .nav-burger {
    display: block; width: 26px; height: 26px; position: relative; cursor: pointer;
  }
  .nav-burger span, .nav-burger span::before, .nav-burger span::after {
    content: ""; position: absolute; left: 0; right: 0; height: 2px;
    background: var(--ink); border-radius: 2px; transition: .25s;
  }
  .nav-burger span { top: 12px; }
  .nav-burger span::before { top: -7px; } .nav-burger span::after { top: 7px; }
  .nav-links {
    position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--bg-raised); border-bottom: 1px solid var(--line);
    max-height: 0; overflow: hidden; transition: max-height .3s ease;
  }
  .nav-links li { border-top: 1px solid var(--line-soft); }
  .nav-links a { display: block; padding: 16px 24px; }
  .nav-toggle:checked ~ .nav-links { max-height: 320px; }
  .nav-toggle:checked ~ .nav-burger span { background: transparent; }
  .nav-toggle:checked ~ .nav-burger span::before { top: 0; transform: rotate(45deg); }
  .nav-toggle:checked ~ .nav-burger span::after  { top: 0; transform: rotate(-45deg); }
}

/* ============================================================
   Layout shell
   ============================================================ */
.site-main { flex: 1 0 auto; }

/* ============================================================
   Hero
   ============================================================ */
.hero { padding: clamp(64px, 12vw, 132px) 0 clamp(40px, 7vw, 72px); }
.hero-inner { max-width: 760px; }
.hero-eyebrow {
  font-family: var(--mono); font-size: 13px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 20px;
}
.hero-title {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(56px, 13vw, 132px); line-height: .92;
  letter-spacing: -.03em; margin: 0; color: var(--ink);
}
.hero-period { color: var(--accent); }
.hero-lede {
  font-size: clamp(19px, 2.4vw, 23px); line-height: 1.55;
  color: var(--ink-soft); max-width: 33em; margin: 28px 0 0;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 36px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 500; padding: 12px 22px;
  border-radius: 999px; border: 1px solid transparent; transition: .18s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: var(--accent); color: #fff; }
.btn-ghost { border-color: var(--line); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }

/* ============================================================
   Home sections
   ============================================================ */
.home-section { padding: clamp(36px, 6vw, 64px) 24px; border-top: 1px solid var(--line-soft); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 28px; }
.section-title {
  font-family: var(--serif); font-weight: 500; font-size: clamp(24px, 3.5vw, 32px);
  letter-spacing: -.02em; margin: 0; color: var(--ink);
}
.section-link { font-size: 14px; font-weight: 500; color: var(--muted); }
.section-link:hover { color: var(--accent); text-decoration: none; }

/* post list (shared home + archive) */
.post-list { list-style: none; margin: 0; padding: 0; }
.post-row { border-bottom: 1px solid var(--line-soft); }
.post-row:first-child { border-top: 1px solid var(--line-soft); }
.post-row-link {
  display: grid; grid-template-columns: 120px 1fr; gap: 4px 28px;
  align-items: baseline; padding: 18px 4px; color: var(--ink);
}
.post-row-link:hover { text-decoration: none; }
.post-row-link:hover .post-row-title { color: var(--accent); }
.post-row-date {
  font-family: var(--mono); font-size: 13px; color: var(--faint);
  letter-spacing: .02em; white-space: nowrap;
}
.post-row-title { font-size: 19px; font-weight: 500; letter-spacing: -.01em; transition: color .15s; }
.post-row-sub { grid-column: 2; color: var(--muted); font-size: 15.5px; line-height: 1.5; }

@media (max-width: 560px) {
  .post-row-link { grid-template-columns: 1fr; gap: 2px; }
  .post-row-sub, .post-row-title { grid-column: 1; }
  .post-row-date { order: -1; }
}

/* now grid */
.now-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.now-card {
  background: var(--bg-raised); border: 1px solid var(--line-soft);
  border-radius: 14px; padding: 22px; box-shadow: var(--shadow);
}
.now-card p { margin: 8px 0 0; font-size: 15.5px; color: var(--ink-soft); line-height: 1.55; }
.now-label {
  font-family: var(--mono); font-size: 12px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--accent);
}
@media (max-width: 720px) { .now-grid { grid-template-columns: 1fr; } }

/* ============================================================
   Page + prose
   ============================================================ */
.page-head { padding: clamp(48px, 8vw, 84px) 0 8px; }
.page-title {
  font-family: var(--serif); font-weight: 500; font-size: clamp(38px, 7vw, 58px);
  letter-spacing: -.03em; line-height: 1.02; margin: 0; color: var(--ink);
}
.page-subtitle, .post-subtitle { color: var(--muted); font-size: 19px; margin: 14px 0 0; max-width: 34em; }

.prose { padding-bottom: 96px; }
.prose > * + * { margin-top: 1.15em; }
.prose h2 {
  font-family: var(--serif); font-weight: 500; font-size: 28px; letter-spacing: -.02em;
  margin-top: 2em; line-height: 1.15; color: var(--ink);
}
.prose h3 { font-family: var(--serif); font-weight: 500; font-size: 22px; margin-top: 1.6em; color: var(--ink); }
.prose p, .prose li { color: var(--ink-soft); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-top: .4em; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose blockquote {
  border-left: 3px solid var(--accent); margin: 1.6em 0; padding: 2px 0 2px 20px;
  color: var(--muted); font-style: italic; font-size: 19px;
}
.prose code {
  font-family: var(--mono); font-size: .86em; background: var(--line-soft);
  padding: .15em .4em; border-radius: 5px; color: var(--ink);
}
.prose pre {
  background: #15151a; color: #e8e6df; padding: 18px 20px; border-radius: 12px;
  overflow-x: auto; font-size: 14px; line-height: 1.6;
}
.prose pre code { background: none; padding: 0; color: inherit; font-size: 14px; }
.prose hr { border: none; border-top: 1px solid var(--line); margin: 2.4em 0; }
.prose img { border-radius: 12px; }

/* tables */
.prose table { width: 100%; border-collapse: collapse; font-size: 16px; margin: 1.4em 0; }
.prose th, .prose td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.prose th { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

/* ============================================================
   Post
   ============================================================ */
.post-head { padding: clamp(48px, 8vw, 84px) 0 4px; }
.post-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 13px; color: var(--muted); margin-bottom: 18px;
}
.post-meta .dot { color: var(--faint); }
.post-tags { display: inline-flex; gap: 8px; }
.tag {
  background: var(--line-soft); color: var(--ink-soft);
  padding: 2px 9px; border-radius: 999px; font-size: 12px;
}
.post-title {
  font-family: var(--serif); font-weight: 500; font-size: clamp(34px, 6vw, 52px);
  line-height: 1.06; letter-spacing: -.03em; margin: 0; color: var(--ink);
}
.post-foot { margin-top: 64px; padding-top: 24px; border-top: 1px solid var(--line); }
.back-link { font-size: 15px; font-weight: 500; }

/* archive */
.archive-year { margin-top: 44px; }
.archive-year-label {
  font-family: var(--mono); font-size: 14px; color: var(--faint);
  letter-spacing: .08em; margin: 0 0 6px;
}
.empty-state { color: var(--muted); padding: 40px 0; }

/* ============================================================
   Projects
   ============================================================ */
.project-list { display: grid; gap: 18px; padding-bottom: 96px; }
.project {
  background: var(--bg-raised); border: 1px solid var(--line-soft);
  border-radius: 16px; padding: 28px; box-shadow: var(--shadow);
}
.project-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.project-name { font-family: var(--serif); font-weight: 500; font-size: 26px; letter-spacing: -.02em; margin: 0; color: var(--ink); }
.project-status {
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--line); padding: 4px 10px; border-radius: 999px; white-space: nowrap;
}
.status-live { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.project-tag { font-family: var(--mono); font-size: 13px; color: var(--muted); margin: 6px 0 14px; }
.project p { color: var(--ink-soft); margin: 0 0 4px; }
.project-points { margin: 14px 0 0; padding-left: 1.2em; color: var(--ink-soft); }
.project-points li { margin-top: .35em; }
.project-placeholder { border-style: dashed; box-shadow: none; background: transparent; }

/* ============================================================
   Bookshelf
   ============================================================ */
.book-list { display: grid; gap: 12px; margin: 16px 0 8px; }
.book {
  border: 1px solid var(--line-soft); border-radius: 12px; padding: 18px 20px;
  background: var(--bg-raised);
}
.book.reading { border-left: 3px solid var(--accent); }
.book-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.book-title { font-family: var(--serif); font-size: 19px; font-weight: 500; color: var(--ink); }
.book-author { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.book-note { margin: 6px 0 0; font-size: 15.5px; color: var(--ink-soft); }

/* ============================================================
   Contact card (about)
   ============================================================ */
.contact-card { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0; }
.contact-item {
  display: flex; flex-direction: column; gap: 4px;
  border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; color: var(--ink);
}
.contact-item:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-1px); transition: .18s; }
.contact-label { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.contact-value { font-size: 16px; font-weight: 500; }
.fine-print { font-size: 13px; color: var(--faint); }
@media (max-width: 520px) { .contact-card { grid-template-columns: 1fr; } }

/* ============================================================
   Footer
   ============================================================ */
.site-footer { border-top: 1px solid var(--line-soft); margin-top: 40px; padding: 40px 0; }
.footer-inner { max-width: var(--wrap-wide); display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: space-between; }
.footer-left { display: flex; flex-direction: column; }
.footer-name { font-family: var(--serif); font-size: 17px; color: var(--ink); }
.footer-meta { font-size: 13px; color: var(--faint); font-family: var(--mono); }
.footer-links { display: flex; flex-wrap: wrap; gap: 20px; list-style: none; margin: 0; padding: 0; }
.footer-links a { color: var(--muted); font-size: 14px; }
.footer-links a:hover { color: var(--accent); text-decoration: none; }
