:root {
  --ink: #0b0e11;
  --panel: #15191b;
  --panel-raised: #1b211e;
  --line: #363d37;
  --line-soft: #ffffff1c;
  --paper: #f1eee5;
  --white: #f5f3ed;
  --muted: #aab0a6;
  --moss: #9eb08b;
  --gold: #f0b90b;
  --gold-soft: #f3d875;
  --danger: #ee9b81;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  scroll-behavior: smooth;
  background: var(--ink);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--white);
  background:
    linear-gradient(90deg, transparent 0, transparent calc(50% - 660px), #ffffff08 calc(50% - 659px), transparent calc(50% - 658px), transparent calc(50% + 658px), #ffffff08 calc(50% + 659px), transparent calc(50% + 660px)),
    var(--ink);
  font-family: Manrope, "Noto Sans SC", -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

a { color: inherit; }

button,
input { font: inherit; }

button,
a,
input { -webkit-tap-highlight-color: transparent; }

.page-shell {
  width: min(1320px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 5.2%;
  display: flex;
  flex-direction: column;
}

.skip-link {
  position: fixed;
  top: 14px;
  left: 18px;
  z-index: 10;
  padding: 9px 12px;
  color: var(--ink);
  background: var(--gold);
  transform: translateY(-180%);
  transition: transform .2s ease;
}

.skip-link:focus { transform: translateY(0); }

.site-header {
  min-height: 92px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid var(--line-soft);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  color: var(--white);
  text-decoration: none;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -1.5px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.brand sup {
  align-self: flex-start;
  margin-top: 5px;
  color: var(--gold);
  font-size: 10px;
  letter-spacing: 0;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #8f988a;
  font: 600 10px/1.4 Manrope, sans-serif;
  letter-spacing: 1.4px;
}

.header-status i,
.storage-badge i {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 5px #f0b90b12;
}

.back-link {
  justify-self: end;
  color: var(--gold-soft);
  font-size: 13px;
  text-decoration: none;
  transition: color .2s ease, transform .3s var(--ease);
}

.back-link:hover,
.back-link:focus-visible { color: var(--gold); transform: translateX(3px); }

.back-link:focus-visible,
.brand:focus-visible,
.reference-card a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}

main { flex: 1; }

.hero {
  position: relative;
  padding: 68px 0 65px;
  overflow: hidden;
}

.hero-rule {
  position: absolute;
  top: 0;
  right: 18%;
  width: 1px;
  height: 100%;
  background: #ffffff0d;
}

.hero-rule::after {
  position: absolute;
  top: 20%;
  left: 0;
  width: 1px;
  height: 96px;
  content: "";
  background: var(--gold);
}

.hero-topline {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 57px;
  color: #7d867a;
  font: 600 10px/1.4 Manrope, sans-serif;
  letter-spacing: 1.5px;
}

.hero-topline b { color: var(--gold-soft); font-weight: 700; }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  align-items: end;
  gap: 10%;
}

.eyebrow,
.section-kicker {
  margin: 0 0 16px;
  color: var(--gold);
  font: 700 11px/1.4 Manrope, "Noto Sans SC", sans-serif;
  letter-spacing: 1.8px;
}

.hero h1 {
  max-width: 730px;
  margin: 0;
  color: var(--white);
  font-size: clamp(60px, 8.2vw, 118px);
  font-weight: 700;
  letter-spacing: -6px;
  line-height: .97;
}

.hero h1 span {
  color: var(--gold);
}

.hero-intro {
  max-width: 500px;
  margin: 31px 0 0;
  color: #bbc0b5;
  font-size: 16px;
  line-height: 1.9;
}

.hero-stamp {
  width: 176px;
  height: 176px;
  padding: 29px 15px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  color: var(--ink);
  background: var(--gold);
  border-radius: 50%;
  box-shadow: 13px 18px 0 #ffffff12;
  transform: rotate(7deg);
  text-align: center;
}

.hero-stamp span {
  font: 700 9px/1.4 Manrope, sans-serif;
  letter-spacing: 1.8px;
}

.hero-stamp strong {
  font: 800 66px/.9 Manrope, sans-serif;
  letter-spacing: -5px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr);
  gap: 28px;
  padding: 34px 0 88px;
}

.config-card,
.reference-card {
  border: 1px solid var(--line);
  background: var(--panel);
}

.config-card { padding: clamp(25px, 4vw, 47px); }

.reference-card {
  align-self: start;
  padding: 29px 28px 32px;
  background: #ded9ca;
  color: var(--ink);
}

.card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 43px;
}

.card-heading h2,
.reference-card h2 {
  margin: 0;
  font-size: clamp(28px, 3.8vw, 48px);
  letter-spacing: -2.5px;
  line-height: 1;
}

.storage-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-top: 5px;
  color: var(--moss);
  font: 700 9px/1.4 Manrope, sans-serif;
  letter-spacing: 1.2px;
  white-space: nowrap;
}

.storage-badge i { width: 5px; height: 5px; box-shadow: 0 0 0 4px #f0b90b14; }

form label {
  display: block;
  margin-bottom: 12px;
  color: #d9ddd4;
  font-size: 15px;
  font-weight: 600;
}

form label span { color: #7f897c; font-size: 12px; font-weight: 500; }

.input-row {
  display: flex;
  gap: 12px;
}

#ca-input {
  min-width: 0;
  flex: 1;
  height: 54px;
  padding: 0 16px;
  color: var(--white);
  background: #0e1214;
  border: 1px solid #586052;
  border-radius: 2px;
  font: 600 14px/1 Manrope, monospace;
  letter-spacing: .1px;
}

#ca-input::placeholder { color: #697267; }
#ca-input:hover { border-color: #869179; }
#ca-input:focus { border-color: var(--gold); }
#ca-input[aria-invalid="true"] { border-color: var(--danger); }

.save-button,
.secondary-button,
.text-button {
  border: 0;
  cursor: pointer;
}

.save-button {
  min-width: 164px;
  padding: 0 20px;
  color: var(--ink);
  background: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 2px;
  font-size: 14px;
  font-weight: 800;
  transition: background .2s ease, transform .3s var(--ease);
}

.save-button span { margin-left: 7px; }
.save-button:hover,
.save-button:focus-visible { background: var(--gold-soft); transform: translateY(-2px); }

.field-help {
  max-width: 600px;
  margin: 15px 0 0;
  color: #879283;
  font-size: 12px;
  line-height: 1.8;
}

.field-error {
  min-height: 20px;
  margin: 10px 0 0;
  color: var(--danger);
  font-size: 12px;
}

.saved-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-top: 28px;
  padding: 18px 20px;
  border-left: 3px solid var(--gold);
  background: var(--panel-raised);
}

.saved-label,
.saved-time {
  margin: 0;
  color: #96a28f;
  font-size: 11px;
}

.saved-label {
  margin-bottom: 9px;
  color: var(--gold-soft);
  font-weight: 700;
  letter-spacing: .7px;
}

.saved-card code {
  display: block;
  overflow-wrap: anywhere;
  color: var(--white);
  font: 600 14px/1.6 Manrope, monospace;
}

.saved-time { margin-top: 8px; }

.saved-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.secondary-button {
  padding: 8px 13px;
  color: var(--ink);
  background: var(--gold-soft);
  border: 1px solid var(--gold-soft);
  border-radius: 2px;
  font-size: 12px;
  font-weight: 700;
}

.secondary-button:hover,
.secondary-button:focus-visible { background: var(--gold); border-color: var(--gold); }

.text-button {
  padding: 6px 0;
  color: #aab8a1;
  background: transparent;
  font-size: 11px;
}

.text-button:hover,
.text-button:focus-visible { color: var(--danger); }

.privacy-note {
  display: flex;
  gap: 9px;
  margin: 38px 0 0;
  padding-top: 18px;
  color: #8f998c;
  border-top: 1px solid #ffffff12;
  font-size: 12px;
}

.privacy-note span { color: var(--gold); }

.reference-card .section-kicker { color: #9b7500; }
.reference-card h2 { font-size: clamp(28px, 3vw, 40px); }

.reference-intro {
  max-width: 310px;
  margin: 20px 0 25px;
  color: #4f594c;
  font-size: 13px;
  line-height: 1.85;
}

.address-list {
  margin: 0;
  border-top: 1px solid #bab7a9;
}

.address-list > div {
  padding: 15px 0;
  border-bottom: 1px solid #bab7a9;
}

.address-list dt {
  margin-bottom: 6px;
  color: #6d7568;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .7px;
  text-transform: uppercase;
}

.address-list dd { margin: 0; }

.address-list a {
  color: #435e3b;
  font-size: 13px;
  font-weight: 700;
  text-underline-offset: 4px;
}

.address-list code {
  display: block;
  overflow-wrap: anywhere;
  color: #272f28;
  font: 600 11px/1.6 Manrope, monospace;
}

.reference-footnote {
  margin: 21px 0 0;
  color: #5c6558;
  font-size: 12px;
  line-height: 1.8;
}

.site-footer {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 25px;
  min-height: 106px;
  padding: 28px 0;
  border-top: 1px solid var(--line-soft);
  color: #879083;
  font-size: 12px;
}

.site-footer .brand { font-size: 21px; }
.site-footer .brand sup { font-size: 8px; margin-top: 3px; }
.site-footer p { margin: 0; }
.site-footer > span { color: #667064; }

[hidden] { display: none !important; }

@media (max-width: 850px) {
  .site-header { grid-template-columns: 1fr auto; }
  .header-status { grid-column: 1 / -1; grid-row: 2; justify-self: start; padding-bottom: 15px; }
  .back-link { grid-column: 2; grid-row: 1; }
  .content-grid { grid-template-columns: 1fr; }
  .reference-card { max-width: none; }
  .hero-grid { grid-template-columns: minmax(0, 1fr) 170px; gap: 6%; }
  .hero-stamp { width: 148px; height: 148px; padding: 24px 12px 19px; }
  .hero-stamp strong { font-size: 55px; }
}

@media (max-width: 600px) {
  .page-shell { padding: 0 6%; }
  .site-header { min-height: 76px; padding: 15px 0 14px; }
  .brand { font-size: 22px; gap: 8px; }
  .brand-mark { width: 38px; height: 38px; }
  .back-link { font-size: 12px; }
  .header-status { font-size: 9px; padding-bottom: 2px; }
  .hero { padding: 48px 0 44px; }
  .hero-rule { right: 9%; }
  .hero-topline { display: block; margin-bottom: 38px; font-size: 9px; line-height: 2; }
  .hero-topline span { display: block; }
  .hero-grid { display: block; }
  .hero h1 { font-size: clamp(58px, 17vw, 82px); letter-spacing: -4px; }
  .hero-intro { margin-top: 24px; font-size: 14px; }
  .hero-stamp { margin: 37px 0 0 auto; }
  .content-grid { padding: 28px 0 64px; }
  .config-card { padding: 24px 18px; }
  .card-heading { display: block; margin-bottom: 32px; }
  .storage-badge { margin-top: 15px; }
  .input-row { display: block; }
  .save-button { width: 100%; min-height: 52px; margin-top: 12px; }
  .saved-card { display: block; padding: 17px 16px; }
  .saved-actions { justify-content: flex-start; margin-top: 15px; }
  .reference-card { padding: 25px 20px 27px; }
  .site-footer { grid-template-columns: 1fr; gap: 8px; min-height: 0; padding: 25px 0; font-size: 11px; }
}

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

/* Official token preparation uses the existing AnimaForge palette and typography. */
.official-card { margin: -12px 0 30px; padding: 18px; border: 1px solid var(--line); background: #0e1214; }
.official-card code { overflow-wrap: anywhere; }
.preparation-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 20px; }
button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
#ca-status[data-state="error"] { color: var(--danger); }
#checked-block { overflow-wrap: anywhere; }
.integration-guide { margin: -30px 0 70px; padding: clamp(24px, 4vw, 44px); border: 1px solid var(--line); background: var(--panel); }
.integration-guide h2 { margin: 0 0 28px; font-size: clamp(26px, 3vw, 40px); line-height: 1.25; }
.integration-guide ol { padding-left: 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 24px 48px; }
.integration-guide li { padding-left: 6px; color: var(--gold-soft); }
.integration-guide li p { margin: 8px 0 0; color: #bbc0b5; font-size: 14px; }
.integration-notice { border-left: 3px solid var(--gold); padding: 12px 18px; color: #d9ddd4; background: #22251c; font-size: 14px; }
@media (max-width: 700px) { .integration-guide ol { grid-template-columns: 1fr; } }
