/* =====================================================================
   FaceShapeDetector.com
   1 tokens · 2 base · 3 utilidades · 4 cabecera · 5 héroe · 6 herramienta
   7 resultado · 8 secciones · 9 prosa · 10 pie · 11 responsive · 12 motion
   ===================================================================== */

/* 1) tokens */
:root {
  --ink: #070708;
  --ink-2: #0B0B0D;
  --ink-3: #101012;
  --surface: rgba(255, 255, 255, 0.028);
  --surface-2: rgba(255, 255, 255, 0.055);
  --line: rgba(242, 239, 233, 0.1);
  --line-2: rgba(242, 239, 233, 0.19);
  --text: #F2EFE9;
  --muted: #A39D92;
  --muted-2: #78726A;
  --gold: #C6A15B;
  --gold-bright: #E3C489;
  --gold-soft: rgba(198, 161, 91, 0.13);
  --gold-line: rgba(198, 161, 91, 0.42);

  --font-display: "Poppins", "Segoe UI", system-ui, sans-serif;
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --section-y: clamp(3rem, 2rem + 5vw, 6rem);
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
  --max: 1080px;
}

/* 2) base */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; }

body {
  min-height: 100vh;
  font-family: var(--font-ui);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background:
    radial-gradient(60% 42% at 50% -8%, rgba(198, 161, 91, 0.11), transparent 70%),
    var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 300; line-height: 1.12; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.3rem, 1.5rem + 3.6vw, 3.9rem); }
h2 { font-size: clamp(1.7rem, 1.3rem + 1.8vw, 2.5rem); }
h3 { font-size: clamp(1.05rem, 1rem + 0.3vw, 1.2rem); font-weight: 400; }
p { text-wrap: pretty; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
::selection { background: rgba(198, 161, 91, 0.32); color: #fff; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* 3) utilidades */
.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: clamp(1.15rem, 4vw, 2.5rem); }
.section { padding-block: var(--section-y); border-top: 1px solid var(--line); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-size: 0.66rem; font-weight: 500; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--muted);
}
.eyebrow::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 0 4px rgba(198, 161, 91, 0.14);
}
.lead { color: var(--muted); font-size: 1.02rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  padding: 0.78rem 1.5rem; border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--text);
  font-size: 0.86rem; font-weight: 500; white-space: nowrap;
  transition: transform 0.18s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.btn:hover { transform: translateY(-1px); background: var(--surface-2); border-color: rgba(242, 239, 233, 0.3); }
.btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary { background: var(--gold); border-color: var(--gold); color: #14100A; font-weight: 600; }
.btn-primary:hover { background: var(--gold-bright); border-color: var(--gold-bright); }
.btn-lg { padding: 0.92rem 1.9rem; font-size: 0.92rem; }
.btn[disabled] { opacity: 0.4; pointer-events: none; }
.linkish { border: 0; background: none; padding: 0; color: var(--gold); text-decoration: underline; text-underline-offset: 3px; font-weight: 500; }
.linkish:hover { color: var(--gold-bright); }
.linkout {
  display: inline-block; margin-top: 1.6rem;
  color: var(--gold); font-size: 0.9rem; font-weight: 500;
  text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px;
}
.linkout:hover { color: var(--gold-bright); }

/* 4) cabecera */
.site-header {
  position: sticky; top: 0; z-index: 60;
  border-bottom: 1px solid transparent;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
}
.site-header.is-scrolled {
  background: rgba(7, 7, 8, 0.82);
  backdrop-filter: blur(16px) saturate(130%);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
  border-bottom-color: var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.4rem; min-height: 74px; }

.brand { display: inline-flex; align-items: center; gap: 0.6rem; }
.brand-mark { width: 34px; height: 34px; object-fit: contain; }
.brand-name {
  font-family: var(--font-display); font-weight: 300; font-size: 1.16rem;
  letter-spacing: -0.01em; line-height: 1; white-space: nowrap;
}
.brand-name b { font-weight: 400; }
.brand-name .tld { color: var(--gold); font-size: 0.78rem; font-weight: 300; letter-spacing: 0.04em; }

.nav { display: flex; align-items: center; gap: 1.6rem; font-size: 0.8rem; font-weight: 400; color: var(--muted); }
.nav a { transition: color 0.2s var(--ease); }
.nav a:hover { color: var(--text); }
.nav .btn { padding: 0.55rem 1.1rem; font-size: 0.78rem; }

/* 5) héroe */
.hero { padding-block: clamp(2.6rem, 2rem + 4vw, 4.4rem) clamp(1.6rem, 2.5vw, 2.6rem); }
.hero-copy { max-width: 40rem; margin-inline: auto; text-align: center; }
.hero h1 { margin-top: 1.2rem; }
.hero h1 em { font-style: normal; color: var(--gold); }
.hero .lead { margin: 1rem auto 0; max-width: 31rem; }
.hero-note { margin-top: 1.1rem; font-size: 0.78rem; color: var(--muted-2); }
.hero-note a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.hero-note a:hover { color: var(--text); }

/* 6) herramienta */
.tool { display: grid; gap: 0.9rem; margin-top: clamp(1.8rem, 3vw, 2.6rem); max-width: 640px; margin-inline: auto; }

.drop {
  position: relative; display: grid; place-items: center; min-height: 250px;
  padding: 2rem 1.4rem; text-align: center;
  border: 1.5px dashed var(--line-2); border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.012));
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.drop:hover { border-color: var(--gold-line); background: var(--gold-soft); }
.drop.is-over { border-color: var(--gold); background: rgba(198, 161, 91, 0.15); }
.drop-ico { width: 42px; height: 42px; margin: 0 auto 1rem; color: var(--gold); }
.drop-ico svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.drop p { color: var(--muted); font-size: 0.95rem; }
.drop strong { color: var(--text); font-weight: 500; }
.drop .hint { margin-top: 0.5rem; font-size: 0.76rem; color: var(--muted-2); }

.tool-row { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; }

.camera { display: grid; gap: 0.8rem; justify-items: center; }
.camera[hidden] { display: none; }
.camera video { width: min(100%, 420px); border-radius: var(--radius); border: 1px solid var(--line-2); background: #000; transform: scaleX(-1); }

.status { min-height: 1.5rem; text-align: center; font-size: 0.84rem; color: var(--muted-2); }
.status.is-error { color: #E9A08E; }
.status.is-busy { color: var(--gold); }

/* 7) resultado */
.result { display: grid; gap: 1.1rem; margin-top: clamp(1.8rem, 3vw, 2.8rem); }
.result[hidden] { display: none; }

.result-main { display: grid; gap: 1.1rem; }

.canvas-wrap {
  border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--ink-2);
  overflow: hidden; display: grid; place-items: center; min-height: 260px;
}
.canvas-wrap canvas { display: block; width: 100%; height: auto; }

.card {
  padding: 1.5rem;
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012));
}
.card-kicker { font-size: 0.62rem; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted-2); }

.shape-name {
  display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap;
  margin-top: 0.3rem;
  font-family: var(--font-display); font-weight: 300; letter-spacing: -0.02em;
  font-size: clamp(2rem, 1.6rem + 1.3vw, 2.5rem); line-height: 1.1;
}
.shape-name span { color: var(--gold); }

.match {
  font-family: var(--font-ui); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.03em;
  padding: 0.24rem 0.65rem; border-radius: 999px;
  border: 1px solid var(--gold-line); background: var(--gold-soft); color: var(--gold-bright);
  transform: translateY(-0.12rem);
}
.match.is-low { border-color: var(--line-2); background: var(--surface-2); color: var(--muted); }

.shape-desc { margin-top: 0.65rem; color: var(--muted); font-size: 0.92rem; }
.second { margin-top: 0.55rem; font-size: 0.8rem; color: var(--muted-2); }
.second b { color: var(--text); font-weight: 500; }

.dist-title {
  margin-top: 1.3rem; font-size: 0.62rem; font-weight: 600; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--muted-2);
}
.dist { margin-top: 0.55rem; display: grid; gap: 0.45rem; }
.dist-row {
  display: grid; grid-template-columns: 5.4rem minmax(0, 1fr) 2.4rem;
  align-items: center; gap: 0.6rem; font-size: 0.77rem; color: var(--muted);
}
.dist-row .bar { display: block; height: 5px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.dist-row .bar span { display: block; height: 100%; border-radius: inherit; background: rgba(198, 161, 91, 0.42); }
.dist-row .pct { text-align: right; font-variant-numeric: tabular-nums; }
.dist-row.is-top { color: var(--text); font-weight: 500; }
.dist-row.is-top .bar span { background: linear-gradient(90deg, var(--gold), var(--gold-bright)); }
.dist-row.is-top .pct { color: var(--gold-bright); }

.recs { display: grid; gap: 0.8rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); }
.rec { padding: 1.1rem 1.2rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.rec h3 { display: flex; align-items: center; gap: 0.5rem; font-size: 0.82rem; font-weight: 500; letter-spacing: 0.02em; color: var(--text); }
.rec h3 svg { width: 14px; height: 14px; fill: none; stroke: var(--gold); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.rec p { margin-top: 0.5rem; font-size: 0.83rem; color: var(--muted); }

.result-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.share-note { font-size: 0.78rem; color: var(--gold-bright); transition: opacity 0.2s var(--ease); }
.share-note:empty { display: none; }
.share-note.is-error { color: #E9A08E; }
.feedback { margin-left: auto; display: flex; align-items: center; gap: 0.5rem; font-size: 0.78rem; color: var(--muted-2); }
.feedback .btn { padding: 0.42rem 0.9rem; font-size: 0.74rem; }
.feedback[hidden] { display: none; }

.disclaimer {
  margin-top: 0.4rem; padding: 0.85rem 1rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: 0.74rem; color: var(--muted-2); line-height: 1.55;
}

/* 8) secciones */
.section-head { max-width: 36rem; margin-bottom: 2rem; }
.section-head p { margin-top: 0.8rem; color: var(--muted); font-size: 0.94rem; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: 1.3rem; }
.step { position: relative; padding-top: 2.7rem; }
.step b {
  position: absolute; top: 0; left: 0; display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--gold-line); background: var(--gold-soft);
  font-family: var(--font-display); font-size: 0.82rem; font-weight: 400; color: var(--gold-bright);
}
.step h3 { font-size: 0.98rem; font-weight: 400; }
.step p { margin-top: 0.4rem; font-size: 0.85rem; color: var(--muted); }

.shape-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr)); gap: 0.7rem; }
.shape-tile {
  display: grid; justify-items: center; gap: 0.5rem; padding: 1.1rem 0.6rem;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.2s var(--ease);
}
.shape-tile:hover { border-color: var(--gold-line); background: var(--gold-soft); transform: translateY(-2px); }
.shape-tile svg { width: 40px; height: 48px; fill: none; stroke: var(--muted); stroke-width: 1.5; transition: stroke 0.2s var(--ease); }
.shape-tile:hover svg { stroke: var(--gold); }
.shape-tile span { font-size: 0.78rem; color: var(--muted); }
.shape-tile.is-on { border-color: var(--gold); background: var(--gold-soft); }
.shape-tile.is-on svg { stroke: var(--gold-bright); }
.shape-tile.is-on span { color: var(--text); }

/* 9) prosa (páginas de contenido) */
.page-hero { padding-block: clamp(2.4rem, 2rem + 3vw, 4rem) clamp(1rem, 2vw, 1.6rem); }
.page-hero .lead { margin-top: 0.9rem; max-width: 38rem; }
.prose { max-width: 44rem; }
.prose h2 { margin-top: 2.4rem; }
.prose h3 { margin-top: 1.6rem; font-weight: 500; font-size: 1rem; }
.prose p { margin-top: 0.8rem; color: var(--muted); }
.prose ul, .prose ol { margin-top: 0.8rem; padding-left: 1.15rem; color: var(--muted); }
.prose li { margin-top: 0.4rem; }
.prose li::marker { color: var(--gold); }
.prose strong { color: var(--text); font-weight: 500; }
.prose a { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }
.prose .callout {
  margin-top: 1.4rem; padding: 1rem 1.2rem; border-left: 2px solid var(--gold-line);
  background: var(--surface); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.88rem; color: var(--muted);
}

.faq-list { max-width: 46rem; display: grid; gap: 0.6rem; }
.faq-list details {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  padding: 0.9rem 1.1rem;
}
.faq-list summary {
  cursor: pointer; list-style: none; font-size: 0.92rem; font-weight: 500; color: var(--text);
  display: flex; justify-content: space-between; gap: 1rem; align-items: center;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; color: var(--gold); font-size: 1.1rem; line-height: 1; }
.faq-list details[open] summary::after { content: "−"; }
.faq-list p { margin-top: 0.7rem; font-size: 0.86rem; color: var(--muted); }

.cta-band {
  display: grid; gap: 1rem; justify-items: center; text-align: center;
  padding: clamp(2rem, 3vw, 3rem) 1.5rem;
  border: 1px solid var(--gold-line); border-radius: var(--radius-lg);
  background: radial-gradient(80% 120% at 50% 0%, rgba(198, 161, 91, 0.14), transparent 70%);
}
.cta-band p { max-width: 30rem; color: var(--muted); font-size: 0.9rem; }

/* 10) pie */
.site-footer { border-top: 1px solid var(--line); padding-block: 2.4rem 2rem; }
.footer-grid { display: flex; flex-wrap: wrap; gap: 1.6rem 2.4rem; justify-content: space-between; align-items: flex-start; }
.footer-brand { display: flex; align-items: center; gap: 0.55rem; }
.footer-brand img { width: 26px; height: 26px; object-fit: contain; }
.footer-brand span { font-family: var(--font-display); font-weight: 300; font-size: 0.95rem; }
.footer-brand .tld { color: var(--gold); font-size: 0.72rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.6rem 1.4rem; font-size: 0.78rem; color: var(--muted-2); }
.footer-links a:hover { color: var(--text); }
.footer-legal { margin-top: 1.6rem; padding-top: 1.2rem; border-top: 1px solid var(--line); font-size: 0.72rem; color: var(--muted-2); line-height: 1.6; }

/* 11) responsive */
@media (min-width: 900px) {
  .result-main { grid-template-columns: minmax(0, 1fr) minmax(330px, 0.82fr); align-items: start; }
}

@media (max-width: 820px) {
  .nav { display: none; }
  .nav.is-open { display: flex; }
}

@media (max-width: 520px) {
  .brand-name { font-size: 1rem; }
  .brand-mark { width: 30px; height: 30px; }
  .feedback { margin-left: 0; width: 100%; }
}

/* 12) motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  .btn:hover, .shape-tile:hover { transform: none; }
}
