/* The Fine Pages concept kit: shared structure for appointment sites (practice, studio).
   Each site sets its own tokens (colour, type) in <slug>.css and loads this file first.
   Spacing: 4px grid. Scale 1.333 from 16px. No inline styles (site CSP). */

@font-face { font-family: "Hanken Grotesk"; src: url("/assets/fonts/hanken-grotesk-latin.woff2") format("woff2"); font-weight: 200 700; font-style: normal; font-display: swap; }

:root {
  --sans: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
  --t-sm: .75rem;
  --t-base: 1rem;
  --t-md: 1.333rem;
  --t-lg: 1.777rem;
  --t-xl: 2.369rem;
  --t-2xl: 3.157rem;
  --t-3xl: 4.209rem;
  --t-4xl: 5.61rem;
  --t-5xl: 7.478rem;
  --gutter: clamp(16px, 5vw, 64px);
  --section: clamp(96px, 13vw, 176px);
  --wide: 1440px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --radius: 6px;
  --radius-sheet: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 var(--t-base)/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.muted { color: var(--muted); }

.skip { position: absolute; left: 16px; top: -100px; z-index: 50; background: var(--ink); color: var(--bg); padding: 8px 16px; border-radius: var(--radius); }
.skip:focus { top: 16px; }

/* concept strip */
.concept {
  margin: 0;
  display: flex; flex-wrap: wrap; gap: 4px 16px; justify-content: center; align-items: center;
  padding: 8px var(--gutter);
  background: var(--ink); color: var(--bg);
  font-size: var(--t-sm); letter-spacing: .01em; text-align: center;
}
.concept a { text-underline-offset: 3px; }
.concept-cta { font-weight: 600; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px;
  border: 1px solid transparent; border-radius: var(--radius);
  font: 500 var(--t-base)/1 var(--sans); letter-spacing: .01em;
  text-decoration: none; cursor: pointer;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
  user-select: none; -webkit-user-select: none;
}
.btn:active { transform: scale(.98); }
.btn-l { min-height: 56px; padding: 0 28px; }
.btn-block { width: 100%; }
.btn-main { background: var(--accent); color: var(--on-accent); }
.btn-ghost { background: transparent; border-color: currentColor; }
.btn-ink { background: var(--ink); color: var(--bg); }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
@media (hover: hover) {
  .btn-main:hover { background: var(--accent-hi); }
  .btn-ghost:hover { background: rgba(255, 255, 255, .12); }
}

.txt-link {
  display: inline-flex; align-items: center; min-height: 44px;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px;
  transition: text-underline-offset .2s var(--ease);
}
@media (hover: hover) { .txt-link:hover { text-underline-offset: 9px; } }

/* top bar (transparent over the hero, solid after scrolling) */
.bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 24px;
  height: 72px; padding: 0 var(--gutter);
  margin-bottom: -72px;
  color: var(--hero-text);
  border-bottom: 1px solid transparent;
  transition: background-color .3s var(--ease), border-color .3s var(--ease), color .3s var(--ease);
}
.bar.solid { background: var(--bar-solid); color: var(--ink); border-bottom-color: var(--line); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.logo { font: 400 var(--t-lg)/1 var(--display); text-decoration: none; letter-spacing: -.01em; margin-right: auto; }
.links { display: none; gap: 32px; }
.links a { text-decoration: none; opacity: .85; transition: opacity .2s var(--ease); }
@media (hover: hover) { .links a:hover { opacity: 1; } }
@media (min-width: 960px) { .links { display: flex; } }
.bar .btn { min-height: 44px; padding: 0 18px; }
@media (max-width: 420px) { .bar .btn { display: none; } }

/* hero: full-bleed video, words bottom-left */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 100vh; min-height: 100svh;
  display: flex; align-items: flex-end;
  padding: 120px var(--gutter) clamp(40px, 8vh, 88px);
  color: var(--hero-text);
  background: var(--hero-bg, #111);
}
.hero-video { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.hero-shade {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(var(--scrim), .5) 0%, rgba(var(--scrim), 0) 26%),
    linear-gradient(0deg, rgba(var(--scrim), .9) 0%, rgba(var(--scrim), .45) 40%, rgba(var(--scrim), .05) 72%),
    linear-gradient(rgba(var(--scrim), var(--dim, 0)), rgba(var(--scrim), var(--dim, 0)));
}
.hero-in { max-width: 960px; }
.hero-h { margin: 0; font-family: var(--display); font-weight: 400; text-wrap: balance; }
.hero-lead { margin: 24px 0 0; max-width: 44ch; text-wrap: pretty; font-size: var(--t-md); line-height: 1.45; }
.hero-act { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 32px; }

/* live opening status */
.today { margin: 0; display: inline-flex; align-items: center; gap: 12px; font-size: var(--t-base); }
.today::before { content: ""; flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 4px var(--live-halo); }
.today.closed::before { background: var(--muted); box-shadow: none; }

/* section helpers */
.wrap { max-width: var(--wide); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.sec { padding-top: var(--section); padding-bottom: var(--section); }
.h2 { margin: 0; font: 400 clamp(var(--t-2xl), 5.6vw, var(--t-4xl))/1.02 var(--display); letter-spacing: -.02em; text-wrap: balance; }
.h3 { margin: 0; font: 400 var(--t-lg)/1.15 var(--display); }
.lead { font-size: var(--t-md); line-height: 1.5; text-wrap: pretty; }
.media-frame { width: 100%; object-fit: cover; border-radius: var(--radius); background: var(--band); }

/* opening hours list */
.hours { margin: 0; }
.hours div { display: grid; grid-template-columns: 1fr auto; gap: 16px; padding: 18px 0; border-top: 1px solid var(--line); }
.hours div:last-child { border-bottom: 1px solid var(--line); }
.hours dt { color: var(--muted); }
.hours dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

/* footer pitch (sells The Fine Pages) */
.foot { padding: var(--section) var(--gutter) 120px; max-width: var(--wide); margin: 0 auto; }
.foot-sell { max-width: 720px; }
.foot-h { margin: 0; font: 400 clamp(var(--t-2xl), 5.6vw, var(--t-4xl))/1.02 var(--display); letter-spacing: -.02em; }
.foot-sell p:not(.foot-h) { font-size: var(--t-md); line-height: 1.5; margin: 24px 0 32px; }
.foot-small { margin: 96px 0 0; padding-top: 24px; border-top: 1px solid var(--line); font-size: var(--t-sm); color: var(--muted); }
.foot-small a { color: inherit; text-underline-offset: 3px; }
@media (min-width: 960px) { .foot { padding-bottom: 48px; } }

/* mobile dock: the main action stays in reach after the hero */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
  display: flex; gap: 8px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(0deg, var(--bg) 62%, rgba(var(--bg-rgb), 0));
  transform: translateY(110%);
  transition: transform .35s var(--ease);
}
.dock .btn { flex: 1 1 0; }
.dock.on { transform: none; }
@media (min-width: 960px) { .dock { display: none; } }

/* booking sheet (bottom sheet on phones, centred on desktop) */
.sheet {
  width: 100%; max-width: 100%; max-height: 92vh; max-height: 92dvh;
  margin: auto 0 0; padding: 0;
  border: 0; border-radius: var(--radius-sheet) var(--radius-sheet) 0 0;
  background: var(--paper); color: var(--paper-ink);
  overscroll-behavior: contain;
}
.sheet::backdrop { background: rgba(var(--scrim), .6); }
.sheet[open] { animation: sheet-in .38s var(--ease); }
.sheet[open]::backdrop { animation: fade-in .3s var(--ease); }
@keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@media (min-width: 640px) { .sheet { max-width: 580px; margin: auto; border-radius: 14px; } }
.sheet-form { padding: 20px 20px calc(24px + env(safe-area-inset-bottom)); }
@media (min-width: 640px) { .sheet-form { padding: 28px 32px 32px; } }
.sheet-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 4px; }
.sheet-h { margin: 0; font: 400 var(--t-xl)/1.05 var(--display); outline: none; }
.x { flex: 0 0 auto; display: grid; place-items: center; width: 44px; height: 44px; margin-right: -10px; border: 0; background: none; cursor: pointer; border-radius: 50%; color: inherit; }
.group { border: 0; margin: 20px 0 0; padding: 0; min-width: 0; }
.group legend, .field > span { font-size: var(--t-sm); letter-spacing: .02em; color: var(--ink-soft); }
.group legend { float: left; width: 100%; padding: 0; margin-bottom: 10px; }
.chips { clear: both; display: flex; flex-wrap: wrap; gap: 8px; }
.chips-scroll { flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 20px; overscroll-behavior-x: contain; margin: 0 -20px; padding: 0 20px 4px; scrollbar-width: none; }
.chips-scroll::-webkit-scrollbar { display: none; }
@media (min-width: 640px) { .chips-scroll { margin: 0 -32px; padding: 0 32px 4px; scroll-padding-inline: 32px; } }
.chips-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.chips-list { display: grid; gap: 8px; }
.chip { position: relative; scroll-snap-align: start; flex: 0 0 auto; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip > span {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 48px; min-height: 48px; padding: 6px 14px;
  border: 1px solid var(--paper-line); border-radius: var(--radius);
  font-size: var(--t-base); line-height: 1.15; font-variant-numeric: tabular-nums;
  transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
}
.chips-list .chip > span { flex-direction: row; justify-content: space-between; gap: 16px; padding: 12px 16px; text-align: left; }
.chips-list .chip small { flex: 0 0 auto; white-space: nowrap; }
.chip-t { font-weight: 500; }
.chip small { font-size: var(--t-sm); color: var(--ink-faint); }
.chip input:checked + span { background: var(--paper-ink); border-color: var(--paper-ink); color: var(--paper); }
.chip input:checked + span small { color: inherit; opacity: .8; }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.chip input:disabled + span { color: var(--ink-off); border-style: dashed; text-decoration: line-through; }
.chip input:disabled { cursor: not-allowed; }
@media (hover: hover) { .chip input:not(:checked):not(:disabled):hover + span { border-color: var(--paper-ink); } }
.field { display: grid; gap: 8px; margin: 20px 0 0; }
.field[hidden] { display: none; }
.field input {
  font: 400 var(--t-base)/1.2 var(--sans); /* 16px: no zoom on iOS */
  color: var(--paper-ink); background: var(--paper-field);
  border: 1px solid var(--paper-line); border-radius: var(--radius);
  min-height: 48px; padding: 0 14px; width: 100%;
}
.field input:focus { outline: 2px solid var(--paper-ink); outline-offset: 0; border-color: var(--paper-ink); }
.field input[aria-invalid="true"] { border-color: var(--warn); outline-color: var(--warn); }
.pair { display: grid; gap: 0 12px; }
@media (min-width: 480px) { .pair { grid-template-columns: 1fr 1fr; } }
.sheet .btn-main { margin-top: 24px; }
.fine { margin: 12px 0 0; font-size: var(--t-sm); color: var(--ink-faint); text-align: center; }
.done { text-align: center; padding: 24px 0 0; }
.tick { margin: 0 auto 16px; color: var(--accent); }
.done-h { margin: 0; font: 400 var(--t-2xl)/1.05 var(--display); outline: none; }
.done-sum { margin: 12px auto 8px; max-width: 32ch; font-size: var(--t-md); line-height: 1.4; }
.done .btn { margin-top: 24px; }
.done .tick path { stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw .5s .15s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* scroll reveal (only with JS) */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
.hero-in > * { animation: rise .9s var(--ease) both; }
.hero-in > :nth-child(2) { animation-delay: .12s; }
.hero-in > :nth-child(3) { animation-delay: .24s; }
.hero-in > :nth-child(4) { animation-delay: .36s; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal, .hero-in > * { opacity: 1; transform: none; animation: none; transition: none; }
  .sheet[open], .sheet[open]::backdrop, .done .tick path { animation: none; stroke-dashoffset: 0; }
  .dock { transition: none; }
}
