/* softprint: black cloth. White prints on the intro, violet prints on the posts; nothing else is coloured. */
:root {
  --bg: #0b0b0c;
  --bg-2: #131314;
  --bg-3: #1d1d1f;
  --white: #ecebe6;
  --ink-1: rgba(236, 235, 230, 0.95);
  --ink-2: rgba(236, 235, 230, 0.66);
  --ink-3: rgba(236, 235, 230, 0.42);
  --line: rgba(236, 235, 230, 0.12);
  --line-strong: rgba(236, 235, 230, 0.28);
  --accent: #a77dff;      /* violet: the lead colour */


  --f-display: 'Fraunces', Georgia, serif;
  --f-text: 'Familjen Grotesk', 'Helvetica Neue', Arial, sans-serif;

  --step--1: clamp(0.8rem, 0.78rem + 0.1vw, 0.86rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.1rem);
  --step-1: clamp(1.25rem, 1.12rem + 0.5vw, 1.6rem);
  --step-2: clamp(1.6rem, 1.3rem + 1.3vw, 2.5rem);
  --step-3: clamp(2.2rem, 1.5rem + 3vw, 4.4rem);

  --wrap: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
  --r: 6px;          /* thumbnails, widgets, inputs */
  --r-pill: 999px;   /* buttons, tags */

  --dur-fast: 0.25s;
  --dur-base: 0.6s;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);

  /* cotton twill over everything printed */
  --weave:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.022) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(-45deg, rgba(0, 0, 0, 0.35) 0 1px, transparent 1px 5px);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink-1); font: 400 var(--step-0)/1.65 var(--f-text); -webkit-font-smoothing: antialiased; }
::selection { background: var(--accent); color: var(--bg); }
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-family: var(--f-display); font-weight: 500; font-variation-settings: 'SOFT' 100, 'opsz' 96; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol { list-style: none; margin: 0; padding: 0; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.js-only { display: none; }
.js .js-only { display: inline-flex; }
.skip { position: fixed; left: 16px; top: -100px; z-index: 50; background: var(--white); color: var(--bg); padding: 12px 16px; border-radius: var(--r); }
.skip:focus { top: 12px; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }

/* ---------- buttons, labels ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px;
  border: 1px solid var(--accent); border-radius: var(--r-pill); background: var(--accent); color: var(--bg);
  font-weight: 500; font-size: var(--step--1); letter-spacing: 0.02em; cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.btn:hover, .btn:focus-visible { background: var(--white); border-color: var(--white); }
.btn--sm { min-height: 38px; padding: 0 16px; }
.btn[disabled] { opacity: 0.6; cursor: progress; }
.kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: var(--step--1); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.flag { color: var(--ink-3); text-transform: none; letter-spacing: 0.02em; }
.excerpt { color: var(--ink-2); }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: var(--step--1); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.meta .dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; }
.avatar { display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--white); color: var(--bg); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em; }
.avatar--lg { width: 56px; height: 56px; font-size: 1rem; }
.section-title { font-size: var(--step-1); padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.tag { display: inline-block; padding: 5px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-pill); font-size: var(--step--1); color: var(--ink-2); transition: color var(--dur-fast), border-color var(--dur-fast); }
.tag:hover, .tag:focus-visible { color: var(--white); border-color: var(--accent); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }

/* title links underline on hover */
.featured__title a, .post__title a, .card__title a {
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size var(--dur-base) var(--ease-io);
}
.featured:hover .featured__title a, .post:hover .post__title a, .card:hover .card__title a,
.featured__title a:focus-visible, .post__title a:focus-visible, .card__title a:focus-visible { background-size: 100% 1px; }

/* ---------- header ---------- */
.progress { position: fixed; inset: 0 0 auto 0; z-index: 30; height: 2px; pointer-events: none; }
.progress span { display: block; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; }
.site-head { position: sticky; top: 0; z-index: 20; background: rgba(11, 11, 12, 0.92); border-bottom: 1px solid var(--line); backdrop-filter: saturate(1.2) blur(8px); }
.site-head__in { display: flex; align-items: center; gap: 24px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; }
.brand__mark { width: 32px; height: 32px; }
.brand__word { font: 600 1.45rem/1 var(--f-display); font-variation-settings: 'SOFT' 100, 'opsz' 48; letter-spacing: -0.02em; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { padding: 8px 12px; border-radius: var(--r-pill); font-size: var(--step--1); color: var(--ink-2); transition: color var(--dur-fast), background-color var(--dur-fast); }
.nav a:hover, .nav a:focus-visible { color: var(--white); background: var(--bg-3); }
.nav a[aria-current] { color: var(--white); }
@media (max-width: 820px) {
  .site-head__in { flex-wrap: wrap; gap: 0 12px; padding-top: 8px; }
  .nav { order: 3; width: 100%; margin: 0 -12px; overflow-x: auto; scrollbar-width: none; }
  .site-head .btn { margin-left: auto; }
}

/* ---------- masthead: the printed banner ---------- */
.masthead { position: relative; overflow: hidden; background: #0e0e0f; border-bottom: 1px solid rgba(236, 235, 230, 0.12); }
.masthead::after { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: var(--weave); mix-blend-mode: multiply; }
.cloth { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.masthead__in { position: relative; z-index: 2; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; min-height: calc(100svh - var(--head-h, 69px)); padding-top: 48px; padding-bottom: clamp(28px, 5vw, 56px); }
.masthead__label { max-width: 600px; padding: clamp(24px, 3.4vw, 44px); background: #0b0b0c; border: 1px solid rgba(236, 235, 230, 0.2); border-radius: var(--r); display: grid; gap: 14px; box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.7); }
.masthead__label .kicker { color: rgba(236, 235, 230, 0.6); }
.masthead .masthead__title { color: #ecebe6; }
.masthead .masthead__text { color: rgba(236, 235, 230, 0.66); }
.masthead__title { font-size: clamp(3rem, 1.6rem + 6vw, 7.2rem); font-weight: 600; line-height: 0.95; letter-spacing: -0.03em; font-variation-settings: 'SOFT' 100, 'WONK' 1, 'opsz' 144; }
.masthead__text { color: var(--ink-2); }
.masthead__side { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; flex: none; }
.scroll-cue { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: var(--r-pill); background: var(--bg); font-size: var(--step--1); color: var(--white); }
.scroll-cue svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; animation: cue 2.4s var(--ease-io) infinite; }
.scroll-cue:hover, .scroll-cue:focus-visible { color: #fff; border-color: #ecebe6; }
@keyframes cue { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(5px); } }
.reprint {
  align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; flex: none;
  border: 1px solid var(--line-strong); border-radius: var(--r-pill); background: var(--bg); cursor: pointer;
  font-size: var(--step--1); color: var(--ink-1); transition: border-color var(--dur-fast), color var(--dur-fast);
}
.reprint svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform var(--dur-base) var(--ease-out); }
.reprint:hover, .reprint:focus-visible { border-color: #ecebe6; color: #fff; }
.reprint:hover svg { transform: rotate(-180deg); }
.reprint[disabled] { opacity: 0.6; cursor: progress; }
@media (max-width: 640px) {
  .masthead__in { flex-direction: column; align-items: stretch; justify-content: flex-end; }
  .masthead__side { flex-direction: row-reverse; justify-content: space-between; align-items: center; }
}

/* ---------- main layout: content + sidebar ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: clamp(32px, 5vw, 64px); align-items: start; padding-top: 32px; padding-bottom: clamp(64px, 9vw, 120px); }
@media (max-width: 980px) { .layout { grid-template-columns: minmax(0, 1fr); } }
.feed { display: grid; gap: 40px; min-width: 0; }

.featured { display: grid; gap: 22px; }
.featured__thumb, .post__thumb, .card__thumb, .article__figure canvas {
  position: relative; display: block; overflow: hidden; border-radius: var(--r);
  background: var(--bg-2);
}
.featured__thumb { aspect-ratio: 16 / 8; }
.featured__thumb canvas, .post__thumb canvas, .card__thumb canvas { position: absolute; inset: 0; width: 100%; height: 100%; transition: transform 0.9s var(--ease-out); }
.featured:hover .featured__thumb canvas, .post:hover .post__thumb canvas, .card:hover .card__thumb canvas { transform: scale(1.04); }
.featured__body { display: grid; gap: 12px; }
.featured__title { font-size: var(--step-2); line-height: 1.08; font-variation-settings: 'SOFT' 100, 'WONK' 1, 'opsz' 144; }

.posts { display: grid; }
.post { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.post__thumb { aspect-ratio: 4 / 3; }
.post__body { display: grid; gap: 8px; align-content: start; }
.post__title { font-size: var(--step-1); line-height: 1.15; }
.post .excerpt { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 600px) {
  .post { grid-template-columns: 112px minmax(0, 1fr); gap: 16px; }
  .post .excerpt { display: none; }
  .post__title { font-size: 1.15rem; }
}

.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pager a, .pager span { display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: var(--r-pill); font-size: var(--step--1); font-variant-numeric: tabular-nums; }
.pager span { border-color: transparent; }
.pager a:hover, .pager a:focus-visible { border-color: var(--white); }
.pager [aria-current] { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.pager__next { margin-left: auto; }

/* ---------- sidebar ---------- */
.side { display: grid; gap: 20px; position: sticky; top: 92px; }
@media (max-width: 980px) { .side { position: static; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); } }
.widget { display: grid; gap: 14px; align-content: start; padding: 22px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); min-width: 0; }
.widget__title { font-family: var(--f-text); font-size: var(--step--1); font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); }
.widget > p { color: var(--ink-2); font-size: 0.95em; }
.search { grid-template-columns: minmax(0, 1fr) auto; gap: 0; padding: 6px; }
.search__input { min-height: 40px; padding: 0 12px; border: 0; background: transparent; color: var(--ink-1); }
.search__input::placeholder { color: var(--ink-3); }
.search__input:focus-visible { outline: 0; }
.search:focus-within { border-color: var(--accent); }
.search__btn { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: var(--r); background: var(--bg-3); cursor: pointer; }
.search__btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.about__head { display: flex; align-items: center; gap: 14px; }
.about__name { font: 500 1.2rem/1.1 var(--f-display); font-variation-settings: 'SOFT' 100, 'opsz' 48; }
.about__role { font-size: var(--step--1); color: var(--ink-3); }
.popular { display: grid; gap: 14px; }
.popular a { display: grid; grid-template-columns: 1.8rem minmax(0, 1fr); gap: 10px; align-items: baseline; font-size: 0.95em; }
.popular a:hover span:last-child { text-decoration: underline; text-underline-offset: 3px; }
.popular__n { font: 500 1.4rem/1 var(--f-display); color: var(--accent); }

.suggest { display: grid; gap: 10px; }
.suggest__input { min-height: 44px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--bg); color: var(--ink-1); font: inherit; }
.suggest__input--area { min-height: 96px; padding: 10px 14px; resize: vertical; line-height: 1.45; }
.suggest__input::placeholder { color: var(--ink-3); }
.suggest__input:focus-visible { outline: 0; border-color: var(--accent); }
.suggest__input[aria-invalid='true'] { border-color: #f2a7a0; }
.suggest__msg { min-height: 1.4em; font-size: var(--step--1); color: var(--ink-2); }
.suggest__msg.is-error { color: #f6b9b2; }

/* ---------- article ---------- */
.layout--article { padding-top: 28px; }
.article { min-width: 0; display: grid; gap: 28px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: var(--step--1); color: var(--ink-3); }
.crumbs a:hover { color: var(--white); }
.article__head { display: grid; gap: 14px; }
.article__title { font-size: var(--step-3); font-weight: 600; line-height: 1.02; letter-spacing: -0.02em; font-variation-settings: 'SOFT' 100, 'WONK' 1, 'opsz' 144; }
.article__figure { margin: 0; display: grid; gap: 10px; }
.article__figure canvas { width: 100%; aspect-ratio: 16 / 8; }
.article__figure figcaption { font-size: var(--step--1); color: var(--ink-3); }
.prose { max-width: 68ch; font-size: clamp(1.05rem, 1rem + 0.2vw, 1.15rem); line-height: 1.75; }
.prose > * + * { margin-top: 1.1em; }
.prose .lede { font: 400 var(--step-1)/1.45 var(--f-display); font-variation-settings: 'SOFT' 100, 'opsz' 48; color: var(--white); }
.prose h2 { font-size: var(--step-2); line-height: 1.1; margin-top: 1.8em; }
.prose blockquote { margin: 1.8em 0; padding: 4px 0 4px 22px; border-left: 2px solid var(--accent); font: italic 400 var(--step-1)/1.4 var(--f-display); color: var(--white); }
.prose ul { padding-left: 1.2em; list-style: none; }
.prose li { position: relative; }
.prose li::before { content: ''; position: absolute; left: -1em; top: 0.72em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.prose li + li { margin-top: 0.4em; }
.article__tags { padding-top: 24px; border-top: 1px solid var(--line); }
.author-box { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px; padding: 22px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); }
.author-box p { color: var(--ink-2); }
.author-box .author-box__name { color: var(--white); font: 500 1.2rem/1.2 var(--f-display); margin-bottom: 4px; }
.prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.prevnext a { display: grid; gap: 4px; padding: 18px; border: 1px solid var(--line); border-radius: var(--r); transition: border-color var(--dur-fast); }
.prevnext a:hover, .prevnext a:focus-visible { border-color: var(--accent); }
.prevnext a[rel='next'] { text-align: right; }
.prevnext span { font-size: var(--step--1); color: var(--ink-3); }
.prevnext strong { font: 500 1.05rem/1.25 var(--f-display); }
@media (max-width: 600px) { .prevnext { grid-template-columns: 1fr; } .prevnext a[rel='next'] { text-align: left; } }

.related { display: grid; gap: 28px; padding-bottom: clamp(64px, 9vw, 120px); }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px 24px; }
@media (max-width: 860px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .cards { grid-template-columns: minmax(0, 1fr); } }
.card { display: grid; gap: 10px; align-content: start; }
.card__thumb { aspect-ratio: 4 / 3; margin-bottom: 4px; }
.card__title { font-size: 1.25rem; line-height: 1.2; }

/* ---------- footer ---------- */
.site-foot { border-top: 1px solid var(--line); background: var(--bg-2); }
.site-foot__grid { display: grid; grid-template-columns: 2fr 1fr; gap: 40px; padding-top: 56px; padding-bottom: 40px; }
@media (max-width: 760px) { .site-foot__grid { grid-template-columns: 1fr 1fr; } .site-foot__about { grid-column: 1 / -1; } }
.site-foot__about { display: grid; gap: 14px; align-content: start; max-width: 40ch; }
.site-foot__about p { color: var(--ink-2); }
.site-foot__h { font-family: var(--f-text); font-size: var(--step--1); font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 14px; }
.site-foot ul { display: grid; gap: 8px; }
.site-foot ul a { color: var(--ink-2); }
.site-foot ul a:hover, .site-foot ul a:focus-visible { color: var(--white); }
.site-foot__bar { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-top: 20px; padding-bottom: 28px; border-top: 1px solid var(--line); font-size: var(--step--1); color: var(--ink-3); }
.site-foot__bar a:hover { color: var(--white); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
.posts li:first-child .post { padding-top: 0; }
.feed .section-title { margin-bottom: -16px; }
.suggest__msg:empty { display: none; }
/* the spam trap: off-screen, out of the tab order and hidden from assistive tech */
.suggest__trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.suggest__note { font-size: var(--step--1); color: var(--ink-3); }
.suggest__note a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
.suggest__note a:hover { color: var(--white); }
.legal .prose { max-width: 68ch; }
.legal__forget { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; font-size: var(--step--1); color: var(--ink-2); }

.widget--news { border-color: var(--line-strong); }
.masthead .scroll-cue, .masthead .reprint { background: #0b0b0c; border-color: rgba(236, 235, 230, 0.28); color: #ecebe6; }
/* the same cloth weave as the intro, over every printed thumbnail */
.featured__thumb::after, .post__thumb::after, .card__thumb::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: var(--weave); mix-blend-mode: multiply; }

/* ---------- version switch ---------- */

/* anchor targets stop below the sticky header */
[id] { scroll-margin-top: calc(var(--head-h, 69px) + 12px); }

/* ---------- touch: every link and button gets a finger-sized target ---------- */
@media (pointer: coarse) {
  .nav a { display: inline-flex; align-items: center; min-height: 44px; }
  .btn--sm { min-height: 44px; }
  .tag { display: inline-flex; align-items: center; min-height: 40px; }
  .crumbs a { padding: 12px 0; margin: -12px 0; }
  .site-foot ul { gap: 0; }
  .site-foot ul a, .site-foot__bar a { display: inline-flex; align-items: center; min-height: 44px; }
  .site-foot__bar { padding-top: 8px; padding-bottom: 16px; align-items: center; }
}
/* narrow screens: a meta line that wraps would leave a dot hanging at its end, so drop the dots */
@media (max-width: 480px) { .meta .dot { display: none; } .meta { column-gap: 14px; } }
