/* The Pop Street: shared foundation (tokens, type, buttons, forms, utilities). */

@font-face {
  font-family: "Newsreader";
  src: url("/assets/fonts/newsreader-wght.woff2") format("woff2");
  font-weight: 300 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("/assets/fonts/newsreader-wght-italic.woff2") format("woff2");
  font-weight: 300 500; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("/assets/fonts/instrument-sans-wght.woff2") format("woff2");
  font-weight: 400 600; font-style: normal; font-display: swap;
}
/* Metric-matched fallbacks so the swap doesn't shift layout. */
@font-face { font-family: "Newsreader Fallback"; src: local("Georgia"), local("Times New Roman"); size-adjust: 92%; ascent-override: 98%; descent-override: 28%; line-gap-override: 0%; }
@font-face { font-family: "Newsreader Fallback"; font-style: italic; src: local("Georgia Italic"), local("Georgia"); size-adjust: 90%; ascent-override: 100%; descent-override: 28%; line-gap-override: 0%; }
@font-face { font-family: "Instrument Sans Fallback"; src: local("Arial"), local("Helvetica Neue"); size-adjust: 97%; ascent-override: 95%; descent-override: 25%; line-gap-override: 0%; }

@property --sweep { syntax: "<percentage>"; inherits: false; initial-value: -30%; }

:root {
  --ink-0: #0e0d0b;
  --ink-1: #14130f;
  --ink-2: #1b1915;
  --ink-3: #2a2722;
  --ink-4: #3a362f;
  --ivory: #f3ede2;
  --ivory-2: #d8d1c4;
  --ash: #9a9284;
  --brass: #c8a15a;
  --brass-hi: #e3c58c;
  --brass-lo: #7a5d2c;
  --paper: #faf6ee;
  --paper-2: #f1ebdf;
  --sand: #e4dccd;
  --umber: #2b2620;
  --muted: #6b6457;
  --ok: #4e8a63;
  --warn: #b5762a;
  --danger: #a3413a;

  /* Public palette (cream, greige, muted sage, terracotta; bronze for text only). Used by the public site via .warm/.light/.plain. */
  --cream-white: #f6f2ea; --cream-50: #f9f6f1; --cream-200: #ece6db; --cream-300: #dfd8cb;
  --greige: #b8ada0; --greige-700: #6e655c;
  --sage: #71846f; --sage-50: #eaedea; --sage-100: #dde1dc; --sage-200: #c2cac1; --sage-300: #a7b3a6; --sage-400: #8c9b8a;
  --sage-600: #606f5d; --sage-700: #505a4b; --sage-800: #3f4539;
  --terracotta: #b7654a; --terracotta-ink: #9b5038; --terracotta-deep: #86452f; --terracotta-soft: #e8b49e;
  --bronze: #3b3029; --coral: #f15f22;

  --serif: "Newsreader", "Newsreader Fallback", Georgia, serif;
  --sans: "Instrument Sans", "Instrument Sans Fallback", Arial, system-ui, sans-serif;

  --ease: cubic-bezier(.2, .7, .1, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --dur: .7s;
  --gutter: clamp(18px, 4.5vw, 64px);
  --maxw: 1320px;
  --radius: 14px;
  --radius-lg: 22px;

  --step--1: clamp(.82rem, .8rem + .1vw, .88rem);
  --step-0: clamp(1rem, .96rem + .2vw, 1.09rem);
  --step-1: clamp(1.18rem, 1.08rem + .45vw, 1.42rem);
  --step-2: clamp(1.42rem, 1.22rem + .9vw, 1.96rem);
  --step-3: clamp(1.8rem, 1.4rem + 1.8vw, 2.9rem);
  --step-4: clamp(2.3rem, 1.6rem + 3.2vw, 4.4rem);
  --step-5: clamp(2.9rem, 1.7rem + 5.6vw, 7.2rem);

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; min-height: 100dvh;
  background: var(--ink-0); color: var(--ivory);
  font: 400 var(--step-0)/1.6 var(--sans);
  font-kerning: normal; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased;
}
img, svg, video, picture { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .22em; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 400; line-height: 1.05; letter-spacing: -.012em; margin: 0; text-wrap: balance; }
p { margin: 0 0 1em; text-wrap: pretty; }
::selection { background: var(--brass); color: var(--ink-0); }
:focus-visible { outline: 2px solid var(--brass-hi); outline-offset: 3px; border-radius: 6px; }

@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .35s; animation-timing-function: var(--ease); }

.icon { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; background: var(--brass); color: var(--ink-0); border-radius: 999px; font-weight: 600; text-decoration: none; transition: top .2s; }
.skip-link:focus { top: 12px; }
.wrap { width: min(100% - 2 * var(--gutter), var(--maxw)); margin-inline: auto; }
.eyebrow { font: 600 var(--step--1)/1.2 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--brass); }
.lede { font-size: var(--step-1); line-height: 1.5; color: var(--ivory-2); max-width: 36em; }
.muted { color: var(--ash); }
.serif { font-family: var(--serif); }
.italic { font-style: italic; }

/* Buttons */
.btn {
  --btn-bg: transparent; --btn-fg: var(--ivory); --btn-bd: rgba(243, 237, 226, .28);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .6em;
  min-height: 52px; padding: .9em 1.5em; border-radius: 999px;
  background: var(--btn-bg); color: var(--btn-fg); border: 1px solid var(--btn-bd);
  font: 600 1rem/1 var(--sans); letter-spacing: .01em; text-decoration: none; cursor: pointer;
  transition: background-color .3s var(--ease), border-color .3s var(--ease), color .3s var(--ease), transform .45s var(--ease-out);
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.btn .icon { transition: transform .45s var(--ease-out); }
.btn:hover .icon-arrow, .btn:focus-visible .icon-arrow { transform: translateX(4px); }
.btn-primary { --btn-bg: var(--brass); --btn-fg: #17130c; --btn-bd: var(--brass); box-shadow: 0 10px 30px -12px rgba(200, 161, 90, .55), inset 0 1px 0 rgba(255, 255, 255, .25); }
.btn-primary:hover { --btn-bg: var(--brass-hi); --btn-bd: var(--brass-hi); }
.btn-ghost:hover { --btn-bd: var(--ivory); }
.btn-quiet { --btn-bd: transparent; padding-inline: .4em; min-height: 44px; }
.btn-quiet:hover { color: var(--brass-hi); }
.btn-sm { min-height: 40px; padding: .6em 1.1em; font-size: .92rem; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.light .btn { --btn-fg: var(--umber); --btn-bd: rgba(59, 48, 41, .28); }
.light .btn-primary { --btn-bg: var(--terracotta-ink); --btn-fg: var(--cream-50); --btn-bd: var(--terracotta-ink); box-shadow: 0 10px 26px -14px rgba(155, 80, 56, .7), inset 0 1px 0 rgba(255, 255, 255, .16); }
.light .btn-primary:hover { --btn-bg: var(--terracotta-deep); --btn-bd: var(--terracotta-deep); }
.light .btn-ghost:hover { --btn-bd: var(--umber); }
.light .btn-quiet:hover { color: var(--brass-lo); }

/* Reveal-on-scroll primitives (landing.js / app.js add .is-in) */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .9s var(--ease), transform 1.1s var(--ease-out); transition-delay: calc(var(--i, 0) * 80ms); }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { transform: none; transition: opacity .4s linear; }
}
.no-js .reveal { opacity: 1; transform: none; }

/* Plain pages (errors, notices): cream paper */
.plain { color-scheme: light; background: var(--paper); color: var(--umber); }
.plain .btn-primary { --btn-bg: var(--terracotta-ink); --btn-fg: var(--cream-50); --btn-bd: var(--terracotta-ink); box-shadow: 0 10px 26px -14px rgba(155, 80, 56, .7); }
.plain .btn-primary:hover { --btn-bg: var(--terracotta-deep); --btn-bd: var(--terracotta-deep); }
.plain :focus-visible { outline-color: var(--sage-700); }
.plain ::selection { background: var(--sage-200); color: var(--bronze); }
.plain-main { min-height: 100dvh; display: grid; place-items: center; padding: 40px var(--gutter); }
.err { max-width: 34rem; text-align: left; }
.err-num { font: italic 300 clamp(6rem, 22vw, 11rem)/.8 var(--serif); color: transparent; -webkit-text-stroke: 1px var(--brass); margin: 0 0 .25em; letter-spacing: -.04em; }
.err-title { font-size: var(--step-3); margin-bottom: .5em; }
.err-body { color: var(--ivory-2); margin-bottom: 2em; }
.plain .err-body { color: #574c43; }
.plain .err-num { -webkit-text-stroke-color: var(--terracotta); }

/* Light surfaces (intake, portal, legal pages): the public palette. The Studio admin (body.studio) keeps the :root tokens. */
.light, .warm, .plain {
  --paper: var(--cream-white); --paper-2: var(--cream-200); --sand: var(--cream-300);
  --umber: var(--bronze); --muted: var(--greige-700);
  --brass: var(--terracotta); --brass-lo: var(--terracotta-ink); --brass-hi: var(--terracotta-soft);
  --ok: var(--sage-600); --warn: #a8692a;
  /* Anything still asking for the old dark "ink" gets deep sage instead of near-black. */
  --ink-0: var(--sage-800); --ink-1: #444b3e; --ink-2: var(--sage-700); --ink-3: var(--sage-600); --ink-4: var(--sage-400);
  --ivory: var(--cream-white); --ivory-2: var(--sage-100); --ash: var(--sage-200);
}
.light { color-scheme: light; background: var(--paper); color: var(--umber); }
.light ::selection { background: var(--sage-200); color: var(--bronze); }
.light :focus-visible { outline-color: var(--sage-700); }
.light .eyebrow { color: var(--brass-lo); }
.light .lede { color: #574c43; }
.light .muted { color: var(--muted); }

/* Prose (privacy, terms) */
.prose { max-width: 42rem; }
.prose h2 { font-size: var(--step-2); margin: 2em 0 .6em; }
.prose h3 { font-size: var(--step-1); margin: 1.6em 0 .4em; }
.prose ul { padding-left: 1.2em; }
.prose li { margin: .35em 0; }
.prose a { color: inherit; }

/* Grain overlay used by layered heroes */
.grain { position: absolute; inset: 0; pointer-events: none; opacity: .14; mix-blend-mode: overlay; background-image: url("/assets/img/grain.svg"); background-size: 220px; }

/* Wordmark (views/partials/wordmark.php): THE · Pop · Street, with a coral full stop. */
.wm { --wm-accent: var(--terracotta-ink); --wm-the: var(--greige-700); display: inline-block; font: 400 1em/1 var(--serif); letter-spacing: -.012em; white-space: nowrap; color: inherit; }
.wm__vis { display: inline-block; }
.wm__the { display: inline-block; margin-right: -.06em; font: 600 .44em/1 var(--sans); letter-spacing: .22em; text-transform: uppercase; vertical-align: .42em; color: var(--wm-the); }
.wm__pop { font-style: italic; font-weight: 400; letter-spacing: -.02em; color: var(--wm-accent); }
.wm__l { display: inline-block; }
.wm__dot { position: relative; display: inline-block; width: .2em; height: .2em; margin-left: .07em; border-radius: 50%; background: var(--coral); vertical-align: baseline; }
.wm__dot::after { content: ""; position: absolute; inset: -.2em; border-radius: 50%; border: .06em solid var(--coral); opacity: 0; }

/* Load animation (transform/opacity only, about 1.1s): THE drops in, "Pop" springs up letter by letter with an overshoot,
   "Street" follows in a quick ripple, and the coral full stop lands last with a little pop ring. */
@media (prefers-reduced-motion: no-preference) {
  .wm--animate .wm__the { animation: wmDrop .5s cubic-bezier(.2, .8, .2, 1) both; }
  .wm--animate .wm__l { transform-origin: 50% 90%; animation: wmSpring .62s cubic-bezier(.3, 1.6, .5, 1) calc(.12s + var(--i) * 52ms) both; }
  .wm--animate .wm__pop .wm__l { animation-duration: .7s; animation-timing-function: cubic-bezier(.25, 1.9, .45, 1); }
  .wm--animate .wm__dot { animation: wmDot .5s cubic-bezier(.3, 2, .5, 1) .68s both; }
  .wm--animate .wm__dot::after { animation: wmRing .4s ease-out .82s both; }
  .wm--replay .wm__the { animation-name: wmDrop2; }
  .wm--replay .wm__l { animation-name: wmSpring2; }
  .wm--replay .wm__dot { animation-name: wmDot2; }
  .wm--replay .wm__dot::after { animation-name: wmRing2; }
}
@keyframes wmDrop { from { opacity: 0; transform: translateY(-.7em); } }
@keyframes wmDrop2 { from { opacity: 0; transform: translateY(-.7em); } }
@keyframes wmSpring { 0% { opacity: 0; transform: translateY(.55em) scale(.5); } 45% { opacity: 1; } 100% { opacity: 1; transform: none; } }
@keyframes wmSpring2 { 0% { opacity: 0; transform: translateY(.55em) scale(.5); } 45% { opacity: 1; } 100% { opacity: 1; transform: none; } }
@keyframes wmDot { from { opacity: 0; transform: translateY(-.9em) scale(0); } }
@keyframes wmDot2 { from { opacity: 0; transform: translateY(-.9em) scale(0); } }
@keyframes wmRing { 0% { opacity: .9; transform: scale(.4); } 100% { opacity: 0; transform: scale(1.9); } }
@keyframes wmRing2 { 0% { opacity: .9; transform: scale(.4); } 100% { opacity: 0; transform: scale(1.9); } }
.light .skip-link, .plain .skip-link { background: var(--sage-800); color: var(--cream-white); }
