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

:root {
  --ink: #111111;
  --paper: #F2F0E9;
  --sig: #FF4D1C;
  --line: rgba(242, 240, 233, .18);
  --dim: rgba(242, 240, 233, .64);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--ink);
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: "Space Mono", ui-monospace, SFMono-Regular, Menlo, "Noto Sans SC", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(242, 240, 233, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(242, 240, 233, .045) 1px, transparent 1px);
  background-size: 68px 68px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, .9), rgba(0, 0, 0, .25));
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, .9), rgba(0, 0, 0, .25));
}

a { color: var(--sig); }

/* ---------- top strip ---------- */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 46px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 16px;
  background: var(--ink);
  border-bottom: 2px solid var(--sig);
  z-index: 60;
}

.brand-dot {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  text-decoration: none;
  color: var(--paper);
}

.mark {
  display: inline-flex;
  width: 26px;
  height: 26px;
  align-items: center;
  justify-content: center;
  background: var(--sig);
  color: var(--ink);
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
}

.mark-img {
  display: block;
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.bar-slogan {
  font-size: 16px;
  letter-spacing: .16em;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-slash {
  margin-left: auto;
  width: 84px;
  height: 3px;
  background: var(--sig);
  transform: skewX(-32deg);
  flex: 0 0 auto;
}

/* ---------- shell ---------- */
.shell {
  position: relative;
  z-index: 1;
  max-width: 1220px;
  margin: 0 auto;
  padding: 78px 24px 0;
  display: grid;
  grid-template-columns: minmax(168px, 208px) minmax(0, 1fr);
  gap: 44px;
  align-items: start;
}

/* ---------- rail ---------- */
.rail {
  position: sticky;
  top: 64px;
  align-self: start;
  z-index: 30;
}

.rail-nav {
  background: #0c0c0c;
  border: 1px solid var(--line);
}

.rail-nav summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 12px 14px;
  font-size: 16px;
  letter-spacing: .18em;
  border-bottom: 1px solid var(--line);
}

.rail-nav summary::-webkit-details-marker { display: none; }

.rail-nav summary::before {
  content: "";
  width: 11px;
  height: 11px;
  flex: 0 0 auto;
  background: var(--sig);
  transform: rotate(45deg);
  transition: transform .25s ease;
}

.rail-nav[open] summary::before { transform: rotate(0); }

.rail-list {
  list-style: none;
  margin: 0;
  padding: 8px 0 10px;
}

.rail-list a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 11px 14px;
  color: var(--paper);
  text-decoration: none;
  font-size: 16px;
  line-height: 1.4;
  border-left: 3px solid transparent;
  transition: border-color .2s ease, background-color .2s ease, color .2s ease;
}

.rail-list a::before {
  content: "›";
  color: var(--sig);
  margin-right: 9px;
  font-size: 16px;
}

.rail-list a:hover,
.rail-list a:focus-visible {
  border-left-color: var(--sig);
  background: rgba(255, 77, 28, .1);
  outline: none;
}

/* ---------- doc ---------- */
.doc { min-width: 0; }

.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.12fr .88fr;
  gap: 32px;
  align-items: center;
  min-height: 70vh;
  padding: 40px 0 64px;
  overflow: hidden;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.3rem, 7vw, 4.5rem);
  line-height: 1.06;
  letter-spacing: -.02em;
  word-break: break-word;
}

.hero .lead {
  margin: 20px 0 0;
  max-width: 40ch;
  color: var(--dim);
  font-size: 17px;
}

.hero-art {
  position: relative;
  height: min(52vh, 430px);
  border: 1px solid var(--line);
  background: linear-gradient(140deg, #191919, #101010);
  overflow: hidden;
}

.hero-art--empty {
  background: repeating-linear-gradient(-45deg, #161616 0 14px, #1d1d1d 14px 28px);
}

.hero-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  will-change: transform;
}

.hero-slash {
  position: absolute;
  left: -12%;
  bottom: 26px;
  width: 132%;
  height: 10px;
  background: var(--sig);
  transform: rotate(-3.5deg);
  pointer-events: none;
}

.doc > div {
  position: relative;
  padding: 62px 0 54px;
  border-top: 1px solid var(--line);
  scroll-margin-top: 74px;
}

.doc > div::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 76px;
  height: 4px;
  background: var(--sig);
}

.doc h2 {
  margin: 0 0 14px;
  font-size: clamp(1.5rem, 3.4vw, 2.15rem);
  line-height: 1.22;
  letter-spacing: -.01em;
}

.doc h3 {
  margin: 30px 0 10px;
  font-size: 1.14rem;
  line-height: 1.35;
  color: var(--sig);
}

.doc p {
  margin: 0 0 16px;
  color: rgba(242, 240, 233, .84);
}

.doc p.subtitle,
.doc p.lead {
  color: var(--sig);
}

.doc ul,
.doc ol { padding-left: 22px; }

.doc li { margin: 0 0 8px; }

.doc img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 26px 0;
  border: 1px solid var(--line);
}

.doc blockquote {
  margin: 26px 0;
  padding: 4px 0 4px 18px;
  border-left: 4px solid var(--sig);
  color: var(--dim);
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 16px;
}

.doc th,
.doc td {
  border: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
}

.doc th { background: #1a1a1a; }

.doc code {
  font-family: inherit;
  background: #1c1c1c;
  padding: 1px 5px;
}

.doc a { text-decoration-thickness: 1px; }

.doc strong { color: var(--paper); }

/* ---------- footer ---------- */
.page-foot {
  position: relative;
  z-index: 1;
  margin-top: 92px;
  padding: 56px 24px 30px;
  background: #0a0a0a;
  border-top: 4px solid var(--sig);
}

.foot-top {
  max-width: 1172px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 48px;
  align-items: start;
}

.foot-brand h2 {
  margin: 0 0 16px;
  font-size: clamp(2.3rem, 7.6vw, 4.3rem);
  line-height: .94;
  letter-spacing: -.03em;
  word-break: break-word;
}

.foot-brand .subtitle {
  margin: 0 0 24px;
  color: var(--sig);
  font-size: 16px;
  letter-spacing: .2em;
}

.back-top {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 11px 18px;
  border: 1px solid var(--line);
  color: var(--paper);
  text-decoration: none;
  font-size: 16px;
}

.back-top:hover { border-color: var(--sig); color: var(--sig); }

.foot-dls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
}

.foot-dls dl { margin: 0; }

.foot-dls dt {
  margin: 0 0 8px;
  font-size: 16px;
  letter-spacing: .18em;
  color: var(--sig);
}

.foot-dls dd {
  margin: 0;
  font-size: 16px;
}

.foot-dls a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 9px 0;
  color: var(--paper);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

.foot-dls a:hover { color: var(--sig); }

.foot-base {
  max-width: 1172px;
  margin: 42px auto 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 16px;
  color: var(--dim);
}

/* ---------- motion ---------- */
body.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .7s ease, transform .7s ease;
  will-change: opacity, transform;
}

body.js .reveal.is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body.js .reveal { opacity: 1; transform: none; transition: none; }
  .hero-img { transform: none !important; }
}

/* ---------- breakpoints ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; min-height: 0; padding-top: 24px; }
  .hero-art { height: 240px; order: 2; }
  .hero h1 { font-size: clamp(2.1rem, 9vw, 3.2rem); }
  .foot-top { grid-template-columns: 1fr; gap: 34px; }
}

@media (max-width: 860px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    padding: 62px 16px 0;
  }

  .rail {
    top: 46px;
    background: var(--ink);
    padding-bottom: 6px;
    border-bottom: 1px solid var(--line);
    position: sticky;
  }

  .rail-nav summary { min-height: 42px; padding: 10px 12px; }

  .rail-list {
    display: flex;
    gap: 0;
    padding: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .rail-list::-webkit-scrollbar { display: none; }

  .rail-list li { flex: 0 0 auto; }

  .rail-list a {
    border-left: 0;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    padding: 10px 12px;
  }

  .rail-list a:hover,
  .rail-list a:focus-visible { border-bottom-color: var(--sig); }

  .hero-slash { bottom: 14px; height: 8px; }

  .doc > div { padding: 46px 0 40px; scroll-margin-top: 100px; }

  .page-foot { margin-top: 64px; padding: 44px 16px 26px; }

  .foot-dls { grid-template-columns: minmax(0, 1fr); gap: 18px; }

  .foot-dls a { min-height: 44px; }
}

@media (max-width: 420px) {
  body { font-size: 16px; }
  .bar-slogan { letter-spacing: .08em; }
  .bar-slash { width: 48px; }
  .hero-art { height: 200px; }
}

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