/* MOLTEN: shared look for inner pages (the home page carries its own copy inline).
   Pair with /sandpile.js for the header band. */
:root {
  --bg: #0c0908;
  --bg-2: #15100e;
  --line: rgba(255, 214, 170, .12);
  --text: #f3e9df;
  --dim: #a8968a;
  --ember: #e8590c;
  --hot: #ffc36b;
  --display: "Big Shoulders Display", sans-serif;
  --mono: "Martian Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; }
html { background: var(--bg); color: var(--text); }
body { margin: 0; font: 400 17px/1.6 "Schibsted Grotesk", sans-serif; }
a { color: inherit; }
::selection { background: var(--ember); color: var(--bg); }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 clamp(20px, 4vw, 56px); }

/* header band: a short sandpile strip behind the page title */
.band { position: relative; overflow: hidden; isolation: isolate; padding-bottom: clamp(40px, 7vw, 72px); }
.band canvas { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; z-index: -2; }
.band::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, rgba(12,9,8,.9) 0, rgba(12,9,8,0) 90px),
              linear-gradient(90deg, rgba(12,9,8,.92) 0%, rgba(12,9,8,.5) 50%, rgba(12,9,8,.15) 80%),
              linear-gradient(180deg, transparent 75%, var(--bg)); }
nav { display: flex; align-items: center; gap: 28px; padding: 14px clamp(20px, 4vw, 56px); font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
nav .mark { font: 900 22px/1 var(--display); letter-spacing: .02em; text-decoration: none; margin-right: auto; color: var(--text); padding: 8px 8px 8px 0; }
nav a { text-decoration: none; color: var(--dim); transition: color .2s; padding: 10px 0; }
nav a:hover, nav a[aria-current] { color: var(--hot); }
.band .title { padding: clamp(40px, 8vw, 96px) clamp(20px, 4vw, 56px) 0; max-width: 1200px; margin: 0 auto; }
.eyebrow { font: 500 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--hot); display: flex; align-items: center; gap: 12px; }
.eyebrow::before { content: ""; width: 34px; flex: none; height: 1px; background: currentColor; }
.eyebrow { white-space: nowrap; }
.eyebrow.stack { white-space: normal; line-height: 1.5; }
.eyebrow.stack::before { display: none; }
@media (max-width: 480px) { .eyebrow { gap: 8px; } .eyebrow::before { width: 18px; } }
.band h1 { margin: 16px 0 0; font: 900 clamp(72px, 13vw, 180px)/.8 var(--display); text-transform: uppercase; text-shadow: 0 0 40px rgba(232, 89, 12, .35); }
.band .lede { margin: 22px 0 0; max-width: 40ch; font-size: clamp(17px, 1.7vw, 21px); line-height: 1.45; }

/* sections */
section { padding: clamp(56px, 8vw, 96px) 0 0; }
.sec-head { display: flex; align-items: baseline; gap: 18px; margin-bottom: 30px; }
.sec-head h2 { margin: 0; font: 800 clamp(36px, 5vw, 60px)/.9 var(--display); text-transform: uppercase; }
.sec-head .idx { font: 500 11px/1 var(--mono); color: var(--ember); letter-spacing: .1em; }
.sec-head .rule { flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); align-self: center; }

/* tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.tile { position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; min-height: 220px; padding: 24px; border-radius: 6px; text-decoration: none; overflow: hidden; border: 1px solid var(--line); background: var(--bg-2); isolation: isolate; transition: border-color .3s, transform .3s; }
a.tile:hover { border-color: rgba(255, 195, 107, .45); transform: translateY(-3px); }
.tile::before { content: ""; position: absolute; inset: auto -20% -60% -20%; height: 120%; z-index: -1; opacity: 0; transition: opacity .5s, transform .6s;
  background: radial-gradient(ellipse at 50% 100%, rgba(232, 89, 12, .5), rgba(122, 29, 8, .22) 45%, transparent 70%); transform: translateY(20%); }
a.tile:hover::before { opacity: 1; transform: none; }
.tile .k { font: 500 10px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ember); }
.tile h3 { margin: 0; font: 800 34px/.95 var(--display); text-transform: uppercase; }
.tile p { margin: 0; color: var(--dim); font-size: 15px; max-width: 52ch; }
.tile .badge { position: absolute; top: 18px; right: 18px; font: 500 10px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; padding: 6px 9px; border-radius: 99px; background: rgba(12,9,8,.6); border: 1px solid rgba(255,255,255,.2); }
.tile .arrow { position: absolute; top: 22px; right: 22px; font: 500 18px/1 var(--mono); transition: transform .3s; }
a.tile:hover .arrow { transform: translate(4px, -4px); color: var(--hot); }
.tile.has-img { min-height: 300px; }
.tile.has-img .bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform .9s cubic-bezier(.2,.7,.2,1); }
.tile.has-img::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(12,9,8,.05) 30%, rgba(12,9,8,.94)); }
a.tile.has-img:hover .bg { transform: scale(1.04); }
.tile.has-img .k { color: var(--hot); }
.tile.big { grid-column: 1 / -1; min-height: clamp(320px, 38vw, 460px); }
.tile.big h3 { font-size: clamp(40px, 5vw, 64px); }
.tiles.two { grid-template-columns: repeat(2, 1fr); }
/* stacked tile: 16:9 image on top, text underneath (for images that carry their own text) */
.tile.stack { justify-content: flex-start; gap: 0; min-height: 0; padding: 0; }
.tile.stack::after { display: none; }
.tile.stack .media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-bottom: 1px solid var(--line); }
.tile.stack .media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .9s cubic-bezier(.2,.7,.2,1); }
a.tile.stack:hover .media img { transform: scale(1.04); }
.tile.stack .txt { display: flex; flex-direction: column; gap: 8px; padding: 20px 24px 24px; }
.tile.stack .k { color: var(--ember); }
.more { display: inline-block; margin-top: 12px; padding: 8px 0; font: 500 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); text-decoration: none; }
.more:hover { color: var(--hot); }

/* ---------- writing: post header + long-form prose ---------- */
.band.post .title { max-width: 820px; }
.band.post h1 { font-size: clamp(48px, 8vw, 104px); line-height: .86; }
.band.post .lede { max-width: 46ch; color: #dccfc3; }
.measure { max-width: 820px; margin: 0 auto; padding: 0 clamp(20px, 4vw, 56px); }
main.measure { padding-top: clamp(36px, 5vw, 56px); }
.back { display: inline-block; padding: 8px 0; margin-bottom: 18px; font: 500 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); text-decoration: none; }
.back:hover { color: var(--hot); }

.prose { font-size: 18.5px; line-height: 1.72; color: #e2d6cb; }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol, .prose table, .prose pre, .prose blockquote { margin: 0 0 20px; }
.prose a { color: var(--hot); text-decoration-color: rgba(255, 195, 107, .4); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--hot); }
.prose strong { color: var(--text); font-weight: 700; }
.prose em { color: var(--hot); font-style: italic; }
.prose h2 { margin: 72px 0 20px; padding-top: 22px; border-top: 1px solid var(--line); font: 800 clamp(34px, 4.4vw, 50px)/.95 var(--display); text-transform: uppercase; color: var(--text); }
.prose h2 strong { color: var(--hot); font-weight: 800; }
.prose h3 { margin: 48px 0 14px; font: 700 23px/1.25 "Schibsted Grotesk", sans-serif; color: var(--text); }
.prose h4 { margin: 36px 0 12px; font: 500 12px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ember); }
.prose h2[id], .prose h3[id], .prose h4[id] { scroll-margin-top: 24px; }
.prose ul, .prose ol { padding-left: 1.7em; }
.prose li { margin-bottom: 8px; padding-left: .2em; }
.prose li::marker { color: var(--ember); font-family: var(--mono); font-size: .85em; }
.prose code { font: 400 .82em/1 var(--mono); padding: .2em .4em; border-radius: 4px; background: var(--bg-2); border: 1px solid var(--line); color: var(--hot); }
.prose pre { padding: 18px 22px; border-radius: 6px; background: var(--bg-2); border: 1px solid var(--line); overflow-x: auto; }
.prose pre code { padding: 0; border: 0; background: none; font-size: 14px; line-height: 1.7; color: #e2d6cb; }
/* blockquotes in these posts are prompts typed to an AI: show them as a prompt line */
.prose blockquote { position: relative; padding: 16px 20px 16px 44px; border-radius: 6px; background: var(--bg-2); border: 1px solid var(--line); border-left: 2px solid var(--ember);
  font: 400 14.5px/1.7 var(--mono); color: #d6c8bb; }
.prose blockquote::before { content: "›"; position: absolute; left: 18px; top: 13px; font: 500 18px/1.4 var(--mono); color: var(--ember); }
.prose blockquote p { margin: 0 0 10px; } .prose blockquote p:last-child { margin: 0; }
.prose figure { margin: 36px 0; }
@media (min-width: 1000px) { .prose figure { margin: 44px -90px; } }
.prose figure img, .prose figure video { display: block; width: 100%; height: auto; border-radius: 6px; border: 1px solid var(--line); background: var(--bg-2); }
.prose figcaption { margin-top: 12px; text-align: center; font: 400 12px/1.6 var(--mono); color: var(--dim); }
.prose figcaption em { color: inherit; }
.prose figcaption a { display: inline-block; padding: 6px 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: 16px; display: block; overflow-x: auto; }
.prose thead th { font: 500 11px/1.3 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); text-align: left; }
.prose th, .prose td { padding: 12px 16px 12px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose td:last-child, .prose th:last-child { text-align: right; padding-right: 0; white-space: nowrap; }
.prose tbody tr:last-child td { border-bottom: 0; }
.prose hr { border: 0; height: 1px; background: var(--line); margin: 48px 0; }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 72px; padding-top: 28px; border-top: 1px solid var(--line); }
.post-nav a { display: block; padding: 18px 20px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg-2); text-decoration: none; transition: border-color .3s; }
.post-nav a:hover { border-color: rgba(255, 195, 107, .45); }
.post-nav span { display: block; margin-bottom: 8px; font: 500 10px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ember); }
.post-nav b { font: 800 22px/1 var(--display); text-transform: uppercase; }
.post-nav .next { text-align: right; }

/* plain rows for things without a page */
.rows { border-top: 1px solid var(--line); }
.row { display: grid; grid-template-columns: minmax(200px, 1fr) 2fr; gap: 8px 32px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.row h3 { margin: 0; font: 800 24px/1.05 var(--display); text-transform: uppercase; }
.row p { margin: 0; color: var(--dim); font-size: 15px; }

footer { margin-top: clamp(72px, 10vw, 120px); border-top: 1px solid var(--line); padding: 40px 0 44px; background: radial-gradient(ellipse at 50% 160%, rgba(232, 89, 12, .25), transparent 60%); }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px; font: 400 12px/1.6 var(--mono); color: var(--dim); }
footer a { text-decoration: none; display: inline-block; padding: 6px 0; } footer a:hover { color: var(--hot); }
footer .links { display: flex; gap: 22px; }

.rise { opacity: 0; transform: translateY(18px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.7,.2,1); }
.rise.in { opacity: 1; transform: none; }
.load { opacity: 0; animation: load 1s cubic-bezier(.2,.7,.2,1) forwards; }
@keyframes load { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .load, .rise { animation: none; opacity: 1; transform: none; transition: none; } }

@media (max-width: 760px) {
  nav { gap: 18px; }
  nav a:not(.mark):not(.keep) { display: none; }
  .row { grid-template-columns: 1fr; }
  .tiles.two { grid-template-columns: 1fr; }
  .post-nav { grid-template-columns: 1fr; }
  .prose { font-size: 17.5px; }
  .prose pre code { white-space: pre-wrap; overflow-wrap: anywhere; }
  .tile.big { min-height: 470px; }
  .tile.big .bg { object-position: 50% 0; height: 62%; }
  .tile.big::after { background: linear-gradient(180deg, rgba(12,9,8,0) 30%, var(--bg-2) 62%); }
}
