/* Pip Pocket Press — risograph two-color look
   Layout: stacked bands like pages of a zine; catalog is a loose pile of tilted booklets. */

:root {
  --paper: #f3f4f1;       /* slightly cool copy paper */
  --ink: #23213a;         /* soft black-violet ink */
  --pink: #ff4fa3;        /* riso fluorescent pink */
  --blue: #2b6fd6;        /* riso medium blue */
  --yellow: #ffd23f;
  --green: #3fbf8a;
  --orange: #ff6c2f;      /* riso orange */
  --teal: #00838a;        /* riso teal */
  --kelly: #00a95c;       /* riso green */
  --red: #e8402b;         /* riso bright red */
  --sky: #3fa9f5;         /* lighter riso blue, mixes green with yellow */
  --muted: #5e5b74;
  --line: #d6d6dd;
  --about-bg: color-mix(in srgb, #ffd23f 22%, #f3f4f1);

  --display: "Bagel Fat One", "Arial Black", Impact, sans-serif;
  --body: "Courier Prime", "Courier New", Courier, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1b1a28;
    --ink: #f1eff8;
    --muted: #b3afc8;
    --line: #34324a;
    --about-bg: #35204f;   /* deep purple instead of muddy yellow */
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.05rem;
  line-height: 1.6;
  /* faint photocopy speckle */
  background-image: radial-gradient(color-mix(in srgb, var(--ink) 7%, transparent) 1px, transparent 1px);
  background-size: 22px 22px;
}

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

a { color: var(--blue); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--pink); }
a:focus-visible { outline: 3px dashed var(--pink); outline-offset: 3px; }

.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* ---------- Masthead ---------- */
.masthead {
  padding-block: 3rem 2.5rem;
  border-bottom: 3px dashed var(--ink);
}

.stamp {
  display: inline-block;
  margin: 0 0 1rem;
  padding: 0.2rem 0.7rem;
  border: 2px solid var(--pink);
  color: var(--pink);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  transform: rotate(-3deg);
}

.logo {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(3.2rem, 13vw, 8rem);
  line-height: 0.88;
  color: color-mix(in srgb, var(--blue) 92%, transparent);
  letter-spacing: -0.01em;
}
.logo span { display: block; }
.logo span:nth-child(2) { margin-left: 0.6em; }
.logo span:nth-child(3) { margin-left: 1.2em; margin-top: -0.14em; }

.tagline {
  max-width: 38ch;
  margin: 1.5rem 0 1.5rem;
  font-size: 1.15rem;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.nav a {
  padding: 0.35rem 0.9rem;
  border: 2px solid var(--ink);
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  text-transform: lowercase;
  background: var(--paper);
  box-shadow: 3px 3px 0 var(--pink);
  transition: transform 0.15s, box-shadow 0.15s;
}
.nav a:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--blue);
  color: var(--ink);
}

/* ---------- Riso overprint ----------
   Each .riso heading carries a second ink layer (from data-text), printed slightly
   off-register and multiplied over the first, so overlaps mix like real riso ink. */
.riso {
  position: relative;
  isolation: isolate;
}
.riso::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  transform: translate(0.06em, 0.05em);
  color: var(--ink2);
  mix-blend-mode: multiply;
  opacity: 0.9;
  pointer-events: none;
}
.logo .riso { --ink2: var(--pink); }
.section-title.riso { --ink2: var(--blue); }
/* extra riso ink pairs for section headings */
.section-title.pair-yellow { --ink1: var(--yellow); --ink2: var(--sky); }
.section-title.pair-yellow::after { transform: translate(0.12em, 0.09em); opacity: 1; }
.section-title.pair-orange { --ink1: var(--orange); --ink2: var(--teal); }
.section-title.pair-green  { --ink1: var(--kelly);  --ink2: var(--red); }
.section-title.pair-yellowpink { --ink1: var(--pink); --ink2: var(--yellow); }
.section-title.pair-yellowpink::after { transform: translate(0.12em, 0.09em); opacity: 1; }
.section-title.riso::after { transform: translate(0.05em, 0.04em); }

/* ---------- Sections ---------- */
.section { padding-block: 3.5rem; }
.section-alt {
  border-block: 3px dashed var(--ink);
  background: var(--about-bg);
}

.section-title {
  margin: 0 0 0.4rem;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2rem, 6vw, 3rem);
  line-height: 1;
  color: color-mix(in srgb, var(--ink1, var(--pink)) 92%, transparent);
  text-wrap: balance;
}

.section-note {
  margin: 0 0 2rem;
  color: var(--muted);
  font-style: italic;
}

.two-col {
  display: grid;
  gap: 1rem 3rem;
  grid-template-columns: 1fr;
}
@media (min-width: 760px) {
  .two-col { grid-template-columns: 1fr 1.6fr; align-items: start; }
}

.prose { max-width: 62ch; min-width: 0; }
.prose p { margin: 0 0 1rem; }
.small { font-size: 0.9rem; color: var(--muted); }

/* ---------- Zine grid ---------- */
.zine-grid {
  display: grid;
  gap: 2.5rem 2rem;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.zine {
  position: relative;
  min-width: 0;
  transition: transform 0.25s ease;
}
.zine:nth-child(4n+1) { transform: rotate(-2deg); }
.zine:nth-child(4n+2) { transform: rotate(1.5deg); }
.zine:nth-child(4n+3) { transform: rotate(-1deg); }
.zine:nth-child(4n+4) { transform: rotate(2.5deg); }
.zine:hover { transform: rotate(0) translateY(-6px); }

/* Booklet cover, built in CSS so the site works before you have scans */
.cover, .cover-img {
  aspect-ratio: 3 / 4;
  max-width: 100%;
  width: 100%;
  border: 2px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
}
.cover-img { object-fit: cover; }

.cover {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1rem;
  overflow: hidden;
  color: #23213a;
  /* halftone dots */
  background-image: radial-gradient(rgba(35, 33, 58, 0.22) 1.6px, transparent 1.8px);
  background-size: 9px 9px;
}
/* staple marks down the spine */
.cover::before, .cover::after {
  content: "";
  position: absolute;
  left: 8px;
  width: 3px;
  height: 18px;
  background: #23213a;
  opacity: 0.55;
}
.cover::before { top: 25%; }
.cover::after { bottom: 25%; }

.cover.pink   { background-color: var(--pink); }
.cover.blue   { background-color: var(--blue); color: #fff; }
.cover.yellow { background-color: var(--yellow); }
.cover.green  { background-color: var(--green); }
.cover.blue::before, .cover.blue::after { background: #fff; }

.cover-issue {
  align-self: flex-end;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.cover-title {
  font-family: var(--display);
  font-size: clamp(1.8rem, 4vw, 2.3rem);
  line-height: 0.95;
  text-wrap: balance;
}

.zine-info { padding-top: 1.25rem; }
.zine-info h3 {
  margin: 0 0 0.3rem;
  font-size: 1.15rem;
  font-weight: 700;
}
.zine-info p { margin: 0 0 0.8rem; font-size: 0.95rem; }

.specs {
  margin: 0;
  border-top: 1px dashed var(--line);
  font-size: 0.85rem;
}
.specs div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.25rem;
  border-bottom: 1px dashed var(--line);
}
.specs dt { color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.specs dd { margin: 0; font-weight: 700; text-align: right; }

.badge {
  position: absolute;
  top: 1.2rem;
  left: -0.6rem;
  margin: 0;
  padding: 0.15rem 0.6rem;
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  transform: rotate(-8deg);
}

.more-link {
  margin-top: 0.4rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--blue);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  cursor: pointer;
}
.more-link:hover { color: var(--pink); }
.more-link:focus-visible { outline: 3px dashed var(--pink); outline-offset: 3px; }

/* ---------- Zine details pop-up ---------- */
.zine-dialog {
  width: min(32rem, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 1.75rem 1.5rem 1.5rem;
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 8px 8px 0 var(--pink);
  font-family: var(--body);
}
.zine-dialog::backdrop { background: rgba(35, 33, 58, 0.55); }
.dialog-close {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  border: 0;
  background: none;
  color: var(--ink);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}
.dialog-close:hover { color: var(--pink); }
.dialog-eyebrow {
  margin: 0;
  color: var(--pink);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.zine-dialog h3 {
  margin: 0.3rem 0 0.2rem;
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.9rem;
  line-height: 1;
  color: var(--blue);
  text-wrap: balance;
}
.dialog-tagline { margin: 0 0 1.25rem; font-style: italic; color: var(--muted); }
.zine-dialog h4 {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.dialog-sections {
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
  counter-reset: sec;
  display: grid;
  gap: 0.35rem;
}
.dialog-sections li {
  counter-increment: sec;
  display: flex;
  gap: 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px dashed var(--line);
}
.dialog-sections li::before {
  content: counter(sec, decimal-leading-zero);
  color: var(--pink);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.dialog-extras { margin: 0 0 1.25rem; font-size: 0.95rem; }
.dialog-request {
  display: inline-block;
  margin-top: 1.25rem;
  font-weight: 700;
}

/* ---------- Photo covers ---------- */
.cover.photo { padding: 0; isolation: isolate; }
.cover.photo::before, .cover.photo::after { z-index: 2; }
.cover-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}
/* Option 1: real photo inside a pink frame */
.cover.photo-framed .cover-photo {
  inset: 12px;
  width: calc(100% - 24px);
  height: calc(100% - 24px);
  outline: 2px solid #23213a;
}
/* Option 2: photo blended into the pink like a riso print.
   Hover or tap fades in the true-color photo. */
.cover.photo-riso .cover-photo {
  mix-blend-mode: multiply;
  filter: grayscale(1) contrast(1.35) brightness(1.08);
}
.cover.photo-riso .cover-photo.real {
  mix-blend-mode: normal;
  filter: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
}
/* mouse: hover shows the real photo. touch: tap toggles it (see script) */
@media (hover: hover) {
  .cover.photo-riso:hover .cover-photo.real { opacity: 1; }
}
.cover.photo-riso.show-real .cover-photo.real { opacity: 1; }
.cover.photo-riso { cursor: pointer; }
.cover.photo-riso:focus-visible { outline: 3px dashed var(--pink); outline-offset: 4px; }
.cover-hint {
  font-size: 0.8rem !important;
  font-style: italic;
  color: var(--muted);
}

/* ---------- Linocuts ---------- */
.section-lino {
  border-top: 3px dashed var(--ink);
  background: color-mix(in srgb, var(--blue) 10%, var(--paper));
}

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

.print { margin: 0; min-width: 0; }

/* placeholder "inked block" with carved gouge lines */
.print-block, .print-img {
  aspect-ratio: 1 / 1;
  width: 100%;
  max-width: 100%;
  border: 10px solid var(--paper);
  outline: 2px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
}
.print-img { object-fit: cover; }
.print-block {
  background-color: #23213a;
  background-image:
    repeating-linear-gradient(28deg, transparent 0 11px, rgba(243,244,241,0.85) 11px 13px),
    repeating-radial-gradient(circle at 70% 30%, transparent 0 14px, rgba(243,244,241,0.5) 14px 15px);
}
.print:nth-child(2) .print-block {
  background-color: var(--blue);
  background-image:
    repeating-linear-gradient(-35deg, transparent 0 9px, rgba(243,244,241,0.8) 9px 11px),
    repeating-radial-gradient(circle at 20% 80%, transparent 0 18px, rgba(243,244,241,0.45) 18px 19px);
}
.print:nth-child(3) .print-block {
  background-color: var(--pink);
  background-image:
    repeating-linear-gradient(90deg, transparent 0 13px, rgba(35,33,58,0.35) 13px 15px),
    repeating-radial-gradient(circle at 50% 50%, transparent 0 12px, rgba(243,244,241,0.6) 12px 14px);
}

.print figcaption {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  font-weight: 700;
}
.print figcaption span {
  color: var(--muted);
  font-weight: 400;
  font-style: italic;
}

/* ---------- Request form ---------- */
.request-form {
  display: grid;
  gap: 0.35rem;
  max-width: 30rem;
  padding: 1.25rem;
  border: 2px solid var(--ink);
  box-shadow: 5px 5px 0 var(--blue);
  background: var(--paper);
}
.request-form label {
  margin-top: 0.6rem;
  color: var(--pink);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
}
.request-form label:first-of-type { margin-top: 0; }
.request-form label span { color: var(--muted); text-transform: none; letter-spacing: 0; font-weight: 400; }
.request-form input,
.request-form select,
.request-form textarea {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}
.request-form input:focus,
.request-form select:focus,
.request-form textarea:focus {
  outline: 3px dashed var(--pink);
  outline-offset: 2px;
}
.request-form button {
  justify-self: start;
  margin-top: 1rem;
  padding: 0.55rem 1.2rem;
  border: 2px solid var(--ink);
  background: var(--yellow);
  color: #23213a;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--pink);
  transition: transform 0.15s, box-shadow 0.15s;
}
.request-form button:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--blue); }
.request-form button:focus-visible { outline: 3px dashed var(--pink); outline-offset: 3px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ---------- Footer ---------- */
.footer {
  padding-block: 2rem;
  border-top: 3px dashed var(--ink);
  font-size: 0.85rem;
  color: var(--muted);
}
.footer p { margin: 0; }

/* ---------- Phones: two zines / prints per row ---------- */
@media (max-width: 600px) {
  .zine-grid,
  .print-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.75rem 1rem;
  }
  .zine:nth-child(4n+1) { transform: rotate(-1.5deg); }
  .zine:nth-child(4n+2) { transform: rotate(1deg); }
  .zine:nth-child(4n+3) { transform: rotate(-0.75deg); }
  .zine:nth-child(4n+4) { transform: rotate(1.5deg); }
  .cover, .cover-img { box-shadow: 4px 4px 0 var(--ink); }
  .cover { padding: 0.6rem; }
  .cover-title { font-size: 1.15rem; }
  .cover-issue { font-size: 0.7rem; }
  .zine-info { padding-top: 0.9rem; }
  .zine-info h3 { font-size: 0.95rem; }
  .zine-info p { font-size: 0.82rem; }
  .specs { font-size: 0.72rem; }
  .specs div { flex-wrap: wrap; gap: 0 0.5rem; }
  .badge { font-size: 0.68rem; top: 0.8rem; left: -0.4rem; }
  .cover.photo-framed .cover-photo { inset: 8px; width: calc(100% - 16px); height: calc(100% - 16px); }
  .print-block, .print-img { border-width: 6px; box-shadow: 4px 4px 0 var(--ink); }
  .print figcaption { flex-direction: column; gap: 0; font-size: 0.85rem; margin-top: 0.75rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .zine, .nav a, .cover-photo { transition: none; }
}
