:root {
  color-scheme: light;
  font-family: Pretendard, SUIT, "Noto Sans KR", system-ui, -apple-system, sans-serif;
  --bg: #f3f3ef;
  --surface: #fbfbf8;
  --surface-2: #eceeea;
  --ink: #171816;
  --muted: #686c66;
  --line: #d3d6cf;
  --line-strong: #aeb3aa;
  --blue: #315cf6;
  --blue-strong: #2448ca;
  --blue-soft: #e8edff;
  --danger: #b32635;
  --success: #17663a;
  --rail: #101c3a;
  --rail-ink: #f5f7ff;
  background: var(--bg);
  color: var(--ink);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1422;
  --surface: #131d2d;
  --surface-2: #1a2638;
  --ink: #f1f5fb;
  --muted: #a3adbb;
  --line: #2a3749;
  --line-strong: #45536a;
  --blue: #6f91ff;
  --blue-strong: #91aaff;
  --blue-soft: #1a2b5c;
  --danger: #ff8c98;
  --success: #74d39a;
  --rail: #0a1020;
  --rail-ink: #f5f7ff;
}

@media (prefers-color-scheme: dark) {
  html[data-theme="system"] {
    color-scheme: dark;
    --bg: #0d1422;
    --surface: #131d2d;
    --surface-2: #1a2638;
    --ink: #f1f5fb;
    --muted: #a3adbb;
    --line: #2a3749;
    --line-strong: #45536a;
    --blue: #6f91ff;
    --blue-strong: #91aaff;
    --blue-soft: #1a2b5c;
    --danger: #ff8c98;
    --success: #74d39a;
    --rail: #0a1020;
  }
}

* { box-sizing: border-box; }
html, body { min-width: 320px; min-height: 100%; margin: 0; background: var(--bg); color: var(--ink); }
body { min-height: 100vh; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, p { margin: 0; }

.site-nav {
  width: min(1240px, calc(100% - 48px));
  min-height: 76px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  border-bottom: 1px solid var(--line);
}
.site-nav.compact { min-height: 64px; }
.site-nav nav { display: flex; align-items: center; gap: 24px; font-size: .78rem; font-weight: 650; }
.site-nav nav a { text-decoration: none; }
.site-nav nav a:hover { color: var(--blue); }
.wordmark { display: inline-flex; align-items: baseline; gap: 7px; color: var(--ink); font-size: .92rem; letter-spacing: -.02em; text-decoration: none; }
.wordmark span { font-weight: 520; }
.wordmark strong { color: var(--blue); font-weight: 800; }
.wordmark.inverse { color: var(--rail-ink); }
.wordmark.inverse strong { color: #88a2ff; }
.nav-button { border: 0; padding: 6px 0; background: transparent; color: var(--muted); font-size: .72rem; font-weight: 650; }
.nav-button:hover { color: var(--blue); }
.nav-cta, .primary-link {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0 17px;
  border: 1px solid var(--blue);
  background: var(--blue);
  color: #fff !important;
  font-size: .78rem;
  font-weight: 720;
  text-decoration: none;
}
.nav-cta:hover, .primary-link:hover { border-color: var(--blue-strong); background: var(--blue-strong); }

.hero {
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
  padding: clamp(64px, 9vw, 126px) 0 clamp(70px, 10vw, 130px);
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(480px, 1.1fr);
  align-items: center;
  gap: clamp(54px, 8vw, 112px);
}
.eyebrow { color: var(--blue); font-size: .67rem; font-weight: 800; letter-spacing: .13em; }
.hero h1 { margin-top: 18px; font-size: clamp(2.75rem, 6vw, 5.45rem); line-height: .98; letter-spacing: -.075em; font-weight: 760; }
.lede { max-width: 610px; margin-top: 30px; color: var(--muted); font-size: clamp(.94rem, 1.5vw, 1.08rem); line-height: 1.75; word-break: keep-all; }
.hero-actions { display: flex; align-items: center; gap: 25px; margin-top: 34px; }
.primary-link { min-height: 48px; padding-inline: 21px; }
.text-link { color: var(--ink); font-size: .82rem; font-weight: 700; text-underline-offset: 5px; }
.text-link:hover { color: var(--blue); }
.trust-note { margin-top: 19px; color: var(--muted); font-size: .68rem; letter-spacing: .015em; }

.product-frame { border: 1px solid var(--line-strong); background: var(--surface); box-shadow: 18px 22px 0 color-mix(in srgb, var(--blue) 9%, transparent); }
.frame-bar { min-height: 48px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .67rem; font-weight: 680; }
.frame-bar time { color: var(--ink); font-variant-numeric: tabular-nums; }
.focus-card { min-height: 210px; padding: clamp(25px, 4vw, 38px); border-bottom: 1px solid var(--line-strong); }
.focus-card > div:first-child { color: var(--blue); font-size: .7rem; font-weight: 760; }
.focus-card small { float: right; color: var(--muted); font-weight: 600; }
.status-dot { display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: var(--blue); }
.focus-card h2 { margin-top: 30px; font-size: clamp(1.75rem, 3.5vw, 3.15rem); line-height: 1; letter-spacing: -.055em; }
.focus-card p { margin-top: 12px; color: var(--muted); font-size: .77rem; }
.preview-progress { height: 3px; margin-top: 31px; background: var(--surface-2); }
.preview-progress span { display: block; width: 38%; height: 100%; background: var(--blue); }
.preview-grid { display: grid; grid-template-columns: .8fr 1.2fr; }
.preview-grid > div { min-height: 164px; padding: 24px; }
.preview-grid > div + div { border-left: 1px solid var(--line); }
.preview-grid span { color: var(--muted); font-size: .65rem; font-weight: 700; }
.next-preview strong { display: block; margin-top: 27px; font-size: 1rem; }
.next-preview small { display: block; margin-top: 8px; color: var(--blue); font-size: .68rem; font-weight: 700; }
.check-preview { display: flex; flex-direction: column; gap: 11px; }
.check-preview > span { margin-bottom: 6px; }
.check-preview label { display: flex; align-items: center; gap: 9px; font-size: .72rem; }
.check-preview i { width: 17px; height: 17px; display: grid; place-items: center; border: 1px solid var(--line-strong); color: #fff; font-size: .62rem; font-style: normal; }
.check-preview label:first-of-type i { border-color: var(--blue); background: var(--blue); }

.principles { width: min(1240px, calc(100% - 48px)); margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); }
.principles article { min-height: 230px; padding: 32px 32px 38px 0; }
.principles article + article { padding-left: 32px; border-left: 1px solid var(--line); }
.principles span { color: var(--blue); font-size: .64rem; font-variant-numeric: tabular-nums; font-weight: 760; }
.principles h2 { margin-top: 44px; font-size: 1.08rem; letter-spacing: -.035em; }
.principles p { max-width: 340px; margin-top: 12px; color: var(--muted); font-size: .77rem; line-height: 1.65; word-break: keep-all; }
.site-footer { width: min(1240px, calc(100% - 48px)); min-height: 100px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: .65rem; }

.auth-page { display: grid; grid-template-columns: minmax(320px, .72fr) minmax(520px, 1.28fr); }
.auth-rail { position: relative; min-height: 100vh; padding: 40px clamp(34px, 5vw, 72px); display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; background: var(--rail); color: var(--rail-ink); }
.auth-rail::after { position: absolute; right: -150px; bottom: -190px; width: 440px; height: 440px; border: 1px solid rgba(145, 170, 255, .35); border-radius: 50%; box-shadow: 0 0 0 65px rgba(111, 145, 255, .04), 0 0 0 130px rgba(111, 145, 255, .035); content: ""; }
.rail-copy { position: relative; z-index: 1; max-width: 480px; }
.rail-copy h2 { margin-top: 20px; font-size: clamp(2.1rem, 4vw, 4.15rem); line-height: 1.02; letter-spacing: -.065em; }
.rail-copy > p:last-child { max-width: 430px; margin-top: 25px; color: #aebad2; font-size: .86rem; line-height: 1.75; word-break: keep-all; }
.rail-foot { position: relative; z-index: 1; color: #77849d; font-size: .62rem; letter-spacing: .06em; }
.auth-main { min-height: 100vh; padding: 30px 7vw 64px; display: flex; flex-direction: column; }
.auth-topline { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: .72rem; }
.auth-topline a { text-decoration: none; }
.auth-panel { width: min(430px, 100%); margin: auto; padding-block: 45px; }
.auth-panel h1 { margin-top: 13px; font-size: clamp(2rem, 4vw, 3.35rem); line-height: 1.05; letter-spacing: -.06em; }
.auth-copy { margin-top: 15px; color: var(--muted); font-size: .82rem; line-height: 1.65; }
.passkey-button { width: 100%; min-height: 72px; margin-top: 31px; padding: 12px 15px; display: flex; align-items: center; gap: 14px; border: 1px solid var(--ink); background: var(--ink); color: var(--bg); text-align: left; }
.passkey-button:hover { border-color: var(--blue); background: var(--blue); color: #fff; }
.passkey-mark { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid currentColor; font-size: 1.2rem; }
.passkey-button strong, .passkey-button small { display: block; }
.passkey-button strong { font-size: .81rem; }
.passkey-button small { margin-top: 5px; opacity: .65; font-size: .62rem; font-weight: 500; }
.divider { margin: 22px 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; color: var(--muted); font-size: .61rem; }
.divider::before, .divider::after { height: 1px; background: var(--line); content: ""; }
.auth-form { display: grid; gap: 15px; }
.auth-form label { display: grid; gap: 7px; color: var(--muted); font-size: .68rem; font-weight: 700; }
.auth-form input { width: 100%; min-height: 47px; border: 1px solid var(--line-strong); border-radius: 0; padding: 0 13px; background: var(--surface); color: var(--ink); outline: none; }
.auth-form input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 17%, transparent); }
.turnstile-slot { min-height: 0; overflow: hidden; }
.turnstile-slot:not(:empty) { min-height: 65px; }
.submit-button, .secondary-button { min-height: 47px; border: 1px solid var(--blue); padding: 0 18px; background: var(--blue); color: #fff; font-size: .78rem; font-weight: 740; }
.submit-button:hover { border-color: var(--blue-strong); background: var(--blue-strong); }
.submit-button:disabled, .passkey-button:disabled { cursor: wait; opacity: .58; }
.secondary-button { border-color: var(--line-strong); background: transparent; color: var(--ink); }
.secondary-button:hover { border-color: var(--ink); }
.form-status { min-height: 1.4em; margin-top: 15px; color: var(--muted); font-size: .7rem; line-height: 1.5; }
.form-status[data-tone="error"] { color: var(--danger); }
.form-status[data-tone="success"] { color: var(--success); }
.mode-copy { margin-top: 10px; font-size: .73rem; font-weight: 680; }
.mode-copy a { color: var(--blue); text-underline-offset: 4px; }
.recovery-note { margin-top: 24px; padding-top: 17px; border-top: 1px solid var(--line); color: var(--muted); font-size: .64rem; line-height: 1.6; }
.post-signup { padding: 28px 0 5px; text-align: center; }
.success-mark { width: 46px; height: 46px; margin: 0 auto 18px; display: grid; place-items: center; border: 1px solid var(--success); border-radius: 50%; color: var(--success); }
.post-signup h2 { font-size: 1.25rem; }
.post-signup p { margin: 11px 0 23px; color: var(--muted); font-size: .76rem; line-height: 1.6; }
.post-signup .submit-button { width: 100%; }
.text-button { margin-top: 12px; border: 0; background: transparent; color: var(--muted); font-size: .7rem; text-decoration: underline; text-underline-offset: 4px; }

.connect-page { min-height: 100vh; }
.connect-main { min-height: calc(100vh - 65px); padding: 50px 24px 80px; display: grid; place-items: center; }
.connect-panel { width: min(590px, 100%); border-top: 2px solid var(--blue); padding: 40px 0 0; }
.connection-glyph { margin-bottom: 32px; display: flex; align-items: center; gap: 13px; }
.connection-glyph span { width: 43px; height: 43px; display: grid; place-items: center; border: 1px solid var(--line-strong); background: var(--surface); font-size: .64rem; font-weight: 800; }
.connection-glyph i { color: var(--blue); font-size: .9rem; font-style: normal; }
.connect-panel h1 { margin-top: 13px; font-size: clamp(2rem, 5vw, 3.7rem); line-height: 1.06; letter-spacing: -.065em; }
.connect-copy { max-width: 530px; margin-top: 18px; color: var(--muted); font-size: .8rem; line-height: 1.7; word-break: keep-all; }
.account-row { margin-top: 35px; padding: 17px 0; display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: .72rem; }
.account-row span, .scope-box > span { color: var(--muted); }
.account-row strong { overflow: hidden; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.scope-box { padding: 22px 0; border-bottom: 1px solid var(--line); font-size: .72rem; }
.scope-box ul { margin: 14px 0 0; padding: 0; display: grid; gap: 9px; list-style: none; }
.scope-box li::before { margin-right: 9px; color: var(--blue); content: "✓"; font-weight: 800; }
.security-copy { margin-top: 18px; color: var(--muted); font-size: .65rem; line-height: 1.6; }
.connect-actions { margin-top: 28px; display: grid; grid-template-columns: .45fr 1fr; gap: 9px; }

.account-page { min-height: 100vh; }
.account-main { width: min(1050px, calc(100% - 48px)); margin: 0 auto; padding: clamp(54px, 8vw, 100px) 0 90px; }
.account-heading { max-width: 620px; }
.account-heading h1 { margin-top: 14px; font-size: clamp(2.5rem, 6vw, 5rem); line-height: 1; letter-spacing: -.07em; }
.account-heading > p:last-child { margin-top: 18px; color: var(--muted); font-size: .86rem; line-height: 1.7; }
.account-grid { margin-top: 55px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line-strong); border-left: 1px solid var(--line-strong); }
.account-card { min-height: 280px; padding: 30px; border-right: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); }
.account-number { color: var(--blue); font-size: .62rem; font-variant-numeric: tabular-nums; font-weight: 780; }
.account-card h2 { margin-top: 28px; font-size: 1.18rem; letter-spacing: -.035em; }
.account-card > p { max-width: 440px; margin: 12px 0 23px; color: var(--muted); font-size: .73rem; line-height: 1.65; }
.profile-list { margin: 22px 0 0; display: grid; }
.profile-list div { padding: 11px 0; display: grid; grid-template-columns: 95px minmax(0, 1fr); gap: 15px; border-top: 1px solid var(--line); font-size: .72rem; }
.profile-list dt { color: var(--muted); }
.profile-list dd { margin: 0; overflow: hidden; font-weight: 690; text-overflow: ellipsis; white-space: nowrap; }
.credential-list { min-height: 46px; margin-bottom: 15px; display: grid; }
.credential-row { min-height: 42px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; border-top: 1px solid var(--line); font-size: .68rem; }
.credential-row:last-child { border-bottom: 1px solid var(--line); }
.credential-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.credential-row button { border: 0; padding: 6px; background: transparent; color: var(--danger); font-size: .64rem; text-decoration: underline; text-underline-offset: 3px; }
.credential-empty { padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); font-size: .68rem; }
.account-card .submit-button, .account-card .secondary-button { width: 100%; }
.danger-button { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); color: var(--danger); }
.danger-button:hover { border-color: var(--danger); }
.account-main > .form-status, .account-main > .recovery-note { max-width: 700px; }

button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 38%, transparent); outline-offset: 3px; }
[hidden] { display: none !important; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .product-frame { max-width: 680px; }
  .principles { grid-template-columns: 1fr; }
  .principles article { min-height: auto; padding: 28px 0; }
  .principles article + article { padding-left: 0; border-top: 1px solid var(--line); border-left: 0; }
  .principles h2 { margin-top: 22px; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-rail { display: none; }
  .auth-main { padding-inline: max(24px, 8vw); }
}

@media (max-width: 640px) {
  .site-nav { width: min(100% - 32px, 1240px); min-height: 64px; }
  .site-nav nav { gap: 13px; }
  .site-nav nav > a:first-child, .site-nav .nav-button { display: none; }
  .hero { width: min(100% - 32px, 1240px); padding-top: 54px; gap: 50px; }
  .hero h1 { font-size: clamp(2.65rem, 14vw, 4.2rem); }
  .hero-actions { align-items: flex-start; flex-direction: column; gap: 18px; }
  .product-frame { box-shadow: 9px 11px 0 color-mix(in srgb, var(--blue) 9%, transparent); }
  .focus-card { min-height: 190px; }
  .preview-grid { grid-template-columns: 1fr; }
  .preview-grid > div + div { border-top: 1px solid var(--line); border-left: 0; }
  .principles, .site-footer { width: min(100% - 32px, 1240px); }
  .site-footer { align-items: flex-start; flex-direction: column; justify-content: center; gap: 7px; }
  .auth-main { padding: 22px 20px 45px; }
  .auth-panel { padding-top: 55px; }
  .connect-main { padding-inline: 20px; place-items: start center; }
  .connect-actions { grid-template-columns: 1fr; }
  .connect-actions .secondary-button { order: 2; }
  .account-main { width: min(100% - 32px, 1050px); padding-top: 50px; }
  .account-grid { grid-template-columns: 1fr; margin-top: 40px; }
  .account-card { min-height: auto; padding: 25px 22px 29px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
