:root {
  --bg: #0e0e10;
  --surface: #16161a;
  --text: #ececf1;
  --muted: #9b9ba6;
  --line: #25252b;
  --accent: #ff7a59;
  --accent-soft: rgba(255, 122, 89, 0.15);
  --max: 980px;
  --radius: 14px;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Fraunces", "Times New Roman", Georgia, serif;
}

[data-theme="light"] {
  --bg: #fafaf7;
  --surface: #ffffff;
  --text: #161616;
  --muted: #5b5b66;
  --line: #e6e6df;
  --accent: #d8492c;
  --accent-soft: rgba(216, 73, 44, 0.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 8px 12px;
  z-index: 100;
}
.skip-link:focus { left: 12px; top: 12px; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 18px clamp(20px, 5vw, 48px);
  background: color-mix(in oklab, var(--bg) 85%, transparent);
  backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand-mark {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  font-size: 22px;
}
.brand-dot { color: var(--accent); }
.site-header nav {
  margin-left: auto;
  display: flex;
  gap: 22px;
  font-size: 15px;
  color: var(--muted);
}
.site-header nav a:hover { color: var(--text); }

.theme-toggle {
  width: 34px; height: 34px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  display: grid; place-items: center;
  color: var(--muted);
  transition: color 0.2s, border-color 0.2s;
}
.theme-toggle:hover { color: var(--text); border-color: var(--text); }
.theme-toggle-icon {
  width: 14px; height: 14px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: inset -4px -2px 0 0 var(--bg);
}

/* Layout */
main { max-width: var(--max); margin: 0 auto; padding: 0 clamp(20px, 5vw, 48px); }

.section { padding: 96px 0; border-top: 1px solid var(--line); }
.section:first-of-type { border-top: 0; }
.section-title {
  display: flex;
  align-items: baseline;
  gap: 14px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: -0.02em;
  margin: 0 0 36px;
}
.section-num {
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}

/* Hero */
.hero { padding: clamp(72px, 14vh, 140px) 0 96px; }
.eyebrow {
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px;
}
.display {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(48px, 9vw, 96px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin: 0 0 24px;
}
.lede {
  font-size: clamp(18px, 2.2vw, 22px);
  color: var(--muted);
  max-width: 36ch;
  margin: 0 0 36px;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: transform 0.15s ease, background 0.2s, color 0.2s, border-color 0.2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { color: #fff; filter: brightness(1.05); }
.btn-ghost { border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--text); color: var(--text); }

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 48px;
}
.about-grid p { margin: 0 0 16px; color: var(--muted); }
.about-grid p:first-child { color: var(--text); }
.facts {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 14px;
  align-content: start;
  border-left: 1px solid var(--line);
  padding-left: 24px;
}
.facts li { display: grid; gap: 2px; }
.facts span {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.facts strong { font-weight: 500; }

@media (max-width: 720px) {
  .about-grid { grid-template-columns: 1fr; }
  .facts { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 24px; }
}

/* Work */
.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color 0.2s, transform 0.15s ease;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
}
.card-meta {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px;
}
.card p:last-child { margin: 0; color: var(--muted); }

@media (max-width: 720px) {
  .work-grid { grid-template-columns: 1fr; }
}

/* Writing */
.post-list { list-style: none; margin: 0; padding: 0; }
.post-list li { border-top: 1px solid var(--line); }
.post-list li:last-child { border-bottom: 1px solid var(--line); }
.post-list a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 4px;
  transition: padding 0.2s ease, color 0.2s;
}
.post-list a:hover { padding-left: 14px; }
.post-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.post-date {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

/* Contact */
.section-contact { text-align: center; }
.section-contact .section-title { justify-content: center; }
.contact-lede {
  color: var(--muted);
  max-width: 46ch;
  margin: 0 auto 28px;
}
.contact-email {
  font-family: var(--font-display);
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 500;
  letter-spacing: -0.02em;
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
  display: inline-block;
}
.contact-email:hover { border-color: var(--accent); }
.socials {
  list-style: none; padding: 0;
  margin: 36px 0 0;
  display: flex; flex-wrap: wrap; gap: 18px;
  justify-content: center;
  font-size: 14px;
  color: var(--muted);
}
.socials a:hover { color: var(--text); }

/* Footer */
.site-footer {
  padding: 32px clamp(20px, 5vw, 48px) 48px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}
