:root {
  --paper: #f4f4f1;
  --graphite: #2d2b27;
  --graphite-soft: #4e4b45;
  --graphite-faint: #68645d;
  --line: rgba(45, 43, 39, 0.42);
  --site-font: "Courier Prime", "Courier New", ui-monospace, SFMono-Regular,
    Menlo, Monaco, Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  color: var(--graphite);
  background: var(--paper);
  font-family: var(--site-font);
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url("assets/paper-bg.png");
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  filter: contrast(1.01) brightness(1.01);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    repeating-radial-gradient(circle at 22% 18%, rgba(45, 43, 39, 0.022) 0 0.7px, transparent 0.8px 3.6px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(245, 245, 240, 0.04));
  mix-blend-mode: multiply;
  opacity: 0.36;
}

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible {
  outline: 1px solid rgba(45, 43, 39, 0.72);
  outline-offset: 5px;
}

.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 10;
  padding: 0.5rem 0.65rem;
  color: var(--graphite);
  background: rgba(246, 246, 242, 0.92);
  border: 1px solid rgba(45, 43, 39, 0.2);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.paper-page {
  position: relative;
  z-index: 1;
  width: 100vw;
  min-height: 100svh;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: auto auto auto auto;
  column-gap: clamp(2rem, 4vw, 5rem);
  row-gap: clamp(2.4rem, 5vh, 4rem);
  align-items: start;
  padding: clamp(2.4rem, 9.05vh, 7.6rem) clamp(1.5rem, 7.42vw, 7.42vw) clamp(2.4rem, 8.05vh, 6.4rem);
}

.paper-page > .site-header {
  grid-column: 1 / -1;
  grid-row: 1;
}

.paper-page > .hero {
  grid-column: 1 / 2;
  grid-row: 2;
  max-width: 44.5rem;
}

.paper-page > .current {
  grid-column: 2 / 3;
  grid-row: 2;
  justify-self: end;
}

.paper-page > .field-notes {
  grid-column: 1 / -1;
  grid-row: 3;
  width: min(100%, 32rem);
  margin-left: auto;
}

.paper-page > .site-footer {
  grid-column: 1 / -1;
  grid-row: 4;
}

.graphite {
  color: var(--graphite);
  opacity: 0.88;
  letter-spacing: 0.006em;
  filter: blur(0.14px);
  text-shadow:
    0.014em 0.01em 0 rgba(45, 43, 39, 0.07),
    -0.01em 0 0 rgba(255, 255, 255, 0.36),
    0 0 0.032em rgba(45, 43, 39, 0.11);
}

.graphite-body {
  color: var(--graphite-soft);
  font-size: clamp(0.9rem, 0.94vw, 1rem);
  line-height: 1.58;
}

.graphite-small {
  color: var(--graphite);
  font-size: clamp(0.78rem, 0.82vw, 0.92rem);
  line-height: 1;
}

.graphite-tiny {
  color: var(--graphite-soft);
  font-size: clamp(0.7rem, 0.76vw, 0.82rem);
  line-height: 1.72;
}

.site-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 1.25rem;
}

.brand {
  justify-self: start;
}

.nav {
  display: flex;
  gap: clamp(2.7rem, 3.7vw, 3.9rem);
  align-items: center;
  justify-content: center;
}

.info {
  justify-self: end;
}

.hero {
  width: 100%;
  padding-top: clamp(1rem, 5vh, 3.5rem);
}

.eyebrow,
.intro,
.current-title,
.site-footer p,
.section-kicker {
  margin: 0;
}

.eyebrow {
  max-width: 42rem;
  margin-bottom: clamp(1.7rem, 3.05vh, 2rem);
}

.headline {
  margin: 0;
  max-width: 17.8ch;
  color: #282722;
  font-size: clamp(2.32rem, 3.08vw, 3.08rem);
  font-weight: 700;
  line-height: 1.27;
  letter-spacing: 0.002em;
  opacity: 0.9;
  filter: blur(0.22px);
  text-shadow:
    0.015em 0.011em 0 rgba(45, 43, 39, 0.09),
    -0.012em 0 0 rgba(255, 255, 255, 0.42),
    0 0 0.046em rgba(45, 43, 39, 0.14);
}

.intro {
  max-width: 43rem;
  margin-top: clamp(1.7rem, 3.1vh, 2.1rem);
  color: #3f3c37;
  font-size: clamp(1.02rem, 1.18vw, 1.2rem);
  line-height: 1.62;
}

.hero-links {
  display: flex;
  gap: 2.2rem;
  align-items: center;
  margin-top: clamp(2.1rem, 4.1vh, 2.7rem);
}

.work-link,
.quiet-link {
  display: inline-block;
  position: relative;
  padding-bottom: 0.48rem;
  color: var(--graphite);
  line-height: 1;
}

.quiet-link {
  color: var(--graphite-faint);
}

.work-link::after,
.quiet-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0.09rem;
  background: linear-gradient(90deg, rgba(45, 43, 39, 0.46), rgba(45, 43, 39, 0.22));
  filter: blur(0.15px);
  transform: rotate(-0.18deg);
  transform-origin: left center;
}

.quiet-link::after {
  opacity: 0.42;
}

.margin-note {
  position: absolute;
  max-width: 18rem;
  padding-left: 0.85rem;
  color: var(--graphite-faint);
  border-left: 1px solid rgba(45, 43, 39, 0.24);
  pointer-events: none;
}

.note-one {
  top: clamp(13rem, 20vh, 18rem);
  left: 45.8%;
  transform: rotate(-1.2deg);
}

/* note-two and note-three positions are brittle against the new flow
   layout: they need precise per-viewport tuning to land in whitespace
   without colliding with hero links or footer content. Hidden until a
   grid-cell-relative repositioning pass replaces the viewport-relative
   clamp() approach. The single note-one is enough to carry the
   margin-note aesthetic. */
.note-two,
.note-three {
  display: none;
}

.current {
  display: grid;
  grid-template-columns: 0.6rem minmax(18rem, 25.5rem);
  gap: 1.05rem;
  align-items: start;
  padding-top: clamp(4rem, 14vh, 9rem);
}

.current-mark {
  width: 0.54rem;
  height: 0.54rem;
  margin-top: 0.28rem;
  background: var(--graphite);
  border-radius: 999px;
  box-shadow: 0 0 0.08rem rgba(45, 43, 39, 0.28);
}

.section-kicker {
  margin-bottom: 0.75rem;
  color: var(--graphite-faint);
}

.current-title {
  max-width: 24rem;
  color: var(--graphite);
  font-size: clamp(1.04rem, 1.1vw, 1.2rem);
  font-weight: 400;
  line-height: 1.58;
}

.ledger {
  display: grid;
  gap: 0.7rem;
  margin: 1.35rem 0 0;
  padding: 1rem 0 0;
  list-style: none;
  border-top: 1px solid rgba(45, 43, 39, 0.22);
}

.ledger li {
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 0.85rem;
}

.ledger span {
  color: var(--graphite-faint);
}

.ledger p {
  margin: 0;
}

.ledger strong {
  display: block;
  margin-bottom: 0.08rem;
  color: var(--graphite);
  font-weight: 700;
}

.field-notes {
  padding-top: 0.7rem;
  border-top: 1px solid rgba(45, 43, 39, 0.2);
}

.field-notes p {
  margin: 0;
  color: var(--graphite-faint);
}

.site-footer {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2rem;
  padding-top: clamp(2rem, 5vh, 4rem);
}

.site-footer > div:nth-child(2) {
  justify-self: center;
}

.socials {
  justify-self: end;
  display: flex;
  gap: clamp(2.45rem, 3.25vw, 3.25rem);
  align-items: end;
  line-height: 1;
}

.work-link:hover,
.quiet-link:hover,
.nav a:hover,
.brand:hover,
.info:hover,
.socials a:hover {
  opacity: 0.72;
  filter: blur(0.15px);
}

#work,
#notes,
#contact {
  scroll-margin-top: 3rem;
}

@media (max-width: 1439px) {
  /* Margin notes are aesthetic flair that needs whitespace to land in.
     Between 1120px and 1439px the 2-col grid is tight enough that they
     overlap content. Hide them; restore at 1440px+ where the layout
     has the breathing room the design intends. */
  .margin-note {
    display: none;
  }
}

@media (max-width: 1120px) {
  .paper-page {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto auto auto;
    padding: 3.1rem 2rem 2.25rem;
    row-gap: clamp(2rem, 4vh, 3rem);
  }

  .paper-page > .hero {
    grid-column: 1;
    grid-row: 2;
    max-width: 100%;
  }

  .paper-page > .current {
    grid-column: 1;
    grid-row: 3;
    justify-self: start;
    padding-top: 0;
    grid-template-columns: 0.6rem minmax(0, 1fr);
  }

  .paper-page > .field-notes {
    grid-row: 4;
    margin-left: 0;
    width: 100%;
  }

  .paper-page > .site-footer {
    grid-row: 5;
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .margin-note {
    display: none;
  }

  .site-header {
    grid-template-columns: 1fr auto;
    row-gap: 2rem;
  }

  .nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: start;
    gap: 1.25rem;
  }

  .info {
    justify-self: end;
  }

  .site-footer > div:nth-child(2),
  .socials {
    justify-self: start;
  }
}

@media (max-width: 700px) {
  body::before {
    background-position: 63% center;
    background-size: auto 100%;
  }

  .paper-page {
    min-height: 100svh;
    padding: 2rem 1.25rem 1.45rem;
    row-gap: 2rem;
  }

  .nav {
    width: 100%;
    justify-content: space-between;
    gap: 0.56rem;
  }

  .paper-page > .hero {
    padding-top: 0;
  }

  .eyebrow {
    margin-bottom: 1.35rem;
  }

  .headline {
    max-width: 100%;
    font-size: clamp(1.9rem, 9vw, 2.55rem);
    line-height: 1.3;
  }

  .intro {
    margin-top: 1.45rem;
    font-size: 1rem;
  }

  .hero-links {
    gap: 1.4rem;
    margin-top: 2rem;
  }

  .paper-page > .current {
    grid-template-columns: 0.6rem 1fr;
  }

  .socials {
    width: 100%;
    justify-content: space-between;
    gap: 0;
  }
}

@media (max-width: 420px) {
  .graphite-small {
    font-size: 0.7rem;
  }

  .headline {
    font-size: clamp(1.78rem, 8.8vw, 2.25rem);
  }
}

@media print {
  body::before,
  body::after {
    display: none;
  }

  body {
    background: #fff;
    color: #111;
  }

  .paper-page,
  .site-header,
  .hero,
  .current,
  .field-notes,
  .site-footer {
    position: static;
    width: auto;
  }

  .paper-page {
    min-height: auto;
    padding: 1in;
  }

  .site-header,
  .current,
  .field-notes,
  .site-footer {
    margin-top: 2rem;
  }
}

/* ===================================================================
   Article pages (essays, about) — document-flow layout
   The home page is a draftsman's table (absolute-positioned tiles).
   Article pages are a single column of long-form prose on the same
   paper surface, with the same graphite typography and the same
   margin/footer attitude. Keep the substrate; change the flow.
   =================================================================== */

.article-body {
  min-height: 100svh;
}

.article-page {
  position: relative;
  z-index: 1;
  width: min(100%, 78rem);
  margin: 0 auto;
  padding: clamp(2.4rem, 7vh, 5.2rem) clamp(1.5rem, 7.42vw, 7.42rem)
    clamp(2.4rem, 6vh, 4.4rem);
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: 100svh;
}

.article-header {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 2rem;
  margin-bottom: clamp(3.6rem, 9vh, 6.2rem);
}

.article-nav {
  display: flex;
  gap: clamp(1.4rem, 2.4vw, 2.6rem);
  justify-self: end;
  align-items: center;
  flex-wrap: wrap;
}

.article-nav a[aria-current="page"] {
  opacity: 0.62;
}

.article-main {
  flex: 1;
  width: 100%;
  max-width: 44rem;
  margin: 0 auto;
}

.article-title {
  margin: 0.4rem 0 clamp(2rem, 4vh, 2.8rem);
  color: #282722;
  font-size: clamp(2rem, 3.2vw, 2.85rem);
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: 0.002em;
  opacity: 0.92;
  filter: blur(0.2px);
  text-shadow:
    0.015em 0.011em 0 rgba(45, 43, 39, 0.09),
    -0.012em 0 0 rgba(255, 255, 255, 0.42),
    0 0 0.046em rgba(45, 43, 39, 0.14);
}

.essay-meta {
  margin: 0 0 0.85rem;
  color: var(--graphite-faint);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.article-prose {
  max-width: 38rem;
  color: var(--graphite-soft);
  font-size: clamp(1rem, 1.06vw, 1.1rem);
  line-height: 1.72;
}

.article-prose p {
  margin: 0 0 1.35rem;
}

.article-prose p:last-of-type {
  margin-bottom: 1.6rem;
}

.article-prose strong {
  color: var(--graphite);
  font-weight: 700;
}

.article-prose em {
  font-style: italic;
  color: #3f3c37;
}

.article-h2 {
  margin: clamp(2.4rem, 4.4vh, 3rem) 0 clamp(0.9rem, 1.6vh, 1.2rem);
  color: var(--graphite);
  font-size: clamp(1.18rem, 1.34vw, 1.34rem);
  font-weight: 700;
  line-height: 1.36;
  letter-spacing: 0.004em;
}

.article-list {
  margin: 0 0 1.5rem;
  padding-left: 1.4rem;
  list-style: none;
}

.article-list li {
  position: relative;
  margin-bottom: 0.85rem;
  padding-left: 0.25rem;
}

.article-list li::before {
  content: "—";
  position: absolute;
  left: -1.4rem;
  top: 0;
  color: var(--graphite-faint);
}

.article-list li:last-child {
  margin-bottom: 0;
}

.inline-link {
  display: inline;
  position: relative;
  color: var(--graphite);
  background-image: linear-gradient(
    90deg,
    rgba(45, 43, 39, 0.46),
    rgba(45, 43, 39, 0.22)
  );
  background-repeat: no-repeat;
  background-position: 0 92%;
  background-size: 100% 0.09rem;
  filter: blur(0.05px);
  transition: opacity 120ms ease;
}

.inline-link:hover {
  opacity: 0.72;
}

.article-rule {
  margin: clamp(2.4rem, 4.6vh, 3.2rem) 0 1.6rem;
  border: 0;
  border-top: 1px solid rgba(45, 43, 39, 0.22);
}

.article-footer-line {
  margin: 0;
  color: var(--graphite-faint);
  letter-spacing: 0.04em;
}

.article-end-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.6rem;
  flex-wrap: wrap;
  margin-top: clamp(2.4rem, 4.6vh, 3.2rem);
  padding-top: 1.4rem;
  border-top: 1px solid rgba(45, 43, 39, 0.22);
}

.article-end-nav a {
  display: inline-block;
  padding-bottom: 0.32rem;
  position: relative;
  color: var(--graphite);
}

.article-end-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0.09rem;
  background: linear-gradient(
    90deg,
    rgba(45, 43, 39, 0.46),
    rgba(45, 43, 39, 0.22)
  );
  filter: blur(0.15px);
  transform: rotate(-0.18deg);
  transform-origin: left center;
}

.article-footer {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 2rem;
  margin-top: clamp(3rem, 6vh, 4.8rem);
  padding-top: clamp(1.4rem, 2.4vh, 1.8rem);
  border-top: 1px solid rgba(45, 43, 39, 0.18);
}

.article-footer p {
  margin: 0;
  color: var(--graphite-faint);
}

.article-footer .socials {
  justify-self: end;
  display: flex;
  gap: clamp(1.8rem, 2.6vw, 2.6rem);
  align-items: end;
  line-height: 1;
}

.article-nav a:hover,
.article-end-nav a:hover,
.article-footer .socials a:hover {
  opacity: 0.72;
  filter: blur(0.15px);
}

/* ===================================================================
   Essay list (essays/index.html) — numbered ledger of essays
   =================================================================== */

.essay-list {
  list-style: none;
  margin: clamp(2.4rem, 4.4vh, 3rem) 0 0;
  padding: 0;
  display: grid;
  gap: clamp(1.8rem, 3.4vh, 2.4rem);
}

.essay-item {
  padding-top: 1.2rem;
  border-top: 1px solid rgba(45, 43, 39, 0.18);
}

.essay-item:first-child {
  border-top: 1px solid rgba(45, 43, 39, 0.22);
}

.essay-item .essay-meta {
  margin-bottom: 0.55rem;
}

.essay-link-title {
  margin: 0 0 0.65rem;
  font-size: clamp(1.18rem, 1.42vw, 1.4rem);
  font-weight: 700;
  line-height: 1.32;
  letter-spacing: 0.004em;
  color: var(--graphite);
  opacity: 0.92;
  filter: blur(0.16px);
  text-shadow:
    0.014em 0.01em 0 rgba(45, 43, 39, 0.08),
    -0.01em 0 0 rgba(255, 255, 255, 0.36),
    0 0 0.032em rgba(45, 43, 39, 0.11);
}

.essay-link-title a {
  position: relative;
  color: var(--graphite);
}

.essay-link-title a:hover {
  opacity: 0.72;
}

.essay-blurb {
  margin: 0;
  max-width: 42rem;
  color: var(--graphite-soft);
  line-height: 1.62;
}

/* ===================================================================
   Article pages — responsive
   =================================================================== */

@media (max-width: 1120px) {
  .article-page {
    padding: clamp(2.4rem, 6vh, 4rem) 2rem;
  }

  .article-header {
    grid-template-columns: 1fr;
    gap: 1.6rem;
    margin-bottom: clamp(2.8rem, 6vh, 4.4rem);
  }

  .article-nav {
    justify-self: start;
    gap: 1.4rem;
  }
}

@media (max-width: 700px) {
  .article-page {
    padding: 2rem 1.25rem 2.4rem;
  }

  .article-header {
    margin-bottom: 2.4rem;
  }

  .article-nav {
    width: 100%;
    flex-wrap: wrap;
    gap: 1rem 1.4rem;
  }

  .article-title {
    font-size: clamp(1.78rem, 8.6vw, 2.2rem);
    line-height: 1.26;
  }

  .article-prose {
    font-size: 1rem;
    line-height: 1.7;
  }

  .article-h2 {
    font-size: 1.12rem;
  }

  .article-end-nav {
    gap: 1rem;
  }

  .article-footer {
    grid-template-columns: 1fr;
    gap: 1.4rem;
  }

  .article-footer .socials {
    justify-self: start;
    width: 100%;
    justify-content: space-between;
    gap: 0;
  }

  .essay-link-title {
    font-size: 1.18rem;
  }
}

@media (max-width: 420px) {
  .article-title {
    font-size: clamp(1.62rem, 8.4vw, 2rem);
  }

  .article-h2 {
    font-size: 1.06rem;
  }
}

@media print {
  .article-page {
    padding: 1in;
    min-height: auto;
  }

  .article-body body::before,
  .article-body body::after {
    display: none;
  }
}
