@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/instrument-serif-400-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Noto Serif SC";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/noto-serif-sc-cjk.woff2") format("woff2");
}
@font-face {
  font-family: Outfit;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/outfit-400.woff2") format("woff2");
}
@font-face {
  font-family: Outfit;
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/outfit-500.woff2") format("woff2");
}
@font-face {
  font-family: Outfit;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/outfit-600.woff2") format("woff2");
}

:root {
  --bg: #070604;
  --ink: #f4ead8;
  --muted: rgba(244, 234, 216, 0.58);
  --faint: rgba(244, 234, 216, 0.34);
  --line: rgba(244, 234, 216, 0.12);
  --gold: #e2b56a;
  --gold-soft: rgba(226, 181, 106, 0.22);
  --card: rgba(16, 13, 10, 0.62);
  --good: #d7ecc0;
  --bad: #ef9a86;
  --sans: Outfit, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --serif: "Noto Serif SC", "Songti SC", "STSong", serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  isolation: isolate;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.scene {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}
.plate {
  position: absolute;
  inset: -8%;
  background: url("/atmosphere.jpg") center top / cover no-repeat;
  filter: saturate(0.85) contrast(1.08);
  transform: scale(1.04);
  animation: breathe 22s ease-in-out infinite alternate;
}
.wash {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(7, 6, 4, 0.18) 0%, rgba(7, 6, 4, 0.55) 48%, rgba(7, 6, 4, 0.88) 100%),
    radial-gradient(ellipse at 18% 0%, rgba(226, 181, 106, 0.16), transparent 42%);
}
.bloom {
  position: absolute;
  width: 52vw;
  height: 52vw;
  left: -12vw;
  top: -18vw;
  background: radial-gradient(circle, rgba(226, 181, 106, 0.22), transparent 68%);
  filter: blur(8px);
  animation: drift 26s ease-in-out infinite alternate;
}
.grain {
  position: absolute;
  inset: 0;
  opacity: 0.22;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.nav, footer, .shell {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
}
.nav, footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.mark {
  width: 16px;
  height: 16px;
  border: 1.3px solid var(--gold);
  border-radius: 99px;
  position: relative;
}
.mark::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 3px;
  bottom: 3px;
  width: 1.3px;
  background: var(--gold);
  transform: translateX(-50%);
}

.shell {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 440px);
  gap: 72px;
  align-items: end;
  padding: 36px 0 72px;
}
body[data-page="admin"] .shell {
  grid-template-columns: 1fr;
  align-items: start;
  gap: 28px;
  padding-top: 12px;
}
body[data-page="admin"] h1 {
  font-size: clamp(40px, 6vw, 68px);
}
body[data-page="admin"] .stage { max-width: 720px; }

.hero { max-width: 640px; padding-bottom: 8px; }
.eyebrow {
  margin: 0 0 22px;
  font-family: "Instrument Serif", var(--serif);
  font-style: italic;
  font-size: 20px;
  letter-spacing: 0.02em;
  color: var(--gold);
}
.eyebrow::after {
  content: "";
  display: block;
  width: 36px;
  height: 1px;
  margin-top: 14px;
  background: var(--gold);
  opacity: 0.7;
}
h1 {
  margin: 0 0 22px;
  font-family: var(--serif);
  font-size: clamp(48px, 7.2vw, 92px);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: 0.06em;
  color: var(--ink);
}
h1 span { display: block; }
.lede {
  max-width: 28rem;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  letter-spacing: 0.02em;
}

.stage { width: 100%; }
.card {
  position: relative;
  overflow: hidden;
  padding: 28px 28px 26px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--card);
  backdrop-filter: blur(26px) saturate(1.1);
  box-shadow:
    0 0 0 1px rgba(255, 244, 220, 0.03) inset,
    0 30px 80px rgba(0, 0, 0, 0.35);
  animation: rise 0.7s ease both;
}
.card-glow {
  position: absolute;
  inset: auto -20% 55% -20%;
  height: 180px;
  background: radial-gradient(ellipse at center, rgba(226, 181, 106, 0.14), transparent 70%);
  pointer-events: none;
}
.card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.step, .step-meta {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--faint);
}
.step { color: var(--gold); }
.step-meta { margin-left: auto; }
.dots { display: inline-flex; gap: 6px; }
.dots i {
  width: 6px;
  height: 6px;
  border-radius: 99px;
  background: rgba(244, 234, 216, 0.18);
}
.dots i.on { background: var(--gold); }
.card[data-phase="q2"] .dots i:last-child { background: var(--gold); }
.card[data-phase="pending"] .dots i,
.card[data-phase="approved"] .dots i { background: var(--gold); }

.card h2 {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1.25;
}
.hint, .fine { margin: 0; color: var(--muted); }
.hint { margin-bottom: 26px; font-size: 14px; }
.fine { margin-top: 14px; font-size: 13px; }

.row { display: flex; gap: 10px; }
.field, #login-form input, #field {
  flex: 1;
  min-width: 0;
  width: 100%;
  height: 54px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 244, 220, 0.03);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.field:focus, #login-form input:focus, #field:focus {
  border-color: rgba(226, 181, 106, 0.55);
  background: rgba(255, 244, 220, 0.05);
  box-shadow: 0 0 0 4px var(--gold-soft);
}
.go, .copy {
  position: relative;
  overflow: hidden;
  height: 54px;
  padding: 0 20px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(180deg, #f6ead2 0%, #e2b56a 100%);
  color: #2a1d0b;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.18s ease, filter 0.18s ease;
}
.go::after, .copy::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 -40%;
  width: 30%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: skewX(-20deg);
  animation: shine 3.6s ease-in-out infinite;
}
.go:hover, .copy:hover { transform: translateY(-1px); filter: brightness(1.04); }
.go:disabled { opacity: 0.45; cursor: wait; transform: none; }
.err {
  margin: 12px 0 0;
  color: var(--bad);
  font-size: 13px;
}
.card.is-bad #field {
  border-color: rgba(239, 154, 134, 0.75);
  animation: shake 0.36s ease;
}

.result { margin-top: 8px; }
.link-box {
  display: flex;
  gap: 10px;
  align-items: stretch;
}
.link-box code {
  flex: 1;
  min-width: 0;
  overflow: auto;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 244, 220, 0.03);
  color: var(--good);
  font-size: 13px;
  line-height: 1.45;
  word-break: break-all;
}
.reset {
  display: block;
  margin: 18px auto 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--faint);
  cursor: pointer;
  letter-spacing: 0.04em;
}
.reset:hover { color: var(--muted); }
footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 12px;
  letter-spacing: 0.06em;
}

@keyframes breathe {
  from { transform: scale(1.02); }
  to { transform: scale(1.07); }
}
@keyframes drift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(4vw, 3vh, 0); }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes shine {
  0%, 60% { left: -40%; }
  100% { left: 140%; }
}
@keyframes shake {
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}

@media (max-width: 860px) {
  .shell {
    grid-template-columns: 1fr;
    gap: 36px;
    padding: 12px 0 48px;
    align-items: start;
  }
  h1 { font-size: clamp(40px, 11vw, 64px); }
}
@media (max-width: 640px) {
  .nav, footer, .shell { width: min(920px, calc(100% - 32px)); }
  .card { padding: 22px 18px; border-radius: 22px; }
  .row, .link-box { flex-direction: column; }
  .go, .copy, .field, #field { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .plate, .bloom, .card, .go::after, .card.is-bad #field { animation: none; }
}
