@font-face { font-family: "Fraunces"; src: url("/fonts/fraunces-latin-wght-normal.woff2") format("woff2-variations"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("/fonts/fraunces-latin-wght-italic.woff2") format("woff2-variations"); font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fonts/inter-latin-wght-normal.woff2") format("woff2-variations"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2-variations"); font-weight: 100 800; font-style: normal; font-display: swap; }

/* ---------- Variables ---------- */
:root {
  --bg: #131110;
  --bg-raised: #1b1714;
  --text: #f1ebe0;
  --text-dim: #a89f92;
  --text-faint: #6d655f;
  --accent: #e8892b;
  --accent-soft: rgba(232, 137, 43, 0.14);
  --rule: rgba(241, 235, 224, 0.14);
  --rule-strong: rgba(241, 235, 224, 0.28);
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
  --edge: clamp(1.5rem, 6vw, 4.5rem);
  --nav-h: 76px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
  background: var(--bg);
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
h1, h2, h3, p { margin: 0; }
ul { list-style: none; margin: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: #191410; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 var(--edge); }
.mono { font-family: var(--font-mono); }

/* ---------- Grain ---------- */
.grain {
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: rgba(19, 17, 16, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease;
}
.nav.scrolled { border-bottom-color: var(--rule); background: rgba(19, 17, 16, 0.92); }
.nav-wrap {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 var(--edge);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.nav-word {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.nav-links { display: flex; align-items: center; gap: clamp(1rem, 2.5vw, 2rem); }
.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  position: relative;
  padding-bottom: 5px;
  transition: color 0.2s ease;
}
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { transform: scaleX(1); }

/* ---------- Hero ---------- */
.hero { padding: calc(var(--nav-h) + 6.5rem) 0 2rem; }
.eyebrow {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
  margin-bottom: 1.75rem;
}
h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.25rem, 1.6rem + 5vw, 6.2rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
}
h1 em { font-style: italic; font-weight: 500; color: var(--accent); }
.hero-sub {
  font-size: clamp(1.05rem, 1rem + 0.4vw, 1.25rem);
  line-height: 1.65;
  color: var(--text-dim);
  max-width: 46ch;
  margin-top: 1.75rem;
}
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text);
  margin-top: 2.75rem;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--rule-strong);
  transition: color 0.2s ease, border-color 0.2s ease, gap 0.2s ease;
}
.hero-cta:hover { color: var(--accent); border-color: var(--accent); gap: 0.8rem; }
.hero-cta .arrow { transition: transform 0.2s ease; }
.hero-cta:hover .arrow { transform: translateX(3px); }

/* ---------- Sections (common) ---------- */
.section { padding: 7rem 0; }
#work.section { padding-top: 3.5rem; }
.section-head { display: flex; align-items: baseline; gap: 1.25rem; flex-wrap: wrap; margin-bottom: 2rem; }
.section-num { color: var(--accent); font-weight: 500; font-size: 0.85rem; letter-spacing: 0.1em; }
h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.9rem, 1.5rem + 2vw, 2.85rem);
  letter-spacing: -0.01em;
}
.rule { border-top: 1px solid var(--rule); }

/* ---------- Row lists (Work / Writing) ---------- */
.row {
  padding: 2.25rem 0.5rem;
  margin: 0 -0.5rem;
  border-top: 1px solid var(--rule);
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
}
.row-list .row:last-child { border-bottom: 1px solid var(--rule); }
.row:hover { background-color: var(--bg-raised); box-shadow: inset 3px 0 0 var(--accent); }
.row-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.row h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.2rem, 1.05rem + 0.6vw, 1.6rem);
  letter-spacing: -0.01em;
  transition: color 0.25s ease;
}
.row:hover h3 { color: var(--accent); }
.row .tags {
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  white-space: nowrap;
}
.row p { color: var(--text-dim); font-size: 1rem; line-height: 1.6; max-width: 62ch; }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3.5rem; align-items: start; }
.about-lead {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.4rem, 1.2rem + 1vw, 2rem);
  line-height: 1.35;
  color: var(--text);
}
.about-body p { color: var(--text-dim); font-size: 1.05rem; line-height: 1.7; }
.about-body p + p { margin-top: 1.25rem; }
.about-body p.about-meta {
  color: var(--text-faint);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ---------- Contact ---------- */
.contact-availability {
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  color: var(--text-faint);
  margin-bottom: 1rem;
}
.contact-lead { font-size: 1.15rem; color: var(--text-dim); margin-bottom: 2rem; }
.contact-email {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.7rem, 1.3rem + 2.4vw, 3rem);
  letter-spacing: -0.01em;
  border-bottom: 1px solid var(--rule-strong);
  padding-bottom: 0.15em;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.contact-email:hover { color: var(--accent); border-color: var(--accent); }
.contact-links { display: flex; gap: 2rem; margin-top: 2.5rem; flex-wrap: wrap; }
.contact-links a {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  position: relative;
  padding-bottom: 5px;
  transition: color 0.2s ease;
}
.contact-links a::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.contact-links a:hover { color: var(--text); }
.contact-links a:hover::after { transform: scaleX(1); }

/* ---------- Footer ---------- */
.footer { padding: 3rem 0; border-top: 1px solid var(--rule); }
.footer-wrap { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
.footer p { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-faint); }
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-faint); transition: color 0.2s ease; }
.footer-links a:hover { color: var(--text-dim); }

/* ---------- Reveal on scroll ---------- */
/* Only hide .reveal content when JS can actually run to un-hide it again
   (scripting: enabled) and the visitor hasn't asked for reduced motion.
   No-JS, scripting-unaware old browsers, and reduced-motion users all
   fail safely open: the media query simply never matches, so content
   stays at its default fully-visible state. */
@media (scripting: enabled) and (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.7s ease, transform 0.7s ease; }
}
.reveal.in-view { opacity: 1; transform: translateY(0); }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--rule-strong); border-radius: 5px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; gap: 1.75rem; }
  .section { padding: 5rem 0; }
  .hero { padding: calc(var(--nav-h) + 4rem) 0 1.5rem; }
  #work.section { padding-top: 3rem; }
}
@media (max-width: 640px) {
  :root { --nav-h: 64px; }
  .nav-word { font-size: 0.92rem; }
  .nav-links { gap: 0.85rem; }
  .nav-links a { font-size: 0.6rem; letter-spacing: 0.04em; }
  .row-top { flex-direction: column; align-items: flex-start; gap: 0.4rem; }
  .contact-links { gap: 1.25rem; }
  .footer-wrap { flex-direction: column; align-items: flex-start; }
}

/* ---------- Writing empty state ---------- */
.post-empty { color: var(--text-dim); font-size: 1rem; }

/* ---------- Legal + post article typography ---------- */
.legal h1, .post h1 {
  font-size: clamp(2rem, 1.6rem + 2vw, 3.2rem);
  margin-bottom: 1.5rem;
}
.legal h2, .post h2 {
  font-size: clamp(1.25rem, 1.1rem + 0.8vw, 1.6rem);
  margin: 2.25rem 0 0.75rem;
}
.legal p, .post p {
  line-height: 1.7;
  max-width: 65ch;
  margin-bottom: 1.1rem;
}
