:root {
  --bg: #13110f;
  --bg-2: #1c1916;
  --line: #2e2924;
  --fg: #ece5d9;
  --dim: #8f8578;
  --accent: #c65a3e; /* dried-ink vermilion, the only accent */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Geist", ui-sans-serif, system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
  --gutter: clamp(16px, 4vw, 56px);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* paper grain on a fixed layer, never on scrolling content */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 3;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; }
.mono { font-family: var(--mono); font-size: 0.8125rem; letter-spacing: 0.01em; }
.dim { color: var(--dim); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--fg); color: var(--bg); padding: 8px 12px; z-index: 4; }
.skip:focus { left: 8px; }

/* nav */
.nav {
  position: sticky; top: 0; z-index: 2;
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px var(--gutter);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { font: italic 1.6rem/1 var(--serif); text-decoration: none; }
.nav nav { display: flex; gap: clamp(14px, 3vw, 32px); }
.nav nav a { text-decoration: none; font-size: 0.875rem; color: var(--dim); transition: color .3s var(--ease); }
.nav nav a:hover { color: var(--fg); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px;
  border: 1px solid var(--fg);
  background: var(--fg); color: var(--bg);
  border-radius: 999px;
  font-size: 0.875rem; font-weight: 500; text-decoration: none;
  cursor: pointer;
  transition: transform .3s var(--ease), background .3s var(--ease), color .3s var(--ease);
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: var(--fg); }
.btn:active { transform: scale(0.98); }
.btn.ghost { background: transparent; color: var(--fg); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--fg); background: transparent; }
.btn[disabled] { opacity: .35; pointer-events: none; }

/* platform icons (Simple Icons, CC0) */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico { width: 1em; height: 1em; flex: none; fill: currentColor; }
.btn .ico { width: 16px; height: 16px; }

/* type + intro copy (shared by the Inktober header, about and 404) */
.eyebrow { color: var(--accent); margin: 0 0 20px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.02em; line-height: 0.95; margin: 0; }
h1 { font-size: clamp(3rem, 7vw, 6.25rem); }
h1 em { color: var(--accent); }
.lede { color: var(--dim); max-width: 52ch; font-size: 1.0625rem; margin: 28px 0 36px; }
.stats { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 0 clamp(20px, 4vw, 48px); margin: 28px 0 0; }
.stats div { border-top: 1px solid var(--line); padding-top: 10px; }
.stats dt { font-size: 0.75rem; color: var(--dim); }
.stats dd { margin: 2px 0 0; font-size: 1.5rem; color: var(--fg); }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }

/* Inktober 2026: one horizontal row of day cards */
.ink26 { max-width: 1400px; margin: 0 auto; padding: clamp(40px, 8vh, 88px) 0 clamp(56px, 8vw, 96px); }
.ink26-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 24px; padding: 0 var(--gutter); margin-bottom: 32px; }
.ink26-head .lede { margin: 20px 0 0; }
.ink26-arrows { display: flex; gap: 8px; }
.round {
  width: 44px; height: 44px; display: grid; place-items: center; padding: 0;
  border-radius: 999px; border: 1px solid var(--line); background: transparent; cursor: pointer;
  transition: border-color .3s var(--ease), transform .3s var(--ease);
}
.round:hover { border-color: var(--fg); }
.round:active { transform: scale(0.96); }
.round:disabled { opacity: .35; cursor: default; border-color: var(--line); }

.ink26-track {
  --card-w: clamp(220px, 21vw, 300px);
  display: flex; gap: 16px; list-style: none; margin: 0; padding: 4px var(--gutter) 16px;
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter);
  scrollbar-width: none;
}
.ink26-track::-webkit-scrollbar { display: none; }
.day-card { flex: 0 0 var(--card-w); scroll-snap-align: start; }
.day-card.is-skeleton { aspect-ratio: 4 / 5.6; background: var(--bg-2); }
.day-card a {
  display: flex; flex-direction: column; height: 100%; text-decoration: none;
  border: 1px solid var(--line); background: var(--bg-2);
  transition: border-color .3s var(--ease), transform .5s var(--ease);
}
.day-card a:hover { border-color: var(--dim); transform: translateY(-4px); }
.day-card.is-today a { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); }
.day-card.is-open a { border-color: var(--accent); }
.card-media { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 5; overflow: hidden; border-bottom: 1px solid var(--line); }
.card-media picture { display: contents; }
/* contain, not cover: whole drawing stays visible */
.card-img { width: 100%; height: 100%; object-fit: contain; }
.card-num { font: italic clamp(5rem, 9vw, 8rem)/1 var(--serif); color: var(--line); letter-spacing: -0.04em; user-select: none; }
.day-card a:hover .card-num { color: color-mix(in srgb, var(--accent) 45%, var(--line)); transition: color .3s var(--ease); }
.card-meta { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px 16px; }
.card-prompt { font: 400 clamp(1.75rem, 2.4vw, 2.25rem)/1 var(--serif); letter-spacing: -0.02em; }
.card-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 6px; font-size: 0.75rem; }
.today { color: var(--accent); margin-left: 6px; }
.pill { display: inline-block; font: 500 0.6875rem/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; padding: 5px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--dim); white-space: nowrap; }
.pill[data-status="in-progress"] { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.pill[data-status="published"] { color: var(--bg); background: var(--fg); border-color: var(--fg); }
.ink26-error { padding: 48px 0; color: var(--dim); }

.ink26-jump { display: flex; align-items: center; gap: 16px; padding: 8px var(--gutter) 0; }
#jump-label { white-space: nowrap; }
.day-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.day-chips .chip { min-width: 36px; text-align: center; padding: 6px 8px; text-decoration: none; font-size: 0.75rem; }
.day-chips .chip[aria-current="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.day-select { display: none; flex: 1; min-height: 44px; padding: 0 12px; background: var(--bg-2); color: var(--fg); border: 1px solid var(--line); border-radius: 999px; }

/* inline day detail (tablet + desktop) and full-screen day view (phone) share markup */
.day-panel { margin: 32px var(--gutter) 0; border: 1px solid var(--line); background: var(--bg-2); animation: lb-in .5s var(--ease); }
.day-panel:focus { outline: none; }
.day-panel:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.dv-bar { display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.dv-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; }
.dv-media { padding: clamp(16px, 3vw, 40px); display: flex; flex-direction: column; gap: 28px; border-right: 1px solid var(--line); min-width: 0; }
.dv-info { padding: clamp(20px, 3vw, 40px); display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.dv-info p { margin: 0; }
.dv-title { font-size: clamp(3rem, 6vw, 5.5rem); line-height: 0.9; }
.dv-art { margin: 0; }
.dv-art a { display: block; cursor: zoom-in; }
.dv-art picture { display: contents; }
.dv-img { width: auto; max-width: 100%; max-height: 72vh; margin: 0 auto; object-fit: contain; }
.dv-art figcaption { margin-top: 10px; }
.dv-empty { display: grid; place-items: center; gap: 12px; aspect-ratio: 4 / 3; border: 1px dashed var(--line); text-align: center; padding: 24px; color: var(--dim); }
.dv-empty p { margin: 0; max-width: 32ch; }
.dv-block { display: flex; flex-direction: column; gap: 8px; }
.dv-block p { color: var(--dim); max-width: 60ch; }
.dv-block .mediums { margin: 0; }
.dv-label { color: var(--accent); }
.dv-block video { width: 100%; background: var(--bg); border: 1px solid var(--line); }
.gen-prompt { border: 1px solid var(--line); background: var(--bg); padding: 14px; display: flex; flex-direction: column; gap: 12px; align-items: start; }
.gen-prompt pre { margin: 0; white-space: pre-wrap; word-break: break-word; color: var(--fg); }
.dv-nav { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.btn.small { padding: 8px 14px; font-size: 0.8125rem; min-height: 40px; }

.dayview {
  width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: var(--bg); color: var(--fg); overflow-y: auto; overscroll-behavior: contain;
}
.dayview::backdrop { background: var(--bg); }
.dayview[open] { animation: lb-in .4s var(--ease); }
.dayview .dv-bar { position: sticky; top: 0; z-index: 1; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); }
.dayview .dv-grid { grid-template-columns: 1fr; }
.dayview .dv-media { border-right: 0; border-bottom: 1px solid var(--line); padding: 16px; }
.dayview .dv-info { padding: 20px 16px 32px; }
.dayview .dv-img { max-height: none; width: 100%; }

/* View all 31 days */
.ink26-all { padding: 32px var(--gutter) 0; }
.ink26-all > .btn .chev { transition: transform .3s var(--ease); }
.ink26-all > .btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.all-days { display: grid; grid-template-columns: 1fr minmax(260px, 380px); gap: clamp(20px, 3vw, 40px); align-items: start; margin-top: 24px; }
.all-days[hidden] { display: none; }
.day-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; list-style: none; margin: 0; padding: 0; }
.tile {
  display: flex; flex-direction: column; gap: 2px; height: 100%; padding: 12px; text-decoration: none;
  border: 1px solid var(--line); background: var(--bg-2);
  transition: border-color .3s var(--ease);
}
.tile:hover { border-color: var(--dim); }
.tile[aria-current="true"] { border-color: var(--accent); }
.tile picture { display: contents; }
.tile-img { width: 100%; aspect-ratio: 1; object-fit: contain; background: var(--bg); margin-bottom: 8px; }
.tile-prompt { font: 400 1.5rem/1 var(--serif); }
.tile-status { font-size: 0.6875rem; color: var(--dim); margin-top: 4px; }
.tile[data-status="in-progress"] .tile-status { color: var(--accent); }
.prompt-ref { margin: 0; position: sticky; top: 88px; }
.prompt-ref-frame { display: block; width: 100%; padding: 0; border: 1px solid var(--line); background: var(--bg-2); cursor: zoom-in; }
.prompt-ref-frame picture { display: contents; }
/* reference graphic: full image, never cropped or stretched */
.prompt-ref-frame img { width: 100%; height: auto; object-fit: contain; }
.prompt-ref figcaption { display: flex; flex-direction: column; gap: 2px; margin-top: 10px; font-size: 0.875rem; }
.prompt-ref figcaption a { color: var(--fg); }
.refview {
  max-width: min(1024px, 94vw); max-height: 94dvh; padding: 16px; border: 1px solid var(--line);
  background: var(--bg); color: var(--fg); overflow: auto;
}
.refview::backdrop { background: rgba(13, 11, 10, 0.94); }
.refview img { width: auto; max-width: 100%; max-height: calc(94dvh - 96px); margin: 0 auto; object-fit: contain; }
.refview p { margin: 12px 0 0; }
.refview .lb-close { top: 24px; right: 24px; }

@media (max-width: 1099px) {
  .ink26-track { --card-w: clamp(220px, 34vw, 300px); }
  .dv-grid { grid-template-columns: 1fr; }
  .dv-media { border-right: 0; border-bottom: 1px solid var(--line); }
  .all-days { grid-template-columns: 1fr; }
  .prompt-ref { position: static; max-width: 520px; }
}

/* 404 */
.notfound { max-width: 1400px; margin: 0 auto; padding: clamp(64px, 14vh, 160px) var(--gutter); }

/* prompt marquee */
.marquee { overflow: hidden; border-block: 1px solid var(--line); padding: 18px 0; }
.marquee-track { display: flex; width: max-content; animation: marquee 80s linear infinite; }
.marquee-track span { font: italic clamp(1.5rem, 3vw, 2.25rem)/1 var(--serif); padding-right: 0.9em; white-space: nowrap; color: var(--dim); }
.marquee-track span::after { content: "/"; font-style: normal; color: var(--accent); margin-left: 0.9em; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* archive */
.archive { max-width: 1400px; margin: 0 auto; padding: clamp(64px, 10vw, 128px) var(--gutter) 0; }
.archive-lede { color: var(--dim); margin: 16px 0 0; max-width: 52ch; }
.archive-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 48px; }
h2 { font-size: clamp(2.5rem, 5vw, 4rem); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line); background: transparent; border-radius: 999px;
  padding: 7px 14px; cursor: pointer; font-family: var(--mono); font-size: 0.8125rem; color: var(--dim);
  transition: color .3s var(--ease), border-color .3s var(--ease), background .3s var(--ease);
}
.chip:hover { color: var(--fg); border-color: var(--dim); }
.chip:active { transform: scale(0.98); }
.chip[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.chip sup { font-size: 0.7em; margin-left: 4px; opacity: .7; }

.section {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 3fr;
  gap: clamp(24px, 4vw, 64px);
  padding: 48px 0 64px;
  border-top: 1px solid var(--line);
}
.section[hidden] { display: none; }
.section-label { position: sticky; top: 96px; align-self: start; }
.section-label .year { font: 400 clamp(3rem, 6vw, 5.5rem)/0.9 var(--serif); letter-spacing: -0.03em; }
.section-label .kind { color: var(--accent); margin: 0 0 8px; }
.section-label p { color: var(--dim); font-size: 0.875rem; margin: 12px 0 0; max-width: 28ch; }

.grid { columns: 3 220px; column-gap: 20px; }
.work {
  break-inside: avoid; margin: 0 0 20px;
  opacity: 0; transform: translateY(24px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
  transition-delay: calc(var(--i, 0) * 70ms);
}
.work.in { opacity: 1; transform: none; }
.work button { display: block; width: 100%; padding: 0; border: 0; background: none; text-align: left; cursor: zoom-in; }
.thumb {
  position: relative; overflow: hidden; background: var(--bg-2);
  aspect-ratio: var(--ar);
}
.thumb::before { /* shimmer while loading */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.05) 50%, transparent 70%);
  background-size: 200% 100%; animation: shimmer 1.6s linear infinite;
}
.thumb.loaded::before, .thumb.failed::before { display: none; }
.thumb picture, .lb-media picture { display: contents; }
.thumb img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .6s var(--ease), transform .9s var(--ease); }
.thumb.loaded img { opacity: 1; }
.thumb.failed::after { content: "Image unavailable"; position: absolute; inset: 0; display: grid; place-items: center; font: 0.75rem var(--mono); color: var(--dim); }
.work button:hover img { transform: scale(1.035); }
.badge {
  position: absolute; top: 10px; left: 10px;
  font: 500 0.6875rem/1 var(--mono); text-transform: uppercase; letter-spacing: .06em;
  padding: 5px 8px; border-radius: 999px;
  background: rgba(19, 17, 15, 0.75); backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.1);
}
.work figcaption { display: flex; justify-content: space-between; gap: 12px; padding-top: 10px; font-size: 0.875rem; }
.work .t { transition: color .3s var(--ease); }
.work button:hover .t { color: var(--accent); }
.work .d { font: 0.75rem/1.9 var(--mono); color: var(--dim); white-space: nowrap; }
@keyframes shimmer { to { background-position: -200% 0; } }

.skeleton-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.skeleton-grid i { aspect-ratio: 4/5; background: var(--bg-2); }
.empty { color: var(--dim); padding: 48px 0; }

/* about: asymmetric, art left narrow */
.about {
  display: grid; grid-template-columns: 0.8fr 1.2fr; gap: clamp(32px, 6vw, 96px); align-items: center;
  max-width: 1400px; margin: 0 auto; padding: clamp(80px, 12vw, 160px) var(--gutter);
  border-top: 1px solid var(--line);
}
.about-art { margin: 0; transform: rotate(-1.5deg); }
.about-copy p { color: var(--dim); max-width: 60ch; }
.about-copy h2 { margin-bottom: 24px; }
.mediums { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 28px 0 32px; }
.mediums li { border: 1px solid var(--line); padding: 5px 12px; border-radius: 999px; color: var(--fg); }

.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 32px; padding: 28px var(--gutter); border-top: 1px solid var(--line); color: var(--dim); }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.foot a { text-decoration: none; }
.foot-links a, .nav nav a { display: inline-flex; align-items: center; gap: 7px; }
.foot a:hover { color: var(--fg); }

/* lightbox */
.lightbox {
  width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: rgba(13, 11, 10, 0.94); color: var(--fg);
}
.lightbox::backdrop { background: transparent; }
.lightbox[open] .lb-inner { animation: lb-in .5s var(--ease); }
.lb-inner { display: grid; grid-template-columns: 1fr 340px; height: 100%; }
.lb-media { display: grid; place-items: center; padding: 32px; min-height: 0; }
.lb-media img { max-height: calc(100dvh - 64px); width: auto; object-fit: contain; }
.lb-info { border-left: 1px solid var(--line); padding: 72px 32px 32px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; }
.lb-info h3 { font-size: 2.5rem; }
.lb-info p { margin: 0; }
.lb-caption { white-space: pre-line; color: var(--dim); font-size: 0.9375rem; }
.lb-caption:empty { display: none; }
.lb-info .btn { align-self: start; }
.lb-nav { display: flex; gap: 8px; margin-top: auto; }
.lb-close { position: absolute; top: 20px; right: 20px; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); cursor: pointer; }
.lb-close:hover { border-color: var(--fg); }
@keyframes lb-in { from { opacity: 0; transform: scale(0.98); } }

/* mobile: everything collapses to one column */
@media (max-width: 767px) {
  .about { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .section { grid-template-columns: 1fr; padding: 32px 0 40px; }
  .section-label { position: static; }
  .grid { columns: 2; column-gap: 12px; }
  .work { margin-bottom: 12px; }
  .work figcaption { flex-direction: column; gap: 0; }
  .skeleton-grid { grid-template-columns: repeat(2, 1fr); }
  .about-art { transform: none; }
  .lb-inner { grid-template-columns: 1fr; grid-template-rows: auto 1fr; overflow-y: auto; }
  .lb-media { padding: 64px 16px 16px; }
  .lb-media img { max-height: 60dvh; }
  .lb-info { border-left: 0; border-top: 1px solid var(--line); padding: 24px 16px; }
  .lb-info h3 { font-size: 2rem; }
  .nav nav a:last-child { display: none; }
  .ink26 { padding-top: 32px; }
  .ink26-head { margin-bottom: 20px; gap: 16px; }
  .ink26-head h1 { font-size: 3.25rem; }
  .ink26-head .lede { margin-top: 12px; font-size: 1rem; }
  .ink26-track { --card-w: 78vw; gap: 12px; }
  .card-media { aspect-ratio: 1; }
  .nav nav { gap: 14px; }
  .nav nav a { font-size: 0.8125rem; }
  .day-chips { display: none; }
  .day-select { display: block; }
  #jump-label { display: none; }
  .ink26-all > .btn { width: 100%; justify-content: center; }
  .day-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 400px) {
  .nav nav a:first-child { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .work { opacity: 1; transform: none; }
}
