@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
  --ink: #261717;
  --bg: #180f10;
  --red: #ff0000;
  --rose: #ff1493;
  --fg: #f7eeee;
  --soft: #eadada;
  --muted: #c3aeae;
  --line: rgba(255, 255, 255, 0.16);
  --card: rgba(255, 255, 255, 0.035);
  --sans: Inter, system-ui, -apple-system, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --disp: 'Space Grotesk', Inter, system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

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

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

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.75;
}

/* ---------- aurora field ---------- */
.aurora {
  position: fixed;
  inset: -22%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(42% 38% at 16% 20%, rgba(255, 0, 0, 0.5), transparent 70%),
    radial-gradient(38% 42% at 80% 28%, rgba(255, 20, 147, 0.45), transparent 72%),
    radial-gradient(52% 40% at 42% 82%, rgba(255, 64, 64, 0.3), transparent 74%),
    radial-gradient(34% 32% at 88% 76%, rgba(255, 20, 147, 0.32), transparent 72%),
    linear-gradient(160deg, #261717, #140c0d 70%);
  filter: blur(14px) saturate(1.2);
  opacity: 0.95;
  animation: drift 11s ease-in-out infinite alternate;
}

.aurora::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 64px 64px, 64px 64px;
  mix-blend-mode: screen;
  -webkit-mask-image: radial-gradient(70% 60% at 50% 40%, #000 20%, transparent 85%);
  mask-image: radial-gradient(70% 60% at 50% 40%, #000 20%, transparent 85%);
}

@keyframes drift {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
    background-position: 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%;
    background-size: 100% 100%;
  }
  100% {
    transform: translate3d(-2.5%, 2%, 0) scale(1.06);
    background-position: 6% 8%, -6% 4%, 4% -6%, -4% -8%, 0% 0%;
  }
}

/* ---------- fixed spine ---------- */
.side {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 4;
  width: 238px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 28px 20px 22px;
  overflow-y: auto;
  background: linear-gradient(180deg, rgba(38, 23, 23, 0.9), rgba(20, 12, 13, 0.96));
  border-right: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.brand {
  font-family: var(--disp);
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  text-decoration: none;
  background: linear-gradient(94deg, var(--red), var(--rose));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.side-nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 16px;
  text-decoration: none;
  color: var(--muted);
  transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.side-nav a:hover,
.side-nav a:focus-visible {
  color: #fff;
  border-color: var(--line);
  background: var(--card);
}

.contact {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 16px;
  color: var(--muted);
  text-decoration: none;
  word-break: break-all;
  min-height: 40px;
}

.contact:hover {
  color: var(--rose);
}

/* ---------- page ---------- */
main {
  position: relative;
  z-index: 1;
  margin-left: 238px;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.8fr);
  align-items: center;
  gap: 40px;
  min-height: 70vh;
  padding: 92px 56px 84px;
  overflow: hidden;
}

.hero-copy {
  max-width: 34ch;
}

.hero h1 {
  margin: 0 0 20px;
  font-family: var(--disp);
  font-size: clamp(32px, 4.6vw, 60px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
  background: linear-gradient(96deg, #fff 10%, #ffc6dd 55%, var(--rose));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  margin: 0;
  max-width: 46ch;
  color: var(--soft);
  font-size: 18px;
  line-height: 1.7;
}

.blade {
  position: absolute;
  left: -8%;
  right: -8%;
  bottom: -46px;
  height: 104px;
  transform: skewY(-3deg);
  background: linear-gradient(90deg, var(--red), var(--rose) 65%, rgba(255, 20, 147, 0));
  opacity: 0.42;
  filter: blur(2px);
}

.hero-art {
  position: relative;
  margin: 0;
  min-height: 342px;
  aspect-ratio: 1 / 1;
}

.hero-art.empty {
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    conic-gradient(from 210deg at 30% 30%, rgba(255, 0, 0, 0.5), rgba(255, 20, 147, 0.5), rgba(38, 23, 23, 0.9), rgba(255, 0, 0, 0.5));
  filter: saturate(1.15);
}

.hero-art .shot {
  position: absolute;
  width: 74%;
  height: auto;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
}

.hero-art .s1 {
  top: 0;
  right: 0;
}

.hero-art .s2 {
  bottom: 0;
  left: 0;
  width: 62%;
}

/* ---------- reader ---------- */
.reader {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 268px;
  gap: 52px;
  max-width: 1180px;
  padding: 10px 56px 96px;
}

.doc {
  min-width: 0;
}

.doc section {
  padding: 44px 0;
  border-top: 1px solid var(--line);
}

.doc section:first-child {
  border-top: 0;
  padding-top: 6px;
}

.doc section[id] {
  scroll-margin-top: 34px;
}

.doc h2 {
  margin: 8px 0 18px;
  font-family: var(--disp);
  font-size: clamp(25px, 2.8vw, 35px);
  font-weight: 600;
  line-height: 1.24;
  letter-spacing: -0.01em;
  background: linear-gradient(94deg, #ffffff, #ffb7d2);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.doc h3 {
  margin: 26px 0 12px;
  font-family: var(--disp);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.35;
  color: #ffd2e2;
}

.doc small {
  display: block;
  margin-bottom: 6px;
  font-family: var(--mono);
  font-size: 16px;
  letter-spacing: 0.16em;
  color: var(--rose);
}

.doc p {
  margin: 0 0 18px;
  max-width: 68ch;
  color: var(--soft);
}

.doc a {
  color: var(--rose);
  text-decoration: underline;
  text-decoration-color: rgba(255, 20, 147, 0.45);
  text-underline-offset: 3px;
}

.doc a:hover {
  color: #fff;
}

.doc img {
  max-width: 100%;
  height: auto;
  margin: 8px 0 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
}

.doc ul,
.doc ol {
  margin: 0 0 18px;
  padding-left: 22px;
  max-width: 68ch;
  color: var(--soft);
}

.doc li {
  margin-bottom: 8px;
}

.doc blockquote {
  margin: 20px 0;
  padding: 4px 0 4px 20px;
  border-left: 2px solid var(--rose);
  color: var(--muted);
}

.doc code {
  font-family: var(--mono);
  font-size: 16px;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

/* ---------- rail ---------- */
.rail {
  position: sticky;
  top: 32px;
  align-self: start;
  padding: 20px 16px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  backdrop-filter: blur(3px);
}

.rail small {
  font-family: var(--mono);
  font-size: 16px;
  letter-spacing: 0.18em;
  color: var(--rose);
}

.rail h2 {
  margin: 6px 0 14px;
  font-family: var(--disp);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  color: #fff;
}

.rail ol {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  counter-reset: rail;
}

.rail li {
  counter-increment: rail;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.rail li:first-child {
  border-top: 0;
}

.rail a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 4px 2px;
  font-size: 16px;
  line-height: 1.4;
  color: var(--muted);
  text-decoration: none;
}

.rail a::before {
  content: counter(rail, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 13px;
  color: rgba(255, 20, 147, 0.75);
}

.rail a:hover {
  color: #fff;
}

.totop {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 16px;
  color: var(--soft);
  text-decoration: none;
}

.totop:hover {
  border-color: var(--rose);
  color: #fff;
}

/* ---------- footer ---------- */
.foot {
  position: relative;
  z-index: 1;
  margin-left: 238px;
  padding: 44px 56px 26px;
  border-top: 1px solid var(--line);
  text-align: center;
  background: radial-gradient(90% 130% at 50% 0%, rgba(255, 20, 147, 0.14), transparent 72%);
}

.giant {
  margin: 0 0 30px;
  font-family: var(--disp);
  font-size: clamp(46px, 10.5vw, 132px);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.03em;
  background: linear-gradient(94deg, var(--red), var(--rose) 62%, #ffb3d1);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.foot-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
  max-width: 660px;
  margin: 0 auto 26px;
  text-align: left;
}

.foot-nav dl {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.foot-nav dt,
.foot-nav dd {
  margin: 0;
}

.foot-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 4px 0;
  font-size: 16px;
  color: var(--soft);
  text-decoration: none;
}

.foot-nav dd a {
  color: var(--muted);
  padding-left: 12px;
}

.foot-nav a:hover {
  color: var(--rose);
}

.colophon {
  margin: 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 16px;
  color: var(--muted);
}

/* ---------- motion ---------- */
.js .hero,
.js .doc > section,
.js .rail,
.js .foot > * {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.75s ease, transform 0.75s ease;
}

.js .in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .aurora {
    animation: none;
  }
  .js .hero,
  .js .doc > section,
  .js .rail,
  .js .foot > * {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------- narrow ---------- */
@media (max-width: 900px) {
  .side {
    position: sticky;
    inset: auto;
    top: 0;
    width: auto;
    height: auto;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brand {
    flex: 0 0 auto;
    font-size: 20px;
    white-space: nowrap;
  }

  .side-nav {
    flex: 1 1 auto;
    flex-direction: row;
    gap: 4px;
    padding-top: 0;
    border-top: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .side-nav::-webkit-scrollbar {
    display: none;
  }

  .side-nav a {
    white-space: nowrap;
    padding: 8px 10px;
    min-height: 44px;
    font-size: 16px;
  }

  .contact {
    display: none;
  }

  main,
  .foot {
    margin-left: 0;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 26px;
    min-height: 0;
    padding: 34px 18px 54px;
  }

  .hero-copy {
    max-width: none;
  }

  .hero-art {
    min-height: 216px;
    aspect-ratio: 16 / 11;
  }

  .blade {
    height: 68px;
    bottom: -30px;
  }

  .reader {
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 8px 18px 64px;
  }

  .rail {
    position: static;
    order: 2;
  }

  .doc section {
    padding: 32px 0;
  }

  .foot {
    padding: 34px 18px 20px;
  }

  .foot-nav {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .foot-nav dd a {
    padding-left: 0;
  }
}

button[aria-expanded]{min-width:44px;min-height:44px}
