/* THREE TALKING HEADS BLOG — brutalist newspaper, fibonacci boxes.
   Rules: black lines, white paper, zero border-radius. */

:root {
  --mast-h: clamp(5rem, 13vw, 10rem);
  --ink: #000;
  --paper: #fff;
  --line: 1px;
  --accent: #000;
  --accent-light: #666;
  --rule: var(--accent);
  --rule-light: var(--accent-light);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  border-radius: 0 !important;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: Georgia, 'Times New Roman', serif;
  line-height: 1.45;
}

.paper {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- square gif box + long title box ---- */

.masthead-row {
  display: flex;
  height: var(--mast-h);
}

.stamp {
  width: var(--mast-h);
  height: var(--mast-h);
  flex: 0 0 auto;
  border: var(--line) solid var(--rule);
  border-right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.stamp img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* placeholder animation until there's a gif: jerky spinning square */
.stamp-anim {
  width: 55%;
  aspect-ratio: 1 / 1;
  background: var(--accent);
  animation: stamp-spin 1.2s steps(4) infinite;
}

@keyframes stamp-spin {
  to { transform: rotate(360deg); }
}

.masthead {
  flex: 1 1 auto;
  min-width: 0;
  height: var(--mast-h);
  border: var(--line) solid var(--rule);
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* wordmark: plain typewriter mono, lowercase, single ink —
   inspo: thecreativeindependent.com */
.masthead h1 {
  font-family: Courier, 'Courier New', monospace;
  font-weight: 700;
  font-size: clamp(1.3rem, 5vw, 4rem);
  text-transform: lowercase;
  text-align: center;
  white-space: nowrap;
  color: var(--ink);
}

.masthead .t-con,
.masthead .t-conga {
  color: var(--ink);
}

/* ---- fibonacci grid: 13 x 8 golden rectangle ----
   Each article declares data-fib="8|5|3|2|1" and spans that
   many tracks both ways; dense flow packs them into the spiral:
   8x8 square | 5x5 square
              | 3x3 | 2x2
              |     | 1,1  */

.fib {
  /* left border continues the gif box's right border down the page;
     right margin mirrors it so both gutters are identical */
  margin: 0 var(--mast-h);
  flex: 1 1 auto;                  /* fill viewport between header and footer */
  display: grid;
  grid-template-columns: repeat(13, 1fr);
  grid-template-rows: repeat(8, minmax(3.2rem, 1fr));
  grid-auto-flow: dense;
  gap: var(--line);
  background: var(--rule);         /* gap becomes the line */
  border: var(--line) solid var(--rule);
  border-top: 0;
  border-bottom: 0;
}

.box {
  background: var(--paper);
  padding: 1rem;
  overflow: hidden;
}

/* dithered gradient backgrounds: white at top into dense ink color at the
   bottom, where the paper-white title sits */
.box[data-dither] {
  background-size: 100% 100%;
  image-rendering: pixelated;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  /* size (not inline-size) containment so cqh caps the type against box height */
  container-type: size;
}
.box[data-dither="drownings"]   { background-image: url(/img/dither/drownings.png); }
.box[data-dither="elnino"]      { background-image: url(/img/dither/elnino.png); }
.box[data-dither="ssta"]        { background-image: url(/img/dither/ssta.png); }
.box[data-dither="longwalk"]    { background-image: url(/img/dither/longwalk.png); }
.box[data-dither="declaration"] { background-image: url(/img/dither/sqblack.png); }
.box[data-dither="sq1"]         { background-image: url(/img/dither/sq1.gif); }
.box[data-dither="sq2"]         { background-image: url(/img/dither/sqblack.png); }

.box[data-dither] h2 {
  color: var(--paper);
  margin: 0;
}

/* poster type: sized to the box via container units, tuned per title;
   the cqh term caps total line height so text never overflows the box */
[data-dither][data-fib="8"] h2 { font-size: min(16cqw, 19cqh); }
[data-dither][data-fib="5"] h2 { font-size: min(14cqw, 20cqh); }
[data-dither][data-fib="3"] h2 { font-size: min(14cqw, 20cqh); }
[data-dither][data-fib="2"] h2 { font-size: min(12cqw, 13cqh); }
[data-dither][data-fib="1"] h2 { font-size: min(13cqw, 12cqh); color: var(--ink); }
[data-dither][data-fib="1"] { justify-content: flex-start; }

a.box {
  color: var(--ink);
  text-decoration: none;
}

[data-fib="8"] { grid-column: span 8; grid-row: span 8; }
[data-fib="5"] { grid-column: span 5; grid-row: span 5; }
[data-fib="3"] { grid-column: span 3; grid-row: span 3; }
[data-fib="2"] { grid-column: span 2; grid-row: span 2; }
[data-fib="1"] { grid-column: span 1; grid-row: span 1; }

.tag {
  display: inline-block;
  font-family: 'Courier New', monospace;
  font-size: 0.65rem;
  border: var(--line) solid var(--rule);
  padding: 0.1rem 0.4rem;
  margin-bottom: 0.6rem;
}

.box h2 {
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 900;
  -webkit-text-stroke-width: 0.02em;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin-bottom: 0.5rem;
  color: var(--ink);
}

.box h2 .t1 {
  color: var(--accent);
}

.box a {
  color: inherit;
  text-decoration: none;
}

.box a:hover { text-decoration: underline; }

[data-fib="8"] h2 { font-size: 2.4rem; }
[data-fib="5"] h2 { font-size: 1.5rem; }
[data-fib="3"] h2 { font-size: 1.1rem; }
[data-fib="2"] h2 { font-size: 0.9rem; }
[data-fib="1"] h2 { font-size: 0.7rem; margin: 0; }
[data-fib="1"] { padding: 0.5rem; }
[data-fib="1"] .tag { margin-bottom: 0.3rem; }

.meta {
  font-family: 'Courier New', monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  border-bottom: var(--line) solid var(--rule);
  padding-bottom: 0.4rem;
  margin-bottom: 0.6rem;
}

.box p { margin-bottom: 0.6rem; }

.more {
  font-family: 'Courier New', monospace;
  font-size: 0.75rem;
  font-weight: bold;
}

/* ---- colophon ---- */

.colophon {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border: var(--line) solid var(--rule);
  padding: 0.35rem 1rem;
  font-family: 'Courier New', monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
}

/* ---- small screens: stack ---- */

@media (max-width: 720px) {
  .fib { display: block; border: 0; background: none; margin: 0; }
  /* stacked boxes are content-sized: size containment would collapse them */
  .box[data-dither] {
    container-type: inline-size;
    min-height: 6rem;
  }
  .box { border: var(--line) solid var(--rule); border-bottom: 0; }
  .fib > .box:last-child { border-bottom: var(--line) solid var(--rule); }
  .masthead h1 { white-space: normal; }
}
