/* ================================================================== *
 *  Nailing — nail measurement
 *  Design system (B4U): White + Black base, Red #F80000 as POINT only.
 *  English-first display type (Inter) + short Korean subcopy (Pretendard).
 * ================================================================== */
@font-face {
  font-family: 'Pretendard Variable'; font-weight: 45 920; font-style: normal; font-display: swap;
  src: url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/woff2/PretendardVariable.woff2') format('woff2-variations');
}
:root {
  color-scheme: light;
  --white: #ffffff; --black: #000000; --ink: #0b0b0c; --body: #37373c; --deep: #060607;
  --red: #f80000; --gray-50: #f4f4f5; --gray-100: #ececed; --line: #e3e3e5; --line-dk: #262629;
  --muted: #5b5b62; --muted-dk: #b2b2b8; --faint: #97979d;
  --font-sans: 'Pretendard Variable', Pretendard, system-ui, -apple-system, 'Apple SD Gothic Neo', sans-serif;
  --font-display: 'Inter', 'Pretendard Variable', system-ui, sans-serif;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1); --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--white); color: var(--ink); font-family: var(--font-sans); font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; word-break: keep-all; overflow-wrap: anywhere; }
body { min-height: 100dvh; }
::selection { background: var(--red); color: #fff; }
button { font: inherit; color: inherit; }

[hidden] { display: none !important; }
.view { min-height: 100dvh; display: flex; flex-direction: column; padding: calc(24px + var(--sat)) 24px calc(24px + var(--sab)); max-width: 520px; margin: 0 auto; }
.spacer { flex: 1 1 24px; }

/* ---- typography ---- */
.font-display { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.03em; line-height: 0.98; }
.eyebrow { display: inline-flex; align-items: center; gap: 11px; font-family: var(--font-display); font-size: 12px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--red); }
.eyebrow::before { content: ''; width: 24px; height: 2px; background: currentColor; }
.eyebrow--muted { color: var(--muted); }
.display-xl { font-family: var(--font-display); font-weight: 680; letter-spacing: -0.038em; line-height: 0.96; font-size: clamp(40px, 11.5vw, 56px); margin: 0; }
.display-lg { font-family: var(--font-display); font-weight: 640; letter-spacing: -0.035em; line-height: 1; font-size: clamp(30px, 8vw, 38px); margin: 0; }
.lead-kr { font-size: 15.5px; line-height: 1.85; color: var(--body); letter-spacing: -0.005em; margin: 0; }

/* ---- buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-family: var(--font-display); font-size: 15px; font-weight: 600; letter-spacing: -0.01em; padding: 17px 30px; border-radius: 999px; border: 1px solid var(--ink); color: var(--ink); background: transparent; text-decoration: none; cursor: pointer; width: 100%; -webkit-tap-highlight-color: transparent; transition: background .4s var(--ease-out-quart), color .4s var(--ease-out-quart), border-color .4s var(--ease-out-quart); }
.btn .arw { transition: transform .4s var(--ease-out-quart); font-style: normal; }
.btn:hover .arw { transform: translateX(4px); }
.btn--primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn--primary:hover, .btn--primary:active { background: var(--red); border-color: var(--red); }
.btn--ghost:hover, .btn--ghost:active { background: var(--red); border-color: var(--red); color: #fff; }
.link-arrow { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 600; font-size: 14px; color: inherit; text-decoration: none; cursor: pointer; }
.link-arrow .arw { color: var(--red); transition: transform .4s var(--ease-out-quart); font-style: normal; }
.link-arrow:hover .arw { transform: translateX(5px); }

/* ---- card ---- */
.card { position: relative; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 24px; overflow: hidden; }
.card::before { content: ''; position: absolute; left: 0; top: 0; height: 3px; width: 100%; background: var(--red); transform: scaleX(0); transform-origin: left; transition: transform .55s var(--ease-out-expo); }
.card.is-point::before { transform: scaleX(1); }
.card__no { display: block; font-family: var(--font-display); font-size: 13px; font-weight: 700; letter-spacing: 0.06em; color: var(--red); padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.card__title { font-family: var(--font-display); font-weight: 600; font-size: 20px; line-height: 1.12; letter-spacing: -0.025em; margin: 18px 0 8px; }
.card__kr { font-size: 14.5px; line-height: 1.62; color: var(--muted); margin: 0; }

/* ---- home ---- */
.hdr { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.hdr__logo img { height: 20px; display: block; }
.hdr__tag { font-family: var(--font-display); font-size: 11px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--faint); }
.hdr--big { height: 64px; }
.hdr--big .hdr__logo img { height: 34px; }
.hero { margin-top: 28px; }
.hero__kr { margin: 0; font-family: var(--font-sans); font-weight: 600; font-size: clamp(22px, 6.2vw, 26px); line-height: 1.45; letter-spacing: -0.02em; color: var(--ink); }
.hero__kr em { font-style: normal; color: var(--red); }
.howto { margin: 36px 0 0; display: flex; flex-direction: column; gap: 14px; }
.howto svg { width: 100%; height: auto; display: block; }
.steps3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.steps3 > span { display: flex; flex-direction: column; gap: 10px; padding: 16px 14px; border-left: 1px solid var(--line); }
.steps3 > span:first-child { border-left: 0; padding-left: 0; }
.steps3 b { font-family: var(--font-display); font-size: 13px; font-weight: 800; letter-spacing: .12em; color: var(--red); }
.steps3 > span > span { font-size: 17px; font-weight: 800; line-height: 1.35; letter-spacing: -0.02em; color: var(--ink); }
.cta { display: flex; flex-direction: column; align-items: center; gap: 16px; margin-top: 32px; }
.link-upload input { display: none; }

/* ---- capture ---- */
.view-capture { background: var(--deep); color: #fff; padding: 0; max-width: none; position: fixed; inset: 0; overflow: hidden; }
.cam-stage { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: var(--deep); }
.cam-frame { position: relative; width: 100%; height: 100%; }
.cam-frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: var(--deep); }
.guide { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.cam-top { position: absolute; left: 0; right: 0; top: calc(14px + var(--sat)); display: flex; justify-content: space-between; align-items: center; padding: 0 20px; }
.icon-btn { width: 40px; height: 40px; border-radius: 999px; border: 1px solid rgba(255,255,255,.35); background: rgba(0,0,0,.35); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; backdrop-filter: blur(8px); }
.cam-label { font-family: var(--font-display); font-size: 11px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: rgba(255,255,255,.8); }
.cam-label b { color: var(--red); }
.cam-tip { position: absolute; left: 20px; right: 20px; bottom: calc(160px + var(--sab)); background: rgba(6,6,7,.72); border: 1px solid var(--line-dk); border-radius: 8px; padding: 14px 16px; backdrop-filter: blur(10px); }
.cam-tip-title { font-family: var(--font-display); font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.cam-tip-sub { margin-top: 5px; font-size: 12.5px; line-height: 1.6; color: var(--muted-dk); }
.cam-bottom { position: absolute; left: 0; right: 0; bottom: calc(32px + var(--sab)); display: flex; flex-direction: column; align-items: center; gap: 14px; }
.shutter { width: 78px; height: 78px; border-radius: 999px; border: 3px solid #fff; background: transparent; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.shutter span { width: 62px; height: 62px; border-radius: 999px; background: #fff; transition: transform .15s var(--ease-out-quart), background .15s; }
.shutter:active span { transform: scale(.86); background: var(--red); }
.cam-hint { font-family: var(--font-display); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-dk); }
.cam-error { position: absolute; inset: 0; background: rgba(6,6,7,.96); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 32px; text-align: center; line-height: 1.6; color: var(--muted-dk); }
.cam-error .btn { width: auto; border-color: rgba(255,255,255,.4); color: #fff; }
.cam-error .btn input { display: none; }

/* ---- processing ---- */
.view-processing { align-items: center; justify-content: center; gap: 28px; }
.proc-thumb { width: 168px; height: 210px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.proc-text { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.proc-title { font-family: var(--font-display); font-weight: 640; letter-spacing: -0.03em; font-size: 24px; line-height: 1.05; }
.proc-sub { font-size: 13.5px; color: var(--muted); }
.proc-bar { width: 168px; height: 2px; background: var(--line); overflow: hidden; }
.proc-bar i { display: block; width: 40%; height: 100%; background: var(--red); animation: slide 1.2s var(--ease-out-quart) infinite; }
@keyframes slide { 0% { transform: translateX(-100%);} 100% { transform: translateX(400%);} }

/* ---- result ---- */
.result-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; }
.badge { flex-shrink: 0; font-family: var(--font-display); font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; border: 1px solid var(--ink); border-radius: 999px; padding: 7px 12px; color: var(--ink); }
.badge.medium { border-color: var(--line); color: var(--muted); }
.badge.low { border-color: var(--red); color: var(--red); }
.result-photo { margin-top: 22px; border-radius: 8px; overflow: hidden; background: var(--deep); position: relative; border: 1px solid var(--line); }
.result-photo canvas { display: block; width: 100%; height: auto; }
.result-photo-cap { position: absolute; left: 14px; bottom: 10px; font-family: var(--font-display); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.8); text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.stat { margin-top: 28px; padding: 0 0 22px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; }
.num { display: flex; align-items: baseline; gap: 8px; margin-top: 14px; }
.num span { font-family: var(--font-display); font-weight: 700; font-size: 84px; line-height: .92; letter-spacing: -0.05em; }
.num small { font-family: var(--font-display); font-size: 18px; font-weight: 600; color: var(--muted); }
.stat .card__kr { margin-top: 10px; font-size: 13.5px; }
.warnings { margin-top: 16px; background: var(--gray-50); border-radius: 8px; padding: 14px 16px; font-size: 13.5px; line-height: 1.6; color: var(--body); display: flex; flex-direction: column; gap: 6px; }
.warnings.low { border: 1px solid var(--red); background: #fff; }
.details { margin-top: 16px; gap: 0; padding: 20px 20px 8px; }
.details .card__no { padding-bottom: 12px; margin-bottom: 4px; }
.kv { display: flex; justify-content: space-between; gap: 16px; font-size: 13.5px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--muted); }
.kv b { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; text-align: right; }
.actions { display: flex; gap: 10px; margin-top: 22px; }
.actions .btn { padding: 15px 20px; }

/* ---- error ---- */
.view-error { align-items: center; justify-content: center; text-align: center; gap: 14px; }
.view-error .eyebrow { justify-content: center; }
.view-error p { margin: 0; color: var(--muted); line-height: 1.7; font-size: 14.5px; max-width: 32ch; }
.view-error .actions { width: 100%; }

@media (min-width: 600px) { .view-capture .cam-frame { max-width: 520px; margin: 0 auto; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; } }
