/* Component library — the structural furniture every site composes from.
 *
 * base.css styles HTML elements. This styles named patterns: header, hero,
 * footer, and the pieces that sit between them.
 *
 * A site should need no CSS beyond its brand tokens. If it does, the missing
 * piece belongs here — not in the site.
 */

/* Header ------------------------------------------------------------------ */

.site-head {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.site-head > .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-6);
  padding-block: var(--s-4);
}
.wordmark {
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: var(--display-weight);
  font-stretch: var(--display-stretch);
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--ink);
}
.wordmark-mono { font-family: var(--font-mono); font-size: var(--step-0); }

.site-head nav { display: flex; align-items: center; gap: var(--s-6); font-size: var(--step--1); }
.site-head nav a { color: var(--ink-muted); text-decoration: none; transition: color var(--transition-fast); }
.site-head nav a:hover { color: var(--ink); }

/* Hero -------------------------------------------------------------------- */

.hero {
  padding-block: var(--s-24) var(--s-16);
  background: radial-gradient(56rem 26rem at var(--hero-glow, 12% -12%), var(--accent-wash), transparent 70%);
}
.hero h1 { margin-block: var(--s-4) var(--s-6); }
.hero h1 em { font-style: normal; color: var(--accent); }

/* Two-column variant: content beside an illustration */
.hero-split > .wrap {
  display: grid;
  gap: var(--s-12);
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  align-items: center;
}
.hero-art { color: var(--accent); }
@media (max-width: 48rem) {
  .hero-split > .wrap { grid-template-columns: 1fr; }
  .hero-art { order: -1; max-width: 14rem; }
}

/* Centred variant: holding pages, single statements */
.hero-centre {
  min-height: 70vh;
  display: grid;
  place-content: center;
  text-align: center;
}

/* Rule mark — three decreasing lines, the house motif */
.mark { display: flex; flex-direction: column; align-items: center; gap: var(--s-2); margin-bottom: var(--s-8); }
.mark span { display: block; height: 3px; border-radius: 2px; background: var(--accent); }
.mark span:nth-child(1) { width: 4.5rem; opacity: 0.85; }
.mark span:nth-child(2) { width: 3rem;   opacity: 0.6; }
.mark span:nth-child(3) { width: 3.6rem; opacity: 0.4; }

/* Pieces ------------------------------------------------------------------ */

.status {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.muted { color: var(--ink-faint); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--bg-raised);
  padding: var(--s-2) var(--s-4);
  font-family: var(--font-mono);
  font-size: var(--step--1);
}
.pill-accent { border-color: color-mix(in srgb, var(--accent) 35%, var(--rule)); color: var(--accent); }

/* Numbered steps */
.steps { list-style: none; padding: 0; display: grid; gap: var(--s-3);
         grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr)); }
.steps li {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: var(--s-3);
  align-items: center;
  background: var(--bg-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: var(--s-4) var(--s-6);
}
.steps .n { grid-row: 1 / 3; font-family: var(--font-mono); font-size: var(--step-1); color: var(--accent); opacity: 0.75; }
.steps b { font-weight: 600; }
.steps li > span:last-child { font-size: var(--step--1); color: var(--ink-muted); }

/* Footer ------------------------------------------------------------------ */

.site-foot {
  border-top: 1px solid var(--rule);
  padding-block: var(--s-8);
  font-size: var(--step--1);
  color: var(--ink-muted);
}
.site-foot > .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-4);
  justify-content: space-between;
}
.site-foot-centre > .wrap { justify-content: center; text-align: center; }

/* Page shell — sticks the footer to the bottom on short pages */
body { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr auto; }

/* Forms ------------------------------------------------------------------- */
/* First needed by loyalty-wallet (a working console, not a marketing page) --
   base.css/components.css had no form primitives at all until this. */

[x-cloak] { display: none !important; }

.site-head nav a.active { color: var(--ink); font-weight: 600; }

.field-label {
  display: block;
  font-size: var(--step--1);
  color: var(--ink-muted);
}

.field {
  display: block;
  width: 100%;
  margin-top: var(--s-2);
  padding: var(--s-3);
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.field:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* .button/.button-quiet above are written for <a>; these extend them to
   <button>, which needs its own reset (no native anchor styling to build on). */
button.button, button.button-quiet { font: inherit; border: none; cursor: pointer; }
button.button-quiet { border: 1px solid var(--rule); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

code {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  background: var(--bg-sunken);
  padding: var(--s-2) var(--s-3);
  border-radius: var(--radius);
  display: inline-block;
  word-break: break-all;
}

.error { color: var(--error); }

tr.reversed { opacity: 0.5; text-decoration: line-through; }

/* Console patterns -------------------------------------------------------- */
/* First needed by loyalty-wallet, a working console rather than a marketing
   page. All new class names: no existing site's markup uses them, so adding
   them changes nothing elsewhere. Colours come from tokens (--highlight,
   --ticket-bg, ...) whose defaults are the house look. */

.section-tight { padding-block: var(--s-8) var(--s-16); }

/* The heading of a card. (.eyebrow is a small tracked label; this is a title.) */
.card-title {
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 700;
  font-stretch: var(--display-stretch);
  line-height: var(--leading-tight);
}
.card-bold { border: 2px solid var(--ink); }

/* Two options in the header that are a switch, not two links. Put on <nav>. */
.site-head nav.switch {
  gap: 0;
  padding: 3px;
  background: var(--bg-sunken);
  border-radius: 999px;
}
.site-head nav.switch a { padding: var(--s-2) var(--s-4); border-radius: 999px; font-weight: 600; }
.site-head nav.switch a.active { background: var(--ink); color: var(--bg); }

.wordmark-dot::after {
  content: "";
  display: inline-block;
  width: 0.3em; height: 0.3em;
  margin-left: 0.1em;
  border-radius: 50%;
  background: var(--highlight);
}

.button-outline, button.button-outline {
  min-height: 2.5rem;
  padding: var(--s-2) var(--s-4);
  background: none;
  color: var(--ink);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  font-weight: 600;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.button-outline:hover { background: var(--ink); color: var(--bg); }
.button-lg { min-height: 3.5rem; font-size: var(--step-1); }

/* A ticket: a card with a stub torn off by a perforation. Children:
   .ticket-main (name, label, code) and .ticket-stub (the one action). */
.ticket {
  --notch: 1.5rem;
  background: var(--ticket-bg);
  color: var(--ticket-ink);
  border: 0;
  border-radius: 20px;
  padding: var(--s-6) var(--s-6) 0;
  overflow: hidden;
}
.ticket-main { padding-bottom: var(--s-6); }
.ticket-name {
  font-family: var(--font-display);
  font-size: clamp(3rem, 2rem + 6vw, 5rem);
  font-weight: 800;
  font-stretch: 75%;
  line-height: 0.9;
  letter-spacing: -0.02em;
}
.ticket-label { margin-top: var(--s-4); font-size: var(--step--1); opacity: 0.8; }
.ticket code {
  display: block;
  margin-top: var(--s-2);
  padding: 0;
  background: none;
  color: var(--ticket-ink);
  font-family: var(--font-body);
  font-size: var(--step--1);
}
.ticket-stub {
  position: relative;
  margin-inline: calc(var(--s-6) * -1);
  padding: var(--s-6);
  border-top: 2px dashed color-mix(in srgb, var(--ticket-ink) 45%, transparent);
}
.ticket-stub::before, .ticket-stub::after {
  content: "";
  position: absolute;
  top: calc(var(--notch) / -2 - 1px);
  width: var(--notch); height: var(--notch);
  border-radius: 50%;
  background: var(--bg);
}
.ticket-stub::before { left: calc(var(--notch) / -2); }
.ticket-stub::after  { right: calc(var(--notch) / -2); }
.ticket-stub .button { width: 100%; background: var(--highlight); color: var(--on-highlight); }
.ticket-stub .button:hover { background: var(--highlight); color: var(--on-highlight); filter: brightness(1.08); }

/* Rows: a three-column <table> (title, detail, value) shown as one stamp card
   per row, with the value as a badge. The header row stays for screen readers. */
.rows table { margin-top: calc(var(--s-3) * -1); border-collapse: separate; border-spacing: 0 var(--s-3); font-size: var(--step-0); }
.rows thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.rows tbody tr {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "title value" "detail value";
  align-items: center;
  column-gap: var(--s-4);
  padding: var(--s-3) var(--s-4);
  background: var(--bg);
  border: 1.5px solid var(--rule);
  border-radius: var(--radius);
}
.rows td { padding: 0; border: 0; }
.rows td:nth-child(1) { grid-area: title; font-weight: 700; font-size: var(--step-1); font-stretch: 85%; }
.rows td:nth-child(2) { grid-area: detail; color: var(--ink-muted); font-size: var(--step--1); }
.rows td:nth-child(3) {
  grid-area: value;
  min-width: 3.5rem;
  padding: var(--s-2) var(--s-4);
  border-radius: 999px;
  background: var(--highlight);
  color: var(--on-highlight);
  font-size: var(--step-2);
  font-weight: 800;
  font-stretch: 75%;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

/* Board: a wide console. Side cards stack on the left, one main card beside them;
   a single column on a phone. */
.board { display: grid; gap: var(--s-6); }
.board > * + * { margin-top: 0; }
@media (min-width: 60rem) {
  .board { grid-template-columns: minmax(18rem, 25rem) 1fr; align-items: start; }
  .board-side { grid-column: 1; }
  .board-main { grid-column: 2; grid-row: 1 / span 2; }
}

/* Ledger: a table of money. Columns: who, amount, points, when, action. */
.ledger table { font-size: var(--step-0); font-variant-numeric: tabular-nums; }
.ledger th { font-size: var(--step--1); color: var(--ink-muted); }
.ledger th:nth-child(2), .ledger td:nth-child(2),
.ledger th:nth-child(3), .ledger td:nth-child(3) { text-align: right; }
.ledger td:nth-child(3) { font-weight: 800; font-stretch: 80%; }
.ledger td:nth-child(1), .ledger td:nth-child(4) { white-space: nowrap; }
.ledger td:nth-child(4) { color: var(--ink-muted); font-size: var(--step--1); }

/* Scan to join: a camera viewfinder, a QR on white, and a list of shortcut tiles. */
.qr {
  width: 100%;
  max-width: 260px;
  padding: var(--s-4);
  background: #fff;
  border-radius: var(--radius);
  image-rendering: pixelated;
}
.scan-video {
  width: 100%;
  max-width: 360px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius);
  background: #000;
}
.tile-list { display: grid; gap: var(--s-2); }
.tile {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-3) var(--s-2) var(--s-4);
  border: 1.5px solid var(--rule);
  border-radius: var(--radius);
}
.tile > button:first-child {
  flex: 1 1 auto;
  min-height: 2.5rem; padding: 0; border: 0; background: none;
  font-size: var(--step-1); font-weight: 700; font-stretch: 85%; text-align: left;
}
.tile > button:first-child:hover { background: none; color: var(--accent); }
.tile > button:nth-child(2) { flex: 0 0 auto; }
.tile-qr { display: block; flex: 0 0 100%; width: 100%; max-width: 15rem; margin: var(--s-2) auto; padding: var(--s-3); background: #fff; border-radius: var(--radius); image-rendering: pixelated; }
.button-block { width: 100%; }

/* studio — the patterns of the `studio` layout (S81). Tokens only: a re-skin
   swaps site.css, never this block, so no colour literals belong here. */
/* studio */
.announce { background: var(--bg-sunken); text-align: center; padding: var(--s-2) var(--s-4); font-size: var(--step--1); }
.announce p { margin: 0; }
.studio-hero { position: relative; isolation: isolate; display: grid; align-items: center; min-height: min(78vh, 46rem); text-align: left; color: var(--bg); padding-block: var(--s-16); }
.studio-hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--hero-focus, 50% 50%); z-index: -2; }
.studio-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, color-mix(in srgb, var(--ink) 74%, transparent), color-mix(in srgb, var(--ink) 8%, transparent) 78%); }
.studio-hero h1 { color: inherit; font-size: var(--step-4); margin: 0; line-height: var(--leading-tight); }
.studio-hero > .wrap { width: 100%; }
.studio-hero-copy { max-width: 34rem; }
.studio-hero .lede { color: inherit; }
.studio-band { background: var(--bg-sunken); }
.studio-prose { margin-inline: 0; }
.studio-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-12); align-items: center; }
.teacher { max-width: none; }
.teacher.studio-split { grid-template-columns: minmax(0, 20rem) minmax(0, 1fr); align-items: start; }
.teacher-photo, .studio-figure { width: 100%; height: auto; border-radius: var(--radius-lg); object-fit: cover; }
.card > img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius); }
.tt { display: grid; gap: var(--s-8); }
.tt-day h3 { margin-bottom: var(--s-2); }
.tt-row { display: grid; grid-template-columns: 5rem 1fr auto auto; gap: var(--s-4); align-items: center; padding-block: var(--s-3); border-bottom: 1px solid var(--rule); }
.tt-time { font-variant-numeric: tabular-nums; }
.price-amount { font-family: var(--font-display); font-size: var(--step-3); margin: 0; }
.studio-foot > .wrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: var(--s-8); align-items: start; }
.studio-foot nav { display: grid; gap: var(--s-2); }
.placeholder-notice { grid-column: 1 / -1; }
details { border-bottom: 1px solid var(--rule); padding-block: var(--s-3); }
summary { cursor: pointer; font-weight: 600; }
@media (max-width: 40rem) {
  .site-head > .wrap { flex-wrap: wrap; gap: var(--s-3); }
  .site-head nav { flex-wrap: wrap; gap: var(--s-4); }
  .studio-split, .teacher.studio-split { grid-template-columns: minmax(0, 1fr); gap: var(--s-6); }
  .studio-hero::after { background: color-mix(in srgb, var(--ink) 55%, transparent); }
  .tt-row { grid-template-columns: 4rem 1fr; }
  .tt-places { grid-column: 2; }
  .tt-row .book { grid-column: 1 / -1; justify-self: start; }
}
/* /studio */
