/* whose-milk — the CosmicFlow Archives theme (same tokens as cosmicflow.app and every *.cosmicflow.app archive:
   zen-light = sand + slate ink + brown accent · sun = parchment + terracotta). Phone first: most visitors
   arrive from LinkedIn on a phone. */
[data-theme="zen-light"] {
  color-scheme: light;
  --background: #f6f4ee; --card: #ffffff; --card-2: #f9f8f4;
  --text: #1c2431; --text-muted: #5b6573; --text-faint: #5f6874;
  --border: #dcd8cc; --border-strong: #b9b4a5;
  --accent: #8a4b1d; --accent-ink: #ffffff; --accent-soft: #f4e6d6; --accent-2: #8a6d3b;
  --shadow: 0 1px 2px rgba(28, 36, 49, 0.06), 0 8px 24px -16px rgba(28, 36, 49, 0.25);
  --header-bg: rgba(246, 244, 238, 0.97);
  --title: linear-gradient(100deg, #7c3a12 0%, #b5532b 45%, #e0a336 100%);
}
[data-theme="sun"] {
  color-scheme: light;
  --background: #f8efe1; --card: #fff8ec; --card-2: #fdf3e4;
  --text: #3b2416; --text-muted: #7a5a3f; --text-faint: #7a5b3f;
  --border: #e6cfb0; --border-strong: #cfa97e;
  --accent: #b5532b; --accent-ink: #fff8ec; --accent-soft: #f7dcc6; --accent-2: #9a5a2a;
  --shadow: 0 1px 2px rgba(90, 50, 20, 0.08), 0 10px 28px -16px rgba(181, 83, 43, 0.35);
  --header-bg: rgba(248, 239, 225, 0.97);
  --title: linear-gradient(100deg, #9a2f18 0%, #c2410c 45%, #f2b134 100%);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text); line-height: 1.55; -webkit-font-smoothing: antialiased; overflow-x: hidden;
  background: radial-gradient(48rem 24rem at 100% -10%, rgba(138, 75, 29, 0.10), transparent 60%), var(--background);
  background-attachment: fixed;
}
[data-theme="sun"] body {
  background: radial-gradient(50rem 26rem at 8% -10%, rgba(224, 163, 54, 0.22), transparent 60%), radial-gradient(40rem 24rem at 100% 0%, rgba(181, 83, 43, 0.14), transparent 55%), var(--background);
}
a { color: inherit; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--accent-soft); }

.card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border: 1px solid var(--border-strong);
  background: var(--card); color: var(--text); border-radius: 999px; padding: .55rem 1rem; font: 600 .9rem/1.2 inherit;
  min-height: 2.75rem; text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--accent); color: var(--text); }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-primary:hover { color: var(--accent-ink); filter: brightness(1.06); }
.eyebrow { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; color: var(--accent-2); margin: 0 0 .4rem; }

/* header: the way home (CosmicFlow mark), jump links, theme */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: .5rem; padding: .5rem 16px;
  background: var(--background); border-bottom: 1px solid var(--border); }
.home { display: inline-flex; align-items: center; gap: .45rem; text-decoration: none; font-weight: 700; min-height: 44px; }
.home span { display: none; font-size: .9rem; }
.jump { display: flex; gap: .25rem; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.jump::-webkit-scrollbar { display: none; }
.jump a { white-space: nowrap; text-decoration: none; font-size: .85rem; font-weight: 600; padding: .5rem .5rem; border-radius: 999px; min-height: 44px; display: inline-flex; align-items: center; }
.jump a:hover { background: var(--accent-soft); }
.theme { min-width: 44px; padding: 0; font-size: 1.1rem; }
.jump .long { display: none; }
@media (min-width: 560px) { .home span { display: inline; } .jump .long { display: inline; } }

main, footer { width: 100%; max-width: min(94vw, 1180px); margin: 0 auto; padding: 0 16px; }
section { padding: 1.6rem 0 .6rem; scroll-margin-top: 64px; }
h1 { font-family: "Baloo 2", Inter, system-ui, sans-serif; font-weight: 800; font-size: clamp(2.6rem, 11vw, 4.6rem); line-height: 1; margin: .2rem 0 .8rem;
  background: var(--title); -webkit-background-clip: text; background-clip: text; color: transparent; }
h2 { font-family: "Baloo 2", Inter, system-ui, sans-serif; font-size: clamp(1.45rem, 5.5vw, 2rem); line-height: 1.15; margin: 0 0 .6rem; }
.lead { font-size: 1.05rem; color: var(--text); max-width: 62ch; margin: 0 0 1rem; }
.intro { color: var(--text-muted); max-width: 70ch; margin: 0 0 1rem; }

/* snapshot tiles: one column on a phone (these are sentences), two from 560px */
.snapshot { display: grid; grid-template-columns: 1fr; gap: .6rem; }
@media (min-width: 560px) { .snapshot { grid-template-columns: 1fr 1fr; } }
@media (min-width: 980px) { .beat .snapshot { grid-template-columns: repeat(3, 1fr); } }
.snap { border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 10px; padding: .65rem .85rem; background: var(--card-2); min-width: 0; }
.snap-k { font-size: .64rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-2); font-weight: 700; margin-bottom: .15rem; }
.snap-v { font-size: .92rem; line-height: 1.45; overflow-wrap: anywhere; }

/* the call: embed + quote; stacked on a phone */
.call-grid { display: grid; gap: .9rem; grid-template-columns: 1fr; }
@media (min-width: 900px) { .call-grid { grid-template-columns: 520px 1fr; align-items: start; } }
.embed { overflow: hidden; padding: 0; }
.embed iframe { display: block; width: 100%; max-width: 100%; height: 560px; border: 0; background: #fff; }
.quote { padding: 1rem 1.1rem; }
.quote .q { font-size: 1.05rem; font-style: italic; margin: 0 0 .4rem; }
.quote .who { color: var(--text-muted); margin: 0 0 .8rem; font-size: .9rem; }
.cta { white-space: normal; text-align: center; }

/* gallery: 2 per row on a phone, the caption carries the full line (carton print is small) */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem; } }
@media (min-width: 1040px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tee { margin: 0; overflow: hidden; display: flex; flex-direction: column; }
.tee a { display: block; background: var(--card-2); }
.tee img { display: block; width: 100%; height: auto; }
.tee figcaption { padding: .5rem .6rem .7rem; display: flex; flex-direction: column; gap: .2rem; }
.tee .n { font-size: .68rem; font-weight: 700; color: var(--accent-2); letter-spacing: .06em; }
.tee b { font-size: .88rem; line-height: 1.3; }
.tee .idea { font-size: .78rem; line-height: 1.4; color: var(--text-muted); }

/* maker note: top of the page, same shape as the archives' MakerNote */
.maker-note { position: relative; max-width: min(94vw, 1180px); margin: .75rem auto 0; width: calc(100% - 32px);
  background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: .75rem 2.75rem .8rem 1rem; }
.maker-note .kb { display: none; color: var(--accent); flex: 0 0 auto; }
.maker-note .eyebrow { font-size: .66rem; margin: 0 0 .15rem; }
.mn-body { margin: 0; font-size: .875rem; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mn-body span { color: var(--text-muted); }
.maker-note.open .mn-body { -webkit-line-clamp: unset; display: block; }
.maker-note.open .mn-more { display: none; }
.mn-more { background: none; border: 0; padding: .15rem 0; color: var(--accent); font-size: .78rem; text-decoration: underline; cursor: pointer; }
.mn-cta { margin-top: .5rem; min-height: 2.5rem; padding: .45rem .9rem; font-size: .85rem; }
.mn-x { position: absolute; top: .4rem; right: .4rem; width: 2rem; height: 2rem; border: 0; background: none; color: var(--text-muted); font-size: 1.3rem; line-height: 1; border-radius: 999px; cursor: pointer; }
.mn-x:hover { color: var(--text); background: var(--accent-soft); }
@media (min-width: 640px) {
  .maker-note { display: flex; align-items: center; gap: 1rem; }
  .maker-note .kb { display: block; }
  .mn-text { flex: 1; min-width: 0; }
  .mn-body { -webkit-line-clamp: unset; display: block; }
  .mn-more { display: none; }
  .mn-cta { margin-top: 0; flex: 0 0 auto; }
}
.family { color: var(--text); }

/* credit line under the title + footer disclaimer */
.credit { font-size: .9rem; color: var(--text-muted); margin: -.3rem 0 .9rem; }
.credit a { color: var(--accent); }
.disclaimer { background: var(--card-2); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 10px; padding: .8rem .95rem; margin: .4rem 0 1rem; color: var(--text); scroll-margin-top: 72px; }
.disclaimer p { margin: 0 0 .55rem; }
.disclaimer p:last-child { margin-bottom: 0; }
footer { padding: 1rem 16px 2.5rem; color: var(--text-muted); font-size: .85rem; border-top: 1px solid var(--border); }

/* full-size viewer (native <dialog>): full screen, shirt centred, caption under it */
.tee a { cursor: zoom-in; }
.viewer { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; padding: 0; border: 0; background: transparent; color: var(--text); }
.viewer[open] { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem; }
.viewer::backdrop { background: rgba(20, 16, 12, .88); }
.v-fig { margin: 0; width: min(92vw, 560px); background: var(--card); border-radius: 16px; overflow: hidden; box-shadow: 0 20px 60px -20px rgba(0,0,0,.6); }
.v-fig img { display: block; width: 100%; height: auto; max-height: 64dvh; object-fit: contain; background: var(--card-2); cursor: zoom-out; }
.v-fig figcaption { padding: .6rem .9rem .8rem; display: flex; flex-direction: column; gap: .2rem; }
.v-fig .n { font-size: .7rem; font-weight: 700; color: var(--accent-2); }
.v-fig b { font-size: 1rem; line-height: 1.3; }
.v-fig .idea { font-size: .85rem; color: var(--text-muted); }
.v-close { position: fixed; top: max(10px, env(safe-area-inset-top)); right: 12px; width: 48px; height: 48px; border-radius: 999px; border: 0;
  background: rgba(255,255,255,.95); color: #1c2431; font-size: 1.8rem; line-height: 1; cursor: pointer; box-shadow: 0 4px 16px rgba(0,0,0,.3); z-index: 2; }
.v-nav { display: flex; align-items: center; gap: .8rem; }
.v-nav .btn { background: rgba(255,255,255,.95); color: #1c2431; border-color: transparent; }
.v-nav .v-dl { background: var(--accent); color: var(--accent-ink); gap: .45rem; padding: .55rem 1.1rem; }
.v-nav .v-dl:hover { color: var(--accent-ink); filter: brightness(1.08); }
body.noscroll { overflow: hidden; }

/* local-only dev menu */
.dev { position: relative; }
.dev summary { cursor: pointer; font-size: .8rem; font-weight: 600; list-style: none; padding: .4rem .6rem; border: 1px dashed var(--border-strong); border-radius: 8px; }
.devbox { position: absolute; right: 0; top: 2.4rem; width: min(90vw, 420px); background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: .6rem .8rem; font-size: .8rem; box-shadow: var(--shadow); }
.devbox div { margin: .2rem 0; }
