/* ============================================================
   cryptid.wine
   risograph zine. paper, ink, and two plates that don't line up.

   the whole look is one idea: cheap photocopied print. misregistered
   display type, a grain overlay, dashed rules, flat pink and blue.
   nothing here should feel expensive, because the entire argument of
   the site is that wine doesn't need to be.
   ============================================================ */

:root{
  --paper:#e7e5de;
  --ink:#131316;
  --pink:#ff3d9a;
  --blue:#0033cc;
  --overprint:#7a1ea8;
  /* text that sits ON a pink fill. it stays dark in BOTH themes -- flipping it
     with --ink would put pale text on pink and drop the tag to 2.7:1. */
  --on-fill:#131316;
  /* the big Archivo Black type. identical to --ink on paper; softer on dark,
     where a 96px solid glyph in near-white is a headache rather than a heading. */
  --display-ink:#131316;
  --grain:rgba(19,19,22,.035);
  --hatch:rgba(255,61,154,.10);
  color-scheme:light;
  --display:"Archivo Black","Haettenschweiler","Arial Black",system-ui,sans-serif;
  --mono:"JetBrains Mono",ui-monospace,"SFMono-Regular",Menlo,Consolas,monospace;
}

/* ---- dark stock ----
   riso genuinely prints fluorescent inks onto black paper, so this is the same
   press with the paper swapped rather than a second design. --ink and --paper
   trade places; pink, blue and the overprint brighten enough to survive it.

   three states, and the duplication is the price of doing it in plain CSS:
   no attribute = follow the OS, [data-theme] = the reader has chosen. */
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]){
    --paper:#15141a;
    --ink:#ddd8cc;
    --display-ink:#b3ac9c;
    --pink:#ff5fae;
    --blue:#8ab4ff;
    --overprint:#c99bf5;
    --on-fill:#15141a;
    --grain:rgba(233,230,221,.05);
    --hatch:rgba(255,95,174,.14);
    color-scheme:dark;
  }
}
:root[data-theme="dark"]{
    --paper:#15141a;
    --ink:#ddd8cc;
    --display-ink:#b3ac9c;
    --pink:#ff5fae;
    --blue:#8ab4ff;
    --overprint:#c99bf5;
    --on-fill:#15141a;
    --grain:rgba(233,230,221,.05);
    --hatch:rgba(255,95,174,.14);
    color-scheme:dark;
}

*{box-sizing:border-box}
html{scroll-behavior:smooth}
@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto}}

body{
  margin:0;
  background:var(--paper);
  color:var(--ink);
  font-family:var(--mono);
  font-size:16px;
  line-height:1.55;
  text-transform:lowercase;
  /* photocopier grain */
  background-image:
    repeating-linear-gradient(0deg,var(--grain) 0 1px,transparent 1px 3px);
}

.wrap{max-width:820px;margin:0 auto;padding:0 20px}

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

img{max-width:100%;height:auto}
::selection{background:var(--pink);color:var(--on-fill)}

.skip{position:absolute;left:-9999px;background:var(--ink);color:var(--paper);
  font-weight:700;font-size:13px;padding:10px 14px;z-index:99}
.skip:focus{left:20px;top:20px}

/* ---- misregistration: the signature ---- */
/* WHY the display type carries its own colour: at clamp(...96px) Archivo Black
   is a huge solid mass, and paper-white at 14.7:1 glares on a dark screen. body
   copy stays bright because its strokes are thin; headings cannot. dimming the
   fill also lets the pink and blue plates read more clearly, which is the look. */
.riso,.signoff,.rung h3,.entries h3,.prose > h3{color:var(--display-ink)}

.riso{
  font-family:var(--display);
  text-transform:lowercase;
  line-height:.92;
  letter-spacing:-.02em;
  text-shadow:
     3px 3px 0 var(--pink),
    -3px -2px 0 var(--blue);
}

/* ---- masthead ---- */
header{padding:56px 0 40px;border-bottom:4px solid var(--ink)}
.eyebrow{
  font-size:12px;letter-spacing:.18em;font-weight:700;
  display:inline-block;background:var(--ink);color:var(--paper);
  padding:5px 9px;margin-bottom:22px;
}
/* the eyebrow sits on ink, so its link cannot use the page's blue */
.eyebrow a{color:var(--paper);text-underline-offset:3px;text-decoration-color:var(--pink)}
.eyebrow a:hover{color:var(--pink)}
/* sized to break "the somerset wine cryptid" into two stacked lines rather
   than four ragged ones -- the wrap is the point, it fills the plate. */
h1.riso{font-size:clamp(34px,11vw,96px);margin:0 0 26px}
h1.riso a{color:inherit;text-decoration:none}
.creed{list-style:none;margin:0;padding:0;font-size:clamp(19px,4.6vw,26px);font-weight:700;line-height:1.25}
.creed li{padding:3px 0}
.creed li:nth-child(2){color:var(--blue)}
.creed li:nth-child(3){color:var(--pink)}

nav{padding:16px 0;border-bottom:2px solid var(--ink);font-size:13px;font-weight:700;
  letter-spacing:.06em;display:flex;flex-wrap:wrap;align-items:center;gap:10px 18px}
.nav-links{display:flex;flex-wrap:wrap;gap:6px 18px}
nav a{display:inline-block;padding:3px 0}

/* the switcher. hidden in the markup until the script can make it work, so a
   reader with javascript off never meets a button that does nothing. */
.theme{
  margin-left:auto;
  font-family:var(--mono);font-size:12px;font-weight:700;letter-spacing:.06em;
  text-transform:lowercase;
  background:var(--paper);color:var(--ink);
  border:2px solid var(--ink);
  padding:9px 12px;cursor:pointer;
}
.theme:hover{background:var(--pink);border-color:var(--pink);color:var(--on-fill)}
.theme[hidden]{display:none}

/* ---- sections ---- */
section{padding:52px 0;border-bottom:2px solid var(--ink)}
h2.riso{font-size:clamp(30px,8vw,54px);margin:0 0 8px}
.standfirst{font-size:15px;max-width:52ch;margin:0 0 28px}

/* ---- house rules ---- */
.rules{list-style:none;margin:0;padding:0}
.rules li{
  border-top:2px dashed var(--ink);
  padding:14px 0 14px 34px;
  position:relative;font-size:15px;
}
.rules li:last-child{border-bottom:2px dashed var(--ink)}
.rules li::before{
  content:"✕";position:absolute;left:0;top:13px;
  color:var(--pink);font-weight:700;
}

/* ---- the gauntlet ladder ---- */
.ladder{list-style:none;margin:0;padding:0;position:relative}
.ladder::before{
  content:"";position:absolute;left:26px;top:0;bottom:0;width:4px;
  background:linear-gradient(to bottom,var(--blue),var(--overprint),var(--pink));
}
.rung{position:relative;padding:0 0 26px 66px}
.rung .pin{
  position:absolute;left:14px;top:2px;width:28px;height:28px;
  background:var(--ink);color:var(--paper);
  display:grid;place-items:center;font-size:13px;font-weight:700;
  border-radius:50%;
}
.rung h3{
  font-family:var(--display);font-size:clamp(17px,4.4vw,23px);
  margin:0 0 4px;line-height:1.1;letter-spacing:-.01em;
}
.rung h3 a{color:inherit;text-decoration-color:var(--pink)}
.rung h3 a:hover{color:var(--pink)}
.rung p{margin:0 0 8px;font-size:14px;max-width:48ch}
/* the pink box is always our name for the bottle, so it is always pink, and it
   has to wrap: "i saw god and he wouldn't make eye contact" is a long tag. */
.tag{
  display:inline-block;font-size:12px;font-weight:700;letter-spacing:.06em;
  line-height:1.45;background:var(--pink);border:2px solid var(--pink);
  color:var(--on-fill);padding:3px 8px;margin-bottom:8px;
}
.meter{display:flex;gap:3px;margin-top:2px}
.meter span{width:15px;height:9px;border:2px solid var(--ink)}
.meter span.on{background:var(--ink)}
.endnote{margin-top:6px;font-size:14px;font-weight:700;color:var(--overprint);max-width:48ch}

/* ---- the boxed aside ---- */
.log{
  border:3px solid var(--ink);padding:24px;font-size:15px;
  background:repeating-linear-gradient(135deg,transparent 0 12px,var(--hatch) 12px 24px);
}
.log p{margin:0 0 10px}
.log p:last-child{margin:0}
.log-label{
  display:inline-block;font-size:11px;font-weight:700;letter-spacing:.14em;
  background:var(--ink);color:var(--paper);padding:3px 8px;margin-bottom:12px;
}

/* ---- the log listing ---- */
.entries{list-style:none;margin:0 0 26px;padding:0}
.entries li{border-top:2px dashed var(--ink)}
.entries li:last-child{border-bottom:2px dashed var(--ink)}
.entries a{display:block;padding:18px 0;text-decoration:none;color:var(--ink)}
.entry-date{font-size:11px;font-weight:700;letter-spacing:.12em;display:block;margin-bottom:6px}
.entries h3{font-family:var(--display);font-size:clamp(19px,5vw,26px);margin:0 0 8px;line-height:1.05;letter-spacing:-.01em}
.entries a:hover h3{text-shadow:2px 2px 0 var(--pink),-2px -1px 0 var(--blue)}
.entries p{margin:0;font-size:14px;max-width:52ch}
.entries .more{display:inline-block;margin-top:8px;font-size:12px;font-weight:700;letter-spacing:.08em;color:var(--blue)}
.entries a:hover .more{color:var(--pink)}

/* ---- a written-up entry ---- */
.post-head{padding:52px 0 34px;border-bottom:4px solid var(--ink)}
.post-title{font-size:clamp(36px,10vw,76px);margin:0 0 20px}
.post-meta{font-size:12px;letter-spacing:.16em;font-weight:700;margin:0}
.post-standfirst{font-size:17px;font-weight:700;max-width:50ch;margin:22px 0 0}

/* the outer .wrap supplies the gutters, so .prose only ever sets block padding */
.prose{padding-block:44px 8px}
.prose > p,.prose > ul,.prose > ol,.prose > blockquote{max-width:62ch}
.prose > p{margin:0 0 18px}
.prose > h2{font-size:clamp(26px,7vw,42px);margin:44px 0 14px}
.prose > h3{font-family:var(--display);font-size:clamp(18px,4.6vw,24px);margin:34px 0 10px;line-height:1.1;letter-spacing:-.01em}
.prose > ul:not([class]),.prose > ol:not([class]){margin:0 0 18px;padding-left:20px}
.prose > ul:not([class]) > li,.prose > ol:not([class]) > li{margin-bottom:8px}
.prose > ul:not([class]) > li::marker,.prose > ol:not([class]) > li::marker{color:var(--pink)}
.prose > blockquote{
  margin:24px 0;padding:4px 0 4px 18px;border-left:4px solid var(--pink);
  font-weight:700;
}
.prose code{background:rgba(19,19,22,.08);padding:1px 5px;font-size:14px}
.prose pre{border:2px solid var(--ink);padding:16px;overflow-x:auto;margin:0 0 18px}
.prose pre code{background:none;padding:0}
.rule{border:0;border-top:2px dashed var(--ink);margin:36px 0}
.prose .ladder,.prose .rules,.prose .log{margin-bottom:26px}

/* WHY these are blocks and not inline links: they were 13px of blue sitting
   alone in a lot of white space at the bottom of a long page, and they read as
   nothing. the way out of a page has to be as obvious as the way in. */
.post-foot{padding:32px 0 44px;border-top:2px solid var(--ink);
  display:flex;flex-wrap:wrap;gap:12px}
.post-foot a{
  display:inline-block;
  font-size:14px;font-weight:700;letter-spacing:.06em;
  text-decoration:none;
  color:var(--ink);background:var(--paper);
  border:3px solid var(--ink);
  padding:12px 16px;
}
.post-foot a:hover,.post-foot a:focus-visible{
  background:var(--pink);border-color:var(--pink);color:var(--on-fill);
}

/* ---- footer ---- */
footer{padding:44px 0 70px;font-size:15px}
footer p{margin:0 0 10px}
footer .links a{margin-right:16px;font-weight:700;display:inline-block;padding:4px 0}
.signoff{font-family:var(--display);font-size:clamp(22px,6vw,34px);margin-top:26px}

@media (max-width:520px){
  /* .nav-links is a single flex item, so it claimed the whole row and bumped the
     switcher onto a line of its own -- ~54px of nav gone on a phone. display:contents
     drops the wrapper out of the flow so links and button wrap as one group. */
  .nav-links{display:contents}
  .theme{margin-left:0}
  .rung{padding-left:56px}
  .ladder::before{left:20px}
  .rung .pin{left:8px}
}
