:root {
  color-scheme: light dark;
  --bg: #fffdfa;
  --text: #050504;
  --muted: #2c2b28;
  --line: rgba(5, 5, 4, 0.24);
  --accent: #e13a1f;
  --ambient: rgba(0, 0, 0, 0.035);
  --ambient-mobile: rgba(0, 0, 0, 0.04);
  --serif: "Bodoni 72", Didot, "Times New Roman", serif;
  --mono: "SF Mono", "Roboto Mono", "Courier New", monospace;
  --page: calc(100% - 96px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #090908;
    --text: #fffdfa;
    --muted: #c9c1b8;
    --line: rgba(255, 253, 250, 0.24);
    --accent: #ff6b52;
    --ambient: rgba(255, 253, 250, 0.055);
    --ambient-mobile: rgba(255, 253, 250, 0.06);
  }
}

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

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

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 50% 42%, var(--ambient), transparent 38%),
    var(--bg);
  font-family: var(--mono);
  line-height: 1.55;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
}

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

.section-label span {
  color: var(--accent);
}

.section-label,
.post-card-date,
.post-date,
.post-back {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.45;
  text-transform: uppercase;
}

.page-shell {
  width: var(--page);
  margin: 0 auto;
  padding: 52px 0 42px;
}

.hero-stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.76fr);
  column-gap: 44px;
  align-items: end;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.hero-copy {
  min-width: 0;
  padding-bottom: 38px;
}

.hero-copy h1,
.not-found h1 {
  max-width: 8.2ch;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(4.2rem, 8.7vw, 5.1rem);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 0.86;
}

.accent-rule {
  display: block;
  width: 33px;
  height: 1px;
  margin-top: 34px;
  background: var(--accent);
}

.hero-links {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 0;
  margin-top: 38px;
}

.hero-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1;
  text-transform: lowercase;
}

.link-icon {
  display: none;
}

.link-label-long {
  display: none;
}

.hero-portrait {
  position: relative;
  z-index: 1;
  width: min(100%, 460px);
  margin: -10px 0 0;
  align-self: start;
  justify-self: end;
}

.profile-image {
  width: 100%;
  aspect-ratio: auto;
  object-fit: contain;
  object-position: center top;
  background: transparent;
}

.home-panels {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1px minmax(0, 0.72fr);
  column-gap: 48px;
  padding-top: 48px;
}

.home-panels::before {
  content: "";
  grid-column: 2;
  grid-row: 1;
  background: var(--line);
}

.writing-panel,
.work-panel {
  min-width: 0;
}

.section-label {
  margin-bottom: 25px;
}

.post-card {
  border-bottom: 1px solid var(--line);
}

.post-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 88px;
  padding-bottom: 29px;
}

.post-card h2,
.post-header h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.75rem;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.05;
}

.post-card-date {
  margin-top: 10px;
  text-transform: none;
}

.panel-arrow,
.text-link span {
  font-size: 1.45rem;
  line-height: 1;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 28px;
  margin-top: 28px;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--text);
  font-size: 0.9rem;
}

.work-panel {
  padding-left: 3px;
}

.work-panel p:not(.section-label) {
  max-width: 40ch;
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.6;
}

.section-intro,
.post-card-excerpt,
.post-content,
.not-found p {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.75;
}

.post-page,
.not-found {
  width: min(760px, calc(100% - 48px));
  margin: 0 auto;
  padding-top: 56px;
}

.post-back {
  display: inline-block;
  margin-bottom: 34px;
}

.post-header {
  margin-bottom: 34px;
}

.post-date {
  margin-bottom: 14px;
}

.post-content p {
  margin: 0 0 1.3em;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 20px;
  min-height: 34px;
  margin-top: 28px;
  border-bottom: 1px solid var(--text);
  font-size: 0.9rem;
  text-transform: lowercase;
}

@media (max-width: 720px) {
  :root {
    --page: calc(100% - 96px);
  }

  body {
    background:
      radial-gradient(circle at 50% 44%, var(--ambient-mobile), transparent 42%),
      var(--bg);
  }

  .page-shell {
    width: var(--page);
    padding-top: 24px;
    padding-bottom: 36px;
  }

  .hero-stage {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding-bottom: 0;
    border-bottom: 0;
  }

  .hero-copy {
    display: contents;
  }

  .hero-copy h1 {
    order: 1;
    max-width: 9ch;
    font-size: clamp(3.72rem, 15.8vw, 4.18rem);
    line-height: 0.91;
  }

  .accent-rule {
    order: 3;
    width: 39px;
    margin-top: 39px;
  }

  .hero-links {
    order: 5;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 0;
    margin-top: 32px;
  }

  .hero-link {
    display: inline-flex;
    width: auto;
    min-height: 44px;
    align-items: center;
    justify-content: flex-start;
    font-size: 1rem;
  }

  .link-icon {
    display: none;
  }

  .link-label {
    min-width: 0;
  }

  .link-label-short {
    display: inline;
  }

  .link-label-long {
    display: none;
  }

  .hero-portrait {
    order: 6;
    align-self: center;
    width: min(280px, calc(100vw - 40px));
    margin-top: 18px;
  }

  .home-panels {
    display: block;
    padding-top: 43px;
  }

  .home-panels::before,
  .work-panel {
    display: none;
  }

  .section-label {
    margin-bottom: 22px;
  }

  .post-link {
    min-height: 92px;
    padding-bottom: 31px;
  }

  .post-card h2 {
    font-size: 1.95rem;
  }

  .post-card-date {
    margin-top: 12px;
  }

  .text-link {
    margin-top: 28px;
    font-size: 0.98rem;
  }

}

@media (max-width: 420px) {
  :root {
    --page: calc(100% - 56px);
  }

  .hero-copy h1 {
    font-size: clamp(3.5rem, 14.9vw, 3.88rem);
  }
}
