/* greymurality: inner pages (lines, writing, play, 404).
   Same family as the home page: colour-magazine blocks lifted from the hero
   photo, Big Shoulders for display, Instrument Serif for voice, Karla to read.
   Mobile first. */

@font-face { font-family: "Karla Fallback"; src: local("Arial"), local("Roboto"), local("Helvetica Neue"); size-adjust: 97%; ascent-override: 92%; descent-override: 26%; line-gap-override: 0%; }
@font-face { font-family: "Instrument Serif Fallback"; src: local("Georgia"), local("Noto Serif"), local("Times New Roman"); size-adjust: 86%; ascent-override: 102%; descent-override: 26%; }
@font-face { font-family: "Big Shoulders Fallback"; src: local("Arial Narrow"), local("Roboto Condensed"), local("Arial"); size-adjust: 82%; ascent-override: 100%; descent-override: 20%; }

:root {
  --night:   #22150d;
  --night-2: #2e1d12;
  --cream:   #f6ecd8;
  --cream-2: #fbf4e6;
  --ink:     #2b1d14;
  --soft:    #5c5046;   /* 6.6:1 on cream */
  --hair:    rgba(58, 36, 22, .16);
  --teal-d:  #164f4b;   /* cream on it 8.6:1 */
  --teal:    #1d6560;
  --terra:   #a8431a;   /* cream on it 5.3:1 */
  --mustard: #d9a21b;   /* ink on it 8.0:1 */

  --name:  "Big Shoulders Display", "Big Shoulders Fallback", "Arial Narrow", sans-serif;
  --serif: "Instrument Serif", "Instrument Serif Fallback", Georgia, serif;
  --body:  "Karla", "Karla Fallback", "Helvetica Neue", Roboto, Arial, sans-serif;

  --gutter: clamp(16px, 4vw, 48px);
  --page: 76rem;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; color-scheme: light; -webkit-tap-highlight-color: transparent; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--cream); color: var(--ink); font: 400 1.0625rem/1.6 var(--body); }
img { max-width: 100%; display: block; }
a { color: inherit; }
a, button { touch-action: manipulation; }
:focus-visible { outline: 3px solid var(--mustard); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--mustard); color: var(--ink); }
.wrap { width: 100%; max-width: var(--page); margin-inline: auto; padding-inline: var(--gutter); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: var(--gutter); top: -60px; z-index: 50; padding: .6rem 1rem; border-radius: 999px; background: var(--cream); color: var(--night); font-weight: 700; text-decoration: none; }
.skip:focus { top: 10px; }

/* ---------- top bar ---------- */
.bar { position: sticky; top: 0; z-index: 30; background: rgba(246, 236, 216, .94); -webkit-backdrop-filter: saturate(1.2) blur(10px); backdrop-filter: saturate(1.2) blur(10px); box-shadow: 0 1px 0 var(--hair); }
.bar .wrap { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding-top: env(safe-area-inset-top, 0px); }
.bar a { text-decoration: none; font-weight: 700; font-size: .9375rem; min-height: 48px; display: inline-flex; align-items: center; }
.bar .mark { font: 900 1.25rem/1 var(--name); text-transform: lowercase; letter-spacing: .01em; }
.bar .mark span { color: var(--terra); }
.bar nav { display: flex; gap: 1.1rem; }
.bar nav a { font-weight: 600; }
.bar nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.bar a:active { opacity: .6; }

/* ---------- blocks ---------- */
.blk { position: relative; padding-block: clamp(56px, 10vw, 120px); overflow: clip; }
.blk--teal  { background: var(--teal-d); color: var(--cream); }
.blk--brown { background: var(--night); color: var(--cream); }
.blk--mustard { background: var(--mustard); color: var(--ink); }
.blk--cream { background: var(--cream); color: var(--ink); }
.folio { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; font: 700 .8125rem/1 var(--body); padding-bottom: .9rem; border-bottom: 2px solid currentColor; margin-bottom: clamp(24px, 5vw, 48px); }
.folio b { font: 900 clamp(2rem, 7vw, 3.2rem)/.8 var(--name); }
.hd { margin: 0; font: 900 clamp(3.2rem, 14vw, 8.5rem)/.86 var(--name); text-transform: uppercase; letter-spacing: -.01em; text-wrap: balance; }
.hd em { font: italic 400 .6em/1 var(--serif); text-transform: none; letter-spacing: 0; }
.dek { margin: 1rem 0 0; max-width: 38rem; font: italic 400 clamp(1.25rem, 3vw, 1.6rem)/1.3 var(--serif); }

/* the cricket ball, as a small mark (inline SVG via .ball) */
.ball { display: inline-block; width: 1em; height: 1em; vertical-align: -.12em; }
.ball svg { width: 100%; height: 100%; display: block; }
.hero-ball { position: absolute; right: var(--gutter); bottom: clamp(20px, 4vw, 44px); width: clamp(40px, 9vw, 72px); height: clamp(40px, 9vw, 72px); filter: drop-shadow(0 4px 6px rgba(0,0,0,.3)); }
@media (prefers-reduced-motion: no-preference) {
  .hero-ball { animation: drop 1.4s var(--ease-out) both; }
  @keyframes drop {
    0%   { transform: translateY(-160px) rotate(-200deg); opacity: 0; }
    35%  { transform: translateY(0) rotate(-60deg) scale(1.06, .92); opacity: 1; }
    55%  { transform: translateY(-34px) rotate(-20deg); }
    72%  { transform: translateY(0) scale(1.03, .96); }
    86%  { transform: translateY(-8px); }
    100% { transform: translateY(0) rotate(0); }
  }
}

/* ---------- forty lines ---------- */
.lines { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(14px, 2.4vw, 22px); }
@media (min-width: 760px) { .lines { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.line { position: relative; background: var(--cream-2); color: var(--ink); border: 2px solid var(--ink); border-radius: 14px; padding: 1.1rem 1.15rem 1.2rem 4.3rem; box-shadow: 4px 4px 0 var(--ink); }
.line .n { position: absolute; left: 1rem; top: .95rem; font: 900 2rem/.9 var(--name); color: var(--terra); }
.line p { margin: 0; font: 400 clamp(1.25rem, 2.6vw, 1.45rem)/1.35 var(--serif); text-wrap: pretty; }
.line:nth-child(4n+2) { background: var(--mustard); }
.line:nth-child(4n+2) .n { color: var(--ink); }
.line:nth-child(4n+3) { background: var(--teal-d); color: var(--cream); border-color: var(--teal-d); }
.line:nth-child(4n+3) .n { color: var(--mustard); }
.lines-note { margin-top: clamp(28px, 5vw, 48px); color: var(--soft); max-width: 40rem; }

/* ---------- writing ---------- */
.toc { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.toc li { border-bottom: 2px solid var(--ink); }
.toc a { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .25rem 1.1rem; padding: 1.25rem 0; text-decoration: none; min-height: 48px; }
.toc .n { grid-row: span 3; font: 900 clamp(2.4rem, 8vw, 3.4rem)/.85 var(--name); color: var(--terra); }
.toc .k { font: 700 .8125rem/1.2 var(--body); color: var(--soft); }
.toc .t { font: 400 clamp(1.5rem, 4vw, 2.1rem)/1.12 var(--serif); }
.toc .d { color: var(--soft); max-width: 44rem; }
.toc a:hover .t, .toc a:focus-visible .t { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 2px; }

.essay-head .k { font: 700 .875rem/1.2 var(--body); opacity: .9; margin: 0 0 .9rem; }
.essay-head h1 { margin: 0; font: 900 clamp(2.8rem, 11vw, 6.4rem)/.9 var(--name); text-transform: uppercase; text-wrap: balance; }
.essay-head .dek { color: inherit; opacity: .92; }
.prose { max-width: 65ch; margin-inline: auto; font-size: 1.1875rem; line-height: 1.7; padding-block: clamp(40px, 8vw, 80px); }
.prose p { margin: 0 0 1.25em; text-wrap: pretty; }
.prose h2 { margin: 2em 0 .6em; font: 900 clamp(1.8rem, 5vw, 2.4rem)/1 var(--name); text-transform: uppercase; color: var(--teal-d); }
.prose blockquote { margin: 1.8em 0; padding: 1rem 1.2rem; background: var(--mustard); border: 2px solid var(--ink); border-radius: 12px; box-shadow: 4px 4px 0 var(--ink); font: italic 400 1.45rem/1.3 var(--serif); }
.prose blockquote p:last-child { margin: 0; }
.prose strong { font-weight: 700; }
.prose em { font-style: italic; }
.note-ref { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; min-height: 30px; margin: -6px 0 -6px 2px; padding: 0 6px; border-radius: 999px; color: var(--terra); font-weight: 700; font-size: .85em; cursor: pointer; vertical-align: baseline; }
.note-ref:hover { background: rgba(168, 67, 26, .1); }
.note-ref[aria-expanded="true"] { background: var(--terra); color: var(--cream); }
.note-body { display: none; margin: -.4em 0 1.4em; padding: .9rem 1rem; border-left: 4px solid var(--terra); background: var(--cream-2); font-size: 1rem; line-height: 1.55; color: var(--soft); }
.note-body.open { display: block; }
.pager { display: grid; gap: 12px; padding-block: 0 clamp(48px, 8vw, 80px); max-width: 65ch; margin-inline: auto; }
@media (min-width: 640px) { .pager { grid-template-columns: 1fr 1fr; } }
.pager a { display: grid; gap: .2rem; padding: 1rem 1.1rem; min-height: 48px; background: var(--cream-2); border: 2px solid var(--ink); border-radius: 12px; text-decoration: none; box-shadow: 3px 3px 0 var(--ink); }
.pager a.next { text-align: right; }
.pager small { font-weight: 700; color: var(--soft); }
.pager span { font: 400 1.25rem/1.2 var(--serif); }
.pager a:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }

/* ---------- play ---------- */
.games { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.game { display: grid; gap: .4rem; padding: 1.3rem 1.25rem; background: var(--cream-2); color: var(--ink); border: 2px solid var(--ink); border-radius: 16px; box-shadow: 5px 5px 0 var(--ink); text-decoration: none; min-height: 48px; }
.game .t { font: 900 clamp(2rem, 7vw, 3rem)/.9 var(--name); text-transform: uppercase; }
.game .d { color: var(--soft); }
.game .go { font-weight: 700; color: var(--terra); }
.game:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.soon { margin-top: 1.5rem; font: italic 400 1.35rem/1.3 var(--serif); opacity: .9; }

/* ---------- 404 ---------- */
.lost { min-height: 70svh; display: grid; align-content: center; }
.lost .btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 1.6rem; }

/* ---------- buttons + footer ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 1.2rem; border-radius: 999px; border: 2px solid currentColor; font-weight: 700; text-decoration: none; transition: transform .12s var(--ease-out); }
.btn.solid { background: var(--cream); color: var(--night); border-color: var(--cream); }
.btn:active { transform: translateY(1px) scale(.98); }

.foot { background: var(--night); color: var(--cream); padding: clamp(48px, 8vw, 88px) 0 calc(32px + env(safe-area-inset-bottom, 0px)); }
.foot .lead { margin: 0 0 1.2rem; font: italic 400 1.5rem/1.25 var(--serif); color: var(--mustard); }
.foot .contact { display: flex; flex-wrap: wrap; gap: 10px; }
.foot .contact a { display: inline-flex; align-items: center; min-height: 48px; padding: 0 1.1rem; border-radius: 999px; border: 2px solid rgba(246, 236, 216, .55); text-decoration: none; font-weight: 700; transition: transform .12s var(--ease-out); }
.foot .contact a:first-child { background: var(--cream); color: var(--night); border-color: var(--cream); }
.foot .contact a:active { transform: translateY(1px) scale(.98); }
.foot .phone-line { margin: 1rem 0 0; color: rgba(246, 236, 216, .85); }
.foot .phone-line a { text-underline-offset: 4px; display: inline-flex; min-height: 44px; align-items: center; }
.foot .links { display: flex; flex-wrap: wrap; gap: .25rem 1.2rem; margin: 2rem 0 0; padding: 1.2rem 0 0; border-top: 1px solid rgba(246, 236, 216, .16); list-style: none; }
.foot .links a { display: inline-flex; min-height: 44px; align-items: center; font-weight: 600; text-decoration: none; }
.foot .links a:hover { text-decoration: underline; }
.foot .copy { margin: .6rem 0 0; font-size: .875rem; color: rgba(246, 236, 216, .7); }
/* leave room under the hero text for the resting ball */
.blk:has(> .hero-ball) { padding-bottom: calc(clamp(56px, 10vw, 120px) + clamp(40px, 9vw, 72px)); }
