/* Shared look for the home page, member app and admin portal.
   Direction: the membership card is the hero (foil, sheen, tilt); everything around it stays calm.
   One bold accent: Brunei royal yellow, used for main actions. Headings in Bricolage Grotesque,
   body in the device's own font. Light, dark and auto themes (<html data-theme="light|dark">, set by /theme.js). */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/bricolage-grotesque.woff2") format("woff2");
  font-weight: 200 800; font-style: normal; font-display: swap;
}
:root {
  --bg: #f3f4f6;          /* cool paper */
  --surface: #ffffff;
  --soft: #eceef2;
  --ink: #15171c;
  --muted: #5b6270;
  --line: #e1e4e9;
  --accent: #f2b705;      /* royal yellow */
  --accent-ink: #15171c;
  --accent-soft: #fdf3cf;
  --focus: #f2b705;
  --pop: #f2b705;
  --ok: #157f4b; --ok-bg: #ddf3e6;
  --warn: #9a5b00; --warn-bg: #fdf0cc;
  --bad: #b42323; --bad-bg: #fde3e3;
  --card-a: #2d3240; --card-b: #12141a;   /* graphite member card */
  --shadow-lg: 0 24px 48px -24px rgba(21, 23, 28, .45);
  --f-display: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --f-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --f-mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1115; --surface: #171a20; --soft: #1f232b; --ink: #eceef2; --muted: #9aa1ad; --line: #2a2f38;
    --accent: #f5c32e; --accent-ink: #15171c; --accent-soft: #3a2f0c; --focus: #f5c32e; --pop: #f5c32e;
    --ok: #5fd394; --ok-bg: #12301f; --warn: #f5c32e; --warn-bg: #352a0b; --bad: #ff8a8a; --bad-bg: #3a1717;
    --card-a: #353b4b; --card-b: #0b0d11;
    --shadow-lg: 0 24px 48px -20px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1115; --surface: #171a20; --soft: #1f232b; --ink: #eceef2; --muted: #9aa1ad; --line: #2a2f38;
  --accent: #f5c32e; --accent-ink: #15171c; --accent-soft: #3a2f0c; --focus: #f5c32e; --pop: #f5c32e;
  --ok: #5fd394; --ok-bg: #12301f; --warn: #f5c32e; --warn-bg: #352a0b; --bad: #ff8a8a; --bad-bg: #3a1717;
  --card-a: #353b4b; --card-b: #0b0d11;
  --shadow-lg: 0 24px 48px -20px rgba(0, 0, 0, .7);
  color-scheme: dark;
}
html, body { background: var(--bg); color: var(--ink) }
h1, h2, h3 { font-family: var(--f-display); font-weight: 700; letter-spacing: -0.02em; font-optical-sizing: auto }
h1 { font-weight: 750 }

/* Buttons: one shape language. Primary = royal yellow with ink text; pressing sinks it slightly.
   :where() keeps these at zero specificity, so page styles (tabs, segmented controls) still win. */
:where(button:not(.link):not(.themebtn), .btn) { border-radius: 14px; font-weight: 650; transition: transform .08s ease, filter .15s ease }
:where(button:not(.link):not(.themebtn), .btn):active { transform: translateY(1px) scale(.99) }
:where(button:not(.link):not(.themebtn), .btn):hover:not(:disabled) { filter: brightness(1.04) }
:where(input, select, textarea) { border-radius: 12px }
:where(input, select, textarea):focus-visible { outline: 3px solid var(--focus); outline-offset: 1px }

/* Theme switch button (Auto -> Light -> Dark) */
.themebtn { display: inline-flex; align-items: center; gap: 6px; height: 36px; min-height: 36px; padding: 0 10px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 550 13px var(--f-body); cursor: pointer; flex: none }
.themebtn:hover { border-color: var(--muted) }
.themebtn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px }
.themebtn svg { width: 18px; height: 18px; flex: none }
.themebtn .t-light, .themebtn .t-dark { display: none }
:root[data-theme="light"] .themebtn .t-auto, :root[data-theme="dark"] .themebtn .t-auto { display: none }
:root[data-theme="light"] .themebtn .t-light { display: inline-flex }
:root[data-theme="dark"] .themebtn .t-dark { display: inline-flex }
.themebtn span { display: inline-flex; align-items: center; gap: 6px }
@media (max-width: 420px) { .themebtn .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0) } .themebtn { padding: 0 8px } }

/* ---------------------------------------------------------------- the membership card
   Used by the member app and the home page. Markup: .mcard[data-tier] > .foil + content */
.mcard { position: relative; overflow: hidden; border-radius: 22px; aspect-ratio: 1.586; max-width: 100%; color: #fff; isolation: isolate;
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(255,255,255,.14), transparent 55%),
    linear-gradient(140deg, var(--tier-a, var(--card-a)), var(--tier-b, var(--card-b)));
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,.18);
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .25s ease; will-change: transform }
.mcard[data-tier="GOLD"] { --tier-a: #c9952b; --tier-b: #5b3d0b }
.mcard[data-tier="PLATINUM"], .mcard[data-tier="SILVER"] { --tier-a: #9aa3ad; --tier-b: #2f353d }
/* fine engraved lines, like the guilloche on printed cards */
.mcard::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .5;
  background: repeating-radial-gradient(circle at 115% 120%, rgba(255,255,255,.07) 0 1px, transparent 1px 7px) }
/* holographic foil strip */
.mcard .foil { position: absolute; top: 0; bottom: 0; right: 16%; width: 18px; z-index: -1; opacity: .32; mix-blend-mode: overlay;
  background: linear-gradient(calc(160deg + var(--ry, 0deg) * 6), #ff9a9e, #fad0c4 18%, #a1c4fd 36%, #c2ffd8 54%, #fbc2eb 72%, #fdfbfb 90%);
  filter: saturate(1.2) }
/* light sweep: plays once when the card appears */
.mcard::after { content: ""; position: absolute; inset: -40% -60%; z-index: 1; pointer-events: none;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,.28) 50%, transparent 60%); transform: translateX(-60%) }
@media (prefers-reduced-motion: no-preference) {
  .mcard.shine::after { animation: sweep 1.4s .25s cubic-bezier(.3,.6,.2,1) both }
  @keyframes sweep { to { transform: translateX(60%) } }
}
@media (prefers-reduced-motion: reduce) { .mcard { transform: none !important; transition: none } }
.mcard .chip-gold { width: 38px; height: 28px; border-radius: 6px;
  background: linear-gradient(135deg, #f7e2a1, #c9a13b 45%, #f3d77a 55%, #a57f22); box-shadow: inset 0 0 0 1px rgba(0,0,0,.18) }

/* Promotion cards: the same look in the member app, on the front page and in the Admin Portal preview */
.pcards { display: flex; align-items: flex-start; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain;
  margin-inline: -16px; padding: 2px 16px 8px; scroll-padding-inline: 16px }
.pcards::-webkit-scrollbar { display: none }
.pcards > .pcard { flex: 0 0 86%; scroll-snap-align: start }
.pcards > .pcard:only-child { flex-basis: 100% }
.pcard { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; min-width: 0 }
.pcard .pimg { display: block; width: 100%; height: auto; max-height: 340px; object-fit: contain; background: var(--soft) }
.pcard .pbody { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1 }
.pcard h3 { font: 700 17px/1.25 var(--f-display); margin: 0; overflow-wrap: anywhere }
.pcard .ptext { font-size: 14px; line-height: 1.5; color: var(--muted); white-space: pre-line; overflow-wrap: anywhere; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden }
.pcard .ptext.open { display: block; -webkit-line-clamp: unset }
.pcard .pmore { align-self: flex-start; background: none; border: 0; padding: 0; min-height: 0; color: var(--ink); font: 600 13px var(--f-body);
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer }
.pcard .pfoot { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 6px; flex-wrap: wrap }
.pcard .pend { font-size: 12px; color: var(--muted); font-weight: 600 }
.pcard .pbtn { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 8px 16px; border-radius: 12px; margin-left: auto;
  background: var(--accent); color: var(--accent-ink); font: 650 14px var(--f-body); text-decoration: none; max-width: 100% }
.pcard .pbtn:focus-visible, .pcard .pmore:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px }
.pcard [hidden] { display: none !important }
/* carousel extras: dots, and mouse dragging on computers */
@media (hover: hover) and (pointer: fine) { .pcards { cursor: grab } .pcards a, .pcards button { cursor: pointer } }
.pcards.dragging { cursor: grabbing; scroll-snap-type: none; user-select: none }
.pcards.dragging * { pointer-events: none }
.pdots { display: flex; justify-content: center; gap: 2px; margin-top: -2px }
.pdots button { width: 24px; height: 24px; min-height: 0; padding: 0; border: 0; background: none; display: grid; place-items: center; cursor: pointer }
.pdots button::before { content: ""; width: 7px; height: 7px; border-radius: 99px; background: var(--line); transition: width .25s, background .25s }
.pdots button[aria-current="true"]::before { width: 18px; background: var(--ink) }
.pdots button:focus-visible { outline: 3px solid var(--focus); outline-offset: -2px; border-radius: 8px }
.pdots[hidden] { display: none }
