:root {
  --deep-blue: #1a1a2e;
  --gold: #e2b13c;
  --crimson: #8b0000;
  --warm-paper: #f5f0e6;
  --ink-black: #0f0f1a;
  --text-light: #f0e6d2;
  --muted-gray: #a0a0a8;
  --border-dark: #2a2a3e;
  --focus-blue: #3d5a80;
  --gradient-sport: linear-gradient(120deg, rgba(226,177,60,.15), rgba(26,26,46,0) 60%);
  --max-width: 1240px;
  --header-h: 84px;
  --space-section: clamp(4rem, 8vw, 7rem);
  --radius-lg: 14px;
  --radius-md: 10px;
  --shadow-lift: 0 18px 40px rgba(0,0,0,.18);
  --progress: 0%;
  --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

html.no-scroll {
  overflow: hidden;
}

body {
  margin: 0;
  background: var(--deep-blue);
  color: var(--text-light);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
picture,
video,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--focus-blue);
  outline-offset: 3px;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

ul,
ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

h1,
h2,
h3,
h4,
h5,
h6,
p {
  margin: 0;
}

::selection {
  background: var(--gold);
  color: var(--ink-black);
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 2000;
  background: var(--gold);
  color: var(--ink-black);
  padding: .7rem 1.2rem;
  border-radius: 6px;
  font-weight: 600;
  transform: translateY(-300%);
  transition: transform .2s ease;
}

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

.progress-track {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold) var(--progress), rgba(226,177,60,.2) var(--progress));
  z-index: 1500;
  pointer-events: none;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: linear-gradient(180deg, rgba(15,15,26,.7), rgba(15,15,26,.45) 60%, transparent);
  transition: background .3s ease, box-shadow .3s ease, border-color .3s ease;
  border-bottom: 1px solid rgba(255,255,255,.05);
}

.site-header.is-scrolled {
  background: rgba(15,15,26,.96);
  border-color: var(--border-dark);
  box-shadow: 0 12px 30px rgba(0,0,0,.28);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  min-height: var(--header-h);
  padding: 0 clamp(1rem, 4vw, 2.5rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  position: relative;
}

.brand-lockup {
  display: flex;
  align-items: baseline;
  gap: .8rem;
  min-width: 0;
}

.brand-mark {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.75rem;
  line-height: 1.1;
  letter-spacing: .01em;
  color: var(--warm-paper);
  position: relative;
  display: inline-block;
}

.brand-mark::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 4px;
  height: 4px;
  background: var(--gold);
  width: 64%;
  transform: rotate(-1deg);
  z-index: -1;
  border-radius: 2px;
}

.brand-tagline {
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--gold);
  letter-spacing: .08em;
  text-transform: uppercase;
  border: 1px solid rgba(226,177,60,.4);
  padding: .2rem .45rem;
  border-radius: 4px;
  white-space: nowrap;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: .2rem;
}

.nav-link {
  display: block;
  padding: .45rem .7rem;
  font-size: .92rem;
  font-weight: 500;
  letter-spacing: .02em;
  color: var(--text-light);
  border-radius: 5px;
  border-bottom: 2px solid transparent;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}

.nav-link:hover {
  color: var(--gold);
  background: rgba(226,177,60,.06);
}

.nav-link[aria-current="page"] {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: var(--gold);
  color: var(--ink-black);
  font-weight: 600;
  font-size: .9rem;
  letter-spacing: .03em;
  border: 2px solid var(--gold);
  padding: .55rem 1.3rem;
  border-radius: 4px;
  transition: background .2s, transform .15s, box-shadow .2s;
  box-shadow: 0 5px 16px rgba(226,177,60,.18);
}

.btn-primary:hover {
  background: #f0c168;
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(226,177,60,.3);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: transparent;
  color: var(--gold);
  border: 2px solid var(--gold);
  font-weight: 600;
  font-size: .9rem;
  padding: .45rem 1.1rem;
  border-radius: 4px;
  transition: background .2s, transform .15s;
}

.btn-ghost:hover {
  background: rgba(226,177,60,.08);
  transform: translateY(-1px);
}

.nav-toggle {
  display: none;
  width: 46px;
  height: 46px;
  border-radius: 6px;
  border: 1px solid var(--border-dark);
  background: rgba(15,15,26,.65);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: background .2s;
}

.nav-toggle:hover {
  background: rgba(226,177,60,.08);
}

.nav-toggle-line {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--gold);
  border-radius: 4px;
  transition: transform .25s, opacity .2s;
}

.nav-toggle[data-open] .nav-toggle-line:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.nav-toggle[data-open] .nav-toggle-line:nth-child(2) {
  opacity: 0;
}

.nav-toggle[data-open] .nav-toggle-line:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.page-footer {
  background: var(--ink-black);
  border-top: 8px solid var(--deep-blue);
  position: relative;
  margin-top: var(--space-section);
}

.page-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold) 22%, var(--crimson) 22%, var(--crimson) 38%, var(--gold) 38%, var(--gold) 55%, transparent 55%);
  opacity: .8;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3.5rem clamp(1rem, 4vw, 2.5rem) 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.4fr;
  gap: 2rem 3rem;
  margin-bottom: 2.8rem;
}

.footer-brand-mark {
  font-size: 2rem;
  color: var(--warm-paper);
  margin-bottom: .6rem;
}

.footer-slogan {
  font-family: var(--font-mono);
  font-size: .9rem;
  color: var(--muted-gray);
  line-height: 1.6;
}

.footer-heading {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 1rem;
  letter-spacing: .02em;
  border-left: 3px solid var(--gold);
  padding-left: .8rem;
}

.footer-link-list li,
.footer-meta-list li {
  margin-bottom: .55rem;
}

.footer-link-list a,
.footer-meta-list a {
  color: var(--text-light);
  font-size: .92rem;
  transition: color .2s, padding-left .2s;
}

.footer-link-list a:hover,
.footer-meta-list a:hover {
  color: var(--gold);
  padding-left: 5px;
}

.footer-meta-list {
  display: grid;
  gap: .35rem;
}

.footer-maplabel {
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--muted-gray);
  display: block;
  margin-bottom: .1rem;
}

.footer-link-external {
  word-break: break-all;
}

.footer-address {
  color: var(--text-light);
  font-size: .92rem;
}

.footer-legal {
  border-top: 1px solid var(--border-dark);
  padding-top: 1.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: space-between;
  align-items: center;
  font-size: .85rem;
  color: var(--muted-gray);
}

.footer-legal a {
  color: var(--muted-gray);
  transition: color .2s;
}

.footer-legal a:hover {
  color: var(--gold);
}

.footer-icp {
  font-family: var(--font-mono);
}

.footer-guarantee {
  width: 100%;
  color: #8d8d96;
  font-size: .82rem;
  line-height: 1.7;
  max-width: 900px;
}

.section-index {
  margin-bottom: 2.6rem;
}

.section-index-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 900;
  line-height: 1.15;
  color: var(--warm-paper);
  margin-bottom: .6rem;
}

.section-index-desc {
  color: var(--muted-gray);
  font-size: 1.05rem;
  max-width: 700px;
}

.panel-anchor {
  scroll-margin-top: calc(var(--header-h) + 1rem);
}

.code-chip {
  font-family: var(--font-mono);
  font-size: .85rem;
  background: rgba(226,177,60,.12);
  color: var(--gold);
  padding: .3rem .7rem;
  border-radius: 20px;
  border: 1px solid rgba(226,177,60,.35);
  display: inline-block;
}

.time-chip {
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--muted-gray);
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}

.time-chip::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--gold);
  border-radius: 50%;
  display: inline-block;
}

.tick-line {
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold) 70%, rgba(226,177,60,.15));
  width: 120px;
  margin: 1.5rem 0 2.2rem;
  border-radius: 3px;
}

.visual-stage {
  position: relative;
  background: var(--ink-black);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-dark);
  min-height: 260px;
  box-shadow: inset 0 0 60px rgba(0,0,0,.35);
}

.visual-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px) 0 0 / 20px 20px,
    linear-gradient(90deg, rgba(226,177,60,.08) 1px, transparent 1px) 0 0 / 20px 20px;
}

.placeholder-image {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 260px;
  background: linear-gradient(140deg, var(--deep-blue) 0%, var(--ink-black) 60%);
  position: relative;
  border-radius: var(--radius-lg);
  border: 2px dashed var(--border-dark);
  color: var(--muted-gray);
  font-family: var(--font-mono);
  font-size: .9rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  z-index: 1;
}

.placeholder-image::after {
  content: "";
  position: absolute;
  top: -30px;
  right: -30px;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle at center, rgba(226,177,60,.5) 0%, rgba(226,177,60,0) 70%);
  z-index: -1;
  animation: pulse-glow 2.6s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { opacity: .4; transform: scale(1); }
  50% { opacity: .8; transform: scale(1.1); }
}

.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 26px;
  z-index: 900;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--ink-black);
  font-size: 1.3rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateY(10px) scale(.7);
  opacity: 0;
  pointer-events: none;
  transition: transform .2s ease, opacity .2s ease, box-shadow .2s;
  box-shadow: 0 10px 26px rgba(15,15,26,.4);
}

.back-to-top[data-top-visible="true"] {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.back-to-top:hover {
  background: #f0c168;
  box-shadow: 0 14px 36px rgba(226,177,60,.45);
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .5s ease, transform .5s ease;
}

.reveal.is-inview {
  opacity: 1;
  transform: none;
}

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

@media (max-width: 960px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .footer-brand {
    grid-column: span 2;
  }
}

@media (max-width: 820px) {
  .main-nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: rgba(15,15,26,.985);
    border-bottom: 1px solid var(--border-dark);
    flex-direction: column;
    align-items: stretch;
    padding: 1rem 5vw 1.6rem;
    row-gap: .5rem;
    transform-origin: top;
    transform: scaleY(.96);
    opacity: 0;
    visibility: hidden;
    transition: transform .25s ease, opacity .2s ease, visibility .2s;
    box-shadow: var(--shadow-lift);
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
  }
  .main-nav[data-open] {
    transform: scaleY(1);
    opacity: 1;
    visibility: visible;
  }
  .nav-list {
    flex-direction: column;
    align-items: stretch;
  }
  .nav-link {
    padding: .8rem .7rem;
    border-bottom: 1px solid var(--border-dark);
    border-radius: 0;
  }
  .nav-link[aria-current="page"] {
    background: rgba(226,177,60,.07);
  }
  .nav-cta {
    justify-content: center;
    margin-top: .8rem;
  }
  .nav-toggle {
    display: inline-flex;
  }
}

@media (max-width: 600px) {
  .brand-tagline {
    display: none;
  }
  .brand-mark {
    font-size: 1.4rem;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .footer-brand {
    grid-column: span 1;
  }
  .footer-legal {
    flex-direction: column;
    align-items: flex-start;
  }
  .back-to-top {
    right: 14px;
    bottom: 18px;
  }
}
