/* ------------------------------------------------------------------ base */

:root {
  --ink: #1a1a1a;
  --gray: #8b8b8b;
  --faint: #c9c9c9;
  --red: #a03028;      /* orca-mouth red */
  --pink: #fbeae8;     /* old banner pink, diluted */
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

img { max-width: 100%; height: auto; display: block; }

a { color: var(--ink); text-underline-offset: 3px; }
a:hover { color: var(--red); }
a:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

/* ------------------------------------------------------------------ wordmark */

.wordmark {
  font-weight: 900;
  letter-spacing: -0.03em;
  text-decoration: none;
  font-size: clamp(2.4rem, 8vw, 4.2rem);
  line-height: 1.1;
}

.wordmark b { font-weight: 900; color: var(--ink); }
.wordmark i { font-style: normal; font-weight: 900; color: #a8a8a8; }

@supports (-webkit-text-stroke: 2px black) {
  .wordmark i {
    color: #fff;
    -webkit-text-stroke: 2px var(--ink);
  }
}

.wordmark.small { font-size: 1.5rem; }
@supports (-webkit-text-stroke: 2px black) {
  .wordmark.small i { -webkit-text-stroke: 1.2px var(--ink); }
}

a.wordmark:hover b { color: var(--red); }

/* ------------------------------------------------------------------ landing */

.landing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 1.4rem;
  padding: 3rem 1.2rem 2rem;
}

.tagline {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  color: var(--gray);
  margin: 0;
  max-width: 34em;
  text-align: center;
}

.tagline.small { font-size: 0.9rem; margin-top: 0.2rem; text-align: center; }

.landing .baby {
  width: min(190px, 42vw);
  margin: 0.8rem 0;
}

@media (prefers-reduced-motion: no-preference) {
  .landing .baby {
    animation: fall 5.5s ease-in-out infinite alternate;
  }
  @keyframes fall {
    from { transform: translateY(-10px) rotate(-3deg); }
    to   { transform: translateY(12px) rotate(4deg); }
  }
}

.choices {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  font-size: 1.15rem;
}

.adjacent {
  flex-direction: row!important;
}

.choices a { text-decoration-style: dotted; }

a.random { color: var(--red); font-weight: 700; }
a.random:hover { color: var(--ink); }

/* ------------------------------------------------------------------ topbar */

.topbar {
  text-align: center;
  padding: 1.4rem 1rem 0.6rem;
}

/* ------------------------------------------------------------------ viewer */

.viewer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.2rem;
  text-align: center;
}

.viewer .comic {
  margin: 0 auto;
  width: auto;
  /* keep the nav strip reachable without scrolling on desktop */
  max-height: min(74dvh, 1067px);
  /* white-background comics float on the page; darker late ones frame themselves */
}

.caption {
  color: var(--gray);
  font-size: 0.9rem;
  margin: 0.9rem 0 0;
  letter-spacing: 0.02em;
}

.strip {
  display: flex;
  justify-content: center;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 1.4rem;
  margin: 1.4rem 0 0.6rem;
  font-size: 1.05rem;
}

.strip a { text-decoration-style: dotted; white-space: nowrap; }
.strip .dim { color: var(--faint); white-space: nowrap; }

@media (max-width: 480px) {
  .strip { gap: 1rem; font-size: 1rem; }
}

/* ------------------------------------------------------------------ archive */

.archive {
  list-style: none;
  margin: 1.2rem auto 0;
  padding: 0 1.2rem;
  max-width: 1100px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1.5rem 1.2rem;
}

@media (max-width: 480px) {
  .archive { grid-template-columns: repeat(2, 1fr); gap: 1.2rem 0.9rem; }
}

.archive a {
  display: block;
  text-decoration: none;
  color: var(--gray);
  font-size: 0.85rem;
}

.archive a img {
  width: 100%;
  aspect-ratio: 3 / 2;
  image-rendering: pixelated;
  background: var(--pink);
}

.archive a span { display: block; padding-top: 0.35rem; }

.archive a:hover { color: var(--red); }
.archive a:hover img { outline: 3px solid var(--pink); }

.shift {
  grid-column: 1 / -1;
  text-align: center;
  font-family: Georgia, serif;
  font-style: italic;
  color: var(--gray);
  padding: 1.2rem 0 0.4rem;
}

.shift::before, .shift::after { content: " · "; color: var(--faint); }

/* ------------------------------------------------------------------ pencils */

.pencilroll {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1.2rem;
  text-align: center;
}

.pencilroll figure {
  margin: 2.4rem 0;
}

.pencilroll figcaption {
  color: var(--gray);
  font-size: 0.85rem;
  padding-top: 0.5rem;
  letter-spacing: 0.02em;
}

/* ------------------------------------------------------------------ footer */

.colophon {
  text-align: center;
  color: var(--gray);
  font-size: 0.85rem;
  padding: 2.2rem 1rem 1.8rem;
}

.colophon p { margin: 0.3rem 0; }
.colophon a { color: var(--gray); }
.colophon a:hover { color: var(--red); }

.relic {
  margin: 1.6rem auto 0;
  width: min(560px, 92%);
  opacity: 0.85;
}
