:root{
  --ground:#E9EAE6;   /* overcast light */
  --raised:#F4F5F2;   /* form fields */
  --ink:#1D2529;      /* slate */
  --muted:#5A6468;
  --fog:#C9CDCA;      /* borders, empty frames */
  --sodium:#E8A317;   /* lamplight yellow: used sparingly */
  --display:"Bricolage Grotesque","Helvetica Neue",Helvetica,Arial,sans-serif;
  --text:"Newsreader",Georgia,"Times New Roman",serif;
  --gutter:clamp(1.25rem,4vw,3rem);
}
@media (prefers-color-scheme:dark){
  /* Followed automatically until someone picks a side with the toggle below. */
  :root:not([data-theme="light"]){--ground:#131A1D;--raised:#1B2428;--ink:#E6E8E4;--muted:#9BA5A9;--fog:#2E383C}
}
/* The toggle's explicit choice, saved in localStorage, wins over the OS setting either way. */
:root[data-theme="dark"]{--ground:#131A1D;--raised:#1B2428;--ink:#E6E8E4;--muted:#9BA5A9;--fog:#2E383C}

*,*::before,*::after{box-sizing:border-box}
html{scroll-behavior:smooth;scroll-padding-top:5rem}
body{margin:0;background:var(--ground);color:var(--ink);font:400 1.125rem/1.6 var(--text);-webkit-font-smoothing:antialiased;overflow-x:clip}
img{max-width:100%}
a{color:inherit}
:focus-visible{outline:2px solid var(--ink);outline-offset:3px;box-shadow:0 0 0 5px var(--sodium)}
.wrap{width:min(100% - 2 * var(--gutter),76rem);margin-inline:auto}
.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.skip{position:absolute;left:1rem;top:-4rem;padding:.6rem 1rem;background:var(--ink);color:var(--ground);font:500 1rem var(--display);z-index:20}
.skip:focus{top:1rem}

/* Header */
.top{position:sticky;top:0;z-index:10;background:color-mix(in srgb,var(--ground) 90%,transparent);backdrop-filter:blur(10px)}
.top .wrap{display:flex;justify-content:space-between;align-items:center;gap:.25rem 1rem;min-height:4.25rem}
.mark{font:600 1.25rem var(--display);letter-spacing:-.02em;text-decoration:none}
.top nav{display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:0 clamp(1.25rem,3vw,2rem)}
.top nav a{font:500 1rem var(--display);text-decoration:none;padding:.5rem 0}
.top nav a:hover,.top nav a[aria-current="page"]{text-decoration:underline;text-decoration-color:var(--sodium);text-decoration-thickness:3px;text-underline-offset:6px}
.theme-toggle{font:500 1rem var(--display);color:inherit;background:none;border:1px solid var(--fog);border-radius:2em;padding:.4rem 1rem;cursor:pointer}
.theme-toggle:hover{border-color:var(--ink)}

/* Type */
h1{margin:0;font:600 clamp(2.25rem,5vw,4rem)/1.02 var(--display);letter-spacing:-.035em}
h2{margin:0;font:600 clamp(1.75rem,3.5vw,2.5rem)/1.05 var(--display);letter-spacing:-.03em}
.lede{max-width:32rem;margin:1.75rem 0 2rem;font-size:1.25rem;color:var(--muted)}

/* Buttons (admin) */
.btn{display:inline-flex;align-items:center;min-height:48px;padding:0 1.5rem;border:1px solid var(--ink);border-radius:2px;background:var(--ink);color:var(--ground);font:500 1rem var(--display);text-decoration:none;cursor:pointer}
.btn.ghost{background:transparent;color:var(--ink)}
.btn:hover{background:var(--sodium);border-color:var(--sodium);color:#1D2529}
.actions{display:flex;flex-wrap:wrap;gap:.75rem}

/* Photos and placeholders */
.photo{width:100%;overflow:hidden;border-radius:2px;background:var(--fog)}
.photo>img{display:block;width:100%;height:auto}
.photo.fixed{aspect-ratio:var(--r)}
.photo.fixed>img{height:100%;object-fit:cover}
.ph{position:relative;width:100%;height:100%;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .18 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    linear-gradient(165deg,var(--a),var(--b))}
.ph::after{content:attr(data-label);position:absolute;left:.75rem;bottom:.6rem;font:500 .75rem var(--display);color:rgb(255 255 255 / .8)}

figure{margin:0}
figcaption{display:flex;justify-content:space-between;align-items:baseline;gap:1rem;padding-top:.6rem;font-style:italic;font-size:1.0625rem;color:var(--muted)}
.when{font:500 .8125rem var(--display);font-style:normal;font-variant-numeric:tabular-nums;letter-spacing:.02em;white-space:nowrap}

/* The featured photo "develops" once, like a print in the tray */
.develop{animation:develop 2.4s cubic-bezier(.2,.6,.2,1) .15s both}
@keyframes develop{
  from{filter:grayscale(1) contrast(.7) brightness(.55) blur(10px)}
  to{filter:grayscale(0) contrast(1) brightness(1) blur(0)}
}

/* Page headings */
.intro{padding-block:clamp(2rem,6vw,4.5rem) clamp(1.75rem,4vw,3rem)}
.intro-title{max-width:14em;font-size:clamp(2.6rem,6.4vw,5rem);line-height:1}
.intro-sub{margin:1.1rem 0 0;max-width:34rem;font-size:clamp(1.2rem,2.3vw,1.6rem);line-height:1.4;font-style:italic;color:var(--muted)}
.page-head{padding-block:clamp(2.5rem,7vw,5rem) clamp(1.5rem,4vw,2.5rem)}
.page-title{font-size:clamp(2.75rem,7vw,5.5rem)}
.page-head p{max-width:34rem;margin:1rem 0 0;color:var(--muted);font-size:1.25rem}
.section-title{margin-bottom:clamp(1.5rem,3vw,2.25rem)}
.list-section{padding-bottom:clamp(3rem,8vw,6rem)}
.empty{color:var(--muted)}

/* Featured story on the home page */
.feature{padding-bottom:clamp(3rem,7vw,5.5rem)}
.feature-link{display:block;text-decoration:none;color:inherit}
.photo.cover-wide{aspect-ratio:3/2;max-height:80vh}
.photo.cover-wide>img{height:100%;object-fit:cover;object-position:50% 100%}
.feature-text{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(0,1fr);gap:1rem clamp(2rem,6vw,5rem);align-items:start;margin-top:1.5rem}
.feature-text .when{display:block;color:var(--muted)}
.feature-title{margin-top:.5rem;font-size:clamp(2rem,4.5vw,3.5rem);line-height:1.02}
.feature-text p{margin:.25rem 0 0;font-size:1.25rem;color:var(--muted)}
.feature-link:hover .feature-title{text-decoration:underline;text-decoration-color:var(--sodium);text-decoration-thickness:4px;text-underline-offset:6px}

/* Portrait-shaped cover: shown in full (not cropped), since no single crop can protect
   both a face near the top and a copyright mark in a bottom corner on a very tall photo */
.photo.cover-tall{aspect-ratio:4/5;max-height:88vh;background:var(--ground)}
.photo.cover-tall>img{width:100%;height:100%;object-fit:contain;object-position:50% 50%}
.feature-tall .feature-link{display:grid;grid-template-columns:minmax(0,.95fr) minmax(0,1fr);gap:clamp(2rem,6vw,5rem);align-items:end}
.feature-tall .photo{order:2}
.feature-tall .feature-text{order:1;grid-template-columns:minmax(0,1fr);margin-top:0;padding-bottom:1rem}

/* Story cards */
.entries{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,20rem),1fr));gap:clamp(2rem,4vw,3rem) clamp(1.25rem,3vw,2.25rem);align-items:start}
.entry-link{display:block;text-decoration:none;color:inherit}
.photo.cover{aspect-ratio:3/2}
.photo.cover>img{height:100%;object-fit:cover;object-position:50% 100%}
.entry .when{display:block;margin-top:.9rem;color:var(--muted)}
.entry-title{margin:.25rem 0 0;font:600 1.6rem/1.15 var(--display);letter-spacing:-.02em}
.entry p{margin:.6rem 0 0;color:var(--muted)}
.entry-link:hover .entry-title{text-decoration:underline;text-decoration-color:var(--sodium);text-decoration-thickness:3px;text-underline-offset:5px}
.pager{display:flex;justify-content:space-between;gap:1.5rem;padding-bottom:clamp(3rem,8vw,6rem);font:500 1.0625rem var(--display)}
.pager a{text-underline-offset:5px;text-decoration-color:var(--sodium);text-decoration-thickness:3px}
.pager .next{margin-left:auto}

/* Story page */
.post{padding-block:clamp(1.5rem,5vw,3.5rem) clamp(3rem,8vw,6rem)}
.narrow{width:min(100% - 2 * var(--gutter),44rem);margin-inline:auto}
.wide{width:min(100% - 2 * var(--gutter),68rem);margin-inline:auto}
.post-head .when{margin:0;color:var(--muted)}
.post-head h1{margin-top:.6rem;font-size:clamp(2.5rem,6.5vw,4.5rem);line-height:1}
.post-head .lede{margin:1.25rem 0 0;max-width:none}
.post-cover{margin-block:clamp(2rem,5vw,3.5rem)}
.post-cover .photo{background:none}
.post-cover img{width:auto;max-width:100%;max-height:88vh;margin-inline:auto}
.post-body{font-size:1.1875rem;line-height:1.7;overflow-wrap:break-word}
.post-body>*{margin:0 0 1.4em}
.post-body h2{margin:2em 0 .6em;font:600 clamp(1.6rem,3vw,2rem)/1.15 var(--display);letter-spacing:-.02em}
.post-body h3{margin:1.8em 0 .5em;font:600 1.35rem/1.2 var(--display);letter-spacing:-.01em}
.post-body a{text-decoration-color:var(--sodium);text-decoration-thickness:2px;text-underline-offset:4px}
.post-body blockquote{margin-inline:0;padding-inline:1.5rem;font-size:1.4rem;line-height:1.45;font-style:italic}
.post-body img{display:block;width:auto;height:auto;max-width:100%;max-height:88vh;margin-inline:auto;border-radius:2px}
.post-body>p:has(>img:only-child){width:min(100vw - 2 * var(--gutter),68rem);margin-left:50%;transform:translateX(-50%)}
.post-body code{font-size:.9em}
.post-nav{display:flex;justify-content:space-between;gap:1.5rem;margin-top:clamp(2.5rem,6vw,4rem);padding-top:1.5rem;border-top:1px solid var(--fog);font:500 1.0625rem var(--display)}
.post-nav a{max-width:20rem;text-decoration:none}
.post-nav a:hover{text-decoration:underline;text-decoration-color:var(--sodium);text-decoration-thickness:3px;text-underline-offset:5px}
.post-nav small{display:block;font:400 .875rem var(--display);color:var(--muted)}
.post-nav .next{text-align:right;margin-left:auto}
/* Story with a tall photo: beside the text on wide screens, stacked on phones */
.post-grid{display:grid;grid-template-columns:minmax(0,1fr)}
.post-tall .post-head .lede{max-width:34rem}
.post-tall .post-body>*{max-width:36rem;margin-inline:0}
.post-tall .post-body>p:has(>img:only-child){width:auto;margin-left:0;transform:none}
.post-tall .post-nav{margin-top:clamp(2.5rem,6vw,4rem)}
@media (min-width:60rem){
  .post-grid{grid-template-columns:minmax(0,30rem) minmax(0,1fr);grid-template-areas:"photo head" "photo body";grid-template-rows:auto 1fr;column-gap:clamp(3rem,6vw,5.5rem);align-items:start}
  .post-grid .post-cover{grid-area:photo;margin:0}
  .post-grid .post-head{grid-area:head;margin-bottom:clamp(1.75rem,3vw,2.5rem)}
  .post-grid .post-body{grid-area:body}
  .post-grid .post-cover .photo{background:var(--fog)}
  .post-grid .post-cover img{width:100%;max-height:none;margin-inline:0}
}
.notice{margin:0 0 1.25rem;padding:.8rem 1rem;border:1px solid var(--fog);border-radius:2px;background:var(--raised);font:500 .9375rem var(--display)}

/* About */
.about-grid{display:grid;grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr);gap:clamp(2rem,6vw,5rem);align-items:start}
.about-grid.solo{grid-template-columns:minmax(0,40rem)}
.portrait{--r:4/5}
.prose>*{max-width:34rem;margin:0 0 1.25em;font-size:1.25rem}
.prose a{text-decoration-color:var(--sodium);text-decoration-thickness:2px;text-underline-offset:4px}
.elsewhere{margin:2rem 0 0;padding-top:1.25rem;border-top:1px solid var(--fog);max-width:34rem;color:var(--muted)}

/* Photographs page */
.gallery-bar{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:1rem 2rem;margin-bottom:clamp(1.75rem,4vw,2.75rem)}
.count{margin:0;font:500 .9375rem var(--display);color:var(--muted)}
.filters{display:flex;flex-wrap:wrap;gap:.5rem}
.chip{min-height:44px;padding:0 1.1rem;border:1px solid var(--fog);border-radius:999px;background:transparent;color:inherit;font:500 .9375rem var(--display);cursor:pointer}
.chip:hover{border-color:var(--ink)}
.chip[aria-pressed="true"]{background:var(--sodium);border-color:var(--sodium);color:#1D2529}
.gallery{columns:3 18rem;column-gap:clamp(1rem,2.5vw,2rem)}
.item{break-inside:avoid;margin:0 0 clamp(1.25rem,3vw,2.25rem)}
.frame{display:block;width:100%;padding:0;border:0;border-radius:2px;background:none;color:inherit;cursor:zoom-in}
.refresh .item{animation:settle .3s ease both}
@keyframes settle{from{opacity:0}to{opacity:1}}
@media (hover:hover){
  .item{transition:opacity .25s}
  .gallery:has(.frame:hover) .item:not(:has(.frame:hover)){opacity:.5}
}

/* Forms (admin) */
.form{display:grid;gap:1.25rem}
.field{display:grid;gap:.4rem;margin:0;padding:0;border:0;min-width:0}
.field label,.field legend{font:500 .9375rem var(--display)}
.field input:not([type="checkbox"]),.field select,.field textarea{width:100%;min-height:48px;padding:.7rem .9rem;border:1px solid var(--fog);border-radius:2px;background:var(--raised);color:inherit;font:inherit}
.field textarea{min-height:8rem;resize:vertical}
.form .btn{justify-self:start}

/* Footer */
.foot{padding-block:2rem 3rem;color:var(--muted);font:400 .9375rem var(--display)}
.foot .wrap{display:flex;flex-wrap:wrap;justify-content:space-between;gap:.5rem 2rem}
.foot-links{display:flex;gap:1.5rem}

/* Photo viewer */
.viewer{width:100%;height:100dvh;max-width:none;max-height:none;padding:0;border:0;background:transparent;color:#E9EAE6}
.viewer::backdrop{background:#0D1012}
.viewer-inner{height:100%;display:grid;grid-template-rows:auto minmax(0,1fr) auto;gap:.75rem;padding:1rem}
.viewer-top,.viewer-bar{display:flex;align-items:center;justify-content:space-between;gap:1rem}
.viewer p{margin:0}
.stage{display:flex;align-items:center;justify-content:center;min-height:0}
.stage .big{max-width:100%;max-height:100%;object-fit:contain;border-radius:2px}
.stage .photo{width:auto;height:100%;max-width:100%}
.v-cap{flex:1;display:flex;justify-content:center;align-items:baseline;gap:1rem;text-align:center;font-style:italic;font-size:1.125rem}
.vbtn{min-height:44px;padding:0 1.25rem;border:1px solid rgb(255 255 255 / .35);border-radius:2px;background:transparent;color:inherit;font:500 .9375rem var(--display);cursor:pointer}
.vbtn:hover{background:var(--sodium);border-color:var(--sodium);color:#1D2529}
.viewer :focus-visible{outline-color:#fff}
#v-count{font:500 .9375rem var(--display);font-variant-numeric:tabular-nums}

/* Small screens */
@media (max-width:52rem){
  .about-grid,.about-grid.solo{grid-template-columns:minmax(0,1fr)}
  .about-grid .portrait{max-width:20rem}
  .feature-text{grid-template-columns:minmax(0,1fr)}
  .feature-tall .feature-link{grid-template-columns:minmax(0,1fr)}
  .feature-tall .photo{order:0}
  .feature-tall .feature-text{order:1;margin-top:1.5rem;padding-bottom:0}
  .v-cap{flex-direction:column;gap:0}
}
@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  *,*::before,*::after{animation:none!important;transition:none!important}
}

/* About page text */
.prose h2{margin-top:2.25em;font-size:1.6rem;line-height:1.1}
.prose ul{padding-left:1.25rem}
.prose li{margin-bottom:.6em}
.prose li::marker{color:var(--sodium)}
.prose strong{font-weight:600}
