/*
 * /cenik price board. Page-scoped: the site's Tailwind build (marvel-v3.css) is precompiled,
 * so new utilities don't exist — everything this page needs is here, on Marvel V3 tokens.
 *
 * Design rule for this page: the board is the one loud thing. Lime appears only on the
 * selected price and the buy button; no scroll-reveal, no uppercase eyebrows.
 */

.pb {
  --pb-bg: #09090b;
  --pb-surface: #18181b;
  --pb-line: #27272a;
  --pb-text: #f4f4f5;
  --pb-muted: #a1a1aa;
  --pb-faint: #71717a;
  --pb-lime: #a3e635;
  --pb-lime-hover: #bef264;

  position: relative;
  isolation: isolate; /* keeps the ::before texture behind content without z-index games */
  background-color: var(--pb-bg);
  color: var(--pb-text);
  min-height: 100vh;
  padding: 10rem 1rem 0;
}

@media (min-width: 768px) {
  .pb { padding: 11rem 3rem 0; }
}

/*
 * Brick texture (pattern-1, as on the rest of the site). ONE copy scaled to cover —
 * never tiled: pattern-1 isn't a seamless tile, so repeating it (as .bg-brick does at 900px)
 * draws visible vertical seams that split a wide screen into three panels.
 * The gradient darkens it; the mask fades the whole layer out. A colour fade alone to the
 * page black still left a faint horizontal line where the layer ended — the mask leaves no edge.
 */
.pb::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: min(100%, 90rem);
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(to bottom,
      rgba(9, 9, 11, 0.9) 0%,
      rgba(9, 9, 11, 0.78) 25%,
      rgba(9, 9, 11, 0.88) 60%),
    url(/images/pattern-1.webp?width=1920&format=webp&quality=50);
  background-size: 100% 100%, cover;
  background-position: top center, top center;
  background-repeat: no-repeat;
  -webkit-mask-image: linear-gradient(to bottom, #000 45%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 45%, transparent 100%);
}

.pb-head,
.pb-wrap,
.pb-info,
.pb-empty-state {
  max-width: 72rem;
  margin-inline: auto;
}

.pb-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Header ─────────────────────────────────────────────────────────── */

.pb-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--pb-faint);
  font-size: 0.875rem;
  text-decoration: none;
  margin-bottom: 2.5rem;
}
.pb-back:hover { color: var(--pb-text); }

.pb-title {
  font-family: var(--font-display);
  font-size: clamp(4.5rem, 13vw, 10rem);
  line-height: 0.85;
  letter-spacing: -0.01em;
  margin: 0 0 1.5rem;
}

.pb-lede {
  color: var(--pb-muted);
  font-size: 1.125rem;
  line-height: 1.55;
  max-width: 34rem;
  margin: 0 0 4rem;
}

/* ── Regular / student board switch ─────────────────────────────────── */

.pb-mode {
  display: inline-flex;
  gap: 0.25rem;
  border: 1px solid var(--pb-line);
  border-radius: 999px;
  padding: 0.25rem;
  margin: -2.5rem 0 3rem; /* sits in the lede's bottom margin */
}

.pb-mode-link {
  font-family: var(--font-display);
  font-size: 1.125rem;
  letter-spacing: 0.02em;
  color: var(--pb-muted);
  text-decoration: none;
  border-radius: 999px;
  padding: 0.5rem 1.125rem;
}
.pb-mode-link:hover { color: var(--pb-text); }
.pb-mode-link[aria-current="page"] {
  background: var(--pb-lime);
  color: var(--pb-bg);
}

.pb-student a { color: var(--pb-lime); text-decoration: underline; text-underline-offset: 2px; }
.pb-student a:hover { color: var(--pb-lime-hover); }

.pb-empty-state {
  color: var(--pb-muted);
  padding: 3rem 0 6rem;
}

/* ── Tier switch (phone only) ───────────────────────────────────────── */

.pb-switch {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  border: 1px solid var(--pb-line);
  border-radius: 0.75rem;
  padding: 0.25rem;
  margin-bottom: 1.5rem;
}

.pb-switch-btn {
  font-family: var(--font-display);
  font-size: 1.125rem;
  color: var(--pb-muted);
  background: none;
  border: 0;
  border-radius: 0.5rem;
  padding: 0.625rem 0.5rem;
  cursor: pointer;
}
.pb-switch-btn[aria-pressed="true"] {
  background: var(--pb-surface);
  color: var(--pb-text);
}

@media (min-width: 768px) {
  .pb-switch { display: none; }
}

/* ── Board ──────────────────────────────────────────────────────────── */

.pb-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

@media (min-width: 768px) {
  .pb-board {
    grid-template-columns: minmax(10rem, 1.1fr) repeat(var(--pb-tiers), minmax(0, 1fr));
  }
}

.pb-corner { display: none; }
@media (min-width: 768px) {
  .pb-corner { display: block; border-bottom: 1px solid var(--pb-line); }
}

.pb-tier {
  grid-column: 1 / -1;
  padding: 0 0 1.5rem;
  border-bottom: 1px solid var(--pb-line);
}
@media (min-width: 768px) {
  .pb-tier {
    grid-column: auto;
    padding: 0 1.25rem 1.75rem;
    text-align: right;
  }
}

.pb-tier-name {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  line-height: 1;
  margin: 0 0 0.75rem;
  color: var(--pb-muted);
  transition: color 150ms ease;
}
.pb-tier.is-col .pb-tier-name { color: var(--pb-text); }

.pb-tier-desc {
  color: var(--pb-muted); /* not --pb-faint: too little contrast where the brick texture is strongest */
  font-size: 0.875rem;
  line-height: 1.5;
  margin: 0;
}
@media (min-width: 768px) {
  .pb-tier-desc { margin-left: auto; max-width: 18rem; }
}

.pb-tier-perk {
  color: var(--pb-text);
  font-size: 0.875rem;
  font-weight: 600;
  margin: 0.75rem 0 0;
}

.pb-rowhead {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.25rem;
  padding: 1.25rem 1rem 1.25rem 0;
  border-bottom: 1px solid var(--pb-line);
}

.pb-row-label {
  font-size: 1.0625rem;
  font-weight: 500;
  color: var(--pb-muted);
  transition: color 150ms ease;
}
.pb-rowhead.is-row .pb-row-label { color: var(--pb-text); }

.pb-row-note {
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--pb-faint);
  max-width: 22rem;
}

.pb-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 0.25rem;
  padding: 1.25rem 1.25rem;
  border-bottom: 1px solid var(--pb-line);
  text-align: right;
  cursor: pointer;
  transition: background-color 150ms ease;
}
.pb-cell.is-row,
.pb-cell.is-col { background: color-mix(in oklab, var(--pb-surface) 60%, transparent); }
.pb-cell:hover { background: var(--pb-surface); }

.pb-cell-none {
  cursor: default;
  color: var(--pb-line);
  font-size: 1.5rem;
}
.pb-cell-none:hover { background: none; }
@media (max-width: 767px) {
  .pb-cell-none { display: none; }
}

/* The radio stays in the accessibility tree and takes keyboard focus; the cell is its visual. */
.pb-radio {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.pb-price {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 2.6vw, 2.5rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--pb-text);
}
.pb-cur {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: var(--pb-muted);
}

.pb-unit {
  font-size: 0.8125rem;
  color: var(--pb-faint);
  white-space: nowrap;
}

.pb-cell:has(.pb-radio:checked) { background: var(--pb-lime); }
.pb-cell:has(.pb-radio:checked) .pb-price,
.pb-cell:has(.pb-radio:checked) .pb-cur,
.pb-cell:has(.pb-radio:checked) .pb-unit { color: var(--pb-bg); }

.pb-cell:has(.pb-radio:focus-visible) {
  outline: 2px solid var(--pb-lime);
  outline-offset: -4px;
}
.pb-cell:has(.pb-radio:checked:focus-visible) { outline-color: var(--pb-bg); }

.pb-shared {
  color: var(--pb-faint);
  font-size: 0.875rem;
  line-height: 1.5;
  margin: 1.25rem 0 0;
}
.pb-shared p { margin: 0 0 0.375rem; max-width: 48rem; }

/* ── Student note ───────────────────────────────────────────────────── */

.pb-student {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  margin-top: 2rem;
  padding: 1.125rem 1.25rem;
  border: 1px solid var(--pb-line);
  border-radius: 0.75rem;
  background: rgba(24, 24, 27, 0.7);
  max-width: 44rem;
}
.pb-student svg { flex-shrink: 0; color: var(--pb-text); margin-top: 0.125rem; }
.pb-student p { margin: 0; color: var(--pb-muted); font-size: 0.9375rem; line-height: 1.55; }
.pb-student strong { color: var(--pb-text); font-weight: 600; }

/* ── Selection bar ──────────────────────────────────────────────────── */

.pb-bar {
  position: sticky;
  bottom: var(--pb-bar-offset, 0px); /* set by the page script while the cookie banner is showing */
  transition: bottom 300ms ease;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
  padding: 1rem 0 calc(1rem + env(safe-area-inset-bottom));
  /* Frosted like _CookieConsent, so it doesn't cut a flat black band across the texture. */
  background: rgba(9, 9, 11, 0.9);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--pb-line);
}

.pb-bar-choice {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 1rem;
  margin: 0;
  min-width: 0;
}
.pb-bar-name { color: var(--pb-muted); font-size: 0.9375rem; }
.pb-bar-price {
  font-family: var(--font-display);
  font-size: 1.75rem;
  line-height: 1;
  white-space: nowrap;
}

.pb-buy {
  flex-shrink: 0;
  background: var(--pb-lime);
  color: var(--pb-bg);
  font-weight: 700;
  font-size: 1rem;
  border: 0;
  border-radius: 0.75rem;
  padding: 0.9rem 1.75rem;
  cursor: pointer;
  transition: background-color 150ms ease, transform 150ms ease;
}
.pb-buy:hover { background: var(--pb-lime-hover); transform: translateY(-1px); }
.pb-buy:focus-visible { outline: 2px solid var(--pb-lime); outline-offset: 3px; }
.pb-buy:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.pb-bar-offline { color: var(--pb-muted); margin: 0; font-size: 0.9375rem; }

/* ── Info ───────────────────────────────────────────────────────────── */

.pb-info {
  display: grid;
  gap: 3rem;
  padding: 6rem 0 8rem;
  color: var(--pb-muted);
  line-height: 1.6;
}
@media (min-width: 768px) {
  .pb-info { grid-template-columns: 1fr 1fr; gap: 4rem; }
}
.pb-info p { margin: 0 0 1rem; max-width: 34rem; }

.pb-info-title {
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1;
  color: var(--pb-text);
  margin: 0 0 1.25rem;
}

.pb-branches { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem; }
.pb-branches li { display: flex; flex-direction: column; gap: 0.125rem; }
.pb-branch-name { color: var(--pb-text); font-weight: 500; }
.pb-branches a { color: var(--pb-lime); text-decoration: none; width: fit-content; }
.pb-branches a:hover { text-decoration: underline; }
.pb-back:focus-visible,
.pb-branches a:focus-visible,
.pb-switch-btn:focus-visible { outline: 2px solid var(--pb-lime); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .pb *, .pb *::before, .pb *::after { transition: none !important; }
}
