/* =========================================================
   How Old Do I Look – stylesheet
   ========================================================= */
:root {
  --brand: #6d4aff;
  --brand-2: #ff4fa3;
  --brand-dark: #4b2fd6;
  --grad: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  --bg: #f7f6fc;
  --bg-alt: #efedf9;
  --surface: #ffffff;
  --text: #17142e;
  --muted: #5d5a75;
  --border: #e3e0f2;
  --success: #16a34a;
  --danger: #e11d48;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 10px 40px -12px rgba(52, 30, 160, .25);
  --shadow-sm: 0 2px 10px rgba(30, 20, 80, .06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --container: 1160px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.02em; }
p { margin: 0 0 1em; }
button { font: inherit; }

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

[hidden] { display: none !important; }

.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(--text); color: #fff; padding: 10px 16px; border-radius: 8px;
}
.skip-link:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; border-radius: 6px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.grad {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: var(--brand);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 999px; border: 1.5px solid transparent;
  font-weight: 650; font-size: 16px; line-height: 1; cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, color .2s;
  text-decoration: none !important; white-space: nowrap;
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 8px 24px -8px rgba(109, 74, 255, .7); }
.btn-primary:hover { box-shadow: 0 12px 28px -8px rgba(109, 74, 255, .85); transform: translateY(-1px); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-light { background: #fff; color: var(--brand-dark); }
.btn-light:hover { transform: translateY(-1px); box-shadow: 0 10px 30px -10px rgba(0,0,0,.35); }
.btn-sm { padding: 9px 16px; font-size: 14px; }
.btn-lg { padding: 15px 26px; font-size: 17px; }
.btn[disabled] { opacity: .6; cursor: not-allowed; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(247, 246, 252, .82);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid rgba(227, 224, 242, .7);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; color: var(--text); }
.logo:hover { text-decoration: none; }
.logo b { color: var(--brand); }
.logo-mark { width: 32px; height: 32px; }
.nav { display: flex; align-items: center; gap: 26px; }
.nav a:not(.btn) { color: var(--muted); font-weight: 550; font-size: 15px; }
.nav a:not(.btn):hover { color: var(--text); text-decoration: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  padding: 48px 0 72px;
}
.hero::before {
  content: ""; position: absolute; inset: -30% -10% auto auto; width: 720px; height: 720px;
  background: radial-gradient(closest-side, rgba(255, 79, 163, .18), transparent 70%);
  pointer-events: none;
}
.hero::after {
  content: ""; position: absolute; inset: auto auto -40% -15%; width: 760px; height: 760px;
  background: radial-gradient(closest-side, rgba(109, 74, 255, .18), transparent 70%);
  pointer-events: none;
}
.hero-inner {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1fr 1.05fr; gap: 56px; align-items: center;
}
.eyebrow {
  display: inline-block; margin-bottom: 16px; padding: 6px 14px; border-radius: 999px;
  background: rgba(109, 74, 255, .1); color: var(--brand-dark);
  font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
}
.hero h1 { font-size: clamp(36px, 5vw, 58px); font-weight: 850; }
.hero h1 .grad { display: block; font-size: .56em; font-weight: 750; margin-top: .35em; line-height: 1.25; }
.lead { font-size: 19px; color: var(--muted); max-width: 540px; }
.lead strong { color: var(--text); }
.trust { list-style: none; padding: 0; margin: 24px 0 0; display: flex; flex-wrap: wrap; gap: 10px 22px; }
.trust li { font-size: 15px; font-weight: 600; color: var(--text); }
.trust span { color: var(--success); font-weight: 800; margin-right: 4px; }

/* ---------- Tool ---------- */
.tool { padding: 22px; box-shadow: var(--shadow); scroll-margin-top: 84px; }
.view { display: none; animation: fade .35s ease; }
.tool[data-view="upload"] .view-upload,
.tool[data-view="analyzing"] .view-analyzing,
.tool[data-view="result"] .view-result { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  gap: 6px; min-height: 280px; padding: 28px 20px; cursor: pointer;
  border: 2px dashed #c9c2f2; border-radius: var(--radius-sm);
  background:
    radial-gradient(circle at 50% 0%, rgba(109, 74, 255, .07), transparent 60%),
    #fbfaff;
  transition: border-color .2s, background .2s, transform .2s;
}
.dropzone:hover, .dropzone.is-dragover {
  border-color: var(--brand); background-color: #f4f1ff;
}
.dropzone.is-dragover { transform: scale(1.01); }
.dz-icon { width: 60px; height: 60px; color: var(--brand); margin-bottom: 8px; }
.dz-title { font-size: 20px; font-weight: 750; }
.dz-sub { color: var(--muted); font-size: 15px; }
.dz-sub u { color: var(--brand); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.dz-hint { margin-top: 10px; font-size: 13px; color: #8a87a3; }

.tool-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 18px; }
.tool-actions .btn { flex: 1 1 auto; }
.privacy-note { margin: 14px 0 0; text-align: center; font-size: 13.5px; color: var(--muted); }

/* Analyzing */
.scan {
  position: relative; overflow: hidden; border-radius: var(--radius-sm);
  background: #12101f; aspect-ratio: 4 / 3.4;
}
.scan img { width: 100%; height: 100%; object-fit: contain; }
.scan-line {
  position: absolute; left: 0; right: 0; height: 3px; top: 0;
  background: linear-gradient(90deg, transparent, #9d86ff, #ff7ac0, transparent);
  box-shadow: 0 0 18px 4px rgba(157, 134, 255, .6);
  animation: scan 1.8s ease-in-out infinite alternate;
}
@keyframes scan { from { top: 4%; } to { top: 96%; } }
.scan-frame { position: absolute; inset: 18% 24%; }
.scan-frame i { position: absolute; width: 26px; height: 26px; border: 3px solid #fff; opacity: .9; }
.scan-frame i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 8px; }
.scan-frame i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 8px; }
.scan-frame i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 8px; }
.scan-frame i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 8px; }
.scan-status { text-align: center; margin: 16px 0 10px; font-weight: 650; }
.progress { height: 6px; background: var(--bg-alt); border-radius: 99px; overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--grad); border-radius: inherit; transition: width .4s ease; }

/* Result */
.result { display: grid; grid-template-columns: 170px 1fr; gap: 22px; align-items: center; }
.result-photo { border-radius: var(--radius-sm); overflow: hidden; aspect-ratio: 1; background: #12101f; }
.result-photo img { width: 100%; height: 100%; object-fit: cover; }
.result-label { margin: 0; color: var(--muted); font-weight: 600; }
.result-age { margin: 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 8px; font-size: 76px; font-weight: 900; line-height: 1; letter-spacing: -.04em; }
.result-age span { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.result-age small { font-size: 18px; font-weight: 700; color: var(--muted); letter-spacing: 0; white-space: nowrap; }
.result-range { margin: 10px 0 14px; color: var(--muted); }
.result-range b { color: var(--text); }
.confidence-head { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.confidence-head b { color: var(--text); }
.meter { height: 8px; background: var(--bg-alt); border-radius: 99px; overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; background: var(--grad); border-radius: inherit; transition: width 1s cubic-bezier(.2,.8,.2,1); }
.result-msg { margin: 14px 0 0; font-weight: 600; }
.demo-badge {
  display: inline-block; margin: 10px 0 0; padding: 4px 10px; border-radius: 6px;
  background: #fff7e6; color: #9a5b00; font-size: 12.5px; font-weight: 600;
}

.error {
  margin: 14px 0 0; padding: 12px 14px; border-radius: 10px;
  background: #fff1f3; color: var(--danger); font-weight: 600; font-size: 15px; text-align: center;
}

/* ---------- Sections ---------- */
.section { padding: 84px 0; }
.section-alt { background: var(--bg-alt); }
.section-title { font-size: clamp(28px, 3.4vw, 40px); font-weight: 820; text-align: center; }
.section-title.sub { font-size: clamp(24px, 2.8vw, 32px); margin-top: 1.6em; }
.section-lead { text-align: center; color: var(--muted); font-size: 18px; max-width: 680px; margin: 0 auto 44px; }

.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; counter-reset: s; }
.step { padding: 30px 26px; position: relative; }
.step-num {
  display: inline-grid; place-items: center; width: 44px; height: 44px; margin-bottom: 16px;
  border-radius: 12px; background: var(--grad); color: #fff; font-weight: 800; font-size: 19px;
}
.step h3 { font-size: 21px; }
.step p { color: var(--muted); margin: 0; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.feature { background: var(--surface); border-radius: var(--radius); padding: 28px 24px; border: 1px solid var(--border); }
.feature-icon {
  width: 48px; height: 48px; display: grid; place-items: center; font-size: 24px;
  border-radius: 14px; background: rgba(109, 74, 255, .1); margin-bottom: 14px;
}
.feature h3 { font-size: 19px; }
.feature p { color: var(--muted); margin: 0; font-size: 16px; }

.tips { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.tips li {
  position: relative; padding: 18px 20px 18px 56px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--muted);
}
.tips li::before {
  content: "✓"; position: absolute; left: 18px; top: 18px; width: 26px; height: 26px;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--grad); color: #fff; font-size: 14px; font-weight: 800;
}
.tips b { color: var(--text); }

.prose h3 { font-size: 21px; margin-top: 1.6em; }
.prose p { color: var(--muted); }
.prose .section-title { margin-bottom: .8em; }

.faq { display: grid; gap: 12px; }
.faq details {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 0 22px; transition: box-shadow .2s;
}
.faq details[open] { box-shadow: var(--shadow-sm); }
.faq summary {
  cursor: pointer; list-style: none; padding: 18px 30px 18px 0; position: relative;
  font-weight: 700; font-size: 17.5px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  font-size: 24px; font-weight: 500; color: var(--brand); transition: transform .2s;
}
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details p { color: var(--muted); margin: 0 0 18px; }

/* ---------- CTA ---------- */
.cta { padding: 0 0 84px; background: var(--bg-alt); }
.cta-inner {
  text-align: center; color: #fff; background: var(--grad); border-radius: 28px;
  padding: 64px 28px; box-shadow: var(--shadow);
}
.cta h2 { font-size: clamp(28px, 3.6vw, 42px); font-weight: 850; }
.cta p { opacity: .92; font-size: 18px; max-width: 560px; margin: 0 auto 28px; }

/* ---------- Footer ---------- */
.site-footer { background: #141127; color: #b9b5d3; padding: 52px 0 24px; font-size: 15px; }
.footer-inner { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.logo-footer { color: #fff; }
.logo-footer b { color: #a996ff; }
.footer-desc { max-width: 380px; margin-top: 10px; }
.site-footer nav { display: flex; gap: 22px; flex-wrap: wrap; align-items: flex-start; }
.site-footer nav a { color: #d8d4f0; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); margin-top: 32px; padding-top: 20px; font-size: 13.5px; }
.footer-bottom p { margin: 0; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 200;
  background: var(--text); color: #fff; padding: 12px 20px; border-radius: 999px;
  font-size: 15px; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.25);
  animation: fade .25s ease;
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero { padding: 28px 0 56px; }
  .hero-inner { grid-template-columns: 1fr; gap: 28px; }
  .hero-copy { text-align: center; }
  .lead { margin-left: auto; margin-right: auto; }
  .trust { justify-content: center; }
  .steps, .features { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .nav a:not(.btn) { display: none; }
  .hero { padding: 18px 0 48px; }
  .eyebrow { margin-bottom: 10px; font-size: 12px; }
  .hero h1 { font-size: 32px; }
  .lead { font-size: 16px; margin-bottom: 0; }
  .trust { gap: 4px 14px; margin-top: 14px; }
  .trust li { font-size: 13.5px; }
  .tool { padding: 14px; }
  .dropzone { min-height: 170px; padding: 20px 16px; }
  .dz-icon { width: 44px; height: 44px; margin-bottom: 4px; }
  .dz-title { font-size: 17px; }
  .steps, .features { grid-template-columns: 1fr; }
  .section { padding: 60px 0; }
  .result { grid-template-columns: 1fr; text-align: center; }
  .result-age { justify-content: center; }
  .result-photo { max-width: 200px; margin: 0 auto; }
  .tool-actions { margin-top: 14px; gap: 10px; }
  .tool-actions .btn { flex: 1 1 calc(50% - 5px); padding-left: 12px; padding-right: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
