@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@300;400;500;600;700&family=Share+Tech+Mono&display=swap');

:root {
  --ink: #192617;
  --ink-deep: #0f1a0e;
  --neon: #87ff71;
  --sun: #ffce5c;
  --text: #e6f6df;
  --dim: #a3bd9a;
  --line: rgba(135, 255, 113, 0.34);
  --mono: 'Share Tech Mono', 'Fira Code', ui-monospace, monospace;
  --body: 'Fira Code', ui-monospace, 'PingFang SC', 'Microsoft YaHei', monospace;
}

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

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

body {
  margin: 0;
  padding-bottom: 96px;
  background: var(--ink);
  color: var(--text);
  font: 400 16px/1.8 var(--body);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(rgba(135, 255, 113, 0.16) 1px, transparent 1px),
    repeating-linear-gradient(48deg, rgba(255, 206, 92, 0.05) 0 2px, transparent 2px 14px);
  background-size: 22px 22px, auto;
  opacity: 0.6;
  mix-blend-mode: screen;
}

img { max-width: 100%; }

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

:focus-visible {
  outline: 2px dashed var(--sun);
  outline-offset: 3px;
}

/* ---------- decorative field ---------- */

.deco {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.deco span { position: absolute; display: block; }

.deco-tri {
  width: 130px;
  height: 130px;
  right: -30px;
  top: 18vh;
  background: var(--sun);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  opacity: 0.8;
  transform: rotate(12deg);
}

.deco-ring {
  width: 180px;
  height: 180px;
  left: -70px;
  bottom: 16vh;
  border: 10px dotted var(--neon);
  border-radius: 50%;
  opacity: 0.45;
}

.deco-zig {
  width: 220px;
  height: 26px;
  right: 4vw;
  bottom: 26vh;
  background: repeating-linear-gradient(90deg, var(--neon) 0 12px, transparent 12px 24px);
  transform: rotate(-6deg);
  opacity: 0.35;
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 20px 40px;
  overflow: hidden;
  border-bottom: 3px dashed var(--line);
}

.ghost {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 0;
  font-family: var(--mono);
  font-size: clamp(150px, 42vw, 420px);
  line-height: 0.8;
  letter-spacing: 0.02em;
  text-align: center;
  color: transparent;
  -webkit-text-stroke: 2px rgba(255, 206, 92, 0.24);
  pointer-events: none;
  user-select: none;
}

.hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1060px;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 34px;
  align-items: center;
}

.hero-art {
  margin: 0;
  aspect-ratio: 4 / 5;
  border: 3px dashed var(--sun);
  border-radius: 4px;
  overflow: hidden;
  background: var(--ink-deep);
  transform: rotate(-2.5deg);
}

.hero-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.08) contrast(1.06);
}

.hero-art--shape {
  position: relative;
  border-style: solid;
  border-color: var(--neon);
  background:
    repeating-linear-gradient(0deg, rgba(135, 255, 113, 0.1) 0 1px, transparent 1px 16px),
    var(--ink-deep);
}

.hero-art--shape span { position: absolute; display: block; }

.hero-art--shape .a {
  width: 62%;
  height: 62%;
  left: 8%;
  top: 10%;
  background: var(--neon);
  clip-path: polygon(0 0, 100% 24%, 74% 100%, 12% 76%);
  mix-blend-mode: screen;
}

.hero-art--shape .b {
  width: 44%;
  height: 44%;
  right: 6%;
  bottom: 8%;
  background: var(--sun);
  border-radius: 50%;
  mix-blend-mode: screen;
}

.hero-art--shape .c {
  width: 120px;
  height: 18px;
  right: 12%;
  top: 16%;
  background: var(--text);
  transform: rotate(-28deg);
}

.hero-copy { text-align: center; }

.hero-copy h1 {
  margin: 0;
  font-family: var(--mono);
  font-size: clamp(30px, 5.4vw, 58px);
  line-height: 1.14;
  letter-spacing: 0.03em;
  color: var(--neon);
  text-shadow: 3px 3px 0 rgba(25, 38, 23, 0.9);
  word-break: break-word;
}

.hero-bars {
  display: block;
  width: 128px;
  height: 30px;
  margin: 22px auto 0;
  background:
    linear-gradient(90deg, var(--sun) 0 30px, transparent 30px 38px, var(--neon) 38px 68px, transparent 68px 76px, var(--sun) 76px 106px, transparent 106px 114px, var(--neon) 114px 128px);
  clip-path: polygon(0 40%, 100% 0, 100% 60%, 0 100%);
}

/* ---------- main grid ---------- */

main {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 60px 20px 40px;
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: 34px;
  align-items: start;
}

/* ---------- aside ---------- */

.toc {
  position: sticky;
  top: 22px;
  padding: 16px 14px 20px;
  border: 2px dashed var(--line);
  border-radius: 4px;
  background: rgba(15, 26, 14, 0.72);
  transform: rotate(-0.8deg);
}

.toc h2 {
  margin: 0 0 8px;
  font-family: var(--mono);
  font-size: 17px;
  letter-spacing: 0.14em;
  color: var(--sun);
}

.toc hr {
  margin: 0 0 12px;
  border: 0;
  border-top: 2px dotted rgba(255, 206, 92, 0.5);
}

.toc-list {
  counter-reset: toc;
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc-list li { counter-increment: toc; }

.toc-list a {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 6px 4px;
  font-size: 15px;
  line-height: 1.4;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px dotted rgba(135, 255, 113, 0.2);
}

.toc-list a::before {
  content: counter(toc, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--sun);
  flex: none;
}

.toc-list a:hover,
.toc-list a[aria-current] {
  color: var(--ink);
  background: var(--neon);
  border-bottom-color: var(--neon);
}

.toc-list a:hover::before,
.toc-list a[aria-current]::before { color: var(--ink); }

.toc-tag {
  display: block;
  width: 46px;
  height: 12px;
  margin-top: 16px;
  background: repeating-linear-gradient(90deg, var(--neon) 0 6px, transparent 6px 12px);
}

/* ---------- section ---------- */

.doc {
  min-width: 0;
  max-width: 74ch;
}

.doc article {
  padding: 0 0 52px;
  margin: 0 0 52px;
  border-bottom: 2px dotted rgba(135, 255, 113, 0.24);
  scroll-margin-top: 24px;
}

.doc article:last-child {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 8px;
}

.doc h2 {
  margin: 0 0 10px;
  font-family: var(--mono);
  font-size: clamp(22px, 3vw, 31px);
  line-height: 1.28;
  letter-spacing: 0.03em;
  color: var(--sun);
}

.doc h2::before {
  content: "";
  display: inline-block;
  width: 13px;
  height: 13px;
  margin-right: 10px;
  vertical-align: 1px;
  background: var(--neon);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.doc h3 {
  margin: 26px 0 10px;
  font-family: var(--mono);
  font-size: 20px;
  line-height: 1.35;
  color: var(--neon);
  letter-spacing: 0.02em;
}

hr {
  border: 0;
  border-top: 2px dashed var(--line);
  margin: 0 0 22px;
}

.doc p { margin: 0 0 18px; }

.doc ul,
.doc ol {
  margin: 0 0 20px;
  padding-left: 1.3em;
}

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

.doc li::marker { color: var(--sun); }

.doc blockquote {
  margin: 0 0 20px;
  padding: 14px 18px;
  border-left: 5px solid var(--sun);
  border-radius: 0 4px 4px 0;
  background: rgba(255, 206, 92, 0.07);
}

.doc blockquote p:last-child { margin-bottom: 0; }

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

.doc figure { margin: 0 0 22px; }

.doc img {
  display: block;
  height: auto;
  border: 2px solid var(--line);
  border-radius: 4px;
}

.doc time {
  display: inline-block;
  padding: 2px 8px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink);
  background: var(--sun);
  border-radius: 4px;
}

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

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

.doc th { color: var(--sun); }

/* ---------- dock (fixed bottom) ---------- */

.dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: rgba(15, 26, 14, 0.96);
  border-top: 3px dashed var(--neon);
}

.dock-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  min-height: 44px;
  padding: 0 10px;
  font-family: var(--mono);
  font-size: 16px;
  letter-spacing: 0.05em;
  color: var(--neon);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.dock-name { white-space: nowrap; }

.brand-logo {
  display: block;
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.brand-dot {
  width: 13px;
  height: 13px;
  flex: none;
  background: var(--sun);
  transform: rotate(45deg);
}

.dock-nav {
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

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

.dock-list {
  display: flex;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dock-list a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  font-size: 15px;
  white-space: nowrap;
  color: var(--dim);
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 4px;
}

.dock-list a:hover,
.dock-list a:focus-visible,
.dock-list a[aria-current] {
  color: var(--ink);
  background: var(--neon);
  border-color: var(--neon);
}

.dock-cta {
  flex: none;
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  font-weight: 600;
  color: var(--ink);
  background: var(--sun);
  border-radius: 4px;
  text-decoration: none;
}

.dock-cta:hover { background: var(--neon); }

/* ---------- footer ---------- */

.foot {
  position: relative;
  z-index: 1;
  margin-top: 44px;
  padding: 30px 20px 34px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px 26px;
  background: var(--ink-deep);
  border-top: 3px solid var(--sun);
}

.foot-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.foot-dot {
  width: 22px;
  height: 22px;
  background: var(--neon);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.foot-name {
  font-family: var(--mono);
  font-size: clamp(20px, 3vw, 27px);
  letter-spacing: 0.05em;
  color: var(--neon);
}

.foot-nav ol {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.foot-nav a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0 8px;
  font-size: 15px;
  color: var(--dim);
  text-decoration: none;
  border-bottom: 1px dotted rgba(135, 255, 113, 0.35);
}

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

.foot-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
  color: var(--dim);
}

.foot-meta .copy { letter-spacing: 0.02em; }

.foot-meta a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0 10px;
  color: var(--sun);
  text-decoration: none;
  border: 1px dashed rgba(255, 206, 92, 0.55);
  border-radius: 4px;
}

/* ---------- reveal ---------- */

html.js .reveal {
  opacity: 0;
  transform: translateY(18px);
}

html.js .reveal.in {
  opacity: 1;
  transform: none;
  transition: opacity 0.55s ease, transform 0.55s ease;
}

html.js .toc.reveal.in { transform: rotate(-0.8deg); }

/* ---------- breakpoints ---------- */

@media (max-width: 900px) {
  main {
    grid-template-columns: minmax(0, 1fr);
    gap: 26px;
    padding-top: 40px;
  }

  .toc {
    position: static;
    transform: none;
  }

  html.js .toc.reveal.in { transform: none; }

  .toc-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 6px;
  }

  .toc-list li { flex: 1 1 auto; }

  .toc-list a {
    border: 1px dashed rgba(135, 255, 113, 0.28);
    border-radius: 4px;
    padding: 4px 8px;
    min-height: 40px;
  }
}

@media (max-width: 780px) {
  .hero {
    padding: 40px 18px 32px;
    min-height: auto;
  }

  .hero-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
  }

  .hero-copy { order: 1; }

  .hero-art {
    order: 2;
    aspect-ratio: 16 / 10;
    transform: rotate(-1.5deg);
  }

  .ghost { font-size: clamp(120px, 46vw, 260px); opacity: 0.85; }

  .deco-ring { display: none; }

  .foot {
    flex-direction: column;
    align-items: flex-start;
    padding-bottom: 28px;
  }

  .foot-meta { justify-content: space-between; width: 100%; }
}

@media (max-width: 560px) {
  .dock-name { display: none; }

  .dock-brand { padding: 0 10px; }

  .dock-cta { padding: 0 12px; }

  .hero-bars { margin-top: 16px; }

  .doc h2::before { width: 11px; height: 11px; }
}

@media (max-width: 400px) {
  body { padding-bottom: 92px; }

  .dock { gap: 6px; padding: 8px 8px; }

  .dock-list a { padding: 0 8px; font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  html.js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .ghost { transform: translateY(-50%) !important; }
}

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