/* paulcheenis — personal site
   black, white, and the drawings. No hue in the interface at all: the only
   colour on the site comes from the art, which is the point. */

:root {
  /* strictly black and white: no hue anywhere in the interface. The only colour
     on the site comes from the drawings themselves. */
  --paper: #fafafa;
  --paper-2: #ffffff;
  --ink: #0a0a0a;
  --ink-soft: #3c3c3c;
  --muted: #767676;
  --line: #e4e4e4;
  --accent: #0a0a0a;
  --accent-ink: #ffffff;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px -14px rgba(0, 0, 0, .16);
  --radius: 14px;
  --wrap: 1080px;
  --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --sans: ui-sans-serif, system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --hand: "Comic Sans MS", "Comic Neue", cursive;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0c0c0c;
    --paper-2: #151515;
    --ink: #f4f4f4;
    --ink-soft: #c8c8c8;
    --muted: #8b8b8b;
    --line: #2a2a2a;
    --accent: #f4f4f4;
    --accent-ink: #0c0c0c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 10px 30px -18px rgba(0, 0, 0, .9);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }

a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

::selection { background: var(--accent); color: var(--accent-ink); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { width: min(var(--wrap), 92vw); margin-inline: auto; }

/* ---------- header ---------- */

.site-head {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-head .wrap {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 58px;
  flex-wrap: wrap;
  padding-block: 8px;
}

.brand {
  font-family: var(--serif);
  font-size: 19px;
  letter-spacing: -.01em;
  text-decoration: none;
  color: var(--ink);
  white-space: nowrap;
}
.brand b { font-weight: 400; }
.brand .dot { color: var(--accent); }

.nav {
  display: flex;
  gap: 2px;
  margin-left: auto;
  flex-wrap: wrap;
}

.nav a {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 14px;
  text-decoration: none;
  color: var(--ink-soft);
  transition: background .15s ease, color .15s ease;
}
.nav a:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); color: var(--ink); }
.nav a[aria-current="page"] {
  background: var(--ink);
  color: var(--paper-2);
  font-weight: 600;
}
.nav a[aria-current="page"]:hover { background: var(--ink); color: var(--paper-2); }

/* ---------- type ---------- */

.kicker {
  font-family: var(--hand);
  font-size: 15px;
  color: var(--ink);
  margin: 0 0 6px;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 400; letter-spacing: -.02em; }

h1 { font-size: clamp(2.1rem, 5.2vw, 3.6rem); line-height: 1.05; margin: 0 0 14px; }
h2 { font-size: clamp(1.35rem, 2.6vw, 1.9rem); line-height: 1.2; margin: 0 0 4px; }
h3 { font-size: 1.1rem; margin: 0 0 4px; }

.lede { font-size: clamp(1rem, 1.7vw, 1.15rem); color: var(--ink-soft); max-width: 46ch; margin: 0; }

.eyebrow {
  font: 600 11px/1 var(--sans);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(24px, 5vw, 56px);
  align-items: end;
  padding: clamp(38px, 7vw, 76px) 0 clamp(28px, 4vw, 44px);
  border-bottom: 1px solid var(--line);
}

.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper-2);
  color: var(--ink);
  font-size: 14px;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform .12s ease, border-color .12s ease;
}
.btn:hover { transform: translateY(-1px); border-color: var(--muted); color: var(--ink); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { color: var(--accent-ink); filter: brightness(1.05); }

/* ---------- sections ---------- */

.section { padding: clamp(32px, 5vw, 56px) 0; border-bottom: 1px solid var(--line); }
.section:last-of-type { border-bottom: 0; }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.section-head .more {
  margin-left: auto;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px dashed var(--line);
}
.section-head .more:hover { color: var(--ink); border-color: var(--ink); }

/* ---------- comic cards ---------- */

.comics { display: grid; gap: 22px; }

.comic {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  scroll-margin-top: 80px;
}

.comic__img {
  display: block;
  width: 100%;
  background: #fff;
  cursor: zoom-in;
  border: 0;
  padding: 0;
  margin: 0;
}
.comic__img img { width: 100%; height: auto; }

.comic__meta {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
}

.comic__title-img { flex: 1 1 auto; max-width: 240px; height: auto; }
.comic__title-img img { width: 100%; height: auto; }

.comic__date {
  margin-left: auto;
  font: 600 12px/1 var(--sans);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.comic__note {
  font-family: var(--hand);
  font-size: 13px;
  color: var(--accent);
  padding: 0 16px 12px;
  margin: 0;
}

/* two-column on wide screens so 13 squares don't make one endless column */
@media (min-width: 900px) {
  .comics--grid { grid-template-columns: 1fr 1fr; }
  .comics--grid .comic--wide { grid-column: 1 / -1; }
}

/* the featured comic on the home page: big, but not a whole screen */
.comic--wide { max-width: 720px; width: 100%; margin-inline: auto; }

/* ---------- galleries ---------- */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
}

.tile {
  margin: 0;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .15s ease;
}
.tile:hover { transform: translateY(-2px); }

.tile a {
  display: block;
  width: 100%;
  padding: 0;
  background: #fff;
  cursor: zoom-in;
}
.tile img {
  width: 100%;
  aspect-ratio: 1 / 1;
  /* contain, not cover: the source files are everything from 600x250 wordmarks
     to 2000x2000 comics, and cropping a wordmark looks like a bug */
  object-fit: contain;
  background: #fff;
  padding: 14px;
}

.tile figcaption {
  padding: 10px 12px 12px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
}
.tile figcaption b { color: var(--ink); font-weight: 600; display: block; font-size: 14px; }

/* the "instagram" link under a mirrored post: ink and an underline, no colour */
.tile figcaption .tile__src {
  display: inline-block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------- the auto-scrolling sketch ribbon ---------- */

.strip-section { margin-top: 4px; }

.strip {
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--paper-2);
  /* fade the ends so cells slide out instead of being clipped hard */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
}

.strip__track {
  display: flex;
  width: max-content;
  animation: strip-scroll 48s linear infinite;
  will-change: transform;
}
.strip:hover .strip__track,
.strip:focus-within .strip__track { animation-play-state: paused; }

.strip__cell {
  display: block;
  flex: 0 0 auto;
  width: 132px;
  height: 132px;
  padding: 6px;
}
.strip__cell img {
  width: 100%;
  height: 100%;
  object-fit: contain;              /* never crop a drawing */
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.strip__cell:focus-visible { outline: 2px solid var(--ink); outline-offset: -4px; }

@keyframes strip-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }   /* the track holds the cells twice */
}

@media (prefers-reduced-motion: reduce) {
  .strip { overflow-x: auto; }
  .strip__track { animation: none; }
}

/* ---------- prose pages ---------- */

.panel {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(20px, 3vw, 32px);
  box-shadow: var(--shadow);
  max-width: 62ch;
}
.panel p { margin: 0 0 14px; }
.panel p:last-child { margin-bottom: 0; }

.page-head { padding: clamp(34px, 6vw, 64px) 0 24px; border-bottom: 1px solid var(--line); }

/* ---------- forms ---------- */

.form { display: grid; gap: 14px; }

.field label {
  display: block;
  font: 600 12px/1 var(--sans);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.field input,
.field textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}
.field input:focus,
.field textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.field textarea { min-height: 130px; resize: vertical; }

.form .btn { justify-self: start; cursor: pointer; }

/* ---------- lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: rgba(0, 0, 0, .95);
  color: #ffffff;
  padding: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}
.lightbox[data-open="true"] { opacity: 1; pointer-events: auto; }

.lightbox__bar {
  display: flex;
  align-items: center;
  gap: 12px;
  font: 500 13px/1 var(--sans);
  color: #bdbdbd;
}
.lightbox__bar span { margin-right: auto; }

.lightbox__stage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}
.lightbox__stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .6);
  background: #fff;
}

.lightbox button {
  font: inherit;
  color: inherit;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
}
.lightbox button:hover { background: rgba(255, 255, 255, .16); }

.lightbox__nav { display: flex; gap: 8px; justify-content: center; padding-top: 10px; }

/* ---------- footer ---------- */

.site-foot {
  border-top: 1px solid var(--line);
  padding: 26px 0 40px;
  color: var(--muted);
  font-size: 13px;
}
.site-foot .wrap { display: flex; gap: 14px; flex-wrap: wrap; align-items: baseline; }
.site-foot a { color: var(--ink-soft); }
.site-foot .hand { font-family: var(--hand); color: var(--ink-soft); font-size: 14px; margin-left: auto; }

/* ---------- motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}


/* ---------- small screens ---------- */

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; }
  .nav { width: 100%; margin-left: 0; overflow-x: auto; flex-wrap: nowrap;
         padding-bottom: 2px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: 6px 9px; }
  .comic__meta { flex-wrap: wrap; }
  .comic__date { margin-left: 0; }
}
