/* ============================================================
   Gilded Bard site template (every GB page except the story
   containers: Thistle and A Light and Tragic Love Story).

   The look: a clean, sterile white space that the creatives have
   moved into. Big heavy headlines, then a few marks left by hand:
   a red marker underline, a handwritten note, a stamp, masking tape.
   Mobile first: nothing lives in the side margins.
   Keep it about 80% clean, 20% mess. One or two marks per screen.

   GB logo top left beside "where stories begin"; the shared, LOCKED
   <asugoh-footer> (asugoh-logo variant) at the bottom.

   Start a new page from _template.html. Put page content inside
   <main class="page">. Use the classes below; avoid one-off styles.
   ============================================================ */

@font-face {
  font-family: 'Trebuchet MS';
  src: url('/fonts/trebuchet.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --ink: #161615;        /* headlines, main text */
  --ink-soft: #3d3d3a;   /* body copy */
  --ink-faint: #8a8a85;  /* captions, small labels */
  --rule: #e9e9e6;       /* hairlines */
  --gold: #b8953a;       /* GB accent */
  --marker: #ec3d17;     /* red marker: underlines, "YES!", stamps */
  --pencil: #6f6f6a;     /* pencil gray */
  --ballpoint: #2533d6;  /* blue pen */
  --focus: #ec3d17;
  --column: 680px;
  --gutter: 20px;
  --page-end: 72px;      /* space between content and footer */
  --font-head: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-hand: 'Caveat', 'Bradley Hand', cursive;
  --font-marker: 'Permanent Marker', 'Marker Felt', cursive;
  --font-brand: 'Trebuchet MS', Tahoma, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { background: var(--bg); }

body {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
img { display: block; max-width: 100%; height: auto; }

/* ---------- Header: GB logo | where stories begin ---------- */
.gb-header {
  width: 100%;
  max-width: var(--column);
  margin: 0 auto;
  padding: 26px var(--gutter) 22px;
  border-bottom: 1px solid var(--rule);
}
.brandline {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  font-family: var(--font-brand);
  text-transform: lowercase;
}
.brandline-logo { display: block; height: 20px; width: auto; }
.brandline-divider { width: 1px; height: 18px; background: var(--gold); flex-shrink: 0; }
.brandline-tagline { font-size: 13px; letter-spacing: 0.3em; color: var(--ink-soft); }

/* ---------- Page column ---------- */
.page {
  position: relative;
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--column);
  margin: 0 auto;
  padding: 64px var(--gutter) var(--page-end);
}
.hero { position: relative; }
.section { position: relative; margin-top: 96px; }

/* ---------- Type ---------- */
h1, h2, h3 { font-family: var(--font-head); color: var(--ink); }
h1 {
  font-size: 76px;
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.035em;
  word-spacing: 0.08em;
  margin-bottom: 28px;
}
h2 {
  font-size: 40px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  word-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 18px;
}
h3 { font-size: 22px; font-weight: 700; margin: 28px 0 8px; }
p { color: var(--ink-soft); margin-bottom: 18px; }
.lede { font-size: 20px; line-height: 1.55; color: var(--ink); max-width: 34em; }
.centered { text-align: center; }
.centered .lede { margin-left: auto; margin-right: auto; }

.text-link {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--marker);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}
.text-link:hover { color: var(--marker); }

/* ---------- Marks left by hand ---------- */

/* Red marker underline: wrap words in <span class="marked">. */
.marked { position: relative; display: inline-block; white-space: nowrap; }
.marked::after {
  content: "";
  position: absolute;
  left: -2%;
  right: -3%;
  bottom: -0.1em;
  height: 0.2em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 20' preserveAspectRatio='none'%3E%3Cpath d='M3 13 C 60 6, 130 4, 200 8 S 280 12, 297 7' fill='none' stroke='%23ec3d17' stroke-width='6' stroke-linecap='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  pointer-events: none;
}

/* A word scrawled above something: <span class="scrawl">YES!</span> inside a .marked or any inline-block. */
.scrawl-anchor { position: relative; display: inline-block; }
.scrawl {
  position: absolute;
  right: -0.2em;
  top: -0.55em;
  font-family: var(--font-marker);
  font-size: 0.32em;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--marker);
  transform: rotate(-10deg);
  white-space: nowrap;
  pointer-events: none;
}

/* Handwritten note in the flow, e.g. above a heading: <p class="note">. */
.note {
  display: inline-block;
  margin: 0 0 6px;
  font-family: var(--font-hand);
  font-size: 24px;
  line-height: 1.1;
  color: var(--marker);
  transform: rotate(-3deg);
  transform-origin: left bottom;
}

/* Blue pen: a scribbled number or circle. */
.pen {
  font-family: var(--font-hand);
  font-weight: 700;
  color: var(--ballpoint);
}

/* Rubber stamp. */
.stamp {
  display: inline-block;
  padding: 2px 10px 0;
  border: 3px solid var(--marker);
  border-radius: 3px;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--marker);
  transform: rotate(-7deg);
  opacity: 0.88;
  mix-blend-mode: multiply;
  vertical-align: middle;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 14px 26px;
  background: var(--ink);
  color: var(--gold);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  box-shadow: 5px 5px 0 var(--gold);
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--gold); }

/* ---------- Story covers, taped to the wall ---------- */
.covers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-top: 36px;
}
.cover { position: relative; display: block; text-decoration: none; }
.cover:nth-child(1) { transform: rotate(-1.6deg); }
.cover:nth-child(2) { transform: rotate(1.3deg); margin-top: 22px; }
.cover img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
}
.cover::before {               /* masking tape */
  content: "";
  position: absolute;
  z-index: 1;
  top: -14px;
  left: 50%;
  width: 96px;
  height: 28px;
  background: rgba(236, 226, 196, 0.82);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  transform: translateX(-50%) rotate(-4deg);
}
.cover:nth-child(2)::before { transform: translateX(-50%) rotate(5deg); }
.cover-title {
  display: block;
  margin-top: 18px;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.cover-link {
  display: block;
  font-family: var(--font-hand);
  font-size: 24px;
  line-height: 1.1;
  color: var(--marker);
}
.cover:hover .cover-link { text-decoration: underline; }

/* ---------- Email signup: one underline ---------- */
.signup {
  display: flex;
  align-items: baseline;
  max-width: 360px;
  margin-top: 8px;
  border-bottom: 2px solid var(--ink);
}
.signup:focus-within { border-color: var(--marker); }
.signup[hidden] { display: none; }
.signup input[type="email"] {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  padding: 10px 0;
  background: transparent;
  color: var(--ink);
  font: 400 17px var(--font-body);
}
.signup input::placeholder { color: var(--ink-faint); font-family: var(--font-hand); font-size: 22px; }
.signup button {
  border: 0;
  background: transparent;
  color: var(--marker);
  font-size: 22px;
  cursor: pointer;
  padding: 6px 2px 6px 12px;
}
.signup-msg { font-family: var(--font-hand); font-size: 26px; color: var(--marker); }
.hidden-field { position: absolute; left: -9999px; }

/* ---------- Footer: the shared <asugoh-footer> draws itself ---------- */
asugoh-footer {
  --asugoh-footer-max-width: var(--column);
  --asugoh-footer-hover: var(--ink); /* light page: hover goes dark, not white */
}
/* No-JavaScript fallback only (matches asugoh.com's Footer.astro). */
asugoh-footer:not(:defined) {
  display: block;
  width: 100%;
  max-width: var(--column);
  margin: 0 auto;
  padding: 1.5rem var(--gutter) 1.75rem;
  font: 10px 'Helvetica Neue', Helvetica, Arial, sans-serif;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #9a9385;
}
asugoh-footer:not(:defined) a { color: #9a9385; text-decoration: none; margin-right: 1.5rem; }
asugoh-footer:not(:defined) .asugoh-footer-mark { float: right; margin-right: 0; }

@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
}

/* ---------- Phones ---------- */
@media (max-width: 700px) {
  body { font-size: 16px; }
  .gb-header { padding-top: 20px; padding-bottom: 18px; }
  .brandline { gap: 10px; }
  .brandline-logo { height: 16px; }
  .brandline-divider { height: 14px; }
  .brandline-tagline { font-size: 10px; letter-spacing: 0.1em; }
  .page { padding-top: 44px; }
  .section { margin-top: 72px; }
  h1 { font-size: 50px; }
  h2 { font-size: 30px; }
  .lede { font-size: 18px; }
  .covers { gap: 22px; }
  .cover-title { font-size: 18px; }
  .cover-link { font-size: 20px; }
}
@media (max-width: 350px) {
  .brandline { gap: 8px; }
  .brandline-logo { height: 14px; }
  .brandline-tagline { font-size: 9px; letter-spacing: 0.04em; }
  h1 { font-size: 42px; }
}

/* ---------- Landing (gildedbard.com): logo, tag, red arrow. Promotes no story. ---------- */
.landing {
  min-height: 70vh;
  min-height: 70svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: 24px;
}
.landing-logo img { width: min(78vw, 420px); height: auto; margin: 0 auto; }
.landing-tag {
  max-width: 22em;
  margin: 26px auto 0;
  font-family: 'Courier Prime', 'Courier New', Courier, monospace;
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
}
.landing-arrow {
  display: block;
  margin-top: 36px;
  color: var(--marker);
  transform: rotate(-6deg);
}

@media (max-width: 700px) {
  .landing-tag { font-size: 16px; }
}

/* "the ^real world": a word added in red marker above a caret. */
.insert {
  position: relative;
  display: inline-block;
  width: 0.6em;
  height: 1em;
  vertical-align: baseline;
}
.insert::before {                 /* the caret */
  content: "^";
  position: absolute;
  left: 50%;
  bottom: -0.45em;
  transform: translateX(-50%);
  font-family: var(--font-marker);
  font-size: 0.95em;
  color: var(--marker);
}
.insert-word {
  position: absolute;
  left: 50%;
  bottom: 0.6em;
  transform: translateX(-50%) rotate(-6deg);
  font-family: var(--font-marker);
  font-size: 1.2em;
  line-height: 1;
  color: var(--marker);
  white-space: nowrap;
}

/* Landing: leaving in the direction you swiped. */
body { transition: opacity 0.3s ease, transform 0.3s ease; }
body.leaving { opacity: 0; transform: translate(var(--leave-x, 0), var(--leave-y, 0)); }
.landing-arrow { border: 0; background: transparent; padding: 6px; cursor: pointer; transition: transform 0.35s cubic-bezier(.5,1.8,.5,1); }

/* ---------- /drift: titles thrown at you. Hesitate and you lose it. ---------- */
.drift-page { padding-top: 16px; padding-bottom: 24px; }
.drift-field {
  position: relative;
  height: 70vh;
  height: 70svh;
  min-height: 380px;
  overflow: hidden;
  touch-action: manipulation;
}
.drift-title {
  position: absolute;
  white-space: nowrap;
  font-family: var(--font-head);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--ink);
  text-decoration: none;
  padding: 10px 4px;          /* bigger tap target */
  opacity: 0;
  transform: rotate(var(--tilt, 0deg)) scale(0.85);
  transition: opacity 0.18s ease-out, transform 0.18s ease-out, color 0.15s;
}
.drift-title.is-in { opacity: 1; transform: rotate(var(--tilt, 0deg)) scale(1); }
.drift-title.is-out { opacity: 0; transform: rotate(var(--tilt, 0deg)) scale(1.06); transition-duration: 0.35s; }
.drift-title.is-ether {          /* dissolves upward like smoke */
  opacity: 0;
  filter: blur(12px);
  letter-spacing: 0.25em;
  transform: rotate(var(--tilt, 0deg)) translateY(-46px) scale(1.12);
  transition: opacity 1.6s ease-in, filter 1.6s ease-in, letter-spacing 1.6s ease-out, transform 1.6s ease-out;
}
.drift-title:hover { color: var(--marker); }
.has-catch .drift-title:not(.is-caught) { opacity: 0; }
.drift-title.is-caught { opacity: 1; transform: rotate(-3deg) scale(1.05); }
.drift-title.is-caught::after {   /* red marker circle around the catch */
  content: "";
  position: absolute;
  inset: -6px -12px;
  border: 3px solid var(--marker);
  border-radius: 50% 46% 52% 44%;
  transform: rotate(-4deg);
}
.drift-again {
  display: block;
  margin: 10px auto 0;
  border: 0;
  background: transparent;
  font-family: var(--font-hand);
  font-size: 24px;
  color: var(--marker);
  cursor: pointer;
}
.drift-again[hidden] { display: none; }
.drift-again:hover { text-decoration: underline; }
@media (prefers-reduced-motion: reduce) {
  body, .landing-arrow, .drift-title { transition: none; }
}
