:root {
  --paper: #faf9f5;
  --ink: #171716;
  --muted: #5c5c56;
  --muted-2: #3e3e3a;
  --rule: #d8d7d0;
  --link: #0a4fab;
  --link-underline: #a7c2e2;
  --panel: #f0efe9;
  --hover: #f5f4ee;
  --selection: #dbe8f8;
  --max-width: 800px;
}

html[data-theme="dark"] {
  --paper: #151514;
  --ink: #eeeee5;
  --muted: #c4c3ba;
  --muted-2: #cfcec5;
  --rule: #3c3b38;
  --link: #91bdf5;
  --link-underline: #3d5877;
  --panel: #21211f;
  --hover: #1d1d1b;
  --selection: #223349;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.58 Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--selection); color: var(--ink); }

a {
  color: var(--link);
  text-decoration-color: var(--link-underline);
  text-underline-offset: 2px;
}

a:hover { color: var(--link); text-decoration-color: currentColor; }

a:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 4px;
  border-radius: 1px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 10px;
  z-index: 2;
  padding: 9px 12px;
  background: var(--ink);
  color: var(--paper);
}

.skip-link:focus { left: 10px; }

.wrap {
  width: min(var(--max-width), calc(100% - 40px));
  margin: auto;
}

/* Header */
header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: 31px 0 23px;
  border-bottom: 1px solid var(--rule);
}

.name {
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.032em;
  text-decoration: none;
}

nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 15px;
  font-size: 0.86rem;
}

nav a { color: var(--ink); text-decoration: none; padding-bottom: 2px; border-bottom: 1px solid transparent; }
nav a:hover { color: var(--link); }
nav a.current { color: var(--link); border-bottom-color: currentColor; }

.header-actions { display: flex; align-items: center; gap: 17px; }

.social-links { display: flex; align-items: center; gap: 3px; }

.icon-link {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  color: var(--muted);
  text-decoration: none;
}

.icon-link:hover { color: var(--link); }

.icon-link svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.75;
}

.icon-link .github-mark { fill: currentColor; stroke: none; }

.theme-toggle {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.83rem;
}

.theme-toggle:hover { color: var(--link); }

.theme-toggle:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 4px;
  border-radius: 1px;
}

/* Main */
main { padding: 60px 0 76px; }

.intro { padding-bottom: 51px; border-bottom: 1px solid var(--rule); }

h1 {
  margin: 0 0 16px;
  font: 400 clamp(2.65rem, 7vw, 4.55rem) / 0.96 Georgia, "Times New Roman", serif;
  letter-spacing: -0.062em;
}

.tagline { max-width: 650px; margin: 0; color: var(--muted-2); font-size: 1.16rem; }

.meta { margin: 23px 0 0; color: var(--muted); font-size: 0.9rem; }

section { padding: 44px 0; border-bottom: 1px solid var(--rule); }

h2 {
  margin: 0 0 10px;
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.section-note { max-width: 600px; margin: 0 0 22px; color: var(--muted); font-size: 0.94rem; }

/* Entries (Writing / Projects) */
.entry {
  display: grid;
  grid-template-columns: 118px 1fr auto;
  gap: 22px;
  align-items: start;
  padding: 20px 0;
  border-top: 1px solid var(--rule);
  transition: background-color 0.15s ease, padding 0.15s ease;
}

.entry:last-child { border-bottom: 1px solid var(--rule); }
.entry:hover { background: var(--hover); padding-left: 12px; padding-right: 12px; }

.date, .number { color: var(--muted); font-size: 0.83rem; }

.reading-time { display: block; margin-top: 2px; font-size: 0.78rem; color: var(--muted); }

.entry h3 { margin: 0; font-size: 1.02rem; letter-spacing: -0.012em; }
.entry h3 a { color: var(--ink); text-decoration: none; }
.entry h3 a:hover { color: var(--link); }

.entry p { margin: 5px 0 0; color: var(--muted); font-size: 0.93rem; }

.entry-action { padding-top: 1px; color: var(--link); font-size: 1.05rem; text-decoration: none; }

.status-tag {
  display: inline-block;
  margin-left: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.hypothesis {
  margin: 10px 0 0;
  padding: 10px 14px;
  font-size: 0.88rem;
  font-style: italic;
  color: var(--muted-2);
  background: var(--panel);
  border-left: 2px solid var(--rule);
}

/* Interests / Now-style lists */
.interests { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }

.interests li {
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: 22px;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
}

.interests strong { font-size: 0.97rem; }
.interests span { color: var(--muted-2); }

.now { padding: 26px 28px 27px; background: var(--panel); border-left: 3px solid var(--ink); }
.now h2 { margin-bottom: 11px; }
.now p { max-width: 650px; margin: 0; }

/* Notes */
.notes-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }

.notes-list li {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.93rem;
}

.notes-list .date { padding-top: 1px; }
.notes-empty { color: var(--muted); font-size: 0.93rem; }

/* About */
.about { max-width: 680px; margin: 0; font: 400 1.36rem / 1.42 Georgia, "Times New Roman", serif; letter-spacing: -0.026em; }

.links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 21px 0 0; font-size: 0.94rem; }

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 0 38px;
  color: var(--muted);
  font-size: 0.79rem;
}

/* Essay / writing pages */
.essay-intro { padding-bottom: 30px; border-bottom: 1px solid var(--rule); }
.essay-eyebrow { color: var(--muted); font-size: 0.83rem; margin-bottom: 10px; }
.essay-intro h1 { font-size: clamp(2.1rem, 6vw, 3.1rem); }
.essay-meta { color: var(--muted); font-size: 0.9rem; }

.essay-body { max-width: 680px; margin: 0 auto; padding: 46px 0 90px; font-size: 1.08rem; line-height: 1.75; }
.essay-body p { margin: 0 0 22px; }

.coming-soon {
  padding: 60px 0 90px;
  max-width: 600px;
}
.coming-soon h1 { font-size: clamp(2rem, 6vw, 2.8rem); }
.coming-soon p { color: var(--muted-2); font-size: 1.05rem; max-width: 560px; }

@media (max-width: 560px) {
  .wrap { width: min(calc(100% - 32px), 800px); }
  header { flex-direction: column; align-items: flex-start; gap: 14px; }
  .header-actions { flex-wrap: wrap; gap: 16px; }
  nav { justify-content: flex-start; width: 100%; }
  main { padding-top: 42px; }
  section { padding: 36px 0; }
  .entry, .interests li { grid-template-columns: 78px 1fr; gap: 13px; }
  .entry { padding: 18px 0; }
  .entry:hover { padding-left: 0; padding-right: 0; }
  .entry-action { display: none; }
  .now { padding: 22px; }
  footer { flex-direction: column; gap: 4px; }
}

@media print {
  .theme-toggle, .social-links, nav, .skip-link, .entry-action, footer { display: none; }
  body { background: #fff; color: #000; }
  a { color: #000; text-decoration: underline; }
  .essay-body { max-width: 100%; }
}
