/*
 * @palamedes/example-ui — shared design for the example matrix.
 *
 * One stylesheet, shared by twenty-four framework demos, so those apps are
 * visually identical. Framework code only owns markup structure and the
 * locale strategy; every color, font, and spacing decision lives here.
 */

:root {
  --paper: oklch(97.5% 0.012 75);
  --paper-2: oklch(99% 0.008 80);
  --ink: oklch(22% 0.02 285);
  --ink-soft: oklch(42% 0.02 285);
  --ink-faint: oklch(52% 0.018 285);
  --line: oklch(86% 0.012 75);
  --line-soft: oklch(91% 0.01 75);
  --accent: oklch(57% 0.19 32);
  --accent-press: oklch(49% 0.18 32);
  --accent-wash: oklch(94% 0.04 45);
  --gold: oklch(55% 0.1 75);
  --focus: oklch(49% 0.18 32);

  --radius: 14px;
  /* System fonts keep the first render stable without a webfont download. */
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-width: 320px;
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(120% 80% at 88% -8%, var(--accent-wash), transparent 60%), var(--paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
}

/* Keyboard focus is visible on every interactive surface. */
:where(button, a, input, [tabindex]):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 6px;
}

.page-shell {
  max-width: 74rem;
  margin: 0 auto;
  padding: 1.5rem clamp(1rem, 4vw, 3rem) 5rem;
}

/* ---------- locale suggestion notice ---------- */

.notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  flex-wrap: wrap;
  margin: 0.25rem 0 0.5rem;
  padding: 0.7rem 1rem;
  background: var(--accent-wash);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.notice .notice-text {
  flex: 1 1 16rem;
}

.notice .notice-cta {
  flex: 0 0 auto;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.01em;
  color: var(--paper);
  background: var(--accent);
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  transition: background 0.18s;
}

.notice .notice-cta:hover {
  background: var(--accent-press);
}

.notice .notice-dismiss {
  flex: 0 0 auto;
  appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 1.15rem;
  line-height: 1;
  padding: 0.2rem 0.45rem;
  color: var(--ink-soft);
  border-radius: 999px;
  transition: color 0.18s;
}

.notice .notice-dismiss:hover {
  color: var(--ink);
}

/* ---------- top bar ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.75rem 0 1.5rem;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}

.brand b {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.4rem;
  letter-spacing: -0.02em;
}

.brand .brand-meta {
  font-size: 0.8rem;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

.switcher {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.switcher .switcher-label {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-right: 0.15rem;
}

.seg {
  display: inline-flex;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}

.seg button,
.seg a {
  appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  padding: 0.34rem 0.8rem;
  border-radius: 999px;
  color: var(--ink-soft);
  text-decoration: none;
  transition:
    color 0.18s,
    background 0.18s;
}

.seg button:hover,
.seg a:hover {
  color: var(--ink);
}

/* Cookie switchers use <button aria-pressed>; route switchers use <a
   aria-current="page"> — both light up as the active pill. */
.seg button[aria-pressed="true"],
.seg a[aria-current="page"] {
  background: var(--ink);
  color: var(--paper);
}

.seg button:disabled {
  cursor: progress;
  opacity: 0.6;
}

/* ---------- hero ---------- */

.hero {
  padding: 1.5rem 0 2.5rem;
  max-width: 50rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-press);
  font-weight: 700;
  margin: 0 0 1.1rem;
}

.eyebrow .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-wash);
}

.hero h1 {
  font-family: var(--sans);
  font-weight: 500;
  font-optical-sizing: auto;
  font-size: clamp(2.4rem, 5.5vw, 4.1rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin: 0 0 1.1rem;
  text-wrap: balance;
}

.hero h1 em {
  font-style: italic;
  color: var(--accent-press);
}

.greet {
  font-size: 1.05rem;
  color: var(--ink);
  font-weight: 500;
  margin: 0 0 0.4rem;
}

.lede {
  font-size: 1.08rem;
  color: var(--ink-soft);
  margin: 0;
  max-width: 38rem;
  text-wrap: pretty;
}

/* ---------- main grid ---------- */

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 860px) {
  .grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.grid + details.feat {
  margin-top: 1.5rem;
}

/* ---------- ticket (the hero object) ---------- */

.ticket {
  position: relative;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow:
    0 1px 2px oklch(30% 0.05 285 / 0.06),
    0 10px 22px -14px oklch(30% 0.05 285 / 0.22);
}

.ticket-head {
  padding: 1.6rem 1.7rem 1.4rem;
  border-bottom: 1px dashed var(--line);
  position: relative;
}

.ticket-head::before,
.ticket-head::after {
  content: "";
  position: absolute;
  bottom: -11px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--line);
}

.ticket-head::before {
  left: -12px;
}

.ticket-head::after {
  right: -12px;
}

.ticket .kicker {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.ticket h2 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.85rem;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0;
}

.facts {
  padding: 1.4rem 1.7rem 0.4rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem 1.4rem;
}

.fact .fact-label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 700;
  margin: 0 0 0.25rem;
}

.fact .fact-value {
  font-size: 1.02rem;
  font-weight: 500;
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.fact .fact-value small {
  display: block;
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--ink-faint);
}

.avail {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
  color: var(--accent-press);
}

.avail .pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.buy {
  margin: 1.3rem 1.7rem 1.7rem;
  padding: 1.2rem;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
}

.qty-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.qty-label {
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.qty-label b {
  color: var(--ink);
}

.stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-2);
}

.stepper button {
  appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  width: 38px;
  height: 38px;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--ink);
  border-radius: 999px;
  transition: background 0.15s;
}

.stepper button:hover {
  background: var(--line-soft);
}

.stepper .stepper-num {
  min-width: 2.2ch;
  text-align: center;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.total-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 1.1rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line-soft);
}

.total-row .total-label {
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.total-row .total-value {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.7rem;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.cta {
  display: block;
  width: 100%;
  margin-top: 1rem;
  appearance: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  color: var(--paper);
  background: var(--accent);
  padding: 0.95rem;
  border-radius: var(--radius);
  transition:
    background 0.18s,
    transform 0.08s;
}

.cta:hover {
  background: var(--accent-press);
}

.cta:active {
  transform: scale(0.99);
}

/* ---------- behind the scenes (the proof column) ---------- */

.aside {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.aside-head {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  flex-wrap: wrap;
  padding: 0.2rem 0.2rem 0.3rem;
}

.aside-head h3 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.15rem;
  margin: 0;
  letter-spacing: -0.01em;
}

.aside-head span {
  font-size: 0.82rem;
  color: var(--ink-faint);
}

.feat {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
}

.feat .feat-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8rem;
}

.feat .feat-name {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 700;
}

.feat .feat-out {
  font-size: 1.02rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.feat .feat-out.is-text {
  font-size: 0.86rem;
}

.feat code {
  display: block;
  margin-top: 0.55rem;
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--ink-soft);
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.feat code .tok-fn {
  color: var(--accent-press);
}

.feat code .tok-str {
  color: var(--gold);
}

/* ---------- footer ---------- */

.foot {
  margin-top: 2.5rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--ink-faint);
}

.foot .foot-badge {
  font-family: var(--sans);
  font-weight: 600;
  color: var(--ink-soft);
}

/* ---------- responsive ---------- */

@media (max-width: 520px) {
  .facts {
    grid-template-columns: minmax(0, 1fr);
  }

  .total-row .total-value {
    font-size: 1.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
