/* ==========================================================================
   Halomaxx — styles. Editorial beauty salon meets modern app.
   ========================================================================== */

:root {
  --bg: #F6F2EC;
  --bg-2: #EFE9DF;
  --bg-elev: #FFFDF9;
  --ink: #161412;
  --ink-2: #5E5850;
  --ink-3: #6F6961;
  --line: rgba(22, 20, 18, .10);
  --line-strong: rgba(22, 20, 18, .18);
  --halo: #E8C27A;
  --halo-deep: #A8761A;
  --halo-soft: rgba(232, 194, 122, .35);
  --halo-glow: rgba(232, 194, 122, .6);
  --error: #B3261E;
  --radius: 18px;
  --radius-sm: 14px;
  --shadow: 0 1px 2px rgba(22, 20, 18, .04), 0 14px 36px -14px rgba(22, 20, 18, .14);
  --font-head: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
  --font-body: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --container: 1120px;
  --gutter: 20px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 400; letter-spacing: 0; line-height: 1.05; margin: 0; }
p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 6px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 10px; text-decoration: none;
}
.skip-link:focus { top: 12px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.container--narrow { max-width: 720px; }

.section { padding: 64px 0; }
.section--tint { background: var(--bg-2); }
.section__head { text-align: center; margin-bottom: 36px; }
.section__head .section__lead { margin-inline: auto; }
.eyebrow {
  font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 600; margin-bottom: 12px;
}
.section__title { font-size: clamp(35px, 5.3vw, 50px); }
.section__lead { color: var(--ink-2); font-size: 17px; margin-top: 12px; max-width: 52ch; }

@media (min-width: 900px) {
  .section { padding: 104px 0; }
  .section__head { margin-bottom: 48px; }
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(246, 242, 236, .82);
  -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.wordmark {
  font-family: var(--font-head); font-weight: 400; font-size: 26px; letter-spacing: 0;
  text-decoration: none; display: inline-flex; align-items: center; gap: 9px;
}
.wordmark__halo {
  width: 14px; height: 14px; border-radius: 50%;
  border: 3px solid var(--halo); box-shadow: 0 0 12px var(--halo-glow);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 24px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: 16px; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: box-shadow .25s ease, transform .25s ease, background .2s ease, border-color .2s ease;
}
.btn--primary { background: var(--ink); color: var(--bg); }
.btn--primary:hover { box-shadow: 0 0 0 4px var(--halo-soft), 0 14px 30px -8px var(--halo-glow); transform: translateY(-1px); }
.btn--primary:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px var(--halo), 0 14px 30px -8px var(--halo-glow); }
.btn--primary:disabled { opacity: .65; cursor: progress; transform: none; box-shadow: none; }
.btn--ghost { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn--ghost:hover { border-color: var(--ink); box-shadow: 0 0 0 4px var(--halo-soft); }
.btn--lg { min-height: 56px; padding: 0 32px; font-size: 17px; }
.btn--sm { min-height: 40px; padding: 0 16px; font-size: 14px; }
.btn--block { width: 100%; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: 72px 0 56px; text-align: center; }
.hero::before {
  content: ""; position: absolute; left: 50%; top: -20%;
  width: min(130vw, 960px); aspect-ratio: 1; transform: translateX(-50%);
  background: radial-gradient(circle at center, rgba(232, 194, 122, .62) 0%, rgba(232, 194, 122, .26) 34%, rgba(246, 242, 236, 0) 64%);
  filter: blur(18px); pointer-events: none;
}
.hero__inner { position: relative; max-width: 780px; }
.hero__title {
  font-size: clamp(47px, 9.9vw, 90px); line-height: 1.05; letter-spacing: -.01em;
  text-wrap: pretty; /* keeps 'a thing.' together instead of stranding one word */
}
.hero__accent { font-family: var(--font-head); font-style: italic; }
.hero__sub { font-size: clamp(17px, 2.4vw, 21px); color: var(--ink-2); margin: 20px auto 32px; max-width: 42ch; }
.hero__note { margin-top: 16px; font-size: 14px; color: var(--ink-3); }
@media (min-width: 900px) { .hero { padding: 116px 0 96px; } }

/* ---------- Before / After ---------- */
.demo__inner { display: grid; gap: 32px; align-items: center; }
@media (min-width: 900px) { .demo__inner { grid-template-columns: 1fr 1fr; gap: 64px; } }

.segmented {
  display: inline-flex; padding: 4px; border-radius: 999px; margin-top: 24px;
  background: var(--bg-2); border: 1px solid var(--line);
}
.segmented__btn {
  min-height: 48px; min-width: 96px; padding: 0 22px; border: 0; border-radius: 999px;
  background: transparent; font-weight: 600; cursor: pointer; color: var(--ink-2);
  transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}
.segmented__btn[aria-pressed="true"] { background: var(--ink); color: var(--bg); box-shadow: 0 4px 14px -6px rgba(22, 20, 18, .45); }
.segmented__btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--halo); }

.compare {
  position: relative; margin: 0; width: 100%; max-width: 480px; justify-self: center;
  aspect-ratio: 4 / 5; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); background: var(--bg-2);
  touch-action: none; user-select: none; -webkit-user-select: none; cursor: ew-resize;
  container-type: inline-size; /* so the alignment nudge below can use cqw units */
}
.compare__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
/* Pair alignment. Offsets are a percentage of the image's width (1cqw = 1% of the
   frame width, which equals the image's rendered width), so they hold at every
   viewport size. --zoom applies to both layers, so it never introduces a size
   mismatch, and gives the nudge room without exposing the frame behind. */
.compare__img {
  transform-origin: 50% 50%;
  transform: scale(var(--zoom, 1));
  transition-property: none; /* the alignment must snap, never animate, when the pair changes */
}
.compare__img--after {
  transform: translate(calc(var(--ax, 0) * 1cqw), calc(var(--ay, 0) * 1cqw)) scale(var(--zoom, 1));
}
.compare__before { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.compare__line {
  position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px;
  background: #fff; transform: translateX(-50%); box-shadow: 0 0 0 1px rgba(22, 20, 18, .12);
}
.compare__handle {
  position: absolute; top: 50%; left: var(--pos); width: 48px; height: 48px; margin: -24px 0 0 -24px;
  border-radius: 50%; background: #fff; color: var(--ink); display: grid; place-items: center;
  box-shadow: 0 4px 16px rgba(22, 20, 18, .28), 0 0 0 1px rgba(22, 20, 18, .08); cursor: ew-resize;
  transition: box-shadow .2s ease;
}
.compare__handle:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--halo), 0 4px 16px rgba(22, 20, 18, .28); }
.compare.is-dragging .compare__handle { box-shadow: 0 0 0 8px var(--halo-soft), 0 4px 16px rgba(22, 20, 18, .28); }
.compare__label {
  position: absolute; top: 14px; padding: 6px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  background: rgba(22, 20, 18, .62); color: #fff; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.compare__label--before { left: 14px; }
.compare__label--after { right: 14px; }

/* ---------- Steps ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
@media (min-width: 720px) { .steps { grid-template-columns: repeat(3, 1fr); gap: 24px; } }
.step {
  position: relative; background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px 24px; box-shadow: var(--shadow);
}
.step__icon {
  width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center;
  background: var(--halo-soft); color: var(--ink); margin-bottom: 20px;
}
.step__icon svg { width: 26px; height: 26px; }
.step__num { position: absolute; top: 24px; right: 24px; font-family: var(--font-head); font-size: 23px; color: var(--ink-3); }
.step h3 { font-size: 26px; margin-bottom: 8px; }
.step p { color: var(--ink-2); }

/* ---------- Cards ---------- */
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
@media (min-width: 560px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .cards { grid-template-columns: repeat(4, 1fr); gap: 20px; } }
.card {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px;
}
.card h3 { font-size: 28px; }
.card p { color: var(--ink-2); font-size: 15px; }
.tag {
  align-self: flex-start; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  padding: 6px 10px; border-radius: 999px; background: var(--halo-soft); color: var(--ink); margin-bottom: 6px;
}
.tag--home { background: var(--bg-2); border: 1px solid var(--line); }

/* ---------- Form ---------- */
.panel {
  position: relative; background: var(--bg-elev); border: 1px solid var(--line); border-radius: 24px;
  padding: 32px 20px; box-shadow: var(--shadow); max-width: 600px; margin: 0 auto;
}
@media (min-width: 600px) { .panel { padding: 48px; } }
.panel__head { margin-bottom: 28px; }
.field { margin: 0 0 20px; padding: 0; border: 0; min-width: 0; }
.label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 8px; }
.req { color: var(--halo-deep); }
input[type="text"], input[type="email"] {
  width: 100%; min-height: 52px; padding: 0 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: #fff; font: inherit; color: var(--ink);
  transition: border-color .2s ease, box-shadow .2s ease;
}
input[type="text"]:focus, input[type="email"]:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px var(--halo-soft); }
input[aria-invalid="true"] { border-color: var(--error); }
.field__error { color: var(--error); font-size: 14px; margin-top: 8px; }
.form-error { margin: 0 0 16px; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.chip span {
  display: inline-flex; align-items: center; min-height: 48px; padding: 0 20px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: #fff; font-weight: 400; cursor: pointer;
  user-select: none; -webkit-user-select: none;
  transition: background .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.chip span:hover { border-color: var(--ink); }
.chip input:checked + span { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip input:focus-visible + span { box-shadow: 0 0 0 4px var(--halo-soft); border-color: var(--ink); }

.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; font-size: 15px; color: var(--ink-2); }
.check input { width: 22px; height: 22px; flex: none; margin: 1px 0 0; accent-color: var(--ink); cursor: pointer; }
.check a { color: var(--ink); }

.hp { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }

.form__fine { margin-top: 14px; text-align: center; font-size: 13px; color: var(--ink-3); }

.result { text-align: center; padding: 12px 0; }
.result h2:focus { outline: none; }
.result .section__lead { margin-inline: auto; }
.result__halo {
  width: 72px; height: 72px; margin: 0 auto 24px; border-radius: 50%;
  border: 6px solid var(--halo); box-shadow: 0 0 36px var(--halo-glow), inset 0 0 12px var(--halo-soft);
}
.result__actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 24px; }
.result > .btn { margin-top: 24px; }

/* ---------- FAQ ---------- */
.faq { display: flex; flex-direction: column; border-top: 1px solid var(--line); margin-top: 28px; }
.faq__item { border-bottom: 1px solid var(--line); }
.faq__item summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 20px 0; font-family: var(--font-head); font-size: 24px; font-weight: 400;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__icon { flex: none; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line-strong); position: relative; transition: transform .25s ease, background .2s ease; }
.faq__icon::before, .faq__icon::after { content: ""; position: absolute; background: var(--ink); left: 50%; top: 50%; transform: translate(-50%, -50%); }
.faq__icon::before { width: 12px; height: 1.5px; }
.faq__icon::after { width: 1.5px; height: 12px; }
.faq__item[open] .faq__icon { transform: rotate(45deg); background: var(--halo-soft); }
.faq__item p { padding: 0 46px 20px 0; color: var(--ink-2); }

/* ---------- Prose (privacy) ---------- */
.prose h1 { font-size: clamp(42px, 7.1vw, 66px); letter-spacing: -.01em; }
.prose h2 { font-size: 28px; margin: 36px 0 10px; }
.prose p, .prose li { color: var(--ink-2); }
.prose p + p { margin-top: 12px; }
.prose ul { padding-left: 20px; margin: 8px 0 0; }
.prose li + li { margin-top: 6px; }
.prose a { color: var(--ink); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 32px 0; }
.site-footer__inner { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; font-size: 14px; color: var(--ink-2); }
.site-footer nav { display: flex; gap: 20px; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 16px); z-index: 50;
  background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 999px;
  font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none;
  box-shadow: 0 8px 24px -8px rgba(22, 20, 18, .5); transition: opacity .25s ease, transform .25s ease;
  max-width: calc(100vw - 32px);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Scroll reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }
.steps .reveal:nth-child(2), .cards .reveal:nth-child(2) { transition-delay: .08s; }
.steps .reveal:nth-child(3), .cards .reveal:nth-child(3) { transition-delay: .16s; }
.cards .reveal:nth-child(4) { transition-delay: .24s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; }
}
