/* ============ 01. RESET ============ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; }

/* ============ 02. VARIABLES ============ */
:root {
  --bg-deep: #0a0a0a;
  --bg-elevated: #161616;
  --surface: #1f1f1f;
  --text-primary: #f5f5f7;
  --text-secondary: #a1a1a6;
  --text-muted: #6e6e73;
  --gold: #d4af37;
  --gold-light: #fce043;
  --divider: #38383a;

  --font-stack: "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  --font-display: clamp(2rem, 5vw, 3.75rem);
  --font-subhead: clamp(1.25rem, 2vw, 1.5rem);
  --font-body: clamp(1rem, 1.2vw, 1.125rem);
  --font-caption: 0.875rem;
  --line-tight: 1.15;
  --line-body: 1.7;

  --header-top: 16px;
  --header-h: 96px;
  --container: 1440px;
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --radius: 14px;
  --radius-pill: 999px;
  --transition: 220ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --shadow-float: 0 10px 40px rgba(0, 0, 0, 0.5);
  --shadow-gold: 0 4px 20px rgba(212, 175, 55, 0.16);
}

@media (max-width: 960px) {
  :root {
    --header-top: 12px;
    --header-h: 80px;
  }
}

/* ============ 03. BASE TYPOGRAPHY ============ */
body {
  font-family: var(--font-stack);
  font-size: var(--font-body);
  font-weight: 400;
  line-height: var(--line-body);
  color: var(--text-primary);
  background: var(--bg-deep);
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: var(--line-tight);
  letter-spacing: -0.03em;
  color: var(--text-primary);
  text-wrap: balance;
}
h1 { font-size: var(--font-display); }
h2 { font-size: var(--font-subhead); }
h3 { font-size: clamp(1.1rem, 1.6vw, 1.375rem); }

p { text-wrap: pretty; }
a { color: inherit; text-decoration: none; transition: color var(--transition); }
img, svg, video { display: block; max-width: 100%; height: auto; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

::selection { background: rgba(212, 175, 55, 0.3); color: var(--text-primary); }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--divider); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #4a4a4d; }

/* ============ 04. UTILITIES ============ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: clamp(3rem, 8vw, 6rem);
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}
.section-label::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--gold);
  opacity: 0.5;
  flex-shrink: 0;
}

/* ============ 05. SKIP LINK & FOCUS ============ */
.skip-link {
  position: fixed;
  top: -60px;
  left: 1.5rem;
  z-index: 2001;
  padding: 0.625rem 1.25rem;
  background: linear-gradient(145deg, var(--gold-light), var(--gold));
  color: var(--bg-deep);
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 0 0 8px 8px;
  box-shadow: var(--shadow-gold);
  transition: top 200ms ease;
}
.skip-link:focus-visible { top: 0; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ============ 06. HEADER ============ */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.5), var(--gold-light));
  z-index: 2000;
  pointer-events: none;
}

.site-header {
  position: fixed;
  top: var(--header-top);
  left: 50%;
  transform: translateX(-50%);
  width: min(var(--container), calc(100% - 2rem));
  z-index: 100;
}

.site-header__inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
  padding: 0.625rem 1rem 0.625rem 1.25rem;
  background: rgba(10, 10, 10, 0.78);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid rgba(212, 175, 55, 0.16);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-float);
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.brand-icon {
  position: relative;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.brand-icon::before {
  content: "";
  position: absolute;
  inset: 2px;
  border: 1.5px solid var(--gold);
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(212, 175, 55, 0.16), rgba(212, 175, 55, 0.02) 70%);
  transform: rotate(45deg);
  transition: transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.site-brand:hover .brand-icon::before { transform: rotate(225deg); }
.brand-icon__inner {
  position: relative;
  z-index: 1;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--gold-light);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.brand-name {
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-primary);
}
.brand-slogan {
  font-size: 0.6875rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  white-space: nowrap;
}
@media (max-width: 1200px) {
  .brand-slogan { display: none; }
}

/* ---- Navigation ---- */
.site-nav {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.125rem;
  padding: 0.25rem;
  background: rgba(31, 31, 31, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-pill);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
  transition: color var(--transition), background var(--transition), box-shadow var(--transition);
}
.nav-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}
.nav-link[aria-current="page"] {
  color: var(--bg-deep);
  background: linear-gradient(145deg, var(--gold-light), var(--gold));
  font-weight: 600;
  box-shadow: 0 2px 12px rgba(212, 175, 55, 0.25);
}

/* ---- Toggle ---- */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  background: rgba(31, 31, 31, 0.5);
  flex-shrink: 0;
  transition: border-color var(--transition);
}
.nav-toggle:hover { border-color: rgba(212, 175, 55, 0.45); }
.toggle-bar {
  display: block;
  width: 16px;
  height: 1.5px;
  border-radius: 2px;
  background: var(--text-primary);
  transition: transform 250ms ease, opacity 250ms ease;
}
.nav-toggle[aria-expanded="true"] .toggle-bar:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .toggle-bar:nth-child(2) { opacity: 0; transform: scaleX(0.4); }
.nav-toggle[aria-expanded="true"] .toggle-bar:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

/* ---- ICP ---- */
.icp-pill {
  flex-shrink: 0;
  padding: 0.375rem 0.875rem;
  border: 1px solid var(--divider);
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  white-space: nowrap;
}
@media (max-width: 1200px) {
  .icp-pill { display: none; }
}

/* ============ 07. MAIN CONTENT ============ */
#main-content {
  padding-top: var(--header-h);
  min-height: calc(100vh - var(--header-h));
  display: block;
}

/* ============ 08. FOOTER ============ */
.site-footer {
  margin-top: clamp(4rem, 10vw, 8rem);
  padding: 2rem var(--gutter) 2.5rem;
}

.site-footer__inner {
  max-width: var(--container);
  margin-inline: auto;
  position: relative;
  background: linear-gradient(180deg, rgba(22, 22, 22, 0.9), rgba(10, 10, 10, 0.95));
  border: 1px solid var(--divider);
  border-radius: 20px;
  padding: clamp(2rem, 4vw, 3rem) clamp(1.5rem, 3vw, 2.5rem) 1.5rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
.site-footer__inner::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 2.5rem;
  right: 2.5rem;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), rgba(212, 175, 55, 0.15));
  border-radius: 2px;
}

.footer-top {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.9fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  padding-bottom: 1.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* Brand block */
.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}
.footer-brand__icon {
  position: relative;
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--gold-light);
  flex-shrink: 0;
}
.footer-brand__icon::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1.5px solid var(--gold);
  border-radius: 11px;
  background: linear-gradient(145deg, rgba(212, 175, 55, 0.14), rgba(212, 175, 55, 0.02));
  transform: rotate(45deg);
}
.footer-brand__icon::after {
  content: "188";
  position: relative;
  z-index: 1;
}
.footer-brand__copy {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}
.footer-brand__name {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-primary);
}
.footer-brand__slogan {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* Contact block */
.footer-heading {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.875rem;
}
.footer-contact__list,
.footer-links__list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.footer-contact__item {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.footer-contact__label {
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.02em;
}
.footer-contact__item:hover .footer-contact__label { color: var(--gold); }

/* Links block */
.footer-links__list a {
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition);
}
.footer-links__list a:hover { color: var(--gold-light); }

/* Note */
.footer-note {
  margin-top: 1.5rem;
  padding: 0.875rem 1.25rem;
  border-left: 2px solid var(--gold);
  background: rgba(212, 175, 55, 0.04);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  line-height: 1.6;
}

/* Bottom */
.footer-bottom {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.footer-service {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.6;
}
.footer-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.footer-copyright { color: var(--text-secondary); }
.footer-icp {
  padding: 0.25rem 0.625rem;
  border: 1px solid var(--divider);
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ============ 09. BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6875rem 1.625rem;
  border-radius: var(--radius-pill);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition), background var(--transition);
  will-change: transform;
}
.btn:active { transform: scale(0.96); }

.btn-gold {
  background: linear-gradient(145deg, var(--gold-light), var(--gold));
  color: var(--bg-deep);
  box-shadow: 0 2px 16px rgba(212, 175, 55, 0.22);
}
.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(212, 175, 55, 0.32);
}
.btn-gold:active { transform: translateY(0) scale(0.97); }

.btn-ghost {
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}
.btn-ghost:hover {
  border-color: rgba(212, 175, 55, 0.55);
  color: var(--gold-light);
  transform: translateY(-2px);
}
.btn-ghost:active { transform: translateY(0) scale(0.97); }

/* ============ 10. BREADCRUMB ============ */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
  padding: 0.875rem 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.breadcrumb__item {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}
.breadcrumb__item:not(:last-child)::after {
  content: "/";
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0.6;
}
.breadcrumb__link { color: var(--text-secondary); transition: color var(--transition); }
.breadcrumb__link:hover { color: var(--gold-light); }
.breadcrumb__current {
  color: var(--text-primary);
  font-weight: 500;
}

/* ============ 11. SPLIT LAYOUT ============ */
.split-layout {
  display: grid;
  grid-template-columns: minmax(240px, 0.85fr) minmax(0, 2.15fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}
.split-aside {
  position: sticky;
  top: calc(var(--header-h) + 1.5rem);
}
.split-main {
  min-width: 0;
}

/* ============ 12. COMPONENTS ============ */
/* Tag */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.3125rem 0.75rem;
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: var(--radius-pill);
  background: rgba(212, 175, 55, 0.07);
  color: var(--gold-light);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  line-height: 1;
  white-space: nowrap;
}

/* Card */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--divider);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: border-color 260ms ease, transform 260ms ease, box-shadow 260ms ease;
}
.card:hover {
  border-color: rgba(212, 175, 55, 0.28);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

/* Paper layering */
.paper {
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--divider);
  border-radius: 10px;
  padding: 1.5rem;
}
.paper::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(212, 175, 55, 0.14);
  border-radius: 10px;
  transform: translate(6px, 6px);
  z-index: -1;
  pointer-events: none;
}

/* Frame window */
.frame-window {
  position: relative;
  padding: clamp(1.5rem, 4vw, 3.5rem);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(22, 22, 22, 0.72), rgba(10, 10, 10, 0.88));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.frame-window::before,
.frame-window::after {
  content: "";
  position: absolute;
  width: 34px;
  height: 34px;
  pointer-events: none;
}
.frame-window::before {
  top: -1px;
  left: -1px;
  border-top: 2px solid var(--gold);
  border-left: 2px solid var(--gold);
}
.frame-window::after {
  bottom: -1px;
  right: -1px;
  border-bottom: 2px solid var(--gold);
  border-right: 2px solid var(--gold);
}
.frame-corner {
  position: absolute;
  width: 34px;
  height: 34px;
  border: 0 solid var(--gold);
  pointer-events: none;
}
.frame-corner--tr { top: -1px; right: -1px; border-top-width: 2px; border-right-width: 2px; }
.frame-corner--bl { bottom: -1px; left: -1px; border-bottom-width: 2px; border-left-width: 2px; }

/* Timeline */
.timeline {
  position: relative;
  padding-left: 32px;
}
.timeline::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 4px;
  left: 8px;
  width: 1px;
  background: linear-gradient(180deg, var(--gold), rgba(212, 175, 55, 0.35) 40%, rgba(255, 255, 255, 0.05));
}
.timeline-item {
  position: relative;
  padding-bottom: 2.25rem;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: "";
  position: absolute;
  top: 6px;
  left: -28px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg-deep);
  border: 2px solid var(--gold);
  box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.12);
}
.timeline-item:focus-visible {
  outline-offset: 4px;
}

/* Media container */
.media {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background: var(--surface);
  aspect-ratio: 4 / 3;
}
.media img,
.media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Back to top */
.back-to-top {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(22, 22, 22, 0.9);
  border: 1px solid rgba(212, 175, 55, 0.3);
  color: var(--gold-light);
  font-size: 1.125rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 250ms ease, visibility 250ms ease, transform 250ms ease, background 250ms ease, border-color 250ms ease;
  z-index: 150;
  cursor: pointer;
}
.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top:hover {
  background: rgba(212, 175, 55, 0.14);
  border-color: var(--gold);
}
.back-to-top:active { transform: scale(0.9); }

/* ============ 13. REVEAL ============ */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 700ms cubic-bezier(0.22, 0.61, 0.36, 1),
              transform 700ms cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: opacity, transform;
}
.js [data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============ 14. RESPONSIVE ============ */
@media (max-width: 960px) {
  .site-header {
    width: calc(100% - 1.25rem);
  }
  .site-header__inner {
    min-height: 56px;
    padding: 0.5rem 0.75rem 0.5rem 0.875rem;
  }
  .nav-toggle { display: flex; }

  .site-nav {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    right: 0;
    transform: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0.125rem;
    padding: 0.75rem;
    background: rgba(14, 14, 14, 0.97);
    border: 1px solid rgba(212, 175, 55, 0.22);
    border-radius: 18px;
    box-shadow: var(--shadow-float);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 220ms ease, transform 220ms ease, visibility 220ms;
    pointer-events: none;
  }
  .site-nav[data-open] {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }

  .nav-link {
    justify-content: flex-start;
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
    border-radius: 10px;
    color: var(--text-secondary);
  }
  .nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
  }
  .nav-link[aria-current="page"] {
    background: transparent;
    color: var(--gold-light);
    box-shadow: none;
    border-left: 2px solid var(--gold);
    border-radius: 0;
  }

  .split-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .split-aside {
    position: static;
  }

  .site-footer__inner {
    border-radius: 16px;
    padding: 1.75rem 1.25rem 1.25rem;
  }
  .footer-top {
    grid-template-columns: 1fr;
    gap: 1.75rem;
    padding-bottom: 1.25rem;
  }
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
  .footer-meta {
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  .footer-service {
    font-size: 0.75rem;
    line-height: 1.5;
  }
  .footer-icp {
    display: none;
  }
  .media {
    aspect-ratio: 1 / 1;
  }
  .back-to-top {
    right: 1rem;
    bottom: 1rem;
    width: 40px;
    height: 40px;
  }
}

/* ============ 15. REDUCED MOTION ============ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .site-header__inner,
  .site-nav,
  .nav-toggle .toggle-bar,
  .brand-icon::before,
  .btn,
  .card,
  .back-to-top,
  .frame-window,
  .timeline-item::before {
    transition: none !important;
  }
  .js [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .back-to-top {
    transition: none !important;
  }
}
