/* Princess Nails demo. Mobile-first: 360px is the design, wider screens grow from it. */

@font-face {
  font-family: "Instrument Serif";
  src: url("assets/fonts/instrument-serif-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("assets/fonts/instrument-serif-latin-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --font-display: "Instrument Serif", Georgia, "Times New Roman", serif;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Light: cool porcelain, plum-black ink, one cherry lacquer. */
  --bg: #f6f4f8;
  --surface: #ffffff;
  --ink: #1d1220;
  --muted: #5a4d5c;
  --line: #ddd5df;
  --accent: #a3122f;          /* cherry lacquer: 7.3:1 on --bg */
  --accent-ink: #ffffff;
  --accent-press: #7f0d24;
  --band: #1d1220;
  --band-ink: #f6f4f8;
  --focus: #1d4ed8;
  --ok: #17663a;
  --bad: #a3122f;
  --shadow: 0 1px 2px rgb(29 18 32 / 0.06), 0 12px 32px -12px rgb(29 18 32 / 0.25);

  --lacquer-cherry: #a3122f;
  --lacquer-nude: #d9a58f;
  --lacquer-plum: #4b1838;
  --lacquer-milk: #f1ece6;
  --lacquer-chrome: #c9c9d1;
  --lead: var(--lacquer-cherry);

  --step--1: clamp(0.88rem, 0.85rem + 0.15vw, 0.95rem);
  --step-0: clamp(1.06rem, 1rem + 0.25vw, 1.15rem);
  --step-2: clamp(2rem, 1.5rem + 2.4vw, 3.2rem);
  --step-4: clamp(3.1rem, 2rem + 6vw, 6.6rem);
  --gutter: 1rem;
  --radius: 14px;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Dark is re-picked, not inverted: plum-black with a brighter lacquer. */
    --bg: #140c12;
    --surface: #1f141c;
    --ink: #f4edf1;
    --muted: #c7b8c2;
    --line: #3a2a35;
    --accent: #ff7d98;        /* 8.6:1 on --bg */
    --accent-ink: #1a0910;
    --accent-press: #ff9fb3;
    --band: #f4edf1;
    --band-ink: #140c12;
    --focus: #8ab4ff;
    --ok: #7ee2a8;
    --bad: #ff9fb3;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 14px 36px -12px rgb(0 0 0 / 0.7);
    --lacquer-cherry: #c8183f;
    --lead: var(--lacquer-cherry);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 4.5rem; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 var(--step-0)/1.6 var(--font-sans);
  overflow-x: clip;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .swatches input:focus-visible + .chip {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
h1, h2 { font-family: var(--font-display); font-weight: 400; line-height: 1.02; letter-spacing: -0.01em; margin: 0 0 0.5em; }
h2 { font-size: var(--step-2); }
em { font-style: italic; }
p { margin: 0 0 1em; max-width: 62ch; }
.small { font-size: var(--step--1); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.skip { position: absolute; left: 1rem; top: -4rem; z-index: 50; background: var(--surface); padding: 0.6rem 1rem; border-radius: 8px; }
.skip:focus { top: 1rem; }

.demo-banner {
  margin: 0;
  max-width: none;
  background: var(--band);
  color: var(--band-ink);
  text-align: center;
  font-size: var(--step--1);
  font-weight: 600;
  padding: 0.55rem 1rem;
}

.wrap { width: min(100% - 2 * var(--gutter), 70rem); margin-inline: auto; }

/* --- Header ------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.7rem var(--gutter);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.wordmark {
  font-family: var(--font-display);
  font-size: 1.6rem; line-height: 1;
  text-decoration: none;
  margin: 0;
}
.wordmark em { color: var(--accent); }
.call-pill {
  display: inline-flex; align-items: center; min-height: 44px;
  padding: 0.45rem 1rem; border-radius: 999px;
  border: 2px solid var(--ink); font-weight: 700; text-decoration: none; white-space: nowrap;
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.12s ease;
}
.call-pill:hover { background: var(--ink); color: var(--bg); }
.call-pill:active { transform: scale(0.96); }

/* --- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0.8rem 1.4rem; border-radius: 999px;
  font: 700 1rem/1.2 var(--font-sans); text-decoration: none; cursor: pointer;
  border: 2px solid transparent;
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.12s ease, box-shadow 0.18s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 20px -10px var(--accent); }
.btn-primary:hover { background: var(--accent-press); box-shadow: 0 12px 24px -10px var(--accent); }
.btn-ghost { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-ghost:hover { background: var(--ink); color: var(--bg); }

/* --- Hero --------------------------------------------------------------- */
/* Phones: headline, then the fan, then the buttons, all inside the first screen.
   Wide screens: words on the left, the fan on the right. */
.hero {
  --fan-w: min(100%, 17rem);
  position: relative;
  display: grid;
  grid-template-areas: "title" "stage" "actions" "controls" "meta";
  padding: 1.1rem var(--gutter) 0;
  column-gap: 2rem;
}
.hero-title { grid-area: title; }
.stage { grid-area: stage; }
.hero-actions { grid-area: actions; }
.hero-controls { grid-area: controls; display: grid; justify-items: start; gap: 0.6rem; margin-bottom: 1.4rem; }
.hero-meta { grid-area: meta; }
.hero-title {
  font-size: clamp(2.7rem, 1.6rem + 5.2vw, 5.6rem);
  margin-bottom: 0.15em;
  /* Tier 1: extruded type, stacked hard shadows so the words sit raised like gel. */
  text-shadow: 0 1px 0 color-mix(in srgb, var(--ink) 18%, var(--bg)), 0 2px 0 color-mix(in srgb, var(--ink) 12%, var(--bg)), 0 3px 0 color-mix(in srgb, var(--ink) 7%, var(--bg));
}
.hero-title .line { display: block; }
.hero-title em { color: var(--accent); }
.hero-lede { font-size: 1.12rem; color: var(--muted); }
.rating { font-weight: 700; margin-bottom: 0.4rem; }
.stars { color: var(--accent); letter-spacing: 0.08em; margin-right: 0.3rem; }
.open-now { font-weight: 600; display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1.1rem; }
.open-now::before { content: ""; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--muted); flex: none; }
.open-now.is-open::before { background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 25%, transparent); }
.open-now.is-closed::before { background: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-bottom: 1.2rem; }

.motion-toggle {
  display: inline-flex; align-items: center; gap: 0.5rem;
  min-height: 44px; padding: 0.4rem 1rem; border-radius: 999px;
  border: 2px solid var(--line); background: var(--surface); color: var(--ink);
  font: 600 0.92rem/1 var(--font-sans); cursor: pointer;
  transition: border-color 0.18s ease, transform 0.12s ease;
}
.motion-toggle[hidden] { display: none; }
.motion-toggle:hover { border-color: var(--ink); }
.motion-toggle:active { transform: scale(0.96); }
.motion-icon { width: 10px; height: 12px; border-left: 3px solid currentColor; border-right: 3px solid currentColor; }
.is-paused .motion-icon { border: 0; border-left: 10px solid currentColor; border-top: 6px solid transparent; border-bottom: 6px solid transparent; height: 0; }

/* The stage: its own box under the buttons, so nothing that moves can land on them. */
.stage {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  margin: -0.4rem 0 0.6rem;
}
.fan { width: var(--fan-w); aspect-ratio: 340 / 245; height: auto; overflow: visible; }
.hero-3d {
  position: absolute; top: 0; left: 50%; translate: -50% 0;
  width: var(--fan-w); aspect-ratio: 340 / 245; height: auto;
  opacity: 0; transition: opacity 0.6s ease;
  pointer-events: none;
}
.is-3d .hero-3d { opacity: 1; }
.is-3d .fan { opacity: 0; transition: opacity 0.6s ease; }

.t-lead { fill: var(--lead); transition: fill 0.25s ease; }
.t-milk { fill: var(--lacquer-milk); stroke: #d8cfd6; stroke-width: 1.5; }
.t-nude { fill: var(--lacquer-nude); }
.t-plum { fill: var(--lacquer-plum); }
.t-chrome { fill: var(--lacquer-chrome); }
.tip use { filter: drop-shadow(0 6px 8px rgb(29 18 32 / 0.22)); }
.hl { fill: none; stroke: #fff; stroke-width: 7; stroke-linecap: round; opacity: 0.5; }
.stem { stroke: var(--lacquer-chrome); stroke-width: 4; stroke-linecap: round; }
.rivet { fill: var(--lacquer-chrome); stroke: color-mix(in srgb, var(--ink) 40%, transparent); stroke-width: 2; }
.tip { transform-box: view-box; transform-origin: 200px 320px; transform: rotate(var(--a)); }
/* Motion only once script.js says so: the fan is already open in the HTML/CSS.
   Only the whole SVG moves (transform and opacity), so the browser never
   repaints the drawing. It stops once the 3D fan has taken over. */
@media (prefers-reduced-motion: no-preference) {
  .motion-on .fan {
    transform-origin: 50% 92%;
    will-change: transform;
    animation: fan-arrive 1s cubic-bezier(0.2, 0.9, 0.25, 1.15) 0.1s both, sway 7s ease-in-out 1.1s infinite;
  }
  .motion-on.is-paused .fan, .motion-on.is-offscreen .fan { animation-play-state: paused; }
  .motion-on.is-3d .fan { animation: none; will-change: auto; }
}
@keyframes fan-arrive {
  from { opacity: 0.25; transform: translateY(18%) scale(0.72) rotate(-14deg); }
  to { opacity: 1; transform: none; }
}
@keyframes sway { 0%, 100% { transform: rotate(-2.5deg); } 50% { transform: rotate(2.5deg); } }

.swatches {
  display: flex; flex-wrap: wrap; gap: 0.2rem 0.9rem;
  border: 0; margin: 0; padding: 0;
}
.swatches[hidden] { display: none; }
.swatches legend { width: 100%; font-weight: 600; font-size: var(--step--1); color: var(--muted); margin-bottom: 0.4rem; padding: 0; float: left; }
.swatches label { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 44px; cursor: pointer; font-size: var(--step--1); font-weight: 600; }
.swatches input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip {
  width: 28px; height: 28px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: radial-gradient(circle at 35% 30%, rgb(255 255 255 / 0.7), transparent 40%), var(--c);
  border: 2px solid var(--line);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.swatches label:hover .chip { transform: translateY(-2px); }
.swatches input:checked + .chip { border-color: var(--ink); transform: scale(1.12); }

/* --- Sections ----------------------------------------------------------- */
.section { padding: 3.5rem 0; }
/* Below-the-fold sections skip layout and paint until they're near the screen. */
.section { content-visibility: auto; contain-intrinsic-size: auto 900px; }
.two-col { display: grid; gap: 1.6rem; }
.example-note {
  display: inline-block; font-size: var(--step--1); font-weight: 600;
  padding: 0.35rem 0.7rem; border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface)); color: var(--ink);
}

/* Treatments: a salon price card with depth (Tier 1). */
.price-card {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1rem 1.1rem 0.8rem; border: 1px solid var(--line);
}
.card-3d { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform 0.25s ease; }
.price-list { list-style: none; margin: 0; padding: 0; }
.price-list a {
  display: flex; align-items: baseline; gap: 0.5rem;
  padding: 0.75rem 0.2rem; min-height: 48px; text-decoration: none;
  border-bottom: 1px solid var(--line);
  transition: color 0.15s ease, padding 0.2s ease;
}
.price-list li:last-child a { border-bottom: 0; }
.price-list a:hover { color: var(--accent); padding-left: 0.5rem; }
.p-name { font-family: var(--font-display); font-size: 1.45rem; line-height: 1.1; }
.p-dots { flex: 1; border-bottom: 2px dotted var(--line); transform: translateY(-0.3em); min-width: 1rem; }
.p-price { font-weight: 700; white-space: nowrap; }
.price-foot { font-size: var(--step--1); color: var(--muted); margin: 0.6rem 0 0; }

/* Gallery: almond-arch frames, one per photo, in the fan's lacquer colours. */
.arches {
  list-style: none; margin: 0 0 1rem; padding: 0;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.5rem;
}
.arch {
  aspect-ratio: 3 / 5;
  border-radius: 999px 999px 14px 14px;
  display: grid; place-items: end center; padding-bottom: 0.7rem;
  background:
    linear-gradient(100deg, transparent 30%, rgb(255 255 255 / 0.45) 42%, transparent 52%),
    var(--c);
  box-shadow: var(--shadow);
}
.arch span {
  font-size: 0.72rem; font-weight: 700; padding: 0.2rem 0.45rem; border-radius: 6px;
  background: var(--surface); color: var(--ink); white-space: nowrap;
}
/* Reviews */
.count { font-variant-numeric: tabular-nums; }
.reviews h2 em { color: var(--accent); }
.quotes { display: grid; gap: 1rem; margin-top: 1.6rem; }
.quote {
  margin: 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.3rem 1.3rem 1.1rem;
}
.quote blockquote { margin: 0 0 0.8rem; }
.quote blockquote p { font-family: var(--font-display); font-size: 1.4rem; line-height: 1.25; margin: 0; }
.quote figcaption { font-weight: 700; color: var(--muted); font-size: var(--step--1); }

/* Hours */
.open-now-lg { font-size: 1.1rem; }
.hours { border-collapse: collapse; width: 100%; max-width: 26rem; }
.hours th, .hours td { text-align: left; padding: 0.55rem 0.2rem; border-bottom: 1px solid var(--line); }
.hours th { font-weight: 600; }
.hours .is-today th, .hours .is-today td { color: var(--accent); font-weight: 700; }
address { font-style: normal; font-size: 1.15rem; margin-bottom: 1rem; }

/* Form */
.book-form {
  display: grid; gap: 1rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.3rem;
}
.field { display: grid; gap: 0.35rem; border: 0; margin: 0; padding: 0; }
.field > label, .field legend { font-weight: 700; padding: 0; }
.optional { font-weight: 400; color: var(--muted); }
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--bg);
  border: 2px solid var(--line); border-radius: 10px; padding: 0.7rem 0.8rem; min-height: 48px; width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--ink) 45%, var(--line)); }
.field.is-valid input { border-color: var(--ok); }
.field.is-invalid input { border-color: var(--bad); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 18%, transparent); }
.field-msg { margin: 0; min-height: 0; font-size: var(--step--1); font-weight: 600; color: var(--bad); }
.field-msg:empty { display: none; }
.when { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; }
.when legend { width: 100%; margin-bottom: 0.35rem; float: left; }
.when label { display: inline-flex; align-items: center; gap: 0.45rem; min-height: 44px; cursor: pointer; }
.when input { width: 1.2rem; height: 1.2rem; min-height: 0; accent-color: var(--accent); }
.form-done { border-radius: 10px; padding: 1rem; background: color-mix(in srgb, var(--ok) 14%, var(--surface)); }
.form-done p { margin: 0 0 0.4rem; }

/* Footer and call bar */
.site-footer { background: var(--band); color: var(--band-ink); padding: 2.5rem 0 6rem; }
.site-footer .wordmark { font-size: 2rem; margin-bottom: 0.8rem; }
.site-footer .wordmark em { color: inherit; }
.site-footer a { color: inherit; }
.call-bar {
  position: fixed; left: var(--gutter); right: var(--gutter); bottom: 0.8rem; z-index: 30;
  display: flex; align-items: center; justify-content: center; min-height: 54px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; text-decoration: none;
  box-shadow: 0 10px 26px -8px rgb(0 0 0 / 0.45);
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.call-bar.is-tucked { transform: translateY(150%); opacity: 0; }

/* --- Scroll scenes: hidden states only exist once script.js has run ------- */
@media (prefers-reduced-motion: no-preference) {
  .scenes-on [data-scene="steps"] li { opacity: 0; transform: translateX(-14px); transition: opacity 0.45s ease, transform 0.45s ease; transition-delay: calc(var(--i, 0) * 70ms); }
  .scenes-on [data-scene="steps"].is-in li { opacity: 1; transform: none; }
  /* The frames open out from the middle, like the fan. */
  .scenes-on [data-scene="open"] .arch { opacity: 0; transform: translateX(calc(var(--off) * 100%)) scale(0.9); transition: opacity 0.5s ease, transform 0.8s cubic-bezier(0.2, 0.9, 0.25, 1.1); }
  .scenes-on [data-scene="open"] .arch:nth-child(1) { --off: 2; }
  .scenes-on [data-scene="open"] .arch:nth-child(2) { --off: 1; }
  .scenes-on [data-scene="open"] .arch:nth-child(3) { --off: 0; opacity: 1; }
  .scenes-on [data-scene="open"] .arch:nth-child(4) { --off: -1; }
  .scenes-on [data-scene="open"] .arch:nth-child(5) { --off: -2; }
  .scenes-on [data-scene="open"].is-in .arch { opacity: 1; transform: none; }
  .scenes-on [data-scene="lift"] .quote { opacity: 0; transform: perspective(900px) rotateX(14deg) translateY(30px); transition: opacity 0.6s ease, transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1); }
  .scenes-on [data-scene="lift"] .quote:nth-child(2) { transition-delay: 0.12s; }
  .scenes-on [data-scene="lift"] .quote:nth-child(3) { transition-delay: 0.24s; }
  .scenes-on [data-scene="lift"].is-in .quote { opacity: 1; transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); }
}

/* --- Wider screens -------------------------------------------------------- */
@media (min-width: 48rem) {
  :root { --gutter: 2rem; }
  .hero {
    --fan-w: min(100%, 28rem);
    grid-template-columns: 1.15fr 0.85fr;
    grid-template-areas: "title stage" "actions stage" "meta stage" ". controls";
    grid-template-rows: auto auto 1fr auto;
    align-items: start; padding-top: 3rem; padding-bottom: 2rem; width: min(100%, 76rem); margin-inline: auto;
  }
  .stage { align-self: center; margin: 0; }
  .hero-controls { justify-items: center; }
  .swatches { justify-content: center; }
  .swatches[hidden] { display: none; }
.swatches legend { text-align: center; }
  .two-col { grid-template-columns: 0.9fr 1.1fr; align-items: start; gap: 3rem; }
  .quotes { grid-template-columns: repeat(3, 1fr); }
  .quote:nth-child(2) { margin-top: 2.5rem; }
  .arches { gap: 1.2rem; width: min(100%, 52rem); margin-inline: auto; }
  .gallery .example-note { display: table; margin-inline: auto; }
  .arch span { font-size: 0.85rem; }
  .call-bar { display: none; }
  .site-footer { padding-bottom: 2.5rem; }
}

@media print {
  .demo-banner, .call-bar, .motion-toggle, .hero-3d, .stage, .book-form { display: none; }
}
