/* Youth Voices - shared styles
   Desktop (>= 860px): each .stage is a 1366x768 design frame. The design image is the
   background; interactive bits (.ov) sit on top, positioned in design pixels via
   --x --y --w (see tools/asset_manifest.json).
   Mobile (< 860px): stages become a single stacked column; .m elements (mobile-only
   artwork) and .mtext (real text that the desktop image already shows) appear. */

@font-face { font-family: 'Anton'; src: url(../fonts/anton-latin.woff2) format('woff2'); font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD; }
@font-face { font-family: 'Anton'; src: url(../fonts/anton-latin-ext.woff2) format('woff2'); font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Space Grotesk'; src: url(../fonts/spacegrotesk-latin.woff2) format('woff2'); font-weight: 300 700; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD; }
@font-face { font-family: 'Space Grotesk'; src: url(../fonts/spacegrotesk-latin-ext.woff2) format('woff2'); font-weight: 300 700; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Spicy Rice'; src: url(../fonts/spicyrice-latin.woff2) format('woff2'); font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD; }
@font-face { font-family: 'Spicy Rice'; src: url(../fonts/spicyrice-latin-ext.woff2) format('woff2'); font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --orange: #e36824;
  --red: #e3330f;
  --cream: #fdf4e7;
  --beige: #dddac4;
  --sand: #eecf86;
  --teal: #035968;
  --brown: #5b2a0f;
  --ink: #1f1a17;
  --body: 'Space Grotesk', system-ui, sans-serif;
  --display: 'Spicy Rice', 'Space Grotesk', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--body); color: var(--ink); background: var(--beige); }
img { max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; border-radius: 6px; }

.sr-only, .mtext {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.m { display: none; }

/* ------------------------------------------------------------------ stage */
.stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1366 / 768;
  container-type: inline-size;
  overflow: hidden;
}
.stage > .bg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ov {
  position: absolute;
  left: calc(var(--x) * 100% / 1366);
  top: calc(var(--y) * 100% / 768);
  width: calc(var(--w) * 100% / 1366);
  margin: 0;
}
.ov > img, .imgbtn > img { display: block; width: 100%; height: auto; }

.imgbtn { display: block; transition: transform .15s ease, filter .15s ease; -webkit-tap-highlight-color: transparent; }
.imgbtn:hover { transform: translateY(-3px) scale(1.02); filter: drop-shadow(0 6px 0 rgba(0,0,0,.18)); }
.imgbtn:active { transform: translateY(1px) scale(.99); }
button.imgbtn { padding: 0; border: 0; background: none; cursor: pointer; font: inherit; }

/* ------------------------------------------------------------------ landing */
.landing .stage { background: var(--orange); }
.manifesto {
  font-family: 'Anton', sans-serif; color: var(--brown); text-transform: uppercase;
  text-align: center; font-size: 1.35rem; line-height: 1.55; letter-spacing: .01em; margin: 0; max-width: 34rem;
}
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; width: 100%; max-width: 34rem; }
.steps li { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: center; }
.steps .flower { width: 96px; height: auto; }
.steps .step-title { height: 22px; width: auto; display: block; margin-bottom: 6px; }
.steps p { margin: 0; color: #efe2c6; font-size: 1rem; line-height: 1.4; }
.credit { font-size: .75rem; line-height: 1.45; color: #2b1a10; text-align: center; max-width: 40rem; margin: 0; }
.credit-sr { font-size: 1rem; }

/* ------------------------------------------------------------------ post form */
.form-page { background: var(--beige); min-height: 100vh; }
.form-page .stage { background: var(--beige); }
.field {
  font-family: var(--body);
  font-size: calc(23 * 100cqw / 1366);
  line-height: calc(41 * 100cqw / 1366);
  color: var(--teal);
  background: transparent;
  border: 0;
  border-radius: calc(22 * 100cqw / 1366);
  padding: 0 calc(25 * 100cqw / 1366);
  resize: none;
}
.field::placeholder { color: var(--teal); opacity: .75; }
.field:focus { outline: none; box-shadow: inset 0 0 0 3px rgba(3, 89, 104, .45); }
.field[aria-invalid="true"] { box-shadow: inset 0 0 0 3px var(--red); }
input.field { height: calc(61 * 100cqw / 1366); }
textarea.field { height: calc(150 * 100cqw / 1366); padding-top: calc(13 * 100cqw / 1366); padding-bottom: calc(13 * 100cqw / 1366); }
.counter {
  position: absolute; font-size: calc(15 * 100cqw / 1366); color: var(--teal); opacity: .7;
  text-align: right; pointer-events: none;
}
.counter.over { color: var(--red); opacity: 1; font-weight: 700; }

.cats { display: flex; gap: calc(12 * 100cqw / 1366); border: 0; padding: 0; margin: 0; min-width: 0; }
.cats legend { padding: 0; }
.cat { position: relative; flex: 1; }
.cat input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.cat span {
  display: block; text-align: center; cursor: pointer;
  font-family: var(--display); color: var(--c);
  font-size: calc(21 * 100cqw / 1366); line-height: 1;
  padding: calc(12 * 100cqw / 1366) calc(8 * 100cqw / 1366);
  background: var(--cream);
  border: calc(4 * 100cqw / 1366) solid var(--c);
  box-shadow: 0 0 0 calc(3 * 100cqw / 1366) var(--c2), 0 0 0 calc(5 * 100cqw / 1366) var(--ink);
  border-radius: 999px;
  transition: transform .12s ease, background .12s ease;
}
.cat:hover span { transform: translateY(-2px); }
.cat input:checked + span { background: var(--c); color: var(--cream); }
.cat input:focus-visible + span { outline: 3px solid var(--teal); outline-offset: calc(8 * 100cqw / 1366); }
.cats[aria-invalid="true"] .cat span { box-shadow: 0 0 0 calc(3 * 100cqw / 1366) var(--red), 0 0 0 calc(5 * 100cqw / 1366) var(--red); }
.cat-artists { --c: #e36824; --c2: #fbbf32; }
.cat-venues { --c: #146a8a; --c2: #3ea0e4; }
.cat-opportunities { --c: #c2394f; --c2: #f4a3b4; }
.cat-events { --c: #6b6a00; --c2: #a9b84a; }

.tick { display: block; cursor: pointer; }  /* positioned by .ov (absolute) / mobile rule (relative) */
.tick input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; width: 100%; height: 100%; }
.tick img { display: block; width: 100%; height: auto; opacity: 0; transition: opacity .12s; pointer-events: none; }
.tick input:checked ~ img { opacity: 1; }
.tick:has(input:focus-visible) { outline: 3px solid var(--teal); outline-offset: 4px; border-radius: 12px; }
.tick.invalid { outline: 3px solid var(--red); outline-offset: 4px; border-radius: 12px; }
.here-link { display: block; height: calc(26 * 100cqw / 1366); }
.terms-text { color: var(--teal); font-size: 1rem; line-height: 1.45; margin: 0; }
.terms-text a { font-weight: 700; }
.field-error { color: var(--red); font-weight: 700; font-size: .95rem; margin: 6px 0 0; }
.form-msg {
  font-weight: 700; color: var(--red);
  font-size: calc(17 * 100cqw / 1366); margin: 0;
}

/* ------------------------------------------------------------------ about */
.about-page { background: var(--beige); min-height: 100vh; }
.about-page .stage { background: var(--beige); }
.about-text {
  font-family: var(--display); text-transform: uppercase; font-size: 1.05rem; line-height: 1.35;
  color: var(--ink); margin: 0; max-width: 40rem;
}

/* ------------------------------------------------------------------ board */
.board-page {
  background: #c89656 url(../img/cork.webp) top center / max(100%, 1100px) auto repeat;
  min-height: 100vh;
}
.board-page .stage { background: var(--beige); }
.pills a { display: block; }
.board-sec {
  container-type: inline-size;
  max-width: 1366px; margin: 0 auto; padding: calc(30 * min(100vw, 1366px) / 1366) 0 calc(60 * min(100vw, 1366px) / 1366);
  scroll-margin-top: 10px;
}
.board-sec h2 { margin: 0 0 1.5cqw calc(var(--hx) * 100cqw / 1366); width: calc(var(--hw) * 100cqw / 1366); }
.board-sec h2 img { display: block; width: 100%; height: auto; }
.notes {
  display: flex; flex-wrap: wrap; justify-content: space-around; align-items: flex-start;
  gap: 3cqw 2cqw; padding: 0 2cqw;
}
.note {
  --scale: 1;
  position: relative; container-type: inline-size;
  width: min(calc(var(--w) * 100cqw / 1366 * var(--scale)), 94cqw);
  aspect-ratio: var(--w) / var(--h);
  margin-top: var(--dy, 0);
  border: 0; padding: 0; background: none; cursor: pointer; text-align: left; font: inherit; color: inherit;
  transition: transform .15s ease;
}
.note:hover { transform: translateY(-4px) rotate(var(--tilt, -.6deg)); }
.note > img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.note-text {
  position: absolute;
  top: var(--t); right: var(--r); bottom: var(--b); left: var(--l);
  transform: rotate(var(--rot, 0deg));
  overflow: hidden; display: flex; flex-direction: column; gap: .35em;
  color: var(--fg, #2a1d13);
  font-size: var(--fs, 6cqw);
}
.note-text h3 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 1.25em; line-height: 1.1; overflow-wrap: anywhere; }
.note-text p { margin: 0; font-size: 1em; line-height: 1.3; white-space: pre-line; overflow-wrap: anywhere; }
.note.clipped .note-text::after {
  content: 'tap to read more'; margin-top: auto; font-size: .8em; font-weight: 700; opacity: .75;
}
.note.clipped .note-text p { -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); flex: 1; overflow: hidden; }
.empty {
  font-family: var(--display); color: var(--cream); font-size: clamp(1.1rem, 2.4cqw, 1.8rem);
  background: rgba(31, 26, 23, .55); padding: 1rem 1.5rem; border-radius: 18px; text-align: center; margin: 0 auto;
}
.empty a { color: #ffd36b; }
.board-status { text-align: center; color: var(--cream); font-weight: 700; padding: 2rem 1rem; margin: 0; text-shadow: 0 1px 2px #000; }
.board-foot { text-align: center; padding: 1rem 1rem 3rem; }
.board-foot a { display: inline-block; width: min(340px, 80vw); }

dialog.post-dialog {
  border: 0; padding: 0; background: none; width: min(560px, 92vw); max-height: 90vh; overflow: visible;
}
dialog.post-dialog::backdrop { background: rgba(20, 14, 10, .7); }
.post-dialog article {
  background: var(--cream); border: 4px solid var(--ink); border-radius: 22px; box-shadow: 8px 8px 0 var(--ink);
  padding: 1.4rem 1.4rem 1.2rem; max-height: 85vh; overflow: auto;
}
.post-dialog .cat-tag { font-family: var(--display); color: var(--orange); font-size: 1rem; margin: 0 0 .3rem; text-transform: lowercase; }
.post-dialog h3 { font-family: var(--display); font-weight: 400; font-size: 1.6rem; line-height: 1.1; margin: 0 0 .7rem; overflow-wrap: anywhere; }
.post-dialog p.text { margin: 0; font-size: 1.05rem; line-height: 1.45; white-space: pre-line; overflow-wrap: anywhere; }
.post-dialog .date { margin: 1rem 0 0; font-size: .85rem; opacity: .7; }
.post-dialog .close {
  position: absolute; top: -14px; right: -10px; width: 44px; height: 44px; border-radius: 50%;
  border: 3px solid var(--ink); background: var(--red); color: var(--cream); font-size: 1.4rem; font-weight: 700; cursor: pointer;
}

/* ------------------------------------------------------------------ toast + simple pages */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 140%); z-index: 50;
  width: min(560px, calc(100vw - 32px));
  background: var(--cream); border: 4px solid var(--ink); border-radius: 20px; box-shadow: 6px 6px 0 var(--ink);
  padding: 1rem 1.2rem; font-size: 1.05rem; line-height: 1.4; color: var(--ink);
  visibility: hidden; transition: transform .25s ease, visibility 0s linear .25s;
}
.toast.show { transform: translate(-50%, 0); visibility: visible; transition: transform .25s ease; }
.toast.ok { border-color: var(--teal); box-shadow: 6px 6px 0 var(--teal); }
.toast.err { border-color: var(--red); box-shadow: 6px 6px 0 var(--red); }
.toast strong { font-family: var(--display); font-weight: 400; font-size: 1.3rem; display: block; margin-bottom: .2rem; }

.simple { max-width: 46rem; margin: 0 auto; padding: 3rem 1.25rem 4rem; }
.simple h1 { font-family: var(--display); font-weight: 400; color: var(--red); font-size: clamp(2rem, 6vw, 3.2rem); line-height: 1.05; margin: 0 0 1rem; }
.simple p, .simple li { font-size: 1.05rem; line-height: 1.55; }
.simple .card { background: var(--cream); border: 4px solid var(--ink); border-radius: 22px; box-shadow: 8px 8px 0 var(--ink); padding: 1.5rem; }
.simple .placeholder { background: #fff2b8; border: 2px dashed var(--orange); padding: .8rem 1rem; border-radius: 12px; }
.simple.terms h1 { font-size: clamp(1.6rem, 4.5vw, 2.4rem); }
.simple.terms h2 { font-size: 1.2rem; line-height: 1.3; color: var(--teal); margin: 1.8rem 0 .5rem; }
.simple.terms .closing { margin-top: 1.8rem; }
.back { display: inline-block; margin-top: 1.5rem; font-weight: 700; color: var(--teal); }

/* ------------------------------------------------------------------ mobile */
@media (max-width: 859px) {
  .stage {
    aspect-ratio: auto; overflow: visible; container-type: normal;
    display: flex; flex-direction: column; align-items: center; gap: 20px;
    padding: 28px 16px;
  }
  .stage > .bg { display: none; }
  .ov { position: static; width: 100%; inset: auto; }
  /* these contain absolutely positioned children and must stay a containing block */
  .ov.tick, .ov.field-wrap { position: relative; }
  .m { display: block; }
  .mtext {
    position: static !important; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; white-space: normal;
  }
  .d { display: none !important; }
  .stage.flush { padding: 0; }

  .landing .hero-img { align-self: flex-start; width: calc(100% + 16px); max-width: 620px; height: auto; margin: -28px 0 0 -16px; }
  .landing .wide-img { width: 100%; max-width: 640px; height: auto; }
  .landing .btn-col { display: grid; gap: 14px; width: 100%; max-width: 360px; }
  .landing .btn-col .ov { width: 100%; }

  /* form: everything relative to the column instead of the 1366 design */
  .form-page .stage { gap: 12px; align-items: stretch; max-width: 640px; margin: 0 auto; }
  .form-page .m-title { width: 100%; height: auto; }
  .form-page .m-label { height: 30px; width: auto; }
  .label-row { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 10px; }
  .form-page .m-tv { width: 74px; height: auto; margin-bottom: -6px; }
  .field { font-size: 1.05rem; line-height: 1.5; border-radius: 18px; padding: 12px 16px; background: var(--sand); width: 100%; }
  input.field { height: auto; padding-right: 64px; }
  #title-count { top: 50% !important; bottom: auto; transform: translateY(-50%); }
  textarea.field { height: 11.5em; padding-top: 12px; padding-bottom: 28px; }
  .field-wrap { position: relative; }
  .counter { position: absolute; right: 14px; bottom: 6px; font-size: .8rem; }
  .cats { flex-wrap: wrap; gap: 10px; }
  .cat { flex: 1 1 40%; }
  .cat span { font-size: 1.15rem; padding: 10px 6px; border-width: 3px; box-shadow: 0 0 0 3px var(--c2), 0 0 0 5px var(--ink); }
  .terms-row { display: grid; grid-template-columns: 56px 1fr; gap: 14px; align-items: center; margin-top: 6px; }
  .tick { width: 56px; height: 56px; border-radius: 12px; background: var(--teal); border: 4px solid #ff4500; }
  .tick img { width: 70%; margin: 12% auto 0; }
  .form-page .submit { width: min(300px, 80%); align-self: center; margin-top: 8px; }
  /* on phones each field shows its own error; keep the summary for screen readers only */
  .form-msg { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

  .about-page .stage { max-width: none; }
  .about-page .m-who { width: 100%; height: auto; }
  .about-page .m-sticker { width: 60%; max-width: 260px; height: auto; }
  .about-page .btn-row { display: grid; justify-items: end; gap: 14px; width: calc(100% + 16px); margin-right: -16px; }
  .about-page .btn-row .ov { width: min(75%, 340px); }

  .board-page .stage { padding-bottom: 0; gap: 14px; }
  .board-page .m-title { width: 100%; max-width: 520px; height: auto; }
  .board-page .pills { display: flex; justify-content: center; gap: 12px; width: 100%; }
  .board-page .pills .ov { width: 64px; }
  /* the disco ball runs off the right edge in the design, so pin the art to the screen edge */
  .board-page .m-art { align-self: flex-end; width: calc(100% + 16px); max-width: 640px; height: auto; margin-right: -16px; }
  /* title, then artwork, then the tabs last so they hang into the cork like in the design */
  .board-page .pills { order: 1; }
  .board-sec h2 { margin-left: 4cqw; width: min(calc(var(--hw) * 100cqw / 1366 * 1.6), 92cqw); }
  .notes { gap: 26px; padding: 0 3cqw; }
  .note { width: min(94cqw, 440px); margin-top: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

/* ------------------------------------------------------------------ home button (sub-pages) */
.home-btn {
  position: absolute; top: 12px; right: 12px; z-index: 40;  /* top-right is free on every desktop design */
  font-family: var(--display); font-size: clamp(.95rem, 1.25vw, 1.2rem); line-height: 1; text-decoration: none;
  color: var(--ink); background: var(--cream);
  border: 3px solid var(--ink); border-radius: 999px; box-shadow: 3px 3px 0 var(--ink);
  padding: .45em .9em .5em;
  transition: transform .12s ease, box-shadow .12s ease;
}
.home-btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.home-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
@media (max-width: 859px) {
  /* make room above the first block so the button never covers the title */
  .home-btn { right: auto; left: 12px; }
  .home-btn ~ main > .stage:first-child, .home-btn ~ header.stage { padding-top: 64px; }
}
