/*
 * Face Rate. One stylesheet: tokens, the public tool pages, and the
 * signed-in result pages.
 */

:root {
  color-scheme: light dark;

  --bg: light-dark(#faf6f3, #0f0c14);
  --surface: light-dark(#ffffff, #1a1522);
  --surface-2: light-dark(#f3ece8, #251e30);
  --border: light-dark(#ece3de, #2f2739);
  --text: light-dark(#1f1630, #f2ecf6);
  --muted: light-dark(#6e6680, #a99fb8);
  --brand: light-dark(#d6336c, #ff7aa8);
  --brand-2: light-dark(#7c3aed, #b794ff);
  --brand-soft: color-mix(in oklab, var(--brand) 10%, var(--surface));
  --brand-text: #ffffff;
  --gradient: linear-gradient(120deg, var(--brand), color-mix(in oklab, var(--brand) 55%, var(--brand-2)));
  --danger: light-dark(#b42318, #ff8a80);
  --radius: 20px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgb(31 22 48 / .05), 0 2px 8px rgb(31 22 48 / .04);
  --shadow: 0 1px 2px rgb(31 22 48 / .05), 0 12px 32px -8px rgb(31 22 48 / .12);
  --shadow-brand: 0 8px 24px -8px color-mix(in oklab, var(--brand) 60%, transparent);
  --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Fraunces", ui-serif, Georgia, serif;

  accent-color: var(--brand);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); }
h1, h2, h3 { line-height: 1.2; text-wrap: balance; }
img { max-width: 100%; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

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

/* --- buttons, badges, flash ------------------------------------------------ */

.button, .button_to button {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .6rem 1.1rem; border: 1px solid transparent; border-radius: 999px;
  background: var(--brand); color: var(--brand-text);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.button:hover { filter: brightness(1.08); }
.button:disabled { opacity: .6; cursor: progress; }
.button--danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.confirm { display: flex; gap: .6rem; align-items: flex-start; margin: 1.25rem 0 0; }
.confirm input { margin-top: .2rem; }
.button--ghost, .button_to .button--ghost { background: transparent; color: var(--text); border-color: var(--border); }
.button--small { padding: .35rem .85rem; font-size: .9rem; }
.button--large { padding: .85rem 1.6rem; font-size: 1.05rem; }
.button_to { display: inline; }

.badge {
  padding: .15rem .6rem; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand);
  font-size: .8rem; font-weight: 600;
}

.flash {
  max-width: 44rem; margin: 1rem auto 0; padding: .75rem 1rem;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
}
.flash--alert { border-color: color-mix(in oklab, var(--danger) 40%, var(--border)); color: var(--danger); }
main .flash { margin: 1rem 0; }

/* --- top bar, footer ---------------------------------------------------- */

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .75rem clamp(1rem, 4vw, 2rem);
  border-bottom: 1px solid var(--border); background: var(--surface);
}
.topbar__brand { display: flex; align-items: center; gap: .5rem; color: var(--text); font-weight: 700; text-decoration: none; }
.topbar__logo { color: var(--brand); font-size: 1.3rem; }
.topbar__nav { display: flex; align-items: center; gap: .75rem; }
.topbar__link { color: var(--text); text-decoration: none; font-weight: 500; }
.topbar__link:hover { color: var(--brand); }

/* "Tools": a link to /tools whose panel lists every tool on hover or focus.
   The panel's top padding bridges the gap so moving down to it keeps it open. */
.tools-menu { position: relative; }
.tools-menu__caret { color: var(--muted); font-size: .8em; }
.tools-menu__panel {
  position: absolute; left: 50%; top: 100%; z-index: 20; translate: -50% 0;
  padding-top: .6rem; visibility: hidden; opacity: 0; transition: opacity .12s, visibility .12s;
}
.tools-menu:hover .tools-menu__panel,
.tools-menu:focus-within .tools-menu__panel { visibility: visible; opacity: 1; }
/* The panel spans the top bar (not the trigger), grouped by category; it
   lingers a moment on leaving so the gap below the trigger can be crossed. */
.topbar { position: relative; z-index: 20; }
.tools-menu { position: static; }
.tools-menu__panel {
  top: 100%; width: min(68rem, calc(100vw - 1.5rem)); padding-top: 0;
  transition: opacity .12s, visibility 0s linear .25s;
}
.tools-menu:hover .tools-menu__panel,
.tools-menu:focus-within .tools-menu__panel { transition-delay: 0s; }
.tools-menu__groups {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(10.25rem, 1fr)); gap: .25rem .75rem;
  max-height: min(70vh, 40rem); overflow-y: auto; padding: .75rem;
  border: 1px solid var(--border); border-radius: 12px 12px 0 0; border-bottom: 0;
  background: var(--surface); box-shadow: var(--shadow);
}
.tools-menu__heading { margin: .3rem .6rem .2rem; color: var(--muted); font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.tools-menu__panel ul { margin: 0; padding: 0; list-style: none; }
.tools-menu__item {
  display: flex; align-items: center; gap: .5rem; padding: .3rem .45rem; border-radius: 8px; font-size: .9rem; line-height: 1.25;
  color: var(--text); text-decoration: none;
}
.tools-menu__item:hover, .tools-menu__item:focus-visible { background: var(--surface-2); color: var(--brand); }
.tools-menu__item[aria-current="page"] { color: var(--brand); font-weight: 600; }
.tools-menu__all {
  display: block; padding: .55rem 1rem; border: 1px solid var(--border); border-top-color: var(--surface-2);
  border-radius: 0 0 12px 12px; background: var(--surface); box-shadow: var(--shadow);
  color: var(--brand); font-size: .9rem; font-weight: 600; text-decoration: none;
}

.menu { position: relative; }
.menu__trigger { cursor: pointer; list-style: none; font-weight: 500; }
.menu__trigger::-webkit-details-marker { display: none; }
.menu__trigger::after { content: " ▾"; color: var(--muted); }
.menu__panel {
  position: absolute; right: 0; top: calc(100% + .5rem); z-index: 10; min-width: 14rem;
  padding: .5rem; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); box-shadow: var(--shadow);
}
.menu__email { margin: .25rem .5rem .5rem; color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.menu__item, .menu .button_to button {
  display: block; width: 100%; padding: .45rem .5rem; border: 0; border-radius: 8px;
  background: none; color: var(--text); font: inherit; text-align: left; text-decoration: none; cursor: pointer;
}
.menu__item:hover, .menu .button_to button:hover { background: var(--surface-2); }

.footer {
  margin-top: auto; padding: 2rem clamp(1rem, 4vw, 2rem);
  border-top: 1px solid var(--border); font-size: .9rem; text-align: center;
}
.footer__tools {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: 1.5rem 1rem;
  max-width: 68rem; margin: 0 auto 1.5rem; text-align: left;
}
.footer__heading { margin: 0 0 .5rem; color: var(--text); font-weight: 700; }
.footer__group ul { display: grid; gap: .35rem; margin: 0; padding: 0; list-style: none; }
.footer__links { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 1.25rem; margin-bottom: .5rem; }
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--brand); }

/* --- pages -------------------------------------------------------------- */

.page { width: 100%; max-width: 64rem; margin: 0 auto; padding: 1.5rem clamp(1rem, 4vw, 2rem) 3rem; }
.page--narrow { max-width: 44rem; }
.page__title { font-size: clamp(1.6rem, 4vw, 2.1rem); margin: .5rem 0 1rem; }
/* /privacy and /terms (LegalPages): Markdown from the platform's admin. */
.legal__body { line-height: 1.65; }
.legal__body h2 { font-size: 1.25rem; margin: 2rem 0 .5rem; }
.legal__body h3 { font-size: 1.05rem; margin: 1.5rem 0 .4rem; }
.legal__body ul, .legal__body ol { padding-left: 1.25rem; }
.legal__body li + li { margin-top: .35rem; }
.legal__body table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; }
.legal__body th, .legal__body td { border: 1px solid var(--border); padding: .4rem .6rem; text-align: left; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin: 1.5rem 0; }

.crumbs { margin: 0; font-size: .9rem; }
.crumbs a { color: var(--muted); text-decoration: none; }

.hero { max-width: 46rem; margin: 2rem auto 2rem; text-align: center; }
.hero h1 { font-size: clamp(2rem, 5.5vw, 3rem); margin: 0 0 1rem; letter-spacing: -.02em; }
.hero__intro { margin: 0; color: var(--muted); font-size: clamp(1.05rem, 2.2vw, 1.2rem); }
.hero--tool { margin-top: 1.25rem; }

/* home: tool cards */
.tool-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1rem;
  margin: 0; padding: 0; list-style: none;
}
.tool-card {
  display: flex; flex-direction: column; gap: .4rem; height: 100%; padding: 1.4rem;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  color: inherit; text-decoration: none; transition: border-color .15s, transform .15s;
}
.tool-card:hover { border-color: var(--brand); transform: translateY(-2px); }
.tool-card__icon {
  display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 12px;
  background: var(--brand-soft); color: var(--brand); font-size: 1.3rem;
}
.tool-card__name { margin: .4rem 0 0; font-size: 1.2rem; }
.tool-card__text { margin: 0; color: var(--muted); font-size: .95rem; }
.tool-card__cta { margin-top: auto; padding-top: .5rem; color: var(--brand); font-weight: 600; }

/* tool page */
.tool-page { max-width: 46rem; margin: 0 auto; }
.section { margin-top: 3rem; }
.section h2 { font-size: 1.4rem; margin: 0 0 1rem; }
.features { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .6rem; margin: 0; padding: 0; list-style: none; }
.features li { padding: .8rem 1rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.features li::before { content: "✓ "; color: var(--brand); font-weight: 700; }
.steps { padding-left: 1.25rem; }
.steps li { margin-bottom: .5rem; }
.faq { border-bottom: 1px solid var(--border); padding: .85rem 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { margin: .5rem 0 0; color: var(--muted); }
.tool-links { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; padding: 0; list-style: none; }
.tool-links a {
  display: inline-block; padding: .4rem .9rem; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text); text-decoration: none;
}
.tool-links a:hover { border-color: var(--brand); color: var(--brand); }

/* upload */
.upload { display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.upload__drop {
  display: grid; place-items: center; width: 100%; min-height: 16rem; padding: 1.5rem;
  border: 2px dashed var(--border); border-radius: var(--radius); background: var(--surface);
  text-align: center; cursor: pointer; transition: border-color .15s, background .15s;
}
.upload__drop:hover, .upload__drop.is-over, .upload__drop:focus-within { border-color: var(--brand); background: var(--brand-soft); }
.upload__prompt { display: flex; flex-direction: column; align-items: center; gap: .3rem; }
.upload__prompt[hidden] { display: none; }
.upload__icon { font-size: 2rem; color: var(--brand); }
.upload__preview { max-height: 22rem; border-radius: 12px; object-fit: contain; }
.upload__note { margin: 0; font-size: .9rem; }
/* "This photo is of me, and I'm 18 or older": required before any analysis. */
.upload__confirm { display: flex; align-items: flex-start; gap: .5rem; max-width: 30rem; font-size: .95rem; text-align: left; cursor: pointer; }
.upload__confirm input { width: 1.1rem; height: 1.1rem; margin-top: .2rem; flex: none; }

/* results */
.run-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: 1rem;
  margin: 0; padding: 0; list-style: none;
}
.run-card {
  display: flex; flex-direction: column; overflow: hidden; height: 100%;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  color: inherit; text-decoration: none;
}
.run-card:hover { border-color: var(--brand); }
.run-card__photo { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--surface-2); }
.run-card__meta { display: flex; flex-direction: column; padding: .6rem .75rem; font-size: .9rem; }

.result__photos { display: grid; gap: 1rem; margin-bottom: 1.5rem; }
.result__photos--pair { grid-template-columns: 1fr 1fr; }
.result__photos figure { margin: 0; }
.result__photos figcaption { margin-top: .4rem; color: var(--muted); font-size: .9rem; text-align: center; }
.result__photo {
  display: block; width: 100%; max-height: 28rem; object-fit: contain;
  border-radius: var(--radius); background: var(--surface-2);
}
.result__photos:not(.result__photos--pair) .result__photo { max-height: 22rem; }
.result__placeholder { display: grid; place-items: center; aspect-ratio: 3 / 4; }
.result__status { display: flex; align-items: center; gap: .6rem; color: var(--muted); }

.analysis { display: grid; gap: .75rem; margin: 0; }
.analysis__item { padding: 1rem 1.1rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.analysis__item dt { color: var(--muted); font-size: .85rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.analysis__item dd { margin: .3rem 0 0; }
.analysis__item dd ul { margin: 0; padding-left: 1.2rem; }
.score strong { font-size: 1.8rem; }
.meter { display: block; height: 6px; margin-top: .4rem; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: inherit; background: var(--brand); }

.spinner {
  width: 1.4rem; height: 1.4rem; border: 3px solid var(--border); border-top-color: var(--brand);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.locked { text-align: center; }
.locked__photo { width: 10rem; height: 10rem; object-fit: cover; border-radius: 50%; filter: blur(2px); }
.locked .actions { justify-content: center; }
.locked .offers { margin: 1.5rem 0; text-align: left; }

/* face report (runs/reports/_face) */
.report { max-width: 60rem; }
.report-nav {
  position: sticky; top: 0; z-index: 2; display: flex; gap: .4rem; overflow-x: auto;
  margin: 0 0 1.25rem; padding: .5rem 0; background: var(--bg); scrollbar-width: none;
}
.report-nav a {
  flex: none; padding: .3rem .8rem; border: 1px solid var(--border); border-radius: 999px;
  color: var(--text); font-size: .9rem; text-decoration: none; background: var(--surface);
}
.report-nav a:hover { border-color: var(--brand); color: var(--brand); }

.report-hero { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 1.5rem; align-items: center; }
.report-hero__media { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: .75rem; }
.report-photo { margin: 0; }
.report-photo__frame { position: relative; }
.report-photo__image {
  display: block; width: 100%; height: auto; border-radius: var(--radius); background: var(--surface-2);
}
.report-photo__overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.report-photo:has(.report-photo__toggle input:not(:checked)) .report-photo__overlay { display: none; }
.report-photo__toggle { display: inline-flex; align-items: center; gap: .4rem; margin-top: .5rem; color: var(--muted); font-size: .9rem; }
.overlay-line { stroke: var(--brand); stroke-width: 1.5; stroke-opacity: .85; }
.overlay-line--fifths { stroke-dasharray: 4 4; }
.overlay-line--thirds { stroke: light-dark(#0e7490, #67e8f9); }
.overlay-point { fill: #ffffff; stroke: var(--brand); stroke-width: 1; }
.report-concept figcaption { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .5rem; color: var(--muted); font-size: .9rem; }
.report-concept__original { position: absolute; inset: 0; height: 100%; object-fit: cover; }
.report-concept button { touch-action: none; user-select: none; -webkit-user-select: none; }

.report-score { display: flex; align-items: baseline; gap: .2rem; margin: 0; }
.report-score strong { font-size: clamp(3.5rem, 10vw, 5rem); line-height: 1; letter-spacing: -.03em; }
.report-score span { color: var(--muted); font-size: 1.4rem; }
.report-score__word { margin: .2rem 0 .5rem; color: var(--brand); font-size: 1.4rem; font-weight: 700; }
.report-score__rank { margin: 0 0 .5rem; font-weight: 600; }

.report-section { margin-top: 2.5rem; scroll-margin-top: 3.5rem; }
.report-section__title { margin: 0 0 1rem; font-size: 1.4rem; }
.report-section h3 { margin: 1.5rem 0 .6rem; font-size: 1.05rem; }
.report-list { margin: 0; padding-left: 1.3rem; display: grid; gap: .4rem; }

.findings { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); gap: .75rem; margin: 0; }
.finding { padding: 1rem 1.1rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.finding--wide { grid-column: 1 / -1; }
.finding dt { color: var(--muted); font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.finding dd { margin: .3rem 0 0; font-size: 1.05rem; font-weight: 600; }
.finding dd p { margin: .3rem 0 0; font-weight: 400; font-size: .95rem; }

.harmony { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem; align-items: center; }
.harmony-chart { width: 100%; max-width: 22rem; height: auto; justify-self: center; overflow: visible; }
.harmony-chart__ring { fill: none; stroke: var(--border); }
.harmony-chart__spoke { stroke: var(--border); }
.harmony-chart__shape { fill: color-mix(in oklab, var(--brand) 25%, transparent); stroke: var(--brand); stroke-width: 2; }
.harmony-chart__median { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 4 3; }
.harmony-chart__label { fill: var(--muted); font-size: 11px; font-weight: 600; }
.harmony-chart__value { fill: var(--text); font-size: 12px; font-weight: 700; }
.harmony__list, .regions { display: grid; gap: .8rem; margin: 0; padding: 0; list-style: none; }
.harmony__list li, .regions li { display: grid; grid-template-columns: 1fr auto; align-items: baseline; column-gap: .75rem; }
.harmony__list .meter, .regions .meter { grid-column: 1 / -1; margin-top: .2rem; }
.harmony__median { grid-column: 1 / -1; font-size: .85rem; }
.regions { margin-top: 1rem; }

.mirrors { display: grid; grid-template-columns: repeat(2, minmax(0, 12rem)); gap: 1rem; }
.mirrors figure { margin: 0; text-align: center; }
.mirrors figcaption { margin-top: .4rem; color: var(--muted); font-size: .9rem; }
.mirrors__face { display: block; width: 100%; height: auto; border-radius: 12px; background: var(--surface-2); }

.proportions { width: 100%; border-collapse: collapse; font-size: .95rem; }
.proportions th, .proportions td { padding: .6rem .5rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.proportions thead th { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.proportions tbody th { font-weight: 500; }
.proportions td:last-child { min-width: 7rem; }
.proportions__score { font-weight: 700; }

.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .4rem 0 0; padding: 0; list-style: none; }
.chips li { padding: .25rem .7rem; border-radius: 999px; background: var(--brand-soft); font-size: .9rem; font-weight: 500; }

.upload__status { min-height: 1.4em; margin: .5rem 0 0; color: var(--muted); font-size: .95rem; }
.upload__status--problem { color: var(--danger); }

@media (max-width: 44rem) {
  .report-hero, .harmony { grid-template-columns: 1fr; }
  .proportions thead th:nth-child(3), .proportions td:nth-child(3) { display: none; }
}

/* pricing */
.plans {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 22rem)); justify-content: center; gap: 1.25rem;
  margin: 0; padding: 0; list-style: none;
}
.plan {
  display: flex; flex-direction: column; gap: .75rem; padding: 1.6rem;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow);
}
.plan--owned { border-color: var(--brand); }
.plan__name { margin: 0; font-size: 1.25rem; }
.plan__price { margin: 0; display: flex; align-items: baseline; gap: .4rem; flex-wrap: wrap; }
.plan__price strong { font-size: 2.4rem; letter-spacing: -.02em; line-height: 1; }
.plan__description { margin: 0; color: var(--muted); }
.plan__benefits { display: grid; gap: .5rem; margin: 0; padding: 0; list-style: none; }
.plan__benefits li { display: grid; padding-left: 1.5rem; position: relative; }
.plan__benefits li::before { content: "✓"; position: absolute; left: 0; color: var(--brand); font-weight: 700; }
.plan__benefits .muted { font-size: .9rem; }
.plan__label { margin: .25rem 0 0; color: var(--muted); font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.plan__tools { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; padding: 0; list-style: none; }
.plan__tools a {
  display: inline-block; padding: .25rem .65rem; border-radius: 999px; background: var(--brand-soft);
  color: var(--text); font-size: .85rem; text-decoration: none;
}
.plan__tools a:hover { color: var(--brand); }
.plan__action { margin-top: auto; padding-top: .5rem; }
.plan__action .button { width: 100%; }
.pricing__empty { text-align: center; }
.pricing__note { max-width: 36rem; margin: 2rem auto 0; text-align: center; font-size: .95rem; }

@media (max-width: 34rem) {
  .result__photos--pair { grid-template-columns: 1fr; }
  .topbar__link:not(.tools-menu__trigger) { display: none; }
  /* Opens leftwards from "Tools", so it never runs off the screen. */
  .tools-menu__panel { left: auto; right: 0; translate: none; }
}

/* --- browser tools: measuring widgets, camera, photo booth ------------------- */

/* Their controllers show and hide panels with `hidden`, which a display rule would override. */
.widget [hidden] { display: none !important; }

.widget { margin: 0 auto; max-width: 46rem; }
.widget .upload { display: grid; justify-items: center; gap: .75rem; }
.widget__camera { display: grid; gap: .5rem; width: 100%; }
.widget__video, .camera__pane video, .booth__view video { width: 100%; border-radius: var(--radius); background: #000; transform: scaleX(-1); }
.widget__camera .actions { justify-content: center; margin: 0; }

.upload__input { display: grid; gap: .35rem; width: 100%; max-width: 30rem; font-weight: 600; }
.upload__input select, .upload__input textarea, .upload__input input[type=email], .camera__controls select, .camera__controls input[type=text] {
  width: 100%; padding: .6rem .75rem; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text); font: inherit; font-weight: 400;
}

.photo-deleted { display: grid; place-items: center; text-align: center; padding: 1rem; font-size: .9rem; }
.report-pdf { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin: 1.5rem 0; }
.restore__form { display: grid; gap: 1rem; margin: 1.5rem 0; }
.guest-note { margin: 1.5rem 0; padding: 1rem 1.25rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.guest-note p { margin: 0 0 .75rem; }

.reading { max-width: 64rem; margin: 2rem auto 0; }
.reading:empty { display: none; }
.reading__section { margin: 0 0 2.5rem; }
.reading__section h2 { margin: 0 0 1rem; }
.reading__hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.reading-figure { margin: 0; }
.reading-frame { position: relative; }
.reading-photo { display: block; width: 100%; height: auto; border-radius: var(--radius); }
.reading-overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.reading-figure:has(.reading-figure__toggle input:not(:checked)) .reading-overlay { display: none; }
.reading-figure__controls { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin-top: .5rem; font-size: .9rem; }
.reading-figure__toggle { display: inline-flex; align-items: center; gap: .35rem; color: var(--muted); }

.lash-maps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); gap: 1.5rem; margin: 1.5rem 0; }
.lash-maps figure { margin: 0; padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.lash-maps figcaption { margin-top: .5rem; font-size: .95rem; }
.lash-map { width: 100%; height: auto; }
.lash-map__lid { fill: none; stroke: var(--text); stroke-width: 3; stroke-linecap: round; }
.lash-map__lash { stroke: var(--brand); stroke-width: 1.6; stroke-linecap: round; }
.lash-map__label { fill: var(--text); font-size: 13px; font-weight: 700; }
.lash-map__end { fill: var(--muted); font-size: 11px; }

.camera__start { display: grid; justify-items: center; gap: .75rem; padding: 2rem 1rem; border: 2px dashed var(--border); border-radius: var(--radius); text-align: center; }
.camera__stage { display: grid; gap: 1rem; padding: .75rem; border-radius: calc(var(--radius) + 6px); transition: box-shadow .2s, background .2s; }
.camera__stage--pair { grid-template-columns: 1fr 1fr; }
.camera__pane { margin: 0; overflow: hidden; border-radius: var(--radius); }
.camera__pane video, .camera__pane img { display: block; width: 100%; transform-origin: center; transition: transform .15s; }
.camera__pane figcaption { padding: .4rem; color: var(--muted); font-size: .9rem; text-align: center; }
.camera--light .camera__stage, .camera__stage:fullscreen { background: #fff; box-shadow: 0 0 0 1rem #fff, 0 0 4rem 1.5rem #fff; }
.camera__stage:fullscreen { align-content: center; }
.camera__controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .75rem 1rem; margin: 1rem 0; }
.camera__controls label { display: inline-flex; align-items: center; gap: .4rem; color: var(--muted); font-size: .9rem; }
.camera__controls select, .camera__controls input[type=text] { width: auto; }

.booth__view { position: relative; overflow: hidden; border-radius: var(--radius); }
.booth__count { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: clamp(4rem, 18vw, 9rem); font-weight: 800; text-shadow: 0 4px 24px rgb(0 0 0 / .5); pointer-events: none; }
.booth__flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.booth__flash.is-flashing { animation: booth-flash .45s ease-out; }
@keyframes booth-flash { from { opacity: .95; } to { opacity: 0; } }
.booth__result { display: grid; justify-items: center; margin-top: 1.5rem; }
.booth__result img { max-width: 100%; max-height: 80vh; border-radius: 6px; box-shadow: var(--shadow); }

/* results: packs, choices, colours */
.result__pack { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.result__pack figure { margin: 0; }
.result__pack figcaption { margin-top: .4rem; color: var(--muted); font-size: .9rem; text-align: center; }
.result__input { margin: 0 0 1rem; }
.swatches { display: flex; flex-wrap: wrap; gap: .5rem .9rem; margin: 0; padding: 0; list-style: none; }
.swatches li { display: inline-flex; align-items: center; gap: .4rem; }
.swatches__chip { width: 1.4rem; height: 1.4rem; flex: none; border: 1px solid var(--border); border-radius: 50%; }
.prose p { max-width: 46rem; }

@media (max-width: 720px) {
  .reading__hero, .camera__stage--pair { grid-template-columns: 1fr; }
}

/* Tokens: what they have to spend (tool pages, the profile). */
.tokens { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: .35rem; margin: 0 0 1rem; padding: .45rem .85rem; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); font-size: .95rem; }
.tokens__count { font-size: 1.1rem; color: var(--brand); }
.tokens-list { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1rem; padding: 0; list-style: none; }
.tokens-list .tokens { margin: 0; }
.tokens-note { margin-top: .75rem; }

/* The profile. */
.run-card__download { display: inline-block; margin-top: .35rem; font-size: .85rem; }
.reports-list { margin: 0; padding: 0; list-style: none; display: grid; gap: .5rem; }
.reports-list__item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; padding: .7rem .9rem; border: 1px solid var(--border); border-radius: 12px; }
.reports-list__link { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem; color: inherit; text-decoration: none; }
.reports-list__link:hover strong { color: var(--brand); }

/* A free preview: what is shown. */
.preview__top { display: grid; grid-template-columns: minmax(0, 160px) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.preview__photo { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; }
@media (max-width: 560px) { .preview__top { grid-template-columns: 1fr; } .preview__photo { max-width: 160px; } }
/* What unlocking gives, blurred under its prompt (runs/_locked_report): the
   section titles and labels stay sharp, every value is blurred. */
.locked-report { position: relative; margin-top: 2rem; }
.locked-report__prompt {
  position: absolute; z-index: 3; top: 7rem; left: 50%; transform: translateX(-50%);
  width: min(30rem, calc(100% - 2rem)); padding: 1.4rem 1.5rem; text-align: center;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  box-shadow: 0 18px 50px rgb(0 0 0 / .18);
}
.locked-report__prompt h2 { margin: 0 0 .5rem; font-size: 1.3rem; }
.locked-report__prompt p { margin: 0 0 1rem; }
.locked-report__prompt .sample-report-link { margin: .9rem 0 0; }
.locked-report__mock {
  max-height: 80rem; overflow: hidden; pointer-events: none; user-select: none; -webkit-user-select: none;
  mask-image: linear-gradient(to bottom, #000 75%, transparent); -webkit-mask-image: linear-gradient(to bottom, #000 75%, transparent);
}
.locked-report__mock .report-nav, .locked-report__mock .report-hero__media { display: none; }
.locked-report__mock .report-hero,
.locked-report__mock .report-section > :not(.report-section__title),
.locked-report__mock .analysis dd { filter: blur(7px); }
@media (max-width: 560px) { .locked-report__prompt { top: 3rem; } }
.sample-report-link { margin: 1rem 0 0; font-weight: 600; }
.landmark-portrait { display: block; width: 100%; height: auto; background: var(--surface-2); }
.landmark-portrait__dot { fill: var(--muted); opacity: .45; }
.landmark-portrait__line, .landmark-portrait__iris { fill: none; stroke: var(--text, currentColor); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; opacity: .85; }
.report-score__potential { margin: 0 0 .5rem; font-size: 1.1rem; }
.chips--avoid li { background: var(--surface-2); text-decoration: line-through; text-decoration-color: var(--muted); }

/* --- look: type, depth and colour over the layout above -------------------- */

body {
  background:
    radial-gradient(60rem 30rem at 85% -10%, color-mix(in oklab, var(--brand-2) 9%, transparent), transparent 70%),
    radial-gradient(50rem 28rem at -10% 0%, color-mix(in oklab, var(--brand) 9%, transparent), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  font-size: 16px;
}
h1, h2, h3, .page__title, .plan__name, .tool-card__name, .report-score strong, .plan__price strong {
  font-family: var(--font-display); font-weight: 600; letter-spacing: -.015em;
}
h1, .page__title { font-weight: 700; }
::selection { background: color-mix(in oklab, var(--brand) 25%, transparent); }
a { text-underline-offset: .18em; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

/* buttons */
.button, .button_to button {
  background: var(--gradient); box-shadow: var(--shadow-brand);
  transition: transform .15s, box-shadow .15s, filter .15s;
}
.button:hover, .button_to button:hover { filter: brightness(1.05); transform: translateY(-1px); }
.button:active, .button_to button:active { transform: translateY(0); }
.button--ghost, .button_to .button--ghost {
  background: var(--surface); box-shadow: var(--shadow-sm);
}
.button--ghost:hover, .button_to .button--ghost:hover { border-color: color-mix(in oklab, var(--brand) 45%, var(--border)); color: var(--brand); }
.button--danger { background: var(--danger); box-shadow: none; }
.menu .button_to button, .menu .button_to button:hover { background: none; box-shadow: none; transform: none; filter: none; }
.menu .button_to button:hover { background: var(--surface-2); }

/* top bar: frosted, stays in view */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in oklab, var(--surface) 78%, transparent);
  backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom-color: color-mix(in oklab, var(--border) 70%, transparent);
}
.topbar__brand { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; letter-spacing: -.01em; }
.topbar__logo {
  display: grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 10px;
  background: var(--gradient); color: #fff; font-size: 1.05rem; box-shadow: var(--shadow-brand);
}
.topbar__nav { gap: 1.1rem; }
.topbar__link { font-size: .95rem; color: color-mix(in oklab, var(--text) 85%, var(--muted)); }
.tools-menu__groups, .tools-menu__all, .menu__panel { box-shadow: var(--shadow); }
.menu__panel { border-radius: var(--radius-sm); }
.report-nav { top: 3.6rem; background: transparent; backdrop-filter: blur(10px); }

/* hero */
.hero { margin-top: 3rem; }
.hero h1 { font-size: clamp(2.3rem, 6vw, 3.6rem); line-height: 1.05; letter-spacing: -.03em; }
.hero h1::after {
  content: ""; display: block; width: 3.5rem; height: 4px; margin: 1.1rem auto 0; border-radius: 999px; background: var(--gradient);
}
.crumbs { text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; font-weight: 700; }
.crumbs a { color: var(--brand); }

/* surfaces: one card look */
.features li, .analysis__item, .finding, .plan, .tool-card, .run-card, .guest-note, .reports-list__item,
.lash-maps figure, .flash, .faq {
  border-color: color-mix(in oklab, var(--border) 80%, transparent);
  box-shadow: var(--shadow-sm);
}
.features li, .analysis__item, .finding, .reports-list__item { border-radius: var(--radius-sm); background: var(--surface); }
.plan { border-radius: var(--radius); box-shadow: var(--shadow); }
.plan--owned { border-color: var(--brand); box-shadow: var(--shadow), 0 0 0 1px var(--brand); }
.tool-card:hover, .run-card:hover { box-shadow: var(--shadow); }
.run-card { border-radius: var(--radius-sm); }
.faq { box-shadow: none; }
.features li::before { content: "✦ "; background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* tool page */
.section h2 { font-size: clamp(1.4rem, 3vw, 1.75rem); }
.steps { counter-reset: step; list-style: none; padding: 0; display: grid; gap: .75rem; }
.steps li { counter-increment: step; position: relative; padding: .2rem 0 .2rem 3rem; margin: 0; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0; display: grid; place-items: center;
  width: 2.1rem; height: 2.1rem; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 700;
}
.faq summary { list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--brand); font-size: 1.3rem; line-height: 1; transition: rotate .2s; }
.faq[open] summary::after { rotate: 45deg; }

/* upload */
.upload__drop {
  min-height: 18rem; border-width: 1.5px; border-color: color-mix(in oklab, var(--brand) 30%, var(--border));
  background:
    radial-gradient(28rem 14rem at 50% 0%, var(--brand-soft), transparent 75%),
    var(--surface);
  box-shadow: var(--shadow);
}
.upload__drop:hover, .upload__drop.is-over, .upload__drop:focus-within { border-color: var(--brand); }
.upload__icon {
  display: grid; place-items: center; width: 3.4rem; height: 3.4rem; margin-bottom: .4rem; border-radius: 50%;
  background: var(--gradient); color: #fff; box-shadow: var(--shadow-brand);
}
.upload__icon svg { stroke: currentColor; }

/* scores and meters */
.meter { height: 7px; }
.meter span { background: var(--gradient); }
.score strong, .report-score strong, .tokens__count { background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.report-score__word { font-family: var(--font-display); }
.badge { background: var(--brand-soft); border: 1px solid color-mix(in oklab, var(--brand) 20%, transparent); }
.tokens { background: var(--surface); box-shadow: var(--shadow-sm); }

/* footer */
.footer { background: color-mix(in oklab, var(--surface) 70%, transparent); border-top-color: color-mix(in oklab, var(--border) 70%, transparent); }
.footer__heading { font-family: var(--font-display); font-size: 1.02rem; }

/* pricing: what a plan buys; the plan chosen there, first on the paywall */
.plan__units { margin: 0; font-size: 1.05rem; }
.plan__units strong { background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; font-size: 1.3rem; }
.plan--chosen { border-color: var(--brand); box-shadow: var(--shadow), 0 0 0 2px var(--brand); }
.plan__chosen { align-self: flex-start; }

/* /?plan=: the upload is the page */
.hero--focus { margin-top: 1.5rem; margin-bottom: 1.25rem; }
.hero--focus h1 { font-size: clamp(2rem, 5vw, 2.8rem); }
#upload { scroll-margin-top: 5rem; }

/* paywall: tokens on an account */
.paywall-signin { margin: 1rem 0; padding: .75rem 1rem; border: 1px dashed color-mix(in oklab, var(--brand) 35%, var(--border)); border-radius: var(--radius-sm); }

/* top bar: "Log in" stands out without competing with "Rate my face" */
.button--outline, .button_to .button--outline {
  background: var(--surface); color: var(--brand); border: 1.5px solid var(--brand); box-shadow: none;
}
.button--outline:hover { background: var(--brand-soft); }
.topbar__link[aria-current="page"] { color: var(--brand); }
@media (max-width: 34rem) {
  .topbar { gap: .5rem; padding-inline: .75rem; }
  .topbar__nav { gap: .45rem; min-width: 0; }
  .topbar .button--small { padding: .35rem .65rem; font-size: .85rem; white-space: nowrap; }
}
@media (max-width: 26rem) {
  .topbar__name { display: none; } /* the logo is the home link */
}
.report-photo__image.result__placeholder { display: grid; place-items: center; padding: 1rem; text-align: center; }
/* The original under the concept shows only while "Hold to compare" is
   pressed: .report-photo__image's display would otherwise beat [hidden]. */
.report-concept__original[hidden] { display: none; }

/* The face report's style examples (ConceptJob), and its glow-up plan. */
.style-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: .9rem; margin: 0 0 1.25rem; }
.style-gallery__item { margin: 0; }
.style-gallery__image { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius-sm); background: var(--surface-2); }
.style-gallery__image.result__placeholder { display: grid; place-items: center; padding: 1rem; text-align: center; }
.style-gallery figcaption { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: .45rem; }
.glow-up { margin: 0; padding-left: 1.3rem; display: grid; gap: .55rem; }
.glow-up strong { color: var(--brand); }
.report-section > .regions + .findings, .report-section > p + .regions { margin-top: 1rem; }
.report-section > .findings + .proportions, .report-section > .regions + .proportions { margin-top: 1rem; }

/* The face report's reading guide and radar legend. */
.report-howto { margin-top: 1.5rem; padding: 1rem 1.25rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.report-howto h3 { margin-top: 0; }
.report-howto ul { margin: 0; padding-left: 1.2rem; display: grid; gap: .4rem; }
.report-photo figcaption.muted { margin-top: .4rem; font-size: .85rem; }
.harmony-legend { display: flex; flex-wrap: wrap; gap: 1rem; margin: .5rem 0 0; color: var(--muted); font-size: .9rem; }
.harmony-legend span::before { content: ""; display: inline-block; width: 1.4rem; height: 0; margin-right: .4rem; vertical-align: middle; border-top: 2px solid var(--brand); }
.harmony-legend__median::before { border-top: 1.5px dashed var(--muted) !important; }
/* /sample-report: the two ways in, kept in view. */
.buy-bar {
  position: sticky; bottom: 0; z-index: 4; display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem;
  margin: 2rem -1rem 0; padding: .75rem 1rem; border-top: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.buy-bar .actions { margin: 0; justify-content: center; }
.report-section + .actions, .actions + .report-section { margin-top: 2rem; }

/* Proportions and golden ratio drawn on the face (FaceReportHelper#proportion_map, #golden_map). */
.face-map-layout { display: grid; grid-template-columns: minmax(0, 20rem) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
@media (max-width: 720px) { .face-map-layout { grid-template-columns: 1fr; } .face-map { max-width: 22rem; } }
.face-map figcaption { margin-top: .5rem; font-size: .85rem; }
.proportion-map__label { fill: #ffffff; font-weight: 700; paint-order: stroke; stroke: rgb(0 0 0 / .7); stroke-linejoin: round; }
.golden-key { display: inline-grid; place-items: center; width: 1.3rem; height: 1.3rem; margin-right: .3rem; border-radius: 50%; color: #1f1630; font-size: .75rem; font-weight: 700; }

/* HUDs over the face (FaceReportHelper#golden_rectangle_map, #eye_map). */
.face-map__frame { position: relative; overflow: hidden; border-radius: var(--radius-sm); background: var(--surface-2); }
.face-map__canvas { display: block; width: 100%; height: 100%; }
.face-map--eyes { max-width: none; }
.hud-line { fill: none; stroke-width: 2; }
.hud-line--frame { stroke: #ffffff; stroke-opacity: .9; }
.hud-line--golden { stroke: #ffc145; stroke-dasharray: 8 6; }
.hud-line--cut { stroke: #ffc145; stroke-opacity: .7; stroke-dasharray: 2 5; }
.hud-line--feature { stroke: #ff4d8d; stroke-width: 2.5; }
.hud-line--guide { stroke: #4cc9f0; stroke-dasharray: 6 5; stroke-opacity: .85; }
.hud-line--pd { stroke: #ffc145; stroke-width: 2.5; }
.hud-dot { stroke: rgb(0 0 0 / .5); stroke-width: 1; vector-effect: non-scaling-stroke; }
.hud-dot--ideal { fill: #ffc145; }
.hud-dot--actual { fill: #ffffff; }
.hud-dot--pupil { fill: #ffc145; }
.hud-line--dashed { stroke-dasharray: 6 5; }
.face-map--nose, .face-map--lips, .face-map--jaw { max-width: 34rem; }

/* Votes on the AI images, their retry, the report's feedback form and tones. */
.image-vote { display: inline-flex; gap: .3rem; }
.image-vote__form { display: inline; margin: 0; }
.image-vote__button { padding: .2rem .55rem; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); cursor: pointer; font-size: .95rem; line-height: 1.4; }
.image-vote__button:hover { border-color: var(--brand); }
.image-vote__button.is-chosen { border-color: var(--brand); background: var(--brand-soft); }
.style-gallery figcaption .image-vote { margin-left: auto; }
.retry-images { margin-top: .6rem; }
.result__placeholder .muted + .retry-images, .result__placeholder > .muted { display: block; }
.feedback-form { display: grid; gap: 1rem; max-width: 36rem; }
.feedback-form__rating { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: 0; padding: 0; border: 0; }
.feedback-form__rating legend { margin-bottom: .4rem; font-weight: 600; }
.feedback-form__star input { position: absolute; opacity: 0; }
.feedback-form__star span { display: inline-grid; place-items: center; width: 2.4rem; height: 2.4rem; border: 1px solid var(--border); border-radius: 50%; cursor: pointer; font-weight: 700; }
.feedback-form__star input:checked + span { border-color: var(--brand); background: var(--brand); color: #fff; }
.feedback-form__star input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.feedback-form__comment { display: grid; gap: .4rem; font-weight: 600; }
.feedback-form__comment textarea { width: 100%; padding: .7rem .8rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; font-weight: 400; }
.tone-swatches { margin-bottom: 1rem; }
