/* ==========================================================================
   Nevada County Geekout
   A photocopied zine that happens to be a website. Black ink, cheap paper,
   fonts off a label maker.
   ========================================================================== */

@font-face {
  font-family: 'Comic Zine';
  src: url('/fonts/comiczine.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Embossing Tape';
  src: url('/fonts/embossingtape1.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Dymo';
  src: url('/fonts/dymo.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Plastique';
  src: url('/fonts/plastique.woff2') format('woff2');
  font-display: swap;
}

/* --- Ink and paper ------------------------------------------------------ */

:root {
  --paper: #e9e5da;
  --ink: #14110d;
  --ink-soft: #4a453c;
  --rule: #14110d;
  --paper-img: url('/img/paper.jpg');
  --paper-blend: multiply;
  --paper-size: 560px;
  --art-filter: none;
  --grain: 0.055;

  /* Display faces off the flyer. Embossing Tape and Dymo are knockout
     label-maker types — every glyph carries its own solid block — so they only
     read above ~1.2rem. Small copy gets a plain typewriter instead, which is
     period-correct for a zine and costs nothing to load. */
  --display: 'Comic Zine', 'Comic Sans MS', cursive;
  --label: 'Embossing Tape', 'Courier New', monospace;
  --tape: 'Dymo', 'Courier New', monospace;
  --scrawl: 'Plastique', 'Comic Sans MS', cursive;
  --type: 'Courier New', Courier, monospace;

  color-scheme: light;
}

/* The same zine, photocopied onto black. Inverting the line art is what keeps
   the drawings readable — they're black-on-transparent SVG. */
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #17150f;
    --ink: #ebe6d8;
    --ink-soft: #a49d8c;
    --rule: #ebe6d8;
    --paper-img: url('/img/paper-dark.jpg');
    --paper-blend: screen;
    --art-filter: invert(1);
    --grain: 0.09;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background-color: var(--paper);
  background-image: var(--paper-img);
  background-size: var(--paper-size);
  background-blend-mode: var(--paper-blend);
  color: var(--ink);
  font-family: var(--label);
  font-size: clamp(1rem, 0.9rem + 0.5vw, 1.15rem);
  line-height: 1.45;
  overflow-x: hidden;
}

/* Toner speckle over everything. */
.grain {
  position: fixed;
  inset: -50%;
  pointer-events: none;
  z-index: 9;
  opacity: var(--grain);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

a {
  color: inherit;
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
}
a:hover { background: var(--ink); color: var(--paper); text-decoration: none; }

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

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

.skip {
  position: absolute; left: -9999px;
  background: var(--ink); color: var(--paper);
  padding: 0.6em 1em; z-index: 20;
  font-family: var(--type);
}
.skip:focus { left: 1rem; top: 1rem; }

.page {
  max-width: 46rem;
  margin: 0 auto;
  padding: clamp(1rem, 4vw, 3rem) clamp(1rem, 5vw, 2.5rem) 4rem;
  position: relative;
  z-index: 1;
}

/* --- Hero --------------------------------------------------------------- */

.terminal {
  position: relative;
  margin: 0 auto;
  container-type: inline-size;
}

.terminal-art {
  display: block;
  width: 100%;
  filter: var(--art-filter);
}

/* Live text sitting inside the CRT bezel. Coordinates measured off the
   traced VT103 artwork: the glass runs 21.1%–54.4% across, 10.8%–45% down. */
.screen {
  position: absolute;
  left: 21.1%;
  top: 10.8%;
  width: 33.3%;
  height: 34.2%;
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.12em;
  padding: 0 0.4em;
  font-family: var(--display);
  font-weight: normal;
  /* Sized off the terminal drawing, so it stays inside the glass at any width.
     'Geek out?' is the widest line and sets the ceiling. */
  font-size: 5.7cqw;
  line-height: 1.05;
  letter-spacing: 0;
  transform: rotate(-0.6deg);
}
@supports not (container-type: inline-size) {
  .screen { font-size: clamp(0.75rem, 4.2vw, 1.9rem); }
}

.screen-line { display: block; white-space: nowrap; }

.caret {
  display: inline-block;
  width: 0.09em;
  height: 0.82em;
  margin-left: 0.1em;
  vertical-align: -0.06em;
  background: currentColor;
  animation: blink 1.15s step-end infinite;
}
@keyframes blink { 0%, 55% { opacity: 1; } 56%, 100% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .caret { animation: none; }
}

.pitch {
  margin: 0 0 0.35em;
  font-family: var(--label);
  font-size: clamp(0.78rem, 4.15vw, 1.95rem);
  line-height: 1.18;
  letter-spacing: 0.01em;
  transform: rotate(-0.5deg);
}

/* --- Where / when ------------------------------------------------------- */

.details {
  position: relative;
  margin: clamp(1rem, 3vw, 1.75rem) 0 0;
}

.note-cluster {
  float: right;
  width: min(21%, 9.25rem);
  margin: 0 0 0 1rem;
  position: relative;
}

.note {
  position: relative;
  transform: rotate(2deg);
  container-type: inline-size;
}
.note-art { display: block; width: 100%; filter: var(--art-filter); }

.note-text {
  position: absolute;
  inset: 9% 15% 10% 12%;
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  font-family: var(--scrawl);
  font-size: 10.5cqw;
  line-height: 1.18;
  letter-spacing: 0.02em;
}
@supports not (container-type: inline-size) {
  .note-text { font-size: clamp(0.58rem, 2.1vw, 0.86rem); }
}

.arrow-art {
  display: block;
  width: 76%;
  /* Overhangs the note's left edge so the head points down-left, off the
     cluster and onto the first line of the address. */
  margin: -6% 0 0 -30%;
  transform: rotate(-4deg);
  filter: var(--art-filter);
}

.where {
  font-style: normal;
  font-family: var(--label);
  font-size: clamp(0.95rem, 3.4vw, 1.35rem);
  line-height: 1.34;
  text-align: right;
  text-wrap: balance;
  clear: right;
  padding-top: 0.35em;
}
.where .line { display: block; }
.where .em { margin-top: 0.35em; }

.map-link {
  clear: both;
  margin: 0.75rem 0 0;
  text-align: right;
  font-family: var(--type);
  font-size: 0.95rem;
}

/* --- Next meeting marquee ----------------------------------------------- */

.marquee {
  margin: clamp(2.5rem, 8vw, 4rem) 0;
  padding: 1.1rem 1rem 1.3rem;
  text-align: center;
  color: var(--paper);
  background: var(--ink);
  transform: rotate(-0.9deg);
  box-shadow: 6px 6px 0 var(--ink-soft);
}

.marquee-label {
  margin: 0 0 0.15em;
  font-family: var(--tape);
  font-size: clamp(1.1rem, 4vw, 1.35rem);
  font-weight: normal;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.marquee-date {
  margin: 0.15em 0 0;
  font-family: var(--label);
  font-size: clamp(1.35rem, 5.6vw, 2.1rem);
  line-height: 1.12;
  text-wrap: balance;
}

.marquee-time {
  margin: 0.1em 0 0;
  font-family: var(--label);
  font-size: clamp(1rem, 3.6vw, 1.3rem);
}

.marquee-cal {
  margin: 0.7em 0 0;
  font-family: var(--type);
  font-size: 0.9rem;
}
.marquee-cal a { color: inherit; }
.marquee-cal a:hover { background: var(--paper); color: var(--ink); }

/* --- Cut-out coupons ---------------------------------------------------- */

.coupon {
  position: relative;
  margin: clamp(2rem, 7vw, 3.25rem) 0;
  padding: 2rem clamp(1rem, 4vw, 2rem);
  border: 3px dashed var(--rule);
  transform: rotate(0.4deg);
}
.coupon-alt { transform: rotate(-0.5deg); }

.cutline {
  position: absolute;
  top: -0.85em;
  left: 1.5rem;
  background: var(--paper);
  padding: 0 0.4em;
  line-height: 1;
}
.scissors { font-size: 1.4rem; }

.coupon-h {
  margin: 0;
  font-family: var(--display);
  font-weight: normal;
  font-size: clamp(2rem, 8vw, 3rem);
  line-height: 1;
}

.coupon-sub {
  margin: 0.5rem 0 1.6rem;
  max-width: 42ch;
  font-family: var(--type);
  font-size: 0.98rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

/* --- Forms -------------------------------------------------------------- */

.form { margin: 0; }

.hp { position: absolute; left: -9999px; }

.field { margin: 0 0 1.25rem; }
.field-narrow input { max-width: 6.5rem; }

.field label,
.check label {
  display: block;
  font-family: var(--label);
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  margin-bottom: 0.4rem;
}

.opt { color: var(--ink-soft); }

input[type='text'],
input[type='email'],
input[type='number'],
textarea {
  width: 100%;
  padding: 0.5rem 0.15rem;
  font-family: var(--type);
  font-size: 1.05rem;
  color: var(--ink);
  background: transparent;
  /* A ruled line to write on, not a box. */
  border: 0;
  border-bottom: 2px solid var(--rule);
  border-radius: 0;
  appearance: none;
}
textarea { resize: vertical; line-height: 1.4; }

input::placeholder,
textarea::placeholder {
  color: var(--ink-soft);
  opacity: 0.7;
  font-family: var(--type);
  font-size: 0.9rem;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin: 0 0 1.75rem;
}
.check input {
  flex: 0 0 auto;
  width: 1.15rem;
  height: 1.15rem;
  margin: 0.15rem 0 0;
  accent-color: var(--ink);
}
.check label { margin: 0; line-height: 1.4; }

.btn {
  font-family: var(--label);
  font-size: 1.3rem;
  padding: 0.55rem 1.5rem;
  color: var(--paper);
  background: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 0;
  cursor: pointer;
  box-shadow: 5px 5px 0 var(--ink-soft);
  transition: transform 0.08s, box-shadow 0.08s;
}
.btn:hover { transform: translate(2px, 2px); box-shadow: 3px 3px 0 var(--ink-soft); }
.btn:active { transform: translate(5px, 5px); box-shadow: 0 0 0 var(--ink-soft); }
.btn[disabled] { opacity: 0.5; cursor: progress; }

.status {
  margin: 1rem 0 0;
  min-height: 1.4em;
  font-family: var(--type);
  font-size: 0.98rem;
  line-height: 1.45;
}
.status.err { text-decoration: underline wavy; text-underline-offset: 4px; }
.status.ok::before { content: '✔ '; }

.field.bad input,
.field.bad textarea { border-bottom-width: 4px; }
.field.bad label::after { content: ' ←'; }

/* --- Footer ------------------------------------------------------------- */

.footer {
  margin-top: clamp(3rem, 10vw, 5rem);
  border-top: 3px solid var(--rule);
  padding-top: 1.5rem;
  text-align: center;
}

.footer-flyer { margin: 0 0 1.5rem; }
.footer-flyer a { display: inline-block; text-decoration: none; }
.footer-flyer a:hover { background: none; color: inherit; }
.footer-flyer img {
  width: min(11rem, 45%);
  /* Deliberately not inverted in dark mode — it's a printed sheet, and it
     should read as one sitting on the dark page. */
  background: #fff;
  border: 2px solid var(--rule);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
  transform: rotate(-2deg);
  transition: transform 0.12s;
}
.footer-flyer a:hover img { transform: rotate(1deg) scale(1.02); }
.footer-flyer span {
  display: block;
  margin-top: 0.75rem;
  font-family: var(--type);
  font-size: 0.9rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-flyer .footer-fmt {
  margin-top: 0.3rem;
  font-size: 0.78rem;
  color: var(--ink-soft);
  text-decoration: none;
  letter-spacing: 0.06em;
}

.colophon {
  margin: 0;
  font-family: var(--type);
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

/* --- Narrow screens ----------------------------------------------------- */

@media (max-width: 34rem) {
  /* The note keeps its place beside the pitch all the way down — cluster,
     label and arrow are all sized in percentages of the container, so the
     whole assembly shrinks rather than reflowing under the text. */
  .marquee { transform: none; }
}

/* --- Print: it should photocopy well --------------------------------- */

@media print {
  .grain, .skip, .coupon .btn, .marquee-cal, .footer-flyer { display: none; }
  body { background: #fff; color: #000; }
  .marquee { color: #000; background: none; border: 3px solid #000; box-shadow: none; }
  .page { max-width: none; }
}
