/* ============================================================
   SkinAI — components & sections
   ============================================================ */

/* ---------- HERO ---------- */
.hero { padding-top: clamp(48px, 7vw, 96px); padding-bottom: clamp(56px, 8vw, 104px); position: relative; }
.hero__grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
.hero__title {
  font-size: clamp(40px, 6.6vw, 78px);
  line-height: 0.98;
  letter-spacing: -0.04em;
  margin-top: 26px;
}
.hero__title .soft { color: var(--faint); }
.hero__lede {
  margin-top: 26px;
  font-size: clamp(17px, 1.5vw, 20px);
  color: var(--ink-2);
  max-width: 46ch;
  text-wrap: pretty;
}
.hero__cta { margin-top: 34px; display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.hero__assurance { margin-top: 18px; font-size: 13.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.hero__assurance svg { color: var(--accent); flex-shrink: 0; }

.statbar {
  margin-top: clamp(48px, 6vw, 76px);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
.stat { padding: 26px 28px 0 0; }
.stat + .stat { padding-left: 28px; border-left: 1px solid var(--line); }
.stat__num { font-size: clamp(26px, 3vw, 36px); font-weight: 600; letter-spacing: -0.03em; }
.stat__num .mono { font-family: var(--mono); font-size: 0.62em; font-weight: 500; }
.stat__label { font-size: 13.5px; color: var(--muted); margin-top: 6px; }

@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__visual { order: -1; }
}
@media (max-width: 560px) {
  .statbar { grid-template-columns: 1fr; }
  .stat { padding: 22px 0; border-top: 1px solid var(--line); }
  .stat:first-child { border-top: none; }
  .stat + .stat { padding-left: 0; border-left: none; }
}

/* ---------- result card (used in hero + demo + scan) ---------- */
.result {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.result__bar {
  display: flex; align-items: center; gap: 8px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: 12px; color: var(--muted);
}
.result__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); }
.result__dot.live { background: var(--risk-low); box-shadow: 0 0 0 0 color-mix(in oklab, var(--risk-low) 60%, transparent); animation: pulse 2s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--risk-low) 50%, transparent); }
  70% { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.result__body { padding: 18px; }

.result__lesion {
  display: grid; grid-template-columns: 92px 1fr; gap: 16px; align-items: center;
  margin-bottom: 18px;
}
.result__thumb {
  width: 92px; height: 92px; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--line); flex-shrink: 0;
}
.result__verdict-label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.result__verdict { font-size: 21px; font-weight: 600; letter-spacing: -0.02em; margin-top: 5px; display: flex; align-items: center; gap: 9px; }
.result__verdict .pill {
  font-family: var(--mono); font-size: 11px; font-weight: 500; padding: 3px 8px; border-radius: 6px;
  letter-spacing: 0.04em; white-space: nowrap;
}
.pill--high { background: var(--risk-high-tint); color: var(--risk-high); }
.pill--low { background: var(--risk-low-tint); color: var(--risk-low); }
.result__sub { font-size: 13.5px; color: var(--muted); margin-top: 6px; }

.bars { display: flex; flex-direction: column; gap: 11px; }
.bar__row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; }
.bar__name { font-size: 13.5px; color: var(--ink-2); }
.bar__name.is-top { font-weight: 600; color: var(--ink); }
.bar__pct { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.bar__track { grid-column: 1 / -1; height: 6px; background: var(--bg-2); border-radius: 999px; overflow: hidden; }
.bar__fill { height: 100%; width: 0; border-radius: 999px; background: var(--accent); transition: width 1s cubic-bezier(.2,.7,.2,1); }
.bar__fill.high { background: var(--risk-high); }
.bar__fill.muted { background: var(--line-2); }

/* ---------- DEMO uploader ---------- */
.demo__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 3vw, 40px); align-items: stretch; }
@media (max-width: 820px) { .demo__grid { grid-template-columns: 1fr; } }

.drop {
  background: var(--surface);
  border: 1.5px dashed var(--line-2);
  border-radius: var(--radius);
  padding: 36px 28px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  gap: 6px; min-height: 320px;
  transition: border-color .18s ease, background .18s ease;
  cursor: pointer; position: relative;
}
.drop:hover, .drop.dragover { border-color: var(--accent); background: var(--accent-tint); }
.drop__icon { width: 52px; height: 52px; border-radius: 13px; background: var(--bg-2); display: grid; place-items: center; color: var(--accent); margin-bottom: 12px; }
.drop.dragover .drop__icon { background: #fff; }
.drop__title { font-weight: 600; font-size: 17px; }
.drop__hint { font-size: 14px; color: var(--muted); }
.drop__meta { font-family: var(--mono); font-size: 11.5px; color: var(--faint); margin-top: 10px; letter-spacing: 0.03em; }
.drop input[type=file] { display: none; }

.demo__panel { display: flex; flex-direction: column; min-height: 320px; }
.demo__placeholder {
  flex: 1; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center;
  color: var(--muted); padding: 28px;
}
.demo__placeholder .ring { width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; color: var(--faint); }

/* analyzing state */
.analyzing { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; flex: 1; text-align: center; padding: 28px; }
.scanthumb { width: 130px; height: 130px; border-radius: 16px; overflow: hidden; position: relative; border: 1px solid var(--line); }
.scanthumb img { width: 100%; height: 100%; object-fit: cover; }
.scanthumb::after {
  content: ""; position: absolute; left: 0; right: 0; height: 34%;
  background: linear-gradient(180deg, transparent, color-mix(in oklab, var(--accent) 55%, transparent), transparent);
  animation: scanmove 1.5s ease-in-out infinite;
}
@keyframes scanmove { 0%,100% { top: -34%; } 50% { top: 100%; } }
.analyzing__label { font-family: var(--mono); font-size: 13px; color: var(--ink-2); }
.analyzing__step { font-size: 13px; color: var(--muted); min-height: 1.2em; }
.miniprog { width: 180px; height: 4px; background: var(--bg-2); border-radius: 999px; overflow: hidden; }
.miniprog > span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s linear; }

/* ---------- STEPS ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.step { padding: clamp(28px, 3vw, 44px); position: relative; }
.step + .step { border-left: 1px solid var(--line); }
.step__n { font-family: var(--mono); font-size: 13px; color: var(--accent); font-weight: 500; }
.step__icon { margin: 22px 0 18px; width: 44px; height: 44px; border-radius: 11px; background: var(--accent-tint); color: var(--accent-ink); display: grid; place-items: center; }
.step h3 { font-size: 19px; }
.step p { margin-top: 10px; font-size: 15px; color: var(--muted); text-wrap: pretty; }
@media (max-width: 760px) {
  .steps { grid-template-columns: 1fr; }
  .step + .step { border-left: none; border-top: 1px solid var(--line); }
}

/* ---------- CONDITIONS ---------- */
.cond-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 880px) { .cond-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .cond-grid { grid-template-columns: 1fr; } }
.cond {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 18px 18px 16px; display: flex; flex-direction: column; gap: 10px;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.cond:hover { border-color: var(--line-2); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.cond__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cond__abbr { font-family: var(--mono); font-size: 12px; color: var(--faint); letter-spacing: 0.06em; }
.cond__name { font-size: 16px; font-weight: 500; letter-spacing: -0.02em; }
.cond.is-high { border-color: color-mix(in oklab, var(--risk-high) 28%, var(--line)); }
.cond.is-high .cond__name { color: var(--risk-high); }
.cond-note { margin-top: 20px; font-size: 14px; color: var(--muted); display: flex; gap: 9px; align-items: flex-start; }
.cond-note .tag--high { flex-shrink: 0; }

/* ---------- MODEL / under the hood ---------- */
.model__grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: clamp(24px, 3vw, 44px); align-items: start; }
@media (max-width: 900px) { .model__grid { grid-template-columns: 1fr; } }
.spec { border-top: 1px solid var(--line); }
.spec__row { display: grid; grid-template-columns: 1fr auto; gap: 16px; padding: 15px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.spec__k { font-size: 14.5px; color: var(--muted); }
.spec__v { font-family: var(--mono); font-size: 13.5px; color: var(--ink); text-align: right; }

.code {
  background: #16151a; color: #e9e7ef; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-md); font-family: var(--mono);
}
.code__bar { display: flex; align-items: center; gap: 8px; padding: 12px 15px; border-bottom: 1px solid rgba(255,255,255,.08); font-size: 12px; color: #9b99a6; }
.code__bar .d { width: 10px; height: 10px; border-radius: 50%; }
.code__bar .d:nth-child(1){ background:#ff5f57;} .code__bar .d:nth-child(2){ background:#febc2e;} .code__bar .d:nth-child(3){ background:#28c840;}
.code__name { margin-left: 8px; }
.code__view { margin-left: auto; color: #7f7d8a; font-size: 11.5px; }
.code__view:hover { color: #cfcdd6; }
.code pre { margin: 0; padding: 18px 18px 20px; font-size: 12.5px; line-height: 1.7; overflow-x: auto; }
.code .c { color: #6f6d7a; } /* comment */
.code .k { color: #c4b5fd; } /* keyword */
.code .f { color: #93c5fd; } /* func */
.code .n { color: #fca5a5; } /* number/const */
.code .s { color: #86efac; } /* string */
.tech-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }

/* ---------- DERM CTA ---------- */
.derm {
  background: var(--ink); color: var(--bg); border-radius: calc(var(--radius) + 6px);
  padding: clamp(40px, 6vw, 76px); position: relative; overflow: hidden;
}
.derm__inner { position: relative; z-index: 1; max-width: 620px; }
.derm .eyebrow { color: color-mix(in oklab, var(--accent) 70%, white); }
.derm .eyebrow::before { background: color-mix(in oklab, var(--accent) 70%, white); }
.derm h2 { font-size: clamp(28px, 3.6vw, 42px); margin-top: 18px; color: #fff; }
.derm p { margin-top: 18px; font-size: 18px; color: color-mix(in oklab, var(--bg) 72%, transparent); text-wrap: pretty; }
.derm__cta { margin-top: 32px; }
.derm .btn--accent { box-shadow: 0 10px 30px color-mix(in oklab, var(--accent) 40%, transparent); }
.derm__deco {
  position: absolute; right: -80px; top: -80px; width: 360px; height: 360px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, color-mix(in oklab, var(--accent) 60%, transparent), transparent 65%);
  opacity: .5; pointer-events: none;
}

/* ============================================================
   SCAN PAGE
   ============================================================ */
.scan-main { min-height: calc(100vh - 64px); display: flex; flex-direction: column; }
.scan-shell { flex: 1; display: grid; place-items: center; padding-block: clamp(40px, 6vw, 80px); }
.scan-stage { width: 100%; max-width: 760px; }
.scan-stage .eyebrow { justify-content: center; width: 100%; }
.scan-stage__head { text-align: center; margin-bottom: 34px; }
.scan-stage__head h1 { font-size: clamp(30px, 4.2vw, 46px); margin-top: 16px; }
.scan-stage__head p { margin-top: 16px; color: var(--muted); font-size: 17px; max-width: 46ch; margin-inline: auto; text-wrap: pretty; }

.scan-drop { min-height: 380px; }
.scan-steps { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 30px; font-family: var(--mono); font-size: 12px; color: var(--faint); letter-spacing: 0.04em; }
.scan-steps b { color: var(--ink); font-weight: 500; }
.scan-steps .sep { width: 22px; height: 1px; background: var(--line-2); }

.scan-result { max-width: 760px; width: 100%; }
.scan-result__head {
  display: grid; grid-template-columns: 150px 1fr; gap: 24px; align-items: center;
  padding: clamp(22px, 3vw, 30px); border-bottom: 1px solid var(--line);
}
@media (max-width: 560px) { .scan-result__head { grid-template-columns: 1fr; text-align: center; justify-items: center; } }
.scan-result__thumb { width: 150px; height: 150px; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); }
.scan-result__thumb img { width: 100%; height: 100%; object-fit: cover; }
.verdict-banner { display: inline-flex; align-items: center; gap: 9px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; }
.scan-result__verdict { font-size: clamp(26px, 3.4vw, 36px); font-weight: 600; letter-spacing: -0.03em; margin-top: 10px; }
.scan-result__conf { font-size: 14.5px; color: var(--muted); margin-top: 8px; }
.scan-result__body { padding: clamp(22px, 3vw, 30px); }
.scan-result__foot {
  padding: clamp(20px, 3vw, 26px) clamp(22px, 3vw, 30px); border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between;
}
.recommend {
  display: flex; gap: 13px; align-items: flex-start; padding: 16px 18px; border-radius: var(--radius-sm);
  background: var(--bg-2); font-size: 14.5px; color: var(--ink-2); margin-bottom: 22px; text-wrap: pretty;
}
.recommend.is-high { background: var(--risk-high-tint); color: color-mix(in oklab, var(--risk-high) 80%, var(--ink)); }
.recommend svg { flex-shrink: 0; margin-top: 1px; }
.scan-disclaimer { font-family: var(--mono); font-size: 11.5px; color: var(--faint); text-align: center; margin-top: 24px; line-height: 1.6; max-width: 52ch; margin-inline: auto; text-wrap: pretty; }

.fade-swap { animation: fadeUp .5s cubic-bezier(.2,.7,.2,1); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* hero entrance — gated so the visible state is always the base (never stuck hidden) */
@media (prefers-reduced-motion: no-preference) {
  body.is-ready .hero__copy > * { animation: heroIn .7s cubic-bezier(.2,.7,.2,1) both; }
  body.is-ready .hero__copy > *:nth-child(1) { animation-delay: .02s; }
  body.is-ready .hero__copy > *:nth-child(2) { animation-delay: .08s; }
  body.is-ready .hero__copy > *:nth-child(3) { animation-delay: .14s; }
  body.is-ready .hero__copy > *:nth-child(4) { animation-delay: .2s; }
  body.is-ready .hero__copy > *:nth-child(5) { animation-delay: .26s; }
  body.is-ready .hero__visual { animation: heroIn .8s cubic-bezier(.2,.7,.2,1) .14s both; }
  @keyframes heroIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
}
