/* ==========================================================================
   C-Note Music Philly · Design C "Philly Soul" (a 70s record sleeve)
   style.css: tokens, base, shared components & motion utilities
   ========================================================================== */

:root {
  /* Palette: burnt orange, espresso, mustard, cream + teal / avocado accents */
  --cream: #f6e7c8;
  --cream-2: #fbf1dc;
  --paper: #f1dab0;
  --espresso: #24130a;
  --brown: #5c2f16;
  --rust: #b3401a;
  --orange: #e2692b;
  --orange-2: #ec8a33;
  --mustard: #e9a93a;
  --teal: #1b5a55;
  --teal-2: #2a7a72;
  --teal-deep: #0f3b39;
  --avocado: #7d8b3a;
  --ink: var(--espresso);
  --ink-soft: #5a3a26;

  --f-display: "Shrikhand", "Cooper Black", Georgia, serif;
  --f-groove: "Righteous", "Trebuchet MS", system-ui, sans-serif;
  --f-body: "Karla", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-type: "Courier Prime", "Courier New", monospace;

  --ease-groove: cubic-bezier(.34, 1.56, .64, 1);   /* springy, a little overshoot */
  --ease-soul: cubic-bezier(.65, 0, .35, 1);        /* smooth in-out */
  --ease-out: cubic-bezier(.22, 1, .36, 1);

  --gutter: clamp(16px, 4vw, 40px);
  --shadow-soft: 0 22px 44px -22px rgba(60, 25, 5, .55);
  --stack: 0 4px 0 var(--mustard), 0 8px 0 var(--rust);

  /* Printed-cardboard grain (SVG turbulence, tiled) */
  --noise: 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='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .32 0 0 0 0 .18 0 0 0 0 .07 0 0 0 1.3 -.42'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--cream) var(--noise);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--f-body);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
@supports (overflow: clip) { body { overflow-x: clip; } }

img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.05; font-weight: 400; }
p { margin: 0 0 1em; }
ul, ol, dl, figure, blockquote { margin: 0; }
strong { font-weight: 800; }
::selection { background: var(--mustard); color: var(--espresso); }

:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }
.on-dark :focus-visible { outline-color: var(--mustard); }

.sr-only {
  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 {
  position: fixed; left: 16px; top: -80px; z-index: 1000;
  padding: 12px 18px; border-radius: 999px;
  background: var(--espresso); color: var(--cream);
  font-family: var(--f-groove); text-decoration: none;
  transition: top .25s;
}
.skip:focus { top: 16px; }

/* ---------- Layout & type ---------- */
.wrap { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: var(--gutter); }
.sec { position: relative; padding-block: clamp(76px, 10vw, 140px); }
.sec-head { max-width: 720px; margin-bottom: clamp(36px, 5vw, 60px); }
.sec-head h2 { margin-bottom: .38em; }
.sec-head > p:last-child { margin: 0; font-size: clamp(1.05rem, 1.4vw, 1.2rem); color: var(--ink-soft); }

h2 {
  font-family: var(--f-display);
  font-size: clamp(2.3rem, 6vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: .005em;
  text-wrap: balance;
}

/* Eyebrow label with a tiny rainbow-stripe pill */
.eyebrow {
  display: inline-flex; align-items: center; gap: .75em;
  margin-bottom: 1rem;
  font: 400 .82rem/1.2 var(--f-groove);
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--rust);
}
.eyebrow::before {
  content: ""; flex: none; width: 34px; height: 12px; border-radius: 6px;
  background: linear-gradient(var(--mustard) 0 33.3%, var(--orange) 33.3% 66.6%, var(--brown) 66.6%);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6em;
  min-height: 52px; padding: .85em 1.6em;
  border: 0; border-radius: 999px;
  font: 400 1rem/1.15 var(--f-groove);
  letter-spacing: .06em; text-transform: uppercase; text-align: center; text-decoration: none;
  cursor: pointer;
  transition: transform .4s var(--ease-groove), box-shadow .4s var(--ease-groove), background-color .3s, color .3s;
}
.btn-primary { background: var(--espresso); color: var(--cream); box-shadow: var(--stack); }
.btn-primary:hover { transform: translateY(-3px) rotate(-1.5deg); box-shadow: 0 5px 0 var(--mustard), 0 10px 0 var(--rust); }
.btn-primary:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--mustard), 0 2px 0 var(--rust); }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2.5px currentColor; }
.btn-ghost:hover { background: var(--espresso); color: var(--cream); box-shadow: inset 0 0 0 2.5px var(--espresso); transform: rotate(1.5deg); }
@media (max-width: 520px) { .btn { padding-inline: 1.15em; letter-spacing: .04em; } }

/* ---------- Star rating (partial fill via background-clip) ---------- */
.stars {
  --pct: 100%;
  display: inline-block; line-height: 1; letter-spacing: .12em;
  background: linear-gradient(90deg, var(--star, var(--rust)) var(--pct), var(--star-off, rgba(36, 19, 10, .22)) var(--pct));
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}

/* ---------- Wavy rainbow stripes (SVG injected by main.js) ---------- */
.waves {
  position: relative;
  height: clamp(64px, 9vw, 130px);
  margin-bottom: -1px;
  pointer-events: none;
  /* flat-stripe fallback until the SVG arrives */
  background: linear-gradient(transparent 0 22%, var(--mustard) 22% 44%, var(--rust) 44% 64%, var(--brown) 64% 84%, var(--espresso) 84%);
}
.waves.has-svg { background: none; }
.waves svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: hidden; }
.wave { animation: wave-x 20s linear infinite; }
.wave.w2 { animation-duration: 26s; animation-direction: reverse; }
.wave.w3 { animation-duration: 32s; }
.wave.w4 { animation-duration: 40s; animation-direction: reverse; }
.w1 { fill: var(--mustard); }
.w2 { fill: var(--rust); }
.w3 { fill: var(--brown); }
.w4 { fill: var(--espresso); }
@keyframes wave-x { to { transform: translateX(-1440px); } }

/* Straight 70s stripe band */
.stripes { height: 27px; background: linear-gradient(var(--mustard) 0 33.3%, var(--orange) 33.3% 66.6%, var(--rust) 66.6%); }
.stripes--flip { background: linear-gradient(var(--rust) 0 33.3%, var(--orange) 33.3% 66.6%, var(--mustard) 66.6%); }

/* ---------- Scroll reveals (only hidden when JS is running) ---------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity .8s var(--ease-out), transform 1.05s var(--ease-groove);
  transition-delay: calc(var(--d, 0) * 90ms);
}
.js [data-reveal="left"] { transform: translateX(-48px) rotate(-3deg); }
.js [data-reveal="pop"] { transform: scale(.82) rotate(-5deg); }
.js [data-reveal].is-in { opacity: 1; transform: none; }
.no-reveal [data-reveal] { opacity: 1 !important; transform: none !important; }

/* ---------- Motion helpers ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes wobble {
  0%, 100% { rotate: 0deg; }
  25% { rotate: -3deg; }
  50% { rotate: 2.5deg; }
  75% { rotate: -1deg; }
}
.wobble:hover { animation: wobble .7s var(--ease-soul); }

/* Loops pause while their section is off-screen (class toggled by main.js) */
.is-offscreen, .is-offscreen *, .is-offscreen *::before, .is-offscreen *::after { animation-play-state: paused !important; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
  }
  .js [data-reveal] { opacity: 1; transform: none; }
}
