/* The Ambit - editorial print cover
   palette: white base, black ink, tomato accent, retro clock in VT323
   the whole cover fits the viewport: no page scroll. */

:root {
  --paper: #fdfdfb;
  --ink: #141414;
  --accent: #e63e23;
  --muted: #3c3c3c;
  --hairline: 1.5px solid var(--ink);
  --serif: "Fraunces", "Georgia", serif;
  --sans: "Inter", "Helvetica Neue", Arial, sans-serif;
  --pixel: "VT323", monospace;
}

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

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  display: flex;
  justify-content: center;
  padding: clamp(10px, 2vh, 20px) 16px;
  -webkit-font-smoothing: antialiased;
}

.cover {
  width: 100%;
  max-width: 860px;
  height: 100%;
  display: flex;
  flex-direction: column;
  border: var(--hairline);
  padding: 0 clamp(14px, 4vw, 44px);
  overflow: hidden;
}

/* top strip: dateline / coming soon / retro clock */
.strip {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: clamp(6px, 1.2vh, 10px) 0;
  border-bottom: var(--hairline);
  font-size: 12px;
  letter-spacing: 0.04em;
  flex: none;
}

.dateline { font-weight: 500; }

.issue-tag {
  color: var(--accent);
  font-weight: 600;
}

.clock {
  font-family: var(--pixel);
  font-size: 18px;
  line-height: 1;
}

/* masthead */
.masthead {
  text-align: center;
  padding: clamp(10px, 3.2vh, 42px) 0 clamp(8px, 2vh, 24px);
  flex: none;
}

.wordmark {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(44px, min(14vw, 15vh), 128px);
  line-height: 0.92;
  letter-spacing: -0.02em;
}

.tagline {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(15px, min(3vw, 2.6vh), 22px);
  color: var(--accent);
  margin-top: clamp(6px, 1.2vh, 12px);
}

/* folio line under the masthead, like vol/no/price on a cover */
.folio {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: var(--hairline);
  border-bottom: var(--hairline);
  padding: clamp(5px, 0.9vh, 8px) 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  flex: none;
}

/* two-column magazine body: lead story + contents sidebar */
.body-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  border-bottom: var(--hairline);
  overflow: hidden;
}

.story {
  padding: clamp(12px, 3vh, 36px) clamp(16px, 3.5vw, 36px) clamp(12px, 3vh, 36px) 0;
  border-right: var(--hairline);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(10px, 1.8vh, 16px);
  min-height: 0;
}

.kicker {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.headline {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(26px, min(6vw, 5.4vh), 48px);
  line-height: 1.05;
}

.cursor {
  color: var(--accent);
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.standfirst {
  font-size: clamp(13px, min(2.3vw, 1.8vh), 16px);
  line-height: 1.55;
  max-width: 46ch;
  color: var(--muted);
}

.standfirst::first-letter {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 3.1em;
  float: left;
  line-height: 0.82;
  padding: 4px 8px 0 0;
  color: var(--ink);
}

.cta {
  display: inline-block;
  padding: clamp(9px, 1.4vh, 12px) 22px;
  border: var(--hairline);
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.02em;
  transition: background 120ms ease, color 120ms ease;
}

.cta:hover, .cta:focus-visible {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--paper);
}

/* sidebar: table of contents + pull quote */
.sidebar {
  padding: clamp(12px, 3vh, 36px) 0 clamp(12px, 3vh, 36px) clamp(16px, 3.5vw, 36px);
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.5vh, 14px);
  min-height: 0;
}

.section-head {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border-bottom: var(--hairline);
  padding-bottom: clamp(5px, 0.9vh, 8px);
}

.toc {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: clamp(5px, 1.1vh, 10px);
}

.toc li {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 13px;
}

.toc-title { flex: none; max-width: 75%; }

.toc li::after {
  content: "";
  flex: 1;
  order: 1;
  border-bottom: 1.5px dotted var(--ink);
  transform: translateY(-3px);
}

.toc-page {
  order: 2;
  font-family: var(--serif);
  font-weight: 600;
}

.toc-note {
  font-size: 11px;
  font-style: italic;
  color: var(--muted);
}

.pull {
  margin-top: auto;
  border: var(--hairline);
  padding: clamp(10px, 1.8vh, 16px) clamp(12px, 2vh, 18px);
}

.pull p {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(16px, min(2.6vw, 2.2vh), 21px);
  line-height: 1.3;
}

.pull cite {
  display: block;
  margin-top: clamp(5px, 0.9vh, 8px);
  font-family: var(--sans);
  font-style: normal;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

/* contents: social links as a magazine index row */
.contents {
  display: flex;
  flex-wrap: wrap;
  border-bottom: var(--hairline);
  flex: none;
}

.contents a {
  flex: 1 1 auto;
  text-align: center;
  padding: clamp(7px, 1.4vh, 12px) 8px;
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  border-right: var(--hairline);
  transition: background 120ms ease, color 120ms ease;
}

.contents a:last-child { border-right: none; }

.contents a:hover, .contents a:focus-visible {
  background: var(--ink);
  color: var(--paper);
}

/* colophon: barcode + issue info */
.colophon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: clamp(8px, 1.5vh, 14px) 0;
  flex: none;
}

.barcode {
  width: 96px;
  height: clamp(20px, 3vh, 28px);
  flex: none;
  image-rendering: pixelated;
}

.colophon-lines {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  justify-content: flex-end;
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--muted);
}

/* phone tweaks: single column, trim decoration so it still fits one screen */
@media (max-width: 640px) {
  .body-grid { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .story {
    border-right: none;
    border-bottom: var(--hairline);
    padding-right: 0;
  }
  .sidebar { padding-left: 0; }
  .pull { display: none; }
  .toc-note { margin-top: auto; }
}

@media (max-width: 480px) {
  .folio span:nth-child(2) { display: none; }
  .colophon { gap: 10px; }
  .colophon-lines { font-size: 10px; gap: 4px 10px; }
}

/* very short screens: drop the toc note too */
@media (max-height: 700px) and (max-width: 640px) {
  .toc-note { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .cursor { animation: none; }
  .cta, .contents a { transition: none; }
}
