/* ============================================================
   The Party Tribe by Sajana — styles
   Design language: "Confetti & cream" (research/design-language.md)
   Follows the "Known kiro bugs" list in design-language.md §2.
   ============================================================ */

/* ---- Tokens: light (default) ---- */
:root {
  --ground: #FFF9F2;
  --surface: #FFFFFF;
  --ink: #231B3D;
  --muted: #5A5170;
  --brand: #0E7C86;           /* CTA fill; white >=4.5:1 */
  --brand-text: #0A6670;      /* small accent text on light */
  --coral: #FF8A65;           /* highlight fill — dark ink text on it */
  --coral-text: #B23C1A;      /* coral as small text / stars on light >=4.5:1 */
  --gold: #B8860B;            /* gold accent (dark goldenrod) >=4.5:1 on light */
  --on-brand: #FFFFFF;        /* text on brand / dark bands — FIXED, never remapped */
  --cream: #F7EFE6;           /* text on always-dark bands — FIXED, never remapped */
  --band: #231B3D;            /* always-dark header/hero/footer/CTA/palette panel */
  --band-surface: #2E2548;    /* a raised surface *inside* a dark band (not a light card) */
  --border: #E7DCCD;
  --shadow: 0 6px 24px rgba(35, 27, 61, 0.08);

  --font-head: "DM Serif Display", Georgia, serif;
  --font-body: "Outfit", system-ui, sans-serif;

  --maxw: 1080px;
  --radius: 14px;
  --radius-lg: 22px;
}

/* ---- Tokens: dark override ---- */
[data-theme="dark"] {
  --ground: #151026;
  --surface: #231C3A;
  --ink: #F7EFE6;
  --muted: #C3BAD6;
  --brand: #0E7C86;           /* keep identical hue; white >=4.5:1 */
  --brand-text: #6FD8E0;
  --coral: #FF8A65;
  --coral-text: #FF9C7C;
  --gold: #E8C66B;            /* lighter gold for dark text pairing */
  --on-brand: #FFFFFF;        /* FIXED */
  --cream: #F7EFE6;           /* FIXED */
  --band: #0F0A1E;
  --band-surface: #1C1534;
  --border: #322A4C;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
}

/* ---- Reset / base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--ink);
  background: var(--ground);
  line-height: 1.6;
  overflow-x: hidden;            /* belt-and-braces: no horizontal overflow */
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 400; line-height: 1.15; color: var(--ink); }
h1 { font-size: clamp(2rem, 6vw, 3.4rem); margin: 0 0 .4em; }
h2 { font-size: clamp(1.6rem, 4vw, 2.4rem); margin: 0 0 .5em; }
h3 { font-size: clamp(1.2rem, 3vw, 1.5rem); margin: 0 0 .4em; }
h4 { font-size: 1.1rem; margin: 0 0 .3em; }
p { margin: 0 0 1rem; }
a { color: var(--brand-text); }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

/* ---- Layout ---- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 20px;          /* RULE 4: never `padding: X 0` on a .container element */
}
.section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }  /* vertical spacing kept OFF .container */
.section--tint { background: var(--surface); }
.stack > * + * { margin-top: 1rem; }

/* grid helpers — RULE 3: min-width:0 on grid children */
.grid { display: grid; gap: 1.5rem; }
.grid > * { min-width: 0; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: var(--font-body); font-weight: 700; font-size: 1rem;
  padding: .72rem 1.3rem; border-radius: 999px; border: 2px solid transparent;
  cursor: pointer; text-decoration: none; line-height: 1.2; transition: transform .08s ease, background .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--primary { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.btn--primary:hover { background: #0b656d; color: var(--on-brand); }
.btn--coral { background: var(--coral); color: #3a1206; border-color: var(--coral); }  /* RULE 8: dark ink on coral */
.btn--coral:hover { background: #ff7a50; color: #3a1206; }
.btn--gold { background: var(--gold); color: #2a1f00; border-color: var(--gold); }
.btn--gold:hover { background: #a6790a; color: #2a1f00; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--border); }
.btn--ghost:hover { background: rgba(14,124,134,.08); color: var(--ink); }
.btn--sm { padding: .5rem .95rem; font-size: .9rem; }
.btn--block { width: 100%; }

/* ---- Chips ---- */
.chip {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .3rem .8rem; border-radius: 999px; font-size: .85rem; font-weight: 500;
  background: rgba(14,124,134,.1); color: var(--brand-text); border: 1px solid rgba(14,124,134,.25);
}
.chip--coral { background: rgba(255,138,101,.18); color: var(--coral-text); border-color: rgba(255,138,101,.4); }

/* ---- Balloon-dot motif ---- */
.dots { display: inline-flex; gap: .4rem; }
.dots span { width: 14px; height: 14px; border-radius: 50%; display: inline-block; box-shadow: inset 0 -2px 3px rgba(0,0,0,.12); }
.dots--lg span { width: 34px; height: 34px; }

/* ---- Cards ---- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.4rem; box-shadow: var(--shadow);
}
.card h3 { margin-top: 0; }
.card__media { border-radius: var(--radius); overflow: hidden; margin: -1.4rem -1.4rem 1.2rem; }
.card__media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

/* image note (caption that says images are stock placeholders) */
.img-note { font-size: .8rem; color: var(--muted); margin-top: .5rem; font-style: italic; }

/* a solid-background note block */
.demo-note {
  background: var(--band); color: var(--cream);
  border-radius: var(--radius); padding: 1rem 1.2rem; font-size: .9rem;
}
.demo-note a { color: var(--cream); text-decoration: underline; }

/* NEEDS CONTENT placeholder block */
.placeholder {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 2rem 1.2rem; text-align: center; color: var(--muted); background: var(--ground);
}

/* ---- NAP list ---- */
dl.nap { margin: 0; }
dl.nap dt { font-weight: 700; color: var(--ink); }
dl.nap dd { margin: 0 0 1rem; color: var(--muted); }

/* ---- Proof strip ---- */
.proof { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; text-align: center; }
.proof > * { min-width: 0; }
.proof__big { font-family: var(--font-head); font-size: 1.8rem; color: var(--ink); }
.proof__label { font-size: .85rem; color: var(--muted); }
.stars { color: var(--coral-text); letter-spacing: 2px; }  /* RULE 9: stars on light >=4.5:1 */

/* ============================================================
   ALWAYS-DARK SECTIONS  (RULE 1 + 6)
   .site-header, .hero, .band, .site-footer, .pp-card
   Explicit light-on-dark colours for EVERYTHING, both themes.
   ============================================================ */
.site-header,
.hero,
.band,
.site-footer,
.pp-card {
  background: var(--band);
  color: var(--cream);
}

/* text elements */
.site-header h1, .site-header h2, .site-header h3, .site-header h4,
.hero h1, .hero h2, .hero h3, .hero h4,
.band h1, .band h2, .band h3, .band h4,
.site-footer h1, .site-footer h2, .site-footer h3, .site-footer h4,
.pp-card h1, .pp-card h2, .pp-card h3, .pp-card h4 { color: var(--cream); }

.site-header p, .site-header li, .site-header .muted,
.hero p, .hero li, .hero .muted,
.band p, .band li, .band .muted,
.site-footer p, .site-footer li, .site-footer .muted,
.pp-card p, .pp-card li, .pp-card .muted { color: var(--cream); }

/* slightly dimmed secondary text still readable on dark */
.hero .muted, .band .muted, .site-footer .muted, .pp-card .muted { color: #D9D0E4; }

/* plain links in dark sections */
.site-header a, .hero a, .band a, .site-footer a, .pp-card a { color: var(--cream); }
.site-header a:hover, .hero a:hover, .band a:hover, .site-footer a:hover, .pp-card a:hover { color: #fff; }

/* NAP inside footer and hero — RULE 1 (dt AND dd) */
.hero dl.nap dt, .band dl.nap dt, .site-footer dl.nap dt, .pp-card dl.nap dt { color: var(--cream); }
.hero dl.nap dd, .band dl.nap dd, .site-footer dl.nap dd, .pp-card dl.nap dd { color: #D9D0E4; }

/* proof/stat text inside .band and .hero — RULE 1 */
.hero .proof__big, .band .proof__big { color: var(--cream); }
.hero .proof__label, .band .proof__label { color: #D9D0E4; }
.hero .stars, .band .stars, .site-footer .stars, .pp-card .stars { color: #FFB49A; } /* coral stars light-on-dark */

/* chips inside dark sections */
.site-header .chip, .hero .chip, .band .chip, .site-footer .chip, .pp-card .chip {
  background: rgba(255,255,255,.12); color: var(--cream); border-color: rgba(255,255,255,.3);
}
.site-header .chip--coral, .hero .chip--coral, .band .chip--coral, .site-footer .chip--coral, .pp-card .chip--coral {
  background: rgba(255,138,101,.22); color: #FFCDBB; border-color: rgba(255,138,101,.5);
}

/* ghost buttons in dark sections — RULE 1: BOTH a.btn--ghost and button.btn--ghost */
.site-header a.btn--ghost, .site-header button.btn--ghost,
.hero a.btn--ghost, .hero button.btn--ghost,
.band a.btn--ghost, .band button.btn--ghost,
.site-footer a.btn--ghost, .site-footer button.btn--ghost,
.pp-card a.btn--ghost, .pp-card button.btn--ghost {
  color: var(--cream); border-color: rgba(255,255,255,.55); background: transparent;
}
.site-header a.btn--ghost:hover, .site-header button.btn--ghost:hover,
.hero a.btn--ghost:hover, .hero button.btn--ghost:hover,
.band a.btn--ghost:hover, .band button.btn--ghost:hover,
.site-footer a.btn--ghost:hover, .site-footer button.btn--ghost:hover,
.pp-card a.btn--ghost:hover, .pp-card button.btn--ghost:hover {
  color: #fff; border-color: #fff; background: rgba(255,255,255,.12);
}

/* .img-note and .demo-note in dark sections */
.hero .img-note, .band .img-note, .site-footer .img-note, .pp-card .img-note { color: #C7BDD6; }

/* RULE 6: link-colour rules in dark sections must NOT override solid button text, incl :hover.
   Re-assert primary/coral/gold button text so the generic "a in dark = cream" above can't win. */
.site-header a.btn--primary, .hero a.btn--primary, .band a.btn--primary, .site-footer a.btn--primary, .pp-card a.btn--primary,
.site-header a.btn--primary:hover, .hero a.btn--primary:hover, .band a.btn--primary:hover, .site-footer a.btn--primary:hover, .pp-card a.btn--primary:hover {
  color: var(--on-brand);
}
.site-header a.btn--coral, .hero a.btn--coral, .band a.btn--coral, .site-footer a.btn--coral, .pp-card a.btn--coral,
.site-header a.btn--coral:hover, .hero a.btn--coral:hover, .band a.btn--coral:hover, .site-footer a.btn--coral:hover, .pp-card a.btn--coral:hover {
  color: #3a1206;  /* RULE 8: dark ink on coral */
}
.site-header a.btn--gold, .hero a.btn--gold, .band a.btn--gold, .site-footer a.btn--gold, .pp-card a.btn--gold,
.site-header a.btn--gold:hover, .hero a.btn--gold:hover, .band a.btn--gold:hover, .site-footer a.btn--gold:hover, .pp-card a.btn--gold:hover {
  color: #2a1f00;
}

/* ---- Header ---- */
.site-header { position: sticky; top: 0; z-index: 50; border-bottom: 1px solid rgba(255,255,255,.12); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: .75rem; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--cream); font-family: var(--font-head); font-size: 1.25rem; line-height: 1.1; }
.brand:hover { text-decoration: none; color: #fff; }
.brand .dots span { width: 11px; height: 11px; }
.site-nav { display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.site-nav a { padding: .4rem .7rem; border-radius: 999px; font-weight: 500; font-size: .95rem; }
.site-nav a[aria-current="page"] { background: rgba(255,255,255,.14); }
.header-actions { display: flex; align-items: center; gap: .5rem; }

/* theme toggle */
.theme-toggle {
  background: transparent; border: 2px solid rgba(255,255,255,.4); color: var(--cream);
  width: 42px; height: 42px; border-radius: 50%; cursor: pointer; display: inline-flex;
  align-items: center; justify-content: center; font-size: 1.1rem; flex: 0 0 auto;
}
.theme-toggle:hover { border-color: #fff; background: rgba(255,255,255,.12); }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: inline; }
[data-theme="dark"] .theme-toggle .icon-sun { display: inline; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ---- Hero ---- */
.hero { position: relative; overflow: hidden; }
.hero__inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: 2.5rem; align-items: center; padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.hero__inner > * { min-width: 0; }
.hero__media img { border-radius: var(--radius-lg); width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.hero .btn-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.2rem; }

/* ---- Bands ---- */
.band { }
.band .btn-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.2rem; }

/* ---- Footer ---- */
.site-footer { margin-top: 0; }
.footer-inner { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; padding-block: 3rem; }
.footer-inner > * { min-width: 0; }
.social-links { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .5rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding-block: 1.2rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .85rem; }

/* ============================================================
   PARTY PALETTE (signature feature)
   ============================================================ */
.pp { display: grid; grid-template-columns: 1.3fr 1fr; gap: 2rem; align-items: start; }
.pp > * { min-width: 0; }
.pp__form { }
.pp fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem; margin: 0 0 1.4rem; background: var(--surface); }
.pp legend { font-family: var(--font-head); font-size: 1.2rem; padding: 0 .5rem; color: var(--ink); }
.pp .hint { font-size: .85rem; color: var(--muted); margin: -.3rem 0 .8rem; }

/* radio/checkbox tile grids */
.tiles { display: grid; gap: .6rem; }
.tiles--2 { grid-template-columns: repeat(2, 1fr); }
.tiles--3 { grid-template-columns: repeat(3, 1fr); }
.tiles > * { min-width: 0; }

/* a tile wraps an input + label text; input visually hidden but focusable */
.tile { position: relative; display: block; }
.tile input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tile__box {
  display: flex; align-items: center; gap: .6rem; width: 100%;
  border: 2px solid var(--border); border-radius: var(--radius); padding: .7rem .9rem;
  background: var(--ground); cursor: pointer; font-weight: 500; min-height: 48px;
}
.tile__box .tick { margin-left: auto; opacity: 0; font-weight: 700; color: var(--brand-text); flex: 0 0 auto; }
/* RULE 13: selected = outline + tick, not colour alone */
.tile input:checked + .tile__box { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.tile input:checked + .tile__box .tick { opacity: 1; }
.tile input:focus-visible + .tile__box { outline: 3px solid var(--brand); outline-offset: 2px; }

/* swatch tiles: a strip of 4 dots + a name + tick */
.swatch__dots { display: inline-flex; gap: .3rem; flex: 0 0 auto; }
.swatch__dots span { width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 -2px 3px rgba(0,0,0,.15); }

/* text inputs */
.pp label.field { display: block; font-weight: 500; margin-bottom: .4rem; }
.pp input[type="text"], .pp input[type="date"], .pp textarea {
  width: 100%; font-family: var(--font-body); font-size: 1rem; color: var(--ink);
  background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius);
  padding: .65rem .8rem;
}
.pp textarea { resize: vertical; min-height: 84px; }
.pp input:focus, .pp textarea:focus { border-color: var(--brand); outline: none; }

/* the result panel is an ALWAYS-DARK card (.pp-card) — styled above */
.pp-card { border-radius: var(--radius-lg); padding: 1.6rem; box-shadow: var(--shadow); position: sticky; top: 84px; }
.pp-card__strip { display: flex; gap: .5rem; margin: .4rem 0 1rem; }
.pp-card__strip span { width: 42px; height: 42px; border-radius: 50%; box-shadow: inset 0 -3px 5px rgba(0,0,0,.18); }
.pp-card__summary { font-size: 1.02rem; margin-bottom: 1rem; }
.pp-card ul { padding-left: 1.1rem; margin: .3rem 0 1.2rem; }
.pp-card li { margin-bottom: .35rem; }
.pp-card .btn-row { display: flex; flex-direction: column; gap: .6rem; }
.pp-card__msg {
  background: var(--band-surface); border: 1px solid rgba(255,255,255,.14); border-radius: var(--radius);
  padding: .9rem 1rem; font-size: .9rem; color: var(--cream); white-space: pre-wrap; margin-bottom: 1rem;
}
.copy-status { font-size: .85rem; color: #BFE9ED; min-height: 1.2em; }

/* ---- Occasion path cards on home ---- */
.paths { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.paths > * { min-width: 0; }
.path-card {
  display: flex; flex-direction: column; gap: .4rem; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.1rem; box-shadow: var(--shadow); transition: transform .08s ease;
}
.path-card:hover { transform: translateY(-2px); text-decoration: none; }
.path-card strong { font-family: var(--font-head); font-weight: 400; font-size: 1.15rem; }

/* ---- Responsive — RULE 3 ---- */
@media (max-width: 900px) {
  .hero__inner { grid-template-columns: 1fr; }
  .pp { grid-template-columns: 1fr; }
  .pp-card { position: static; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .paths { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
  /* nav on its own row under 700px */
  .header-inner { flex-wrap: wrap; }
  .site-nav { order: 3; width: 100%; justify-content: center; border-top: 1px solid rgba(255,255,255,.12); padding-top: .5rem; }
  .grid--3, .grid--2 { grid-template-columns: 1fr; }
  .proof { grid-template-columns: 1fr; gap: 1.4rem; }
  .footer-inner { grid-template-columns: 1fr; }
  .tiles--3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  /* hide the header CTA under 480px */
  .header-cta { display: none; }
  .paths { grid-template-columns: 1fr; }
  .grid--4 { grid-template-columns: 1fr; }
}
@media (max-width: 360px) {
  .tiles--2, .tiles--3 { grid-template-columns: 1fr; }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
