/* Forfeit Zero reader. Black and white from the logo, one red accent. */

:root {
  --bg: #f3f2ee;
  --surface: #ffffff;
  --ink: #141414;
  --muted: #6d6b66;
  --line: #e3e1db;
  --accent: #d7263d;
  --accent-ink: #ffffff;
  --accent-soft: #fbe4e7;
  --masthead: #000000;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.06), 0 10px 28px rgb(0 0 0 / 0.08);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0e0f;
    --surface: #19191b;
    --ink: #ececea;
    --muted: #9d9b96;
    --line: #2b2b2e;
    --accent: #ff5266;
    --accent-ink: #120507;
    --accent-soft: #3b1a20;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 10px 28px rgb(0 0 0 / 0.5);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button {
  font: inherit;
  cursor: pointer;
}

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

svg {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Masthead */

.masthead {
  background: var(--masthead);
  border-bottom: 3px solid var(--accent);
}

.masthead-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo img {
  display: block;
  width: clamp(150px, 28vw, 249px);
  height: auto;
}

.masthead-actions {
  display: flex;
  gap: 8px;
}

.ghost-button,
.solid-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.6em 1.05em;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 650;
}

.ghost-button {
  background: transparent;
  color: #ffffff;
  border-color: rgb(255 255 255 / 0.35);
}

.ghost-button:hover {
  border-color: #ffffff;
}

.solid-button {
  background: var(--accent);
  color: var(--accent-ink);
}

.solid-button:hover {
  filter: brightness(1.08);
}

/* Reader */

.reader {
  max-width: 760px;
  margin: 0 auto;
  padding: 36px 20px 56px;
}

.strip-heading {
  text-align: center;
  scroll-margin-top: 16px;
}

.strip-date {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.strip-title {
  margin: 0;
  font-size: clamp(1.6rem, 4.5vw, 2.5rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.strip-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 18px 0;
}

.strip-nav button {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.55em 0.95em;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 600;
}

.strip-nav button:hover:not(:disabled) {
  border-color: var(--ink);
}

.strip-nav button:disabled {
  opacity: 0.35;
  cursor: default;
}

.strip-position {
  min-width: 6.5em;
  color: var(--muted);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.strip {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  overflow: hidden;
  background: #ffffff; /* the strips are drawn on white */
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  touch-action: pan-y;
}

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

.post {
  margin-top: 30px;
  padding: 26px 30px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.post-body {
  font-size: 1.04rem;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

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

.post-body img {
  max-width: 100%;
  height: auto;
}

.site-footer {
  padding: 24px 20px 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

/* Archive dialog */

.archive {
  width: min(980px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: none;
  border-radius: 18px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 64px rgb(0 0 0 / 0.35);
}

.archive[open] {
  display: flex;
  flex-direction: column;
}

.archive::backdrop {
  background: rgb(0 0 0 / 0.55);
  backdrop-filter: blur(2px);
}

.archive-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 10px;
}

.archive-header h2 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
}

.icon-button:hover {
  border-color: var(--ink);
}

.archive-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 2px 22px 14px;
  border-bottom: 1px solid var(--line);
}

.archive-tabs button {
  padding: 0.45em 1.05em;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-weight: 600;
}

.archive-tabs button[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--surface);
}

.archive-panel {
  overflow: auto;
  padding: 18px 22px 24px;
}

.months {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.month {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.month--empty {
  opacity: 0.45;
}

.month h3 {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 0 0 8px;
  font-size: 0.95rem;
  font-weight: 700;
}

.month h3 small {
  min-width: 1.7em;
  padding: 0.05em 0.5em;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 800;
  text-align: center;
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  font-size: 0.8rem;
  text-align: center;
}

.month-grid .weekday {
  padding-bottom: 2px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.day {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 8px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

button.day {
  padding: 0;
  border: none;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
}

button.day:hover,
button.day[aria-current="true"] {
  background: var(--accent);
  color: var(--accent-ink);
}

button.day[aria-current="true"] {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent);
}

.archive-filter input {
  width: 100%;
  padding: 0.7em 1em;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
}

.archive-rows {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.archive-rows button {
  display: grid;
  grid-template-columns: 9.5em 1fr;
  gap: 12px;
  align-items: baseline;
  width: 100%;
  padding: 0.6em 0.75em;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.archive-rows button:hover {
  background: var(--bg);
}

.archive-rows button[aria-current="true"] {
  background: var(--accent-soft);
}

.archive-rows time {
  color: var(--muted);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

/* Phones: icon-only buttons, tighter spacing */

@media (max-width: 560px) {
  .masthead-inner {
    padding: 10px 14px;
  }

  .ghost-button span,
  .strip-nav button span {
    display: none;
  }

  .ghost-button,
  .solid-button {
    padding: 0.6em 0.8em;
  }

  .reader {
    padding: 24px 14px 44px;
  }

  .strip-nav {
    gap: 4px;
  }

  .strip-nav button {
    padding: 0.65em 0.8em;
  }

  .post {
    padding: 18px;
  }

  .archive {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
  }

  .archive-header,
  .archive-tabs,
  .archive-panel {
    padding-left: 14px;
    padding-right: 14px;
  }

  .archive-rows button {
    grid-template-columns: 7.5em 1fr;
  }
}
