/* Shared by the pages that are not the home page or a case study: the writing index, an article,
   subscribe, the thanks page and the 404. Same dark page, same two typefaces and same pill at the
   top as ./ and berry-street.html; the pieces below are lifted from those two files, so a
   change to the look there should be carried over here.

   The pieces:
     .page               the column. Add "broad" for the wider one the home page uses, "solo" to
                         centre a short page in the window
     .title.heavy        a few heavy capitals fitted to the column (data-fit)
     .headline           a long title, set like the article panels on the home page
     .lead               the opening lines
     .meta               the date and reading time under a headline
     .prose              running text, with the same parts a case study has (h2, h3, p.big,
                         blockquote, .pair, .rows, .prompt, figure)
     .covers > a.cover   the hero articles as panels
     .posts > a          the running series, one row a post
     .signup             the newsletter panel, the one thing in the accent colour
     .about              the two sentences about Jared, with the way to the home page
     .end                the closing block */

@font-face { font-family: "Roboto Flex"; src: url("type/fonts/RobotoFlex-var.woff2") format("woff2"); font-weight: 100 1000; font-stretch: 25% 151%; }
@font-face { font-family: "Roboto Flex Full"; src: url("type/fonts/RobotoFlex-full.woff2") format("woff2"); font-weight: 100 1000; font-stretch: 25% 151%; }
@font-face { font-family: "Geist"; src: url("type/fonts/Geist-var.woff2") format("woff2"); font-weight: 100 900; }

* { box-sizing: border-box; }
html {
  --bg: #0c0d0c; --ink: #fff; --accent: #19ffa6; --accent-glow: 0.55;
  --text: color-mix(in srgb, var(--ink) 84%, transparent);
  --dim: color-mix(in srgb, var(--ink) 60%, transparent);
  --line: color-mix(in srgb, var(--ink) 16%, transparent);
  --read: 680px;      /* the reading column */
  --broad: 850px;     /* the home page's column, for pages that are lists and panels */
  --out: 1040px;      /* how wide a picture may go when it reaches out past the column */
  --edge: 20px;
  background: var(--bg); overflow-x: clip; scroll-behavior: smooth;
}
body { margin: 0; background: var(--bg); color: var(--ink); overflow-x: clip; font-family: "Geist", sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; outline: none; }
img { display: block; max-width: 100%; height: auto; }

/* ---------- the column ---------- */
.page { container-type: inline-size; width: min(100% - var(--edge) * 2, var(--read)); margin: 0 auto; padding: 150px 0 0; }
.page.broad { --read: var(--broad); }
.page.solo { min-height: 100svh; display: grid; align-content: center; padding: 120px 0; }
.page.solo > * { min-width: 0; }      /* so a fitted title is measured against the column, not against itself */
.wide { width: min(100vw - var(--edge) * 2, var(--out)); margin-left: 50%; translate: -50% 0; }

/* ---------- the top ---------- */
.heavy { font-family: "Roboto Flex Full", "Roboto Flex", sans-serif; text-transform: uppercase; font-kerning: normal; }
.title { margin: 0; font-weight: 1000; font-stretch: 62%; line-height: 1; white-space: nowrap; font-size: 90px; }
.title span { display: inline-block; text-box: trim-both cap alphabetic; }
.headline {
  margin: 0; font-family: "Roboto Flex Full", "Roboto Flex", sans-serif; text-transform: uppercase; font-weight: 900; font-stretch: 62%;
  font-size: clamp(44px, 11cqi, 76px); line-height: 0.9; letter-spacing: 0.005em; text-wrap: balance;
}
.lead { margin: 44px 0 0; font-weight: 420; font-size: clamp(21px, 3.4vw, 25px); line-height: 1.36; letter-spacing: -0.012em; text-wrap: pretty; }
.meta { margin: 28px 0 0; font-size: 15px; line-height: 1.45; color: var(--dim); font-variant-numeric: tabular-nums; }
.label {
  font: 560 11px/1.3 "Roboto Flex Full", "Roboto Flex", sans-serif; font-stretch: 130%; letter-spacing: .16em; text-transform: uppercase;
  color: var(--dim);
}
.glow {
  color: var(--accent);
  text-shadow: 0 0 0.12em color-mix(in srgb, var(--accent) calc(var(--accent-glow) * 70%), transparent), 0 0 0.7em color-mix(in srgb, var(--accent) calc(var(--accent-glow) * 100%), transparent);
}
.plain { margin: 28px 0 0; font-size: 19px; line-height: 1.62; color: var(--text); text-wrap: pretty; }

/* ---------- running text ---------- */
.prose { margin-top: 72px; }
.prose > h2, .part { margin: 104px 0 0; font-size: 32px; line-height: 1.15; letter-spacing: -0.025em; font-weight: 600; text-wrap: balance; scroll-margin-top: 110px; }
.prose > h2 + * { margin-top: 22px; }
.prose > h3 { margin: 48px 0 0; font-size: 20px; line-height: 1.3; letter-spacing: -0.012em; font-weight: 600; }
.prose > h3 + p { margin-top: 10px; }
.prose p, .prose li { font-size: 19px; line-height: 1.62; font-weight: 400; letter-spacing: -0.003em; color: var(--text); text-wrap: pretty; }
.prose > p { margin: 1.15em 0 0; }
.prose > :first-child { margin-top: 0; }
.prose strong { font-weight: 600; color: var(--ink); }
.prose > ul { list-style: none; margin: 1.15em 0 0; padding: 0; }
.prose > ul li { position: relative; padding-left: 24px; }
.prose > ul li + li { margin-top: .5em; }
.prose > ul li::before { content: ""; position: absolute; left: 2px; top: .72em; width: 6px; height: 6px; background: color-mix(in srgb, var(--ink) 34%, transparent); }
.prose > .big { margin: 40px 0; font-size: clamp(24px, 4.4vw, 30px); line-height: 1.25; letter-spacing: -0.02em; font-weight: 500; color: var(--ink); text-wrap: balance; }
.prose > blockquote { margin: 32px 0 0; padding: 2px 0 2px 22px; border-left: 2px solid color-mix(in srgb, var(--accent) 80%, transparent); }
.prose > blockquote p { margin: 0; font-size: 21px; line-height: 1.45; letter-spacing: -0.012em; color: var(--ink); }
.prose > blockquote footer { margin-top: 10px; }
.prose > blockquote + p, .prose > .rows + p, .prose > .pair + p { margin-top: 32px; }
.prose > .pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 28px; margin-top: 32px; }
.pair > div { border-top: 1px solid var(--line); padding-top: 14px; }
.prose > .rows { margin-top: 32px; border-bottom: 1px solid var(--line); }
.rows > div { display: grid; grid-template-columns: 11.5em minmax(0, 1fr); gap: 4px 28px; border-top: 1px solid var(--line); padding: 16px 0 18px; }
.pair h4, .rows h4 { margin: 0; font-size: 17px; line-height: 1.45; font-weight: 600; letter-spacing: -0.01em; }
.pair p, .rows p { margin: 6px 0 0; font-size: 17px; line-height: 1.55; }
.rows p { margin: 0; }
.prose > .prompt { margin: 32px 0 0; padding: 20px 24px 24px; border-radius: 8px; background: color-mix(in srgb, var(--ink) 7%, transparent); }
.prompt p { margin: 10px 0 0; font: 400 15px/1.65 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 0; color: var(--ink); }
.prose > figure { margin: 48px 0; }
.prose > figure.wide { margin-left: 50%; }
figure > img { border-radius: 8px; }
figcaption { margin-top: 12px; font-size: 14px; line-height: 1.5; color: var(--dim); }
figure.wide figcaption { width: min(100%, var(--read)); margin-inline: auto; }

/* ---------- the hero articles: panels, as on the home page ---------- */
/* unlit, like a segment that is off, until you point at one: then it flickers on, white with dark type */
.covers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3.6cqi; margin-top: 28px; }
.cover {
  display: flex; flex-direction: column; justify-content: space-between; gap: 6cqi; min-height: 58cqi; padding: 3.4cqi; border-radius: 0.8cqi;
  --ground: var(--ink); --on: var(--bg);
  background: var(--ground); color: var(--on);
}
a.cover { background: color-mix(in srgb, var(--ink) 9%, transparent); color: var(--ink); transition: background-color .12s ease, color .12s ease, box-shadow .4s ease; }
a.cover:hover, a.cover:focus-visible {
  background: var(--ground); color: var(--on); animation: panel-on .5s linear both;
  box-shadow: 0 0 1.2cqi color-mix(in srgb, var(--ground) 70%, transparent), 0 0 7cqi color-mix(in srgb, var(--ground) 45%, transparent);
}
@keyframes panel-on { 0% { opacity: .1; } 8% { opacity: 1; } 13% { opacity: .2; } 22% { opacity: .9; } 28% { opacity: .35; } 40%, 100% { opacity: 1; } }
.cover-title {
  font-family: "Roboto Flex Full", "Roboto Flex", sans-serif; text-transform: uppercase; font-weight: 900; font-stretch: 62%;
  font-size: 6.6cqi; line-height: 0.9; letter-spacing: 0.005em; text-wrap: balance; margin: 0;
}
.cover .small { font-size: 17px; line-height: 1.45; opacity: .78; }

/* ---------- the running series: one row a post, newest first ---------- */
.posts { margin-top: 28px; border-bottom: 1px solid var(--line); }
.posts > a { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 6px 28px; border-top: 1px solid var(--line); padding: 18px 0 20px; }
.posts h3 { margin: 0; font-size: 21px; line-height: 1.3; letter-spacing: -0.015em; font-weight: 500; text-wrap: balance; transition: color .2s ease, text-shadow .3s ease; }
.posts time, .posts .when { font-size: 15px; color: var(--dim); font-variant-numeric: tabular-nums; white-space: nowrap; }
.posts p { grid-column: 1; margin: 0; font-size: 17px; line-height: 1.5; color: var(--dim); }
.posts > a:hover h3, .posts > a:focus-visible h3 { color: var(--accent); text-shadow: 0 0 0.7em color-mix(in srgb, var(--accent) 45%, transparent); }

/* ---------- the newsletter panel ---------- */
.signup {
  display: grid; gap: clamp(20px, 4cqi, 34px); margin-top: 96px; padding: clamp(22px, 3.4cqi, 30px); border-radius: 8px; scroll-margin-top: 110px;
  --ground: var(--accent); --on: #0c0d0c;
  background: var(--ground); color: var(--on);
}
.signup .cover-title { font-size: clamp(40px, 9.6cqi, 82px); }
.signup p { margin: 0; font-size: 18px; line-height: 1.45; text-wrap: pretty; }
.signup form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.signup input, .signup button { font: inherit; font-size: 18px; border-radius: 6px; padding: 12px 16px; min-height: 48px; }
.signup input { min-width: 0; color: var(--on); background: none; border: 1.5px solid var(--on); outline: none; transition: background-color .2s ease; }
.signup input::placeholder { color: color-mix(in srgb, var(--on) 50%, transparent); }
.signup input:focus { background: color-mix(in srgb, #fff 30%, transparent); }
.signup button { cursor: pointer; color: var(--ground); background: var(--on); border: 1.5px solid var(--on); transition: color .2s ease; }
.signup button:hover, .signup button:focus-visible { color: #fff; outline: none; }
.signup .said:empty { display: none; }
.solo .signup { margin-top: 0; }

/* ---------- who wrote this, and the way to the home page ---------- */
.about { margin-top: 40px; border-top: 1px solid var(--line); padding-top: 22px; font-size: 17px; line-height: 1.55; color: var(--dim); text-wrap: pretty; }

/* ---------- the end ---------- */
.end { margin-top: 128px; padding-bottom: 110px; border-top: 1px solid var(--line); padding-top: 56px; }
.end .lead { margin: 0 0 28px; color: var(--text); }
.end .title { transition: color .2s ease, text-shadow .3s ease; font-stretch: 100%; }
.end a:hover .title, .end a:focus-visible .title { color: var(--accent); text-shadow: 0 0 0.35em color-mix(in srgb, var(--accent) 45%, transparent); }
.end > p { margin: 40px 0 0; font-size: 17px; line-height: 1.5; color: var(--dim); }
.foot { margin-top: 96px; padding-bottom: 110px; font-size: 17px; line-height: 1.5; color: var(--dim); }

/* the pill at the top is in nav.css, and written by nav.js */

@media (prefers-reduced-motion: reduce) { a.cover:hover, a.cover:focus-visible { animation: none; } html { scroll-behavior: auto; } }

/* ---------- phones and narrow windows ---------- */
@media (width < 700px) {
  html { --edge: 16px; }
  .page { padding-top: 104px; }
  .page.solo { padding: 96px 0 64px; }
  .lead { margin-top: 32px; }
  .prose { margin-top: 56px; }
  .prose > h2, .part { margin-top: 80px; font-size: 27px; }
  .prose p, .prose li, .plain { font-size: 18px; line-height: 1.6; }
  .prose > blockquote p { font-size: 19px; }
  .prose > .pair { grid-template-columns: minmax(0, 1fr); }
  .rows > div { grid-template-columns: minmax(0, 1fr); }
  .prose > figure { margin: 36px 0; }
  .covers { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .cover { min-height: 78cqi; padding: 6cqi; border-radius: 8px; }
  .cover-title { font-size: 13cqi; }
  .posts > a { grid-template-columns: minmax(0, 1fr); }
  .signup { margin-top: 72px; }
  .signup form { grid-template-columns: minmax(0, 1fr); }
  .end { margin-top: 96px; padding-bottom: 80px; }
  .foot { margin-top: 72px; padding-bottom: 80px; }
}
