/* Archive palette */
:root { --bg: #F7F6F2; --ink: #111; --soft: #6B6A66; --rule: #D9D7D0; --red: #D2381C; --sans: 'Inter Tight', sans-serif; --mono: 'IBM Plex Mono', monospace; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bg: #0F0F0E; --ink: #F1EFEA; --soft: #8F8D87; --rule: #2A2927; --red: #FF6A4D; } }
:root[data-theme="dark"] { --bg: #0F0F0E; --ink: #F1EFEA; --soft: #8F8D87; --rule: #2A2927; --red: #FF6A4D; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 18px; line-height: 1.6; -webkit-font-smoothing: antialiased; transition: background .3s, color .3s; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; letter-spacing: inherit; text-transform: inherit; }
::selection { background: var(--red); color: var(--bg); }
.mono { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--soft); line-height: 1.5; }

/* Letters layout: one narrow column, numbers in the margin */
.col { max-width: 600px; margin: 0 auto; padding: 0 20px; }
header { display: flex; justify-content: flex-end; align-items: center; padding: 26px 0 14px; }
/* ASCII scenes: full-bleed monospace grids rendered from 3D maths every frame */
body { overflow-x: clip; }
.ascii { display: block; width: 100vw; margin-left: calc(50% - 50vw); font-family: var(--mono); font-size: 9px; line-height: 1.1; letter-spacing: 0; color: var(--soft); overflow: hidden; white-space: pre; user-select: none; }
.ascii b { font-weight: 400; color: var(--red); }
.ascii i { font-style: normal; color: var(--ink); }
.ascii.band { margin-top: 0; margin-bottom: 0; border-bottom: 1px solid var(--rule); padding: 4px 0 10px; }
.ascii.field { margin-top: 96px; margin-bottom: 0; border-top: 1px solid var(--ink); padding-top: 8px; cursor: grab; }
header nav { display: flex; gap: 22px; }
header a:hover, header button:hover { color: var(--red); }

.title { padding: clamp(80px, 14vw, 140px) 0 56px; }
.title h1 { font-weight: 500; font-size: clamp(56px, 12vw, 96px); line-height: .86; letter-spacing: -.06em; margin: 20px 0 28px; }
.title h1 i { font-style: normal; color: var(--red); }
.title p { font-weight: 300; font-size: 20px; line-height: 1.45; color: var(--soft); margin: 0; max-width: 24em; }
.hero-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; border-top: 1px solid var(--ink); padding-top: 20px; }
.hero-latest { color: var(--ink); border-bottom: 1px solid var(--ink); padding-bottom: 2px; white-space: nowrap; }
.hero-latest:hover { color: var(--red); border-color: var(--red); }
.hero-latest span { display: inline-block; transition: transform .2s; } .hero-latest:hover span { transform: translateY(3px); }

.year { display: flex; align-items: center; gap: 14px; margin: 72px 0 44px; color: var(--red); }
.year::after { content: ''; flex: 1; border-top: 1px solid var(--ink); }

.letter { position: relative; padding-bottom: 44px; margin-bottom: 44px; border-bottom: 1px solid var(--rule); }
.letter:last-child { border-bottom: 0; }
.letter a { display: block; }
.letter .margin { position: absolute; right: calc(100% + 40px); top: -6px; width: 120px; text-align: right; }
.letter .margin b { font-weight: 300; font-size: 56px; line-height: 1; letter-spacing: -.05em; color: var(--red); font-variant-numeric: tabular-nums; }
.letter h2 { font-weight: 400; font-size: 32px; line-height: 1.1; letter-spacing: -.035em; margin: 10px 0 14px; transition: color .2s; }
.letter p { margin: 0; font-weight: 300; color: var(--soft); }
.letter .read { display: inline-flex; gap: 8px; margin-top: 16px; color: var(--ink); border-bottom: 1px solid var(--ink); padding-bottom: 2px; }
.letter a:hover h2, .letter a:hover .read { color: var(--red); border-color: var(--red); }
.letter .read span { transition: transform .2s; } .letter a:hover .read span { transform: translateX(4px); }
.letter.latest h2 { font-size: clamp(40px, 7vw, 56px); }
.letter.latest p { color: var(--ink); font-size: 20px; }

.stories { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--ink); }
.stories a { padding: 16px 20px 28px 0; border-bottom: 1px solid var(--rule); }
.stories a:nth-child(2n) { padding-left: 20px; padding-right: 0; border-left: 1px solid var(--rule); }
.stories h3 { font-weight: 400; font-size: 26px; letter-spacing: -.03em; margin: 20px 0 6px; transition: color .2s; }
.stories p { margin: 0; font-weight: 300; font-size: 15px; line-height: 1.5; color: var(--soft); }
.stories a:hover h3 { color: var(--red); }

/* the footer line sits in front of the sea scene, over the sky */
.sea { position: relative; }
footer { position: absolute; top: 22px; left: 0; right: 0; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; pointer-events: none; }
footer span { background: var(--bg); padding: 3px 0; box-shadow: 8px 0 0 var(--bg), -8px 0 0 var(--bg); color: var(--ink); }

/* letter page */
header:has(.home) { justify-content: space-between; }
header .home { color: var(--ink); }
.entry { padding: clamp(64px, 10vw, 120px) 0 0; }
.entry-head { position: relative; }
.entry-head .margin { position: absolute; right: calc(100% + 40px); top: 0; width: 140px; text-align: right; }
.entry-head .margin b { font-weight: 300; font-size: 64px; line-height: 1; letter-spacing: -.05em; color: var(--red); }
.entry h1 { font-weight: 500; font-size: clamp(44px, 9vw, 80px); line-height: .95; letter-spacing: -.05em; margin: 18px 0 0; }
.entry .note { margin: 40px 0 0; padding-top: 14px; border-top: 1px solid var(--ink); }
.prose { margin-top: 40px; font-weight: 300; font-size: 19px; line-height: 1.7; }
.prose p { margin: 0 0 1.2em; }
.prose h2, .prose h3 { font-weight: 500; letter-spacing: -.03em; line-height: 1.15; margin: 2em 0 .6em; }
.prose h2 { font-size: 30px; } .prose h3 { font-size: 23px; }
.prose a { color: var(--red); text-decoration: underline; text-underline-offset: 3px; }
.prose img { display: block; max-width: 100%; height: auto; margin: 8px 0; }
.prose blockquote { margin: 1.5em 0; padding-left: 20px; border-left: 2px solid var(--red); color: var(--soft); }
.prose ul, .prose ol { padding-left: 1.2em; }
.entry-page .prose p:has(> img) { margin: 0; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 72px; border-top: 1px solid var(--ink); padding-top: 18px; }
.pager a b { display: block; margin-top: 8px; font-family: var(--sans); font-weight: 400; font-size: 22px; letter-spacing: -.03em; text-transform: none; color: var(--ink); line-height: 1.2; }
.pager a:hover b { color: var(--red); }
.pager .next { text-align: right; }

/* language switch */
.langs { display: flex; gap: 18px; margin-top: 32px; }
.langs button { padding-bottom: 3px; border-bottom: 1px solid transparent; color: var(--soft); }
.langs button[aria-pressed="true"] { color: var(--ink); border-color: var(--ink); }
.langs button:hover { color: var(--red); }

/* about: portrait and contact links with their real logos */
.contacts { list-style: none; padding: 0; margin: 32px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--ink); }
.contacts li { border-bottom: 1px solid var(--rule); }
.contacts a { display: flex; align-items: center; gap: 14px; padding: 16px 12px 16px 0; color: var(--ink); }
.contacts svg { width: 22px; height: 22px; flex: none; fill: currentColor; transition: fill .2s; }
.contacts span b { display: block; font-family: var(--sans); font-weight: 400; font-size: 17px; letter-spacing: -.02em; text-transform: none; margin-top: 2px; overflow-wrap: anywhere; }
.contacts a:hover svg { fill: var(--brand); }
.contacts a:hover b { color: var(--red); }
.portrait { margin: 0 0 32px; }
.portrait img { display: block; width: 100%; max-width: 360px; aspect-ratio: 4 / 5; object-fit: cover; filter: grayscale(.15); }

/* photo grids (gallery and any letter with several photos in a row) */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 0 0 1.6em; }
.photos.single { grid-template-columns: 1fr; }
.photo { padding: 0; display: block; overflow: hidden; background: var(--rule); cursor: zoom-in; }
.photo img { display: block; width: 100%; height: 100%; aspect-ratio: 1; object-fit: cover; margin: 0; transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.photos.single .photo img { aspect-ratio: auto; height: auto; }
.photo:hover img { transform: scale(1.04); }
.entry-gallery .prose h2 { font-size: 22px; margin: 2.4em 0 .8em; padding-top: 14px; border-top: 1px solid var(--ink); }
.entry-gallery .photos { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
#lightbox { border: 0; padding: 0; background: transparent; max-width: 94vw; max-height: 94vh; overflow: visible; cursor: zoom-out; }
#lightbox::backdrop { background: rgba(10, 10, 9, .88); }
#lightbox img { display: block; max-width: 94vw; max-height: 88vh; object-fit: contain; }
#lightbox span { display: block; text-align: center; margin-top: 10px; color: #bbb; }

@media (max-width: 1000px) {
  .entry-head .margin { position: static; width: auto; text-align: left; margin-bottom: 8px; }
  .entry-head .margin b { font-size: 13px; font-family: var(--mono); letter-spacing: .08em; }
}

@media (max-width: 1000px) {
  .letter .margin { position: static; width: auto; text-align: left; margin-bottom: 4px; }
  .letter .margin b { font-size: 13px; font-family: var(--mono); letter-spacing: .08em; }
}
@media (max-width: 520px) {
  .contacts { grid-template-columns: 1fr; }
  .portrait img { max-width: 240px; }
  header nav a:not(:last-of-type) { display: none; }
  .stories { grid-template-columns: 1fr; }
  .stories a:nth-child(2n) { padding-left: 0; border-left: 0; }
}

/* tablet and laptop: the page opens up to the full screen */
@media (min-width: 768px) {
  .col { max-width: 1320px; padding: 0 clamp(24px, 4vw, 56px); }
  /* the opening screen: label at the top, wordmark spanning the column, intro on a rule at the bottom */
  .title { min-height: calc(100svh - 150px); display: flex; flex-direction: column; justify-content: space-between; gap: 48px; padding: 40px 0 56px; }
  .title h1 { font-size: clamp(96px, calc((min(100vw, 1320px) - 2 * clamp(24px, 4vw, 56px)) / 4.7), 270px); margin: 0 0 40px; margin-left: -.04em; }
  .title p { font-size: clamp(20px, 2vw, 26px); }

  /* One grid for the whole site: a narrow rail (number, date, portrait) and a wide
     main column where every title and paragraph shares the same left edge. */
  .letter a, .entry { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(0, 3fr); column-gap: clamp(32px, 4vw, 64px); }
  .letter a > * { grid-column: 2; }
  .letter .margin { position: static; width: auto; text-align: left; margin: 0; grid-column: 1; grid-row: 1; }
  .letter .margin b { font-family: var(--sans); font-size: clamp(56px, 6vw, 88px); letter-spacing: -.05em; }
  .letter a > span:first-of-type { grid-column: 1; grid-row: 2 / span 3; padding-top: 10px; padding-right: 12px; }
  .letter h2 { font-size: clamp(32px, 3.4vw, 48px); margin-top: 0; grid-row: 1; align-self: end; }
  .letter p { max-width: 36em; font-size: 19px; }
  .letter .read { justify-self: start; }
  .letter.latest h2 { font-size: clamp(48px, 6.5vw, 96px); }
  .letter.latest p { font-size: 22px; }

  .stories { grid-template-columns: repeat(4, 1fr); }
  .stories a, .stories a:nth-child(2n) { padding: 16px 20px 28px; border-left: 1px solid var(--rule); }
  .stories a:first-child { padding-left: 0; border-left: 0; }

  .ascii.field { font-size: 11px; }
  footer { top: 32px; }

  .entry > * { grid-column: 2; }
  .entry-head { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; grid-template-rows: auto auto; }
  .entry-head .margin { position: static; width: auto; text-align: left; grid-column: 1; grid-row: 1; align-self: end; }
  .entry-head .margin b { font-family: var(--sans); font-size: clamp(64px, 7vw, 104px); }
  .entry-head > .mono { grid-column: 1; grid-row: 2; padding-top: 12px; padding-right: 12px; }
  .entry-head h1 { grid-column: 2; grid-row: 1 / span 2; align-self: end; margin: 0; font-size: clamp(56px, 7vw, 112px); }
  .prose { max-width: 36em; font-size: 20px; }

  .entry-about .prose { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; max-width: none; }
  .entry-about .portrait { grid-column: 1; grid-row: 1 / span 30; position: sticky; top: 32px; align-self: start; margin-top: 8px; }
  .entry-about .portrait img { max-width: none; }
  .entry-about .prose > :not(.portrait) { grid-column: 2; max-width: 36em; }
  .contacts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .entry-gallery .prose { max-width: none; }
}
