/* marblist.ai. The look is lifted from the Adminus landing (degausai/adminus
   apps/landing/src/styles.css): paper, ink, dashed hairlines, the plaque pill and the pixel
   loop, with the orange accent swapped for an emerald that passes WCAG AA (4.53:1 on paper,
   white on it 4.89:1). Fonts are free stand-ins for PP Editorial Old / F37 Bolton (no web
   licence for this domain): Fraunces and Geist, self-hosted, plus Boxing for the wordmark.
   The daily pages are kept plain, like a Substack archive and post. */
:root {
  color-scheme: light;
  --accent: #038249;
  --accent-deep: #026035;
  --body: "Geist", Arial, sans-serif;
  --display: "Fraunces", Georgia, serif;
  --hairline: rgb(29 29 29 / 26%);
  --rule: rgb(29 29 29 / 12%);
  --ink: #1d1d1d;
  --muted: #5a5a5a;
  --page-gutter: max(clamp(22px, 4.5vw, 76px), calc((100vw - 1680px) / 2 + 48px));
  --paper: #f6f6f6;
}

@font-face {
  font-display: swap;
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 100 900;
  src: url("/fonts/fraunces-opsz.woff2") format("woff2-variations");
}

@font-face {
  font-display: swap;
  font-family: "Fraunces";
  font-style: italic;
  font-weight: 100 900;
  src: url("/fonts/fraunces-opsz-italic.woff2") format("woff2-variations");
}

/* static opsz 144 / wght 300 cuts (site/assets/fonts.py) for the hero, so its canvas copy matches */
@font-face {
  font-display: swap;
  font-family: "Fraunces Display";
  font-style: normal;
  font-weight: 300;
  src: url("/fonts/fraunces-display.woff2") format("woff2");
}

@font-face {
  font-display: swap;
  font-family: "Fraunces Display";
  font-style: italic;
  font-weight: 300;
  src: url("/fonts/fraunces-display-italic.woff2") format("woff2");
}

@font-face {
  font-display: swap;
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  src: url("/fonts/geist.woff2") format("woff2-variations");
}

@font-face {
  font-display: swap;
  font-family: "Boxing";
  font-style: normal;
  font-weight: 400;
  src: url("/fonts/boxing.woff2") format("woff2");
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  margin: 0;
  min-width: 320px;
}

a {
  color: inherit;
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

/* ---- header: the wordmark left, Contact right ---- */
.site-nav {
  align-items: center;
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr auto;
  height: 58px;
  margin: 14px var(--page-gutter) 0;
  padding: 0 0 0 clamp(0px, 1.4vw, 20px);
  position: relative;
  z-index: 20;
}

.landing-page .site-nav {
  margin-bottom: -72px;
}

.wordmark {
  align-items: center;
  display: inline-flex;
  font-family: "Boxing", var(--body);
  font-size: 21px;
  gap: 10px;
  letter-spacing: 0.01em;
  line-height: 1;
  text-decoration: none;
  width: max-content;
}

.nav-cta {
  align-items: center;
  background: linear-gradient(180deg, #049253 0%, #038249 52%, #027742 100%);
  border: 0;
  border-radius: 999px;
  box-shadow:
    0 3px 0 var(--accent-deep),
    0 10px 22px -8px rgb(3 130 73 / 55%),
    inset 0 2px 1px rgb(255 255 255 / 42%),
    inset 0 -4px 8px rgb(1 66 35 / 38%);
  color: #fff;
  display: inline-flex;
  font-family: var(--body);
  font-size: 13px;
  font-weight: 600;
  justify-content: center;
  letter-spacing: 0.01em;
  min-height: 40px;
  padding: 0 20px;
  text-decoration: none;
  text-shadow: 0 1px 1px rgb(1 57 29 / 40%);
  transition: background 120ms ease, box-shadow 120ms ease, transform 120ms ease;
  white-space: nowrap;
  width: max-content;
}

.nav-cta:hover,
.nav-cta:focus-visible {
  background: linear-gradient(180deg, #029655 0%, #007340 55%, #016c3c 100%);
  box-shadow:
    0 2px 0 var(--accent-deep),
    0 7px 16px -7px rgb(3 130 73 / 45%),
    inset 0 2px 1px rgb(255 255 255 / 36%),
    inset 0 -3px 7px rgb(1 57 29 / 42%);
  transform: translateY(1px);
}

.nav-cta:active {
  background: linear-gradient(180deg, #007642 0%, #007d46 60%, #02884d 100%);
  box-shadow:
    0 0 0 var(--accent-deep),
    0 2px 6px -3px rgb(3 130 73 / 35%),
    inset 0 3px 5px rgb(0 52 26 / 45%),
    inset 0 -2px 4px rgb(255 255 255 / 16%);
  transform: translateY(3px);
}

/* ---- the landing: one viewport (one A4 sheet in print) ---- */
.landing-page {
  height: 100svh;
  min-height: 720px;
  overflow: hidden;
  position: relative;
}

.hero {
  height: 100%;
  position: relative;
}

.hero-copy {
  left: 50%;
  position: absolute;
  text-align: center;
  top: calc(50% + 30px);
  transform: translate(-50%, -50%);
  width: min(1120px, calc(100% - 40px));
}

.hero-copy h1 {
  font-family: "Fraunces Display", var(--display);
  font-size: clamp(60px, 7vw, 108px);
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 0.96;
  margin: 0;
}

.hero-copy h1 em {
  color: var(--accent);
  font-style: italic;
  font-weight: 300;
  letter-spacing: -0.02em;
}

.subtitle {
  color: var(--muted);
  font-size: clamp(16px, 1.25vw, 19px);
  line-height: 1.5;
  margin: clamp(18px, 1.8vw, 26px) 0 0;
}

/* the word that pixelates (pixel.js draws its canvas over it) */
.pixel-word {
  display: inline-block;
  isolation: isolate;
  position: relative;
  white-space: nowrap;
}

.pixel-word canvas {
  display: block;
  image-rendering: pixelated;
  pointer-events: none;
  position: absolute;
  z-index: 2;
}

.boxes {
  display: grid;
  gap: clamp(14px, 1.6vw, 22px);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: clamp(36px, 4vw, 52px) auto 0;
  max-width: 460px;
}

.box {
  border: 1px dashed var(--hairline);
  display: flex;
  flex-direction: column;
  padding: 20px 20px 16px;
  text-align: left;
  text-decoration: none;
  transition: border-color 140ms ease;
}

.box:hover,
.box:focus-visible {
  border-color: var(--accent);
  border-style: solid;
}

.box-plate {
  align-items: flex-end;
  display: flex;
  height: clamp(84px, 7.5vw, 112px);
  justify-content: center;
}

.box-plate img,
.box-plate canvas {
  display: block;
  height: 100%;
  width: auto;
}

.box-plate canvas {
  image-rendering: pixelated;
}

.box-name {
  font-family: var(--display);
  font-size: clamp(24px, 2.2vw, 30px);
  font-weight: 300;
  letter-spacing: -0.015em;
  line-height: 1;
  margin-top: 14px;
}

.box:hover .box-name {
  color: var(--accent);
}

/* ---- the dailies: a Substack-style archive and post ---- */
.page {
  margin: 0 auto;
  max-width: 728px;
  padding: clamp(48px, 6vw, 80px) 24px 120px;
}

.page > h1 {
  font-family: var(--display);
  font-size: clamp(34px, 3.4vw, 42px);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 20px;
}

.posts {
  border-top: 1px solid var(--rule);
  list-style: none;
  margin: 0;
  padding: 0;
}

.post-row {
  border-bottom: 1px solid var(--rule);
}

.post-row a {
  align-items: center;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr) 112px;
  padding: 22px 0;
  text-decoration: none;
}

.post-title {
  display: block;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.post-row a:hover .post-title {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.post-preview {
  color: var(--muted);
  display: block;
  font-size: 15px;
  line-height: 1.5;
  margin-top: 6px;
}

.post-date {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  margin-top: 10px;
  text-transform: uppercase;
}

.post-thumb {
  aspect-ratio: 4 / 3;
  background: #e9e9e9;
  display: block;
  object-fit: cover;
  width: 112px;
}

/* one edition */
.post-head h1 {
  font-family: var(--display);
  font-size: clamp(32px, 3.6vw, 44px);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.12;
  margin: 0;
  text-wrap: balance;
}

.post-meta {
  border-bottom: 1px solid var(--rule);
  color: var(--muted);
  font-size: 14px;
  margin: 14px 0 0;
  padding-bottom: 22px;
}

.post-body {
  font-size: 18px;
  line-height: 1.6;
  padding-top: 8px;
}

.post-body h2 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 44px 0 4px;
}

.post-body p,
.post-body ul {
  margin: 0 0 12px;
}

.post-body ul {
  padding-left: 1.2em;
}

.post-body li + li {
  margin-top: 12px;
}

.post-body .item {
  margin-top: 26px;
}

.post-body .item > p:first-child {
  margin-bottom: 6px;
}

.post-body a {
  text-decoration-color: var(--hairline);
  text-underline-offset: 3px;
}

.post-body a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

.post-body b {
  font-weight: 600;
}

.post-body img {
  display: block;
  height: auto;
  margin: 8px 0;
  width: 100%;
}

.post-body .heat {
  color: var(--muted);
  font-size: 14px;
}

.post-nav {
  border-top: 1px solid var(--rule);
  display: flex;
  font-size: 15px;
  justify-content: space-between;
  margin-top: 56px;
  padding-top: 20px;
}

.post-nav a {
  color: var(--muted);
  text-decoration: none;
}

.post-nav a:hover {
  color: var(--accent);
}

.not-found {
  text-align: center;
}

.not-found p {
  color: var(--muted);
}

/* ---- responsive ---- */
@media (max-width: 820px) {
  .landing-page {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 100svh;
    overflow: visible;
  }

  .hero {
    align-items: center;
    display: flex;
    flex: 1;
  }

  .site-nav,
  .landing-page .site-nav {
    background: rgb(246 246 246 / 96%);
    border-bottom: 1px solid rgb(29 29 29 / 10%);
    gap: 10px;
    height: 64px;
    margin: 0;
    padding: 9px 16px;
    position: sticky;
    top: 0;
  }

  .wordmark {
    font-size: 18px;
  }

  .hero-copy {
    left: auto;
    padding: 32px 16px 48px;
    position: static;
    transform: none;
    width: auto;
  }

  .hero-copy h1 {
    font-size: clamp(50px, 15vw, 76px);
  }

  .boxes {
    gap: 12px;
  }

  .box {
    padding: 16px 14px 12px;
  }

  .box-plate {
    height: 84px;
  }

  .page {
    padding: 36px 16px 80px;
  }

  .post-row a {
    gap: 16px;
    grid-template-columns: minmax(0, 1fr) 84px;
  }

  .post-thumb {
    width: 84px;
  }

  .post-title {
    font-size: 17px;
  }

  .post-body {
    font-size: 17px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pixel-word canvas,
  .box-plate canvas {
    display: none;
  }

  .pixel-word > span,
  .box-plate img {
    display: block !important;
    opacity: 1 !important;
  }
}

@page {
  size: A4;
}

@media print {
  body {
    background: #fff;
  }

  .nav-cta {
    box-shadow: none;
  }

  .landing-page {
    height: 277mm;
    min-height: 0;
  }

  .post-body a::after {
    color: var(--muted);
    content: " (" attr(href) ")";
    font-size: 0.8em;
    word-break: break-all;
  }
}
