/* PlasmidDB sign-in · bright warm tech (2026-11-03) */
:root {
  --bg: #fffaf2;
  --bg-2: #fbf1e1;
  --ink: #14213d;
  --ink-2: #33405c;
  --mute: #6a7389;
  --soft: #a3aabb;
  --teal: #0e8a7c;
  --teal-2: #14a895;
  --teal-soft: #e3f4f0;
  --gold: #d98d14;
  --gold-2: #f0b13a;
  --coral: #e2583a;
  --line: rgba(20, 33, 61, .10);
  --line-2: rgba(20, 33, 61, .16);
  --card: rgba(255, 255, 255, .80);
  --err: #b8412d;
  --err-soft: #fdece7;
  --ff-display: 'Fraunces', 'Source Serif 4', 'Songti SC', 'Noto Serif CJK SC', serif;
  --ff-body: 'Plus Jakarta Sans', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans CJK SC', system-ui, sans-serif;
  --ff-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Consolas, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--ff-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--gold); }
:focus-visible { outline: 2px solid var(--teal-2); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ── background layers ── */
#scene { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100lvh; display: block; z-index: 0; }
.veil {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(120% 80% at 100% 50%, rgba(255,250,242,.0) 40%, rgba(255,250,242,.0) 100%),
    linear-gradient(180deg, rgba(255,250,242,0) 0%, rgba(255,250,242,0) 70%, rgba(255,250,242,.55) 100%);
}
.fallback { display: none; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(60% 50% at 30% 42%, rgba(20,168,149,.16), transparent 70%),
    radial-gradient(50% 40% at 75% 70%, rgba(240,177,58,.18), transparent 70%),
    linear-gradient(160deg, #fffdf8 0%, #fff6e8 55%, #fdeedd 100%);
}
.fb-ring { position: absolute; width: min(44vmin, 380px); aspect-ratio: 1; border-radius: 50%;
  left: var(--fb-x, 30%); top: var(--fb-y, 40%); transform: translate(-50%, -50%);
  background: conic-gradient(from 20deg, var(--gold-2) 0 26deg, transparent 26deg 40deg, var(--teal-2) 40deg 150deg,
    transparent 150deg 170deg, var(--coral) 170deg 250deg, transparent 250deg 268deg, #3b7dd8 268deg 318deg, transparent 318deg 360deg);
  -webkit-mask: radial-gradient(circle, transparent 60%, #000 61%, #000 68%, transparent 69%);
          mask: radial-gradient(circle, transparent 60%, #000 61%, #000 68%, transparent 69%);
  opacity: .85;
}
body.no-webgl #scene { display: none; }
body.no-webgl .fallback { display: block; }
body.no-webgl .hud { display: none; }

/* ── layout ── */
.stage {
  position: relative; z-index: 2;
  min-height: 100vh; min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 460px);
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  grid-template-areas: "brand panel" "anchor panel" "hero panel" "foot panel";
  column-gap: clamp(1.5rem, 4vw, 4.5rem);
  padding: clamp(1.25rem, 2.6vw, 2.4rem) clamp(1.25rem, 4vw, 4rem);
  padding-left: max(clamp(1.25rem, 4vw, 4rem), env(safe-area-inset-left));
  padding-right: max(clamp(1.25rem, 4vw, 4rem), env(safe-area-inset-right));
}
.brand { grid-area: brand; }
.anchor { grid-area: anchor; position: relative; min-height: 260px; }
.hero { grid-area: hero; max-width: 640px; padding-bottom: 1.2rem; }
.panel { grid-area: panel; display: flex; align-items: center; justify-content: center; padding: 1rem 0; }
.foot { grid-area: foot; }

.identity { display: inline-flex; align-items: center; gap: .75rem; color: var(--ink); font-family: var(--ff-display); font-weight: 600; font-size: 1.12rem; }
.identity:hover { color: var(--ink); }
.identity .mark {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--teal);
  background: linear-gradient(140deg, #ffffff 0%, #fdf2de 100%);
  border: 1px solid rgba(217,141,20,.35);
  box-shadow: 0 8px 20px -10px rgba(14,138,124,.45), inset 0 0 0 1px rgba(255,255,255,.7);
}
.id-text small { display: block; font-family: var(--ff-mono); font-weight: 500; font-size: .6rem; letter-spacing: .22em; text-transform: uppercase; color: var(--mute); margin-top: 2px; }

.hud { position: absolute; font-family: var(--ff-mono); font-size: .64rem; letter-spacing: .18em; color: var(--mute); text-transform: uppercase; white-space: nowrap; }
.hud-tl { left: 0; bottom: .4rem; display: inline-flex; align-items: center; gap: .5rem; }
.hud-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--teal-2); box-shadow: 0 0 0 3px rgba(20,168,149,.18); animation: pulse 2.2s ease-in-out infinite; }
#hud-bp { color: var(--ink-2); font-variant-numeric: tabular-nums; }

.eyebrow { margin: 0 0 .6rem; font-family: var(--ff-mono); font-size: .66rem; font-weight: 500; letter-spacing: .26em; text-transform: uppercase; color: var(--teal); }
.hero h1 { margin: 0; font-family: var(--ff-display); font-weight: 500; font-size: clamp(2rem, 3.6vw, 3.2rem); line-height: 1.12; letter-spacing: -.01em; color: var(--ink); }
.hero h1 em { font-style: normal; background: linear-gradient(110deg, var(--teal) 0%, var(--teal-2) 45%, var(--gold) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lede { margin: .55rem 0 0; color: var(--ink-2); font-family: var(--ff-display); font-style: italic; font-size: clamp(.98rem, 1.2vw, 1.12rem); }
.stats { display: flex; flex-wrap: wrap; gap: .4rem 2.2rem; margin: 1.25rem 0 0; padding-top: 1rem; border-top: 1px solid var(--line); }
.stats div { min-width: 0; }
.stats dt { font-family: var(--ff-mono); font-size: .62rem; letter-spacing: .2em; text-transform: uppercase; color: var(--mute); }
.stats dd { margin: 0; font-family: var(--ff-display); font-weight: 600; font-size: 1.5rem; color: var(--ink); font-variant-numeric: tabular-nums; }

.foot { display: flex; gap: 1.2rem; justify-content: space-between; align-items: center; font-size: .78rem; color: var(--mute); padding-top: .8rem; border-top: 1px dashed var(--line); }
.mono { font-family: var(--ff-mono); letter-spacing: .16em; text-transform: uppercase; font-size: .62rem; color: var(--soft); }

/* ── card ── */
.card {
  position: relative; width: 100%; max-width: 440px;
  padding: 2.1rem 2.1rem 1.5rem;
  background: var(--card);
  -webkit-backdrop-filter: blur(16px) saturate(1.2); backdrop-filter: blur(16px) saturate(1.2);
  border: 1px solid var(--line-2); border-radius: 22px;
  box-shadow: 0 40px 90px -40px rgba(80, 52, 10, .28), 0 18px 36px -22px rgba(20, 33, 61, .18), inset 0 1px 0 rgba(255,255,255,.9);
  animation: rise .8s .1s cubic-bezier(.2,.8,.2,1) both;
}
.card::before { content: ""; position: absolute; left: 22px; right: 22px; top: -1px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, transparent, var(--teal-2) 25%, var(--gold-2) 75%, transparent); }
.br { position: absolute; width: 12px; height: 12px; border: 1.5px solid var(--teal-2); opacity: .55; }
.br-tl { top: 9px; left: 9px; border-right: 0; border-bottom: 0; }
.br-tr { top: 9px; right: 9px; border-left: 0; border-bottom: 0; }
.br-bl { bottom: 9px; left: 9px; border-right: 0; border-top: 0; }
.br-br { bottom: 9px; right: 9px; border-left: 0; border-top: 0; }
.crumb { display: flex; align-items: center; gap: .6rem; margin: 0 0 .55rem; font-family: var(--ff-mono); font-size: .66rem; letter-spacing: .2em; color: var(--mute); }
.crumb .line { width: 26px; height: 1px; background: linear-gradient(90deg, var(--teal-2), transparent); }
.card h2 { margin: 0 0 1.1rem; font-family: var(--ff-display); font-weight: 500; font-size: 1.75rem; letter-spacing: -.01em; }
.note { margin: 0 0 1rem; padding: .6rem .8rem; border-radius: 10px; background: var(--teal-soft); color: var(--teal); font-size: .85rem; }

.tabs { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 13px; background: rgba(20,33,61,.05); border: 1px solid var(--line); margin-bottom: 1.25rem; }
.tabs button {
  position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 42px; padding: .4rem .5rem; border: 0; border-radius: 10px; background: transparent; cursor: pointer;
  font: 600 .84rem/1.2 var(--ff-body); color: var(--mute); transition: color .2s;
}
.tabs button[aria-selected="true"] { color: var(--ink); }
.tabs button .bi { font-size: 1rem; }
.tabs button[aria-selected="true"] .bi { color: var(--teal); }
.tab-ink { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 10px; background: #fff; box-shadow: 0 6px 16px -8px rgba(20,33,61,.3), 0 0 0 1px rgba(20,33,61,.06); transition: transform .35s cubic-bezier(.2,.8,.2,1); }
body.tab-qr .tab-ink { transform: translateX(100%); }

.field { margin-bottom: 1rem; }
.field label { display: block; margin-bottom: .4rem; font-size: .8rem; font-weight: 600; color: var(--ink-2); }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap input {
  width: 100%; min-height: 48px; padding: .75rem 2.8rem .75rem 2.6rem;
  font: 400 .98rem var(--ff-body); color: var(--ink);
  background: #fff; border: 1px solid var(--line-2); border-radius: 12px;
  transition: border-color .2s, box-shadow .2s; caret-color: var(--teal);
}
.input-wrap input::placeholder { color: var(--soft); }
.input-wrap input:focus { outline: none; border-color: var(--teal-2); box-shadow: 0 0 0 4px rgba(20,168,149,.14); }
.leading { position: absolute; left: 13px; color: var(--soft); pointer-events: none; transition: color .2s; }
.input-wrap:focus-within .leading { color: var(--teal); }
.trailing { position: absolute; right: 5px; width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 9px; background: transparent; color: var(--soft); cursor: pointer; }
.trailing:hover { color: var(--teal); background: var(--teal-soft); }
.err { display: flex; gap: .55rem; align-items: flex-start; margin-bottom: 1rem; padding: .65rem .8rem; border-radius: 10px; border: 1px solid rgba(184,65,45,.25); background: var(--err-soft); color: var(--err); font-size: .86rem; animation: shake .45s both; }
.err .bi { margin-top: 2px; }

.submit {
  position: relative; overflow: hidden; width: 100%; min-height: 50px; margin-top: .35rem;
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  border: 0; border-radius: 12px; cursor: pointer; color: #fff; font: 600 1rem var(--ff-body); letter-spacing: .04em;
  background: linear-gradient(120deg, #0b7a6e 0%, var(--teal-2) 60%, #19b9a4 100%);
  box-shadow: 0 14px 30px -14px rgba(14,138,124,.65), inset 0 0 0 1px rgba(255,255,255,.14);
  transition: transform .15s, box-shadow .25s, filter .2s;
}
.submit::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.35) 50%, transparent 65%); transform: translateX(-110%); transition: transform .9s cubic-bezier(.2,.8,.2,1); }
.submit:hover { transform: translateY(-1px); box-shadow: 0 18px 34px -14px rgba(14,138,124,.75); }
.submit:hover::after { transform: translateX(110%); }
.submit:disabled { filter: saturate(.6) brightness(1.05); cursor: progress; }
.row-links { display: flex; justify-content: space-between; margin-top: .95rem; font-size: .84rem; }
.row-links a { color: var(--mute); }
.row-links a:hover { color: var(--teal); }

/* ── QR ── */
#pane-qr { display: flex; flex-direction: column; align-items: center; }
.qr-box { position: relative; width: 212px; height: 212px; padding: 14px; border-radius: 16px; background: #fff; border: 1px solid var(--line-2); box-shadow: 0 16px 36px -22px rgba(20,33,61,.35); }
.qb { position: absolute; width: 18px; height: 18px; border: 2px solid var(--teal-2); }
.qb-tl { top: -6px; left: -6px; border-right: 0; border-bottom: 0; border-top-left-radius: 8px; }
.qb-tr { top: -6px; right: -6px; border-left: 0; border-bottom: 0; border-top-right-radius: 8px; }
.qb-bl { bottom: -6px; left: -6px; border-right: 0; border-top: 0; border-bottom-left-radius: 8px; }
.qb-br { bottom: -6px; right: -6px; border-left: 0; border-top: 0; border-bottom-right-radius: 8px; }
.qr-img { width: 100%; height: 100%; }
.qr-img svg { width: 100%; height: 100%; display: block; }
.qr-img svg path { fill: var(--ink); }
.laser { position: absolute; left: 10px; right: 10px; top: 14px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, transparent, var(--teal-2), transparent); box-shadow: 0 0 12px 2px rgba(20,168,149,.35); animation: laser 2.6s ease-in-out infinite; opacity: .85; }
.qr-box:not([data-state="pending"]) .laser { display: none; }
.qr-over { position: absolute; inset: 0; border-radius: 16px; display: none; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; padding: 1rem; text-align: center; background: rgba(255,255,255,.93); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.qr-over p { margin: 0; font-size: .9rem; font-weight: 600; color: var(--ink); }
.qr-over .bi { font-size: 2rem; color: var(--teal); }
.qr-box[data-state="loading"] .qr-over,
.qr-box[data-state="scanned"] .qr-over,
.qr-box[data-state="done"] .qr-over,
.qr-box[data-state="expired"] .qr-over,
.qr-box[data-state="error"] .qr-over { display: flex; }
.qr-box[data-state="expired"] .qr-over .bi,
.qr-box[data-state="error"] .qr-over .bi { color: var(--gold); }
.qr-box[data-state="loading"] .qr-over .bi { animation: spin 1s linear infinite; }
.ghost { display: inline-flex; align-items: center; gap: .35rem; margin-top: .2rem; min-height: 38px; padding: .4rem .9rem; border-radius: 10px; border: 1px solid var(--line-2); background: #fff; color: var(--ink); font: 600 .84rem var(--ff-body); cursor: pointer; }
.ghost:hover { border-color: var(--teal-2); color: var(--teal); }
.qr-status { margin: 1.1rem 0 .15rem; font-size: .9rem; color: var(--ink-2); text-align: center; min-height: 1.4em; }
.qr-timer { margin: 0; font-family: var(--ff-mono); font-size: .66rem; letter-spacing: .18em; color: var(--soft); min-height: 1.2em; }

.card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 1.35rem; padding-top: .9rem; border-top: 1px dashed var(--line); font-size: .84rem; }
.card-foot a { color: var(--mute); }
.card-foot a:hover { color: var(--teal); }

/* ── motion ── */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 3px rgba(20,168,149,.18); } 50% { box-shadow: 0 0 0 6px rgba(20,168,149,.04); } }
@keyframes laser { 0%,100% { transform: translateY(0); } 50% { transform: translateY(180px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shake { 20%,60% { transform: translateX(-4px); } 40%,80% { transform: translateX(4px); } }
.hero, .brand { animation: rise .9s cubic-bezier(.2,.8,.2,1) both; }

/* ── responsive ── */
@media (max-width: 1100px) {
  .stage { grid-template-columns: minmax(0, 1fr) minmax(340px, 420px); }
  .hero h1 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
}
/* portrait tablets & phones: single column */
@media (max-width: 860px), (max-aspect-ratio: 1/1) and (max-width: 1100px) {
  .stage {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto auto auto;
    grid-template-areas: "brand" "anchor" "panel" "hero" "foot";
    column-gap: 0;
  }
  .anchor { min-height: 0; height: clamp(240px, 40vh, 460px); }
  .panel { padding: .25rem 0 1.5rem; }
  .card { max-width: 480px; margin: 0 auto; }
  .hero { padding: .5rem 0 1rem; text-align: left; }
  .hero h1 { font-size: clamp(1.6rem, 6vw, 2.4rem); }
}
@media (max-width: 480px) {
  .stage { padding: 1rem 16px 1.2rem; }
  .card { padding: 1.6rem 1.15rem 1.15rem; border-radius: 18px; }
  .card h2 { font-size: 1.5rem; margin-bottom: .9rem; }
  .tabs button { font-size: .8rem; gap: .3rem; padding: .35rem .3rem; }
  .tabs button .bi { display: none; }
  .stats { gap: .3rem 1.4rem; }
  .stats dd { font-size: 1.2rem; }
  .id-text small { display: none; }
  .foot { flex-direction: column; align-items: flex-start; gap: .25rem; }
}
/* phone landscape: short viewport, keep two columns, drop the hero */
@media (max-height: 520px) and (min-aspect-ratio: 1/1) {
  .stage {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 400px);
    grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas: "brand panel" "anchor panel" "foot panel";
    padding-top: .8rem; padding-bottom: .8rem;
  }
  .hero { display: none; }
  .anchor { min-height: 0; }
  .card { padding: 1.2rem 1.25rem 1rem; }
  .card h2 { font-size: 1.3rem; margin-bottom: .7rem; }
  .crumb, .card-foot { display: none; }
  .tabs { margin-bottom: .8rem; }
  .tabs button { font-size: .8rem; }
  .tabs button .bi { display: none; }
  .field { margin-bottom: .6rem; }
  .input-wrap input { min-height: 42px; padding-top: .55rem; padding-bottom: .55rem; }
  .submit { min-height: 44px; }
  .qr-box { width: 172px; height: 172px; padding: 10px; }
  @keyframes laser { 0%,100% { transform: translateY(0); } 50% { transform: translateY(144px); } }
  .qr-status { margin-top: .7rem; }
  .foot { font-size: .7rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .laser { display: none; }
}
