@font-face {
  font-family: Michroma;
  src: url("/assets/fonts/Michroma-Regular.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: "Short Stack";
  src: url("/assets/fonts/ShortStack-Regular.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: Inter;
  src: url("/assets/fonts/InterLatin.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --blue: #1F5A7C;
  --ink: #1c1c1c;
  --light: #c9dbe6;
  --panel: #e0e3e4;
  --green: #4e5c2c;
  --white: #fff;
  --outline: #111;
  --heading: Michroma, sans-serif;
  --comic: "Short Stack", cursive;
  color-scheme: light;
  background: var(--blue);
  color: var(--white);
  font: 400 16px/1.5 Inter, system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
h1, h2, p { margin: 0; }
img { max-width: 100%; }
a { color: inherit; }
a:hover { color: #d5e3ec; }
button, input { font: inherit; }
button:enabled { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid #f9db7d; outline-offset: 3px; }
[hidden] { display: none !important; }

.skip-link, .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.skip-link:focus {
  top: 6px;
  left: 6px;
  z-index: 2;
  width: auto;
  height: auto;
  padding: 12px;
  clip-path: none;
  background: var(--white);
  color: var(--ink);
}
.shell { width: 100%; max-width: 1180px; min-height: 100vh; margin-inline: auto; display: flex; flex-direction: column; }
.site-header { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; padding: 14px 16px 8px; }
.brand {
  min-height: 44px;
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  align-items: center;
  gap: 10px;
  font: clamp(10px, 3vw, 13px)/1.4 var(--heading);
  letter-spacing: .7px;
  text-decoration: none;
}
.brand img { width: 40px; height: 40px; flex: 0 0 auto; border: 2px solid white; border-radius: 50%; object-fit: cover; }
.brand span { white-space: nowrap; }
.top-nav { order: 2; flex: 0 0 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.top-nav a { display: inline-flex; min-height: 44px; align-items: center; text-decoration: none; font-size: 14px; font-weight: 600; }
.top-nav a[aria-current] { text-decoration: underline; text-underline-offset: 4px; }
.balloon { border: 2px solid var(--outline); background: var(--white); color: var(--outline); font-family: var(--comic); }
.balloon:hover { background: #edf4f8; color: var(--outline); }
.boss-toggle { min-height: 44px; padding: 0 14px; border-radius: 22px; font-size: 14px; white-space: nowrap; }

.reader { display: flex; flex-direction: column; }
.reader-side { display: contents; }
.day-info {
  order: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 8px;
  padding: 6px 16px 14px;
  color: var(--light);
}
.day-label, .attendance h2 { font-size: 12px; font-weight: 600; letter-spacing: 2px; color: var(--light); }
.day-number { font: 44px/1 var(--heading); color: var(--white); }
.day-caption { margin-top: 6px; font-size: 14px; }
.day-info time { display: block; text-align: right; font-size: 13px; }
.date-long { display: none; }
.art-column { order: 1; min-width: 0; }
.art-column picture { display: block; }
.strip-art { display: block; width: 100%; height: auto; background: var(--panel); }
.strip-transcript { max-width: 640px; padding: 12px 0 0; margin: 12px 16px 0; border-top: 1px solid #5a88a3; color: var(--light); font-size: 14px; line-height: 1.55; }
.strip-transcript h2 { font-size: 14px; font-weight: 600; }
.strip-transcript ol { margin: 5px 0 0; padding-inline-start: 21px; }
.strip-transcript li + li { margin-top: 4px; }
.strip-navigation { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 12px 16px 4px; }
.nav-control {
  min-height: 48px;
  padding: 4px 5px;
  border: 2px solid var(--white);
  border-radius: 8px;
  background: transparent;
  color: var(--white);
  display: inline-flex;
  justify-content: center;
  align-items: center;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}
.nav-control:disabled { opacity: .58; }
.nav-control.balloon { border-color: var(--outline); background: var(--white); color: var(--outline); font-weight: 400; }
.nav-control.balloon:hover { background: #edf4f8; }
.random-hint { padding: 6px 16px 0; text-align: center; font-size: 13px; color: var(--light); }
.boss-screen { margin: 0 0 4px; padding: 14px 12px 18px; color: var(--ink); background: var(--white); }
.boss-screen h2 { font-size: 16px; }
.boss-screen p { margin: 2px 0 10px; color: #555; font-size: 13px; }
.boss-screen table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 13px; text-align: left; }
.boss-screen th, .boss-screen td { padding: 9px 6px; border: 1px solid #b9c0c4; overflow-wrap: anywhere; }
.boss-screen th { background: #dce6ec; }
.boss-screen .sheet-caption { margin: 14px 0 0; color: var(--ink); font: 15px/1.45 var(--comic); }

.clock-in {
  order: 2;
  margin: 22px 16px 0;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--panel);
  color: var(--ink);
  border-radius: 10px;
}
.clock-in h2 { font: 16px/1.4 var(--heading); }
.clock-in p { font-size: 15px; line-height: 1.45; }
.clock-in label { font-size: 13px; font-weight: 600; }
.clock-fields { display: flex; flex-direction: column; gap: 10px; }
.clock-fields input {
  min-height: 48px;
  min-width: 0;
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--white);
  color: var(--ink);
}
.clock-fields button {
  min-height: 50px;
  padding: 0 22px;
  border: 0;
  border-radius: 8px;
  color: var(--white);
  background: var(--green);
  font-weight: 700;
}
.clock-fields button:enabled:hover { background: #3d4821; }
.clock-fields button:disabled { opacity: .67; }
.clock-in .clock-status { font-size: 13px; }
.clock-in .clock-status:empty { position: absolute; }

.storylines-home { order: 3; min-width: 0; margin-top: 26px; padding: 0 16px; }
.storylines-home h2 { margin-bottom: 12px; font: 15px/1.4 var(--heading); }
.story-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.story-card { min-width: 0; display: flex; flex-direction: column; gap: 6px; text-decoration: none; }
.story-card img, .strip-tile img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  border-radius: 8px;
  object-fit: cover;
  background: var(--panel);
}
.story-card .legacy-thumb, .strip-tile .legacy-thumb { object-position: top; }
.story-title { font-size: 14px; font-weight: 600; line-height: 1.35; }
.story-description { color: var(--light); font-size: 13px; }
.attendance {
  order: 4;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 26px 16px 0;
  padding: 16px;
  border: 2px dashed var(--light);
  border-radius: 10px;
}
.attendance-count { font: 26px/1.4 var(--heading); }
.attendance-caption { font: 15px/1.4 var(--comic); }
.about-teaser { display: none; }

.site-footer { margin-top: auto; padding: 28px 16px 26px; color: var(--light); font-size: 13px; line-height: 1.6; }
.footer-voice { display: block; }
.footer-pages { display: flex; gap: 0 16px; flex-wrap: wrap; }
.footer-pages a { display: inline-flex; min-height: 44px; align-items: center; }
.section-page { width: 100%; min-width: 0; flex: 1 0 auto; padding: 12px 16px 36px; }
.section-page h1 { margin: 0 0 16px; font: 22px/1.45 var(--heading); }
.section-page #strip-screen > p { max-width: 62ch; margin: 0 0 22px; font-size: 16px; }
.strip-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 14px; }
.strip-tile { min-width: 0; display: flex; flex-direction: column; gap: 4px; text-decoration: none; }
.strip-tile span { margin-top: 5px; font-size: 15px; font-weight: 600; }
.strip-tile time { font-size: 13px; color: var(--light); }
.strip-tile:hover span, .story-card:hover .story-title { text-decoration: underline; }
.about-content { max-width: 520px; }
.about-content > p { margin: 0 0 18px; }
.about-avatar { display: block; width: 160px; height: 160px; margin: 0 0 18px; border: 4px solid var(--white); border-radius: 50%; object-fit: cover; }
.about-note { font: 16px/1.5 var(--comic); }
.about-content .clock-in { margin: 0 0 18px; }
.section-page .standalone-strip { max-width: 640px; }
.standalone-strip .strip-transcript { width: auto; margin-inline: 0; }
.standalone-strip .strip-transcript p { margin-top: 5px; }
.strip-note { margin-top: 18px; }
.error-links { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.error-links .balloon { padding-inline: 16px; }

@media (max-width: 599px) {
  .brand { flex: 1 1 0; }
  .brand span { white-space: normal; }
  .boss-toggle { flex: 0 0 auto; margin-inline-start: auto; }
  .storylines-home .story-grid:has(.story-card:nth-child(3)) {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(145px, 47%);
    overflow-x: auto;
    padding-bottom: 5px;
  }
}

@media (min-width: 600px) and (max-width: 919px) {
  .site-header, .day-info, .storylines-home, .site-footer, .section-page { padding-inline: 24px; }
  .top-nav { order: 0; flex: 0 1 auto; gap: 12px; }
  .reader > .art-column { width: 100%; }
  .strip-art { margin-inline: auto; max-width: 640px; }
  .strip-transcript { width: calc(100% - 48px); margin-inline: auto; }
  .strip-navigation { max-width: 672px; margin-inline: auto; }
  .clock-in, .attendance { margin-inline: 24px; }
  .story-grid, .strip-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 920px) {
  .shell { max-width: 1180px; margin: 0 auto; padding: 0 28px 40px; }
  .site-header { flex-wrap: wrap; gap: 14px 26px; padding: 20px 0; }
  .brand { flex: 1 1 0; gap: 26px; font-size: 18px; letter-spacing: 2px; }
  .brand img { width: 52px; height: 52px; }
  .top-nav { order: 0; flex: 0 1 auto; flex-wrap: wrap; gap: 6px 22px; }
  .top-nav a { padding: 12px 0; font-size: 15px; }
  .boss-toggle { padding: 0 18px; font-size: 15px; }
  .reader {
    display: grid;
    grid-template-columns: minmax(460px, 640px) minmax(300px, 1fr);
    gap: 0 36px;
    align-items: start;
    padding-top: 10px;
  }
  .art-column { order: 0; }
  .strip-art { border-radius: 4px; }
  .strip-transcript { margin-inline: 0; }
  .strip-navigation { gap: 10px; padding: 0; margin-top: 14px; }
  .nav-control { min-height: 50px; }
  .nav-control.balloon { font-size: 16px; }
  .reader-side { display: flex; flex-direction: column; gap: 22px; }
  .reader-side > * { order: 0; }
  .day-info { display: block; padding: 0; }
  .day-label { font-size: 13px; letter-spacing: 3px; }
  .day-number { font-size: clamp(60px, 7.2vw, 84px); }
  .day-caption { margin-top: 10px; font-size: 18px; }
  .day-info time { margin-top: 4px; font-size: 14px; text-align: left; }
  .date-short, .random-hint { display: none; }
  .date-long { display: inline; }
  .clock-in { margin: 0; padding: 22px; }
  .clock-in h2 { font-size: 17px; }
  .clock-in p { line-height: 1.5; }
  .clock-fields { display: flex; flex-direction: row; flex-wrap: wrap; gap: 8px; }
  .clock-fields input { flex: 1 1 180px; }
  .clock-fields button { min-height: 48px; }
  .attendance { margin: 0; padding: 18px 20px; }
  .attendance-count { font-size: 28px; }
  .attendance-caption { font-size: 16px; }
  .about-teaser { display: block; color: var(--light); font-size: 14px; line-height: 1.6; }
  .storylines-home { grid-column: 1 / -1; margin-top: 48px; padding: 0; }
  .storylines-home h2 { margin-bottom: 16px; font-size: 17px; }
  .story-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
  .story-card { gap: 8px; }
  .story-title { font-size: 17px; font-weight: 700; }
  .story-description { font-size: 14px; }
  .mobile-copy { display: none; }
  .site-footer { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 28px; padding: 20px 0 0; margin-top: auto; border-top: 1px solid #5a88a3; font-size: 14px; }
  .reader + .site-footer { margin-top: 48px; }
  .footer-voice { flex-grow: 1; }
  .footer-social { display: flex; gap: 28px; }
  .section-page { padding: 18px 0 48px; }
  .section-page h1 { font-size: 32px; }
  .strip-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 26px 20px; }
}
