/* Cairn Card — component styles. Every value comes from tokens.css. Prefix: cc- */

body { margin: 0; background: var(--surface); color: var(--ink); font-family: var(--font-sans); font-size: 16px; line-height: 24px; -webkit-font-smoothing: antialiased; }
.cc-row { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; padding: var(--space-4); }
/* Theme-aware logos: put both versions side by side, one shows per theme */
.cc-only-dark { display: none !important; }
[data-theme="dark"] .cc-only-light { display: none !important; }
[data-theme="dark"] .cc-only-dark { display: block !important; }
.cc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-4); padding: var(--space-4); }

/* ---------- Button ---------- */
.cc-btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); height: 44px; padding: 0 var(--space-6); border: 2px solid transparent; border-radius: var(--radius-pill); font-family: var(--font-sans); font-size: 16px; font-weight: 700; line-height: 1; text-decoration: none; white-space: nowrap; cursor: pointer; transition: background-color .15s ease, transform .1s ease; }
.cc-btn:active { transform: translateY(1px); }
.cc-btn:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 3px; }
.cc-btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.cc-btn--primary { background: var(--alpenglow); color: var(--on-alpenglow); }
.cc-btn--primary:hover:not([disabled]) { background: var(--alpenglow-hover); }
.cc-btn--secondary { background: transparent; color: var(--ink); border-color: var(--ink); }
.cc-btn--secondary:hover:not([disabled]) { background: var(--surface-sunken); }
.cc-btn--ghost { background: transparent; color: var(--glacier-ink); padding: 0 var(--space-2); }
.cc-btn--ghost:hover:not([disabled]) { text-decoration: underline; text-underline-offset: 3px; }
.cc-btn--sm { height: 36px; padding: 0 var(--space-4); font-size: 14px; }

/* ---------- CategoryTag ---------- */
.cc-tag { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px 0 8px; border-radius: var(--radius-pill); background: var(--stone-soft); color: var(--ink); font-family: var(--font-sans); font-size: 12px; line-height: 16px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.cc-tag::before { content: ""; width: 10px; height: 7px; border-radius: var(--radius-pill); background: var(--ink-muted); flex: none; }
.cc-tag--snow { background: var(--glacier-soft); }
.cc-tag--snow::before { background: var(--glacier); }
.cc-tag--climb { background: var(--pine-soft); }
.cc-tag--climb::before { background: var(--pine); }
.cc-tag--gear { background: var(--stone-soft); }
.cc-tag--eat { background: var(--alpenglow-soft); }
.cc-tag--eat::before { background: var(--alpenglow); }
.cc-tag--recover { background: var(--gold-soft); }
.cc-tag--recover::before { background: var(--gold); }

/* ---------- OfferCard ---------- */
.cc-offer { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-4); background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-md); color: var(--ink); transition: box-shadow .15s ease; }
.cc-offer:hover { box-shadow: var(--shadow-card); }
.cc-offer__top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin-bottom: var(--space-1); }
.cc-offer__area { font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.cc-offer__partner { margin: 0; font-family: var(--font-sans); font-size: 18px; line-height: 24px; font-weight: 700; }
.cc-offer__value { margin: 0; font-family: var(--font-display); font-size: 32px; line-height: 34px; font-weight: 800; text-transform: uppercase; color: var(--alpenglow-ink); }
.cc-offer__what { margin: 0; font-size: 16px; line-height: 22px; }
.cc-offer__terms { margin: 0; font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.cc-offer__how { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-2); padding-top: var(--space-3); border-top: 1px solid var(--line); font-size: 13px; line-height: 18px; font-weight: 600; color: var(--glacier-ink); }

/* ---------- PromoCode ---------- */
.cc-code { display: inline-flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4); background: var(--surface-sunken); border: 1.5px dashed var(--line-strong); border-radius: var(--radius-sm); }
.cc-code__label { font-size: 12px; line-height: 16px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }
.cc-code__value { font-family: var(--font-mono); font-size: 15px; line-height: 20px; font-weight: 600; letter-spacing: .04em; color: var(--ink); }

/* ---------- MemberCard ---------- */
/* Card object: fixed card-* colours, identical in both themes. 340px wide = CR80 ratio. */
.cc-member { position: relative; box-sizing: border-box; width: 340px; aspect-ratio: 85.6 / 54; border-radius: var(--radius-md); overflow: hidden; background: var(--card-ground); color: var(--on-granite); box-shadow: var(--shadow-lift), inset 0 0 0 1px var(--card-edge); font-family: var(--font-sans); }
.cc-member__art { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.cc-member__stone { fill: var(--card-stone); }
.cc-member__summit { fill: var(--card-summit); }
.cc-member__logo { position: absolute; left: 22px; top: 20px; height: 15px; display: block; }
.cc-member__place { position: absolute; right: 22px; top: 20px; text-align: right; }
.cc-member__city { display: block; font-size: 9px; line-height: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--on-granite); }
.cc-member__coords { display: block; font-family: var(--font-mono); font-size: 9px; line-height: 12px; letter-spacing: .06em; color: var(--on-granite-muted); }
.cc-member__id { position: absolute; left: 22px; bottom: 20px; }
.cc-member__tier { display: block; font-size: 9px; line-height: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--glacier); }
.cc-member__name { margin: 3px 0 0; font-family: var(--font-display); font-size: 15px; line-height: 18px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }
.cc-member__number { display: block; margin-top: 6px; font-family: var(--font-mono); font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: .14em; color: var(--on-granite); }
/* Back (digital): temporary QR + code, refreshed on a timer */
.cc-member--back { background: var(--card-paper); background-size: cover; background-position: center; color: var(--card-ground); }
.cc-member__qr { position: absolute; left: 14px; top: 14px; width: 148px; height: 148px; border-radius: var(--radius-sm); background: var(--card-paper); }
.cc-member__qr svg { display: block; width: 100%; height: 100%; }
.cc-member__qr path { fill: var(--card-ground); }
.cc-member__live { position: absolute; left: 180px; right: 18px; top: 20px; }
.cc-member__scan { display: block; font-size: 9px; line-height: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--card-paper-muted); }
.cc-member__code { display: block; margin-top: 6px; font-family: var(--font-mono); font-size: 24px; line-height: 28px; font-weight: 600; letter-spacing: .06em; color: var(--card-ground); font-variant-numeric: tabular-nums; }
.cc-member__timer { display: block; margin-top: 4px; font-size: 11px; line-height: 14px; color: var(--card-paper-muted); font-variant-numeric: tabular-nums; }
.cc-member__who { position: absolute; left: 180px; right: 18px; top: 128px; }
.cc-member__who .cc-member__name { font-size: 11px; line-height: 14px; margin: 0; }
.cc-member__who .cc-member__scan { margin-top: 2px; letter-spacing: .1em; }
.cc-member__clock { display: inline-flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; }
.cc-member__pulse { width: 6px; height: 6px; border-radius: var(--radius-pill); background: var(--card-summit); animation: cc-pulse 1s ease-in-out infinite; }
@keyframes cc-pulse { 50% { opacity: .25; transform: scale(.7); } }
.cc-member__strip { position: absolute; left: 0; right: 0; bottom: 0; height: 34px; box-sizing: border-box; padding: 0 18px 0 22px; display: flex; align-items: center; justify-content: space-between; background: var(--card-ground); color: var(--on-granite); }
.cc-member__strip-label { font-size: 9px; line-height: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--on-granite-muted); }
.cc-member__strip .cc-member__number { margin: 0; font-weight: 600; }
.cc-member__progress { position: absolute; left: 0; top: 0; height: 3px; width: 100%; background: var(--glacier); transform-origin: left center; transition: transform 1s linear; }

/* ---------- MemberCard flip (tap to show the code) ---------- */
.cc-flip { display: block; width: 340px; aspect-ratio: 85.6 / 54; perspective: 1200px; border-radius: var(--radius-md); cursor: pointer; -webkit-tap-highlight-color: transparent; outline: none; }
.cc-flip:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 4px; }
.cc-flip__inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .7s cubic-bezier(.2, .75, .25, 1), scale .15s ease; }
.cc-flip:active .cc-flip__inner { scale: .98; }
.cc-flip.is-flipped .cc-flip__inner { transform: rotateY(180deg); }
.cc-flip__face { position: absolute; inset: 0; width: 100%; height: 100%; -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.cc-flip__face--back { transform: rotateY(180deg); }
.cc-flip-hint { margin: var(--space-3) 0 0; width: 340px; text-align: center; font-size: 13px; line-height: 18px; color: var(--ink-muted); }
@media (prefers-reduced-motion: reduce) {
  .cc-flip__inner { transition: none; }
  .cc-member__progress { transition: none; }
  .cc-member__pulse { animation: none; }
}

/* ---------- PartnerBadge ---------- */
.cc-badge { display: inline-flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-6) var(--space-3) var(--space-4); border-radius: var(--radius-pill); background: var(--granite); color: var(--on-granite); }
.cc-badge__mark { height: 36px; display: block; flex: none; }
.cc-badge__title { display: block; font-family: var(--font-display); font-size: 14px; line-height: 16px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; }
.cc-badge__sub { display: block; font-size: 13px; line-height: 18px; color: var(--on-granite-muted); }
.cc-badge--founding { background: var(--gold); color: var(--on-gold); }
.cc-badge--founding .cc-badge__sub { color: var(--on-gold); }
