:root {
  color-scheme: light;
  --paper: #f1ede2;
  --paper-deep: #e2dccb;
  --ink: #173c34;
  --ink-deep: #102d28;
  --signal: #c44f2f;
  --sand: #d8bd83;
  --muted: #65716a;
  --rule: #aeb2a6;
  --display: Baskerville, "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Avenir Next", Avenir, "Gill Sans", "Segoe UI", sans-serif;
  --mono: Menlo, Monaco, Consolas, monospace;
  --page: min(92vw, 1320px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; overflow-x: hidden; background: var(--paper); color: var(--ink-deep); font-family: var(--sans); }
body.is-admin { padding-top: 58px; }
img { display: block; width: 100%; }
button, select, input { font: inherit; }
a { color: inherit; text-underline-offset: 0.22em; }
::selection { background: var(--sand); color: var(--ink-deep); }

.site-head { width: var(--page); margin-inline: auto; }
.identity { color: inherit; text-decoration: none; }
.identity .site-wordmark { font-weight: 700; }
.site-head nav a { text-decoration: none; }
.section-label, .eyebrow { margin: 0; color: var(--signal); font-size: 0.62rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.arrow-link { display: inline-flex; gap: 24px; align-items: baseline; color: var(--signal); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.1em; text-decoration: none; text-transform: uppercase; }
.arrow-link i { font: 1rem var(--display); transition: transform 160ms cubic-bezier(.22,1,.36,1); }
.arrow-link:hover i { transform: translate(5px, -4px); }
.editable-image { position: relative; margin: 0; }
.editable-image figcaption { margin-top: 9px; color: var(--muted); font: 0.66rem/1.45 var(--sans); }

.site-footer { padding: clamp(70px, 9vw, 130px) max(4vw, calc((100vw - 1320px) / 2)); }
.footer-copy p { margin: 0 0 28px; font-family: var(--display); }
.site-footer nav { display: grid; gap: 12px; }
.site-footer nav a { font: 0.58rem var(--mono); letter-spacing: 0.05em; text-transform: uppercase; }
.colophon { color: var(--muted); font: italic 0.78rem/1.5 var(--display); }

.editor-bar { position: fixed; z-index: 1000; inset: 0 0 auto; height: 58px; padding: 0 max(16px, 2.2vw); display: grid; grid-template-columns: auto minmax(220px, auto) 1fr auto auto; gap: clamp(14px, 2.2vw, 32px); align-items: center; background: #102d28; color: #f1ede2; box-shadow: 0 1px 0 rgba(255,255,255,.12); }
.editor-home { display: flex; gap: 9px; align-items: baseline; text-decoration: none; }
.editor-home b { font: 700 1rem var(--display); }
.editor-home span, .editor-bar label, .leave-editor { color: #bac8c0; font: 0.58rem var(--mono); letter-spacing: .05em; text-transform: uppercase; }
.editor-bar label { display: flex; gap: 9px; align-items: center; }
.editor-bar select { height: 32px; max-width: 230px; border: 1px solid #5f756d; border-radius: 0; background: #173c34; color: #f1ede2; font: 0.66rem var(--sans); }
#save-status { justify-self: end; margin: 0; display: flex; gap: 8px; align-items: center; color: #bac8c0; font: 0.6rem var(--mono); }
#save-status i { width: 6px; height: 6px; border-radius: 50%; background: #82af96; }
#save-status.is-saving i { animation: saving 700ms alternate infinite; background: var(--sand); }
#save-status.is-error { color: #ffd0c4; }
#save-status.is-error i { background: #ff7655; }
.publish-button { min-height: 34px; padding: 0 15px; border: 1px solid var(--sand); border-radius: 0; background: var(--sand); color: #102d28; cursor: pointer; font-size: 0.63rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.publish-button:hover { background: #ebd5a8; }
.publish-button:disabled { opacity: .58; cursor: wait; }
.leave-editor { min-height: 34px; display: inline-flex; align-items: center; }

.is-admin [contenteditable] { cursor: text; border-radius: 2px; outline: 1px dashed transparent; outline-offset: 4px; }
.is-admin [contenteditable]:hover { outline-color: rgba(196,79,47,.55); }
.is-admin [contenteditable]:focus { background: rgba(255,248,219,.45); outline: 2px solid var(--signal); }
.replace-image { position: absolute; z-index: 3; top: 12px; right: 12px; min-height: 34px; padding: 0 12px; border: 1px solid rgba(241,237,226,.8); border-radius: 0; background: rgba(16,45,40,.88); color: #fff; cursor: pointer; font-size: .6rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; backdrop-filter: blur(8px); }
.replace-image:hover { background: var(--signal); }

.post-main { width: var(--page); margin-inline: auto; }
.post-hero { min-height: 720px; padding-block: clamp(75px, 9vw, 135px); display: grid; grid-template-columns: minmax(0, .85fr) minmax(420px, 1.15fr); gap: clamp(50px, 8vw, 120px); align-items: center; }
.post-title h1 { margin: 20px 0 30px; font: 400 clamp(3.4rem, 6.3vw, 7rem)/.94 var(--display); letter-spacing: -.055em; }
.post-meta { margin: 18px 0 0; color: var(--muted); font: .58rem var(--mono); letter-spacing: .05em; text-transform: uppercase; }
.post-dek { max-width: 46ch; font: 1.08rem/1.55 var(--display); }
.post-lead-image img { aspect-ratio: 4 / 5; object-fit: cover; filter: saturate(.82) contrast(1.03); }
.essay-body { width: min(100%, 720px); margin: 0 auto; padding: clamp(80px, 10vw, 150px) 0; }
.essay-body p { margin: 0 0 1.55em; font: clamp(1.15rem, 1.6vw, 1.35rem)/1.72 var(--display); }
.essay-body > p:first-child { font-size: clamp(1.5rem, 2.5vw, 2.1rem); line-height: 1.42; }
.essay-body h2 { margin: 2.2em 0 .7em; font: 400 clamp(2.3rem, 4vw, 4rem)/1 var(--display); letter-spacing: -.04em; }
.essay-body blockquote { margin: 2.3em -12vw; padding: .25em 0 .3em; border-top: 3px solid var(--signal); border-bottom: 1px solid var(--ink); color: var(--ink); font: italic clamp(2rem, 4vw, 4.3rem)/1.08 var(--display); }
.photo-body { padding-block: clamp(80px, 11vw, 160px); }
.photo-frame { margin: 0 0 clamp(120px, 17vw, 240px); display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(240px, .45fr); gap: clamp(35px, 7vw, 100px); align-items: end; }
.photo-frame:nth-child(even) { grid-template-columns: minmax(240px, .45fr) minmax(0, 1.25fr); }
.photo-frame:nth-child(even) figure { grid-column: 2; }
.photo-frame:nth-child(even) > p { grid-row: 1; grid-column: 1; }
.photo-frame img { max-height: 78vh; object-fit: cover; }
.photo-frame > p { margin: 0 0 30px; font: italic clamp(1.25rem, 2.5vw, 2.2rem)/1.25 var(--display); }
.next-home { min-height: 180px; padding-block: 45px; display: grid; grid-template-columns: 180px 1fr; gap: 40px; align-items: center; border-top: 1px solid var(--ink); }
.next-home span { color: var(--signal); font: .55rem var(--mono); text-transform: uppercase; }
.next-home a { display: flex; justify-content: space-between; text-decoration: none; font: clamp(1.7rem, 3.5vw, 3.5rem)/1 var(--display); }
.not-found, .access-required { width: min(90vw, 900px); min-height: 70vh; margin-inline: auto; padding-block: 17vh; }
.not-found h1, .access-required h1 { margin: 25px 0 35px; font: 400 clamp(3.5rem, 8vw, 8rem)/.92 var(--display); letter-spacing: -.06em; }
.access-required > p:not(.section-label) { max-width: 50ch; margin-bottom: 30px; font: 1.1rem/1.6 var(--display); }

@keyframes saving { to { opacity: .25; } }
@media (max-width: 860px) {
  body.is-admin { padding-top: 104px; }
  .editor-bar { height: 104px; grid-template-columns: 1fr auto; grid-template-rows: 48px 48px; gap: 0 14px; }
  .editor-home { display: none; }
  .editor-bar label { grid-column: 1; }
  #save-status { grid-column: 2; grid-row: 1; }
  .publish-button { grid-column: 1; grid-row: 2; width: max-content; }
  .leave-editor { grid-column: 2; grid-row: 2; }
  .post-hero { min-height: auto; grid-template-columns: 1fr; }
  .post-lead-image { max-width: 72%; margin-left: auto; }
  .essay-body blockquote { margin-inline: 0; }
  .photo-frame, .photo-frame:nth-child(even) { grid-template-columns: 1fr; }
  .photo-frame:nth-child(even) figure, .photo-frame:nth-child(even) > p { grid-column: 1; grid-row: auto; }
}
@media (max-width: 560px) {
  :root { --page: min(90vw, 1320px); }
  .editor-bar select { width: 155px; }
  #save-status span { display: none; }
  .leave-editor { font-size: 0; }
  .leave-editor::after { content: "Public ↗"; font-size: .58rem; }
  .post-lead-image { max-width: 100%; }
  .next-home { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
}
