:root {
  --bg: #0a0e14;
  --bg-2: #161b22;
  --ink: #f0f6fc;
  --muted: #8b93a7;
  --line: rgba(240, 246, 252, 0.12);
  --line-strong: rgba(240, 246, 252, 0.28);
  --accent: #c77dff;
  --accent-rgb: 199, 125, 255;
  --accent-dim: #9b59d0;
  --on-accent: #0a0e14;
  --cursor: #c77dff;
  --cursor-rgb: 199, 125, 255;
  --panel: #12101a;
  --glow: #c77dff;
  --c-home: #c77dff;
  --c-build: #00ffcc;
  --c-service: #c3e88d;
  --c-cs: #82aaff;
  --c-community: #89ddff;
  --max: 1280px;
  --nav-h: 72px;
  --stage: calc(100svh - var(--nav-h));
  --display: "IBM Plex Sans Condensed", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", sans-serif;
  --body: "IBM Plex Sans", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
}

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

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

html.has-snap {
  scroll-snap-type: y mandatory;
  scroll-behavior: auto;
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.68;
  cursor: none;
  overflow-x: hidden;
}

html.has-custom-cursor,
html.has-custom-cursor *,
html.has-custom-cursor *::before,
html.has-custom-cursor *::after {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1' height='1'%3E%3C/svg%3E") 0 0, none !important;
}

body.touch-ui {
  cursor: auto;
}

img,
svg {
  display: block;
  max-width: 100%;
}

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

button {
  font: inherit;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 100;
  padding: 8px 12px;
  background: var(--accent);
  color: var(--on-accent);
}

.skip-link:focus {
  top: 12px;
}

.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 80;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 70;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, #c77dff, #82aaff, #00ffcc, #c3e88d);
  box-shadow: 0 0 12px rgba(130, 170, 255, 0.45);
  pointer-events: none;
}

/* Cursor */
.cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 90;
  width: 0;
  height: 0;
  pointer-events: none;
  mix-blend-mode: plus-lighter;
  opacity: 0;
}

.tick {
  position: absolute;
  background: var(--cursor);
  box-shadow: 0 0 6px rgba(var(--cursor-rgb), 0.9);
  transition: transform 0.2s ease, background-color 0.25s ease, box-shadow 0.25s ease;
}

.tick-n,
.tick-s {
  width: 1.25px;
  height: 7px;
  left: -0.625px;
}

.tick-n {
  top: -11px;
}

.tick-s {
  top: 4px;
}

.tick-e,
.tick-w {
  width: 7px;
  height: 1.25px;
  top: -0.625px;
}

.tick-w {
  left: -11px;
}

.tick-e {
  left: 4px;
}

body.is-pointer .tick-n {
  transform: translateY(-4px);
}

body.is-pointer .tick-s {
  transform: translateY(4px);
}

body.is-pointer .tick-e {
  transform: translateX(4px);
}

body.is-pointer .tick-w {
  transform: translateX(-4px);
}

body.touch-ui .cursor {
  display: none !important;
}

/* Nav */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  height: var(--nav-h);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 0 28px;
  background: linear-gradient(180deg, rgba(10, 14, 20, 0.88), rgba(10, 14, 20, 0));
  backdrop-filter: blur(0px);
}

.nav.is-scrolled {
  background: rgba(10, 14, 20, 0.72);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.nav-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.12em;
}

.nav-mark-logo {
  width: 64px;
  height: 44px;
  max-width: none;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

.nav-mark-box {
  width: 10px;
  height: 10px;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

.nav-mark sup {
  font-size: 0.7em;
}

.nav-links {
  display: flex;
  justify-content: center;
  gap: 28px;
}

.nav-links a {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.04em;
  transition: color 0.2s ease;
}

.nav-links a span {
  font-family: var(--mono);
  font-size: 12px;
}

.nav-links a[data-nav="build"] span {
  color: var(--c-build);
}

.nav-links a[data-nav="service"] span {
  color: var(--c-service);
}

.nav-links a[data-nav="cs"] span {
  color: var(--c-cs);
}

.nav-links a[data-nav="community"] span {
  color: var(--c-community);
}

.nav-links a:hover,
.nav-links a.is-active {
  color: var(--ink);
}

.nav-links a.is-active span {
  filter: brightness(1.15);
}

.nav-cta {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  padding: 8px 12px;
  border: 1px solid #2a2a2a;
  color: var(--muted);
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.nav-cta:hover,
.nav-cta.is-active {
  color: var(--on-accent);
  background: var(--accent);
  border-color: var(--accent);
}

/* Dots */
.dots {
  position: fixed;
  right: 22px;
  top: 50%;
  z-index: 55;
  transform: translateY(-50%);
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dots a {
  position: relative;
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid var(--dot);
  background: transparent;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.dots a::before {
  content: attr(data-label);
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--dot);
  opacity: 0;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

.dots li:nth-child(1) a {
  --dot: var(--c-home);
}

.dots li:nth-child(2) a {
  --dot: var(--c-build);
}

.dots li:nth-child(3) a {
  --dot: var(--c-service);
}

.dots li:nth-child(4) a {
  --dot: var(--c-cs);
}

.dots li:nth-child(5) a {
  --dot: var(--c-community);
}

.dots li:nth-child(6) a {
  --dot: var(--c-home);
}

.dots a.is-active {
  background: var(--dot);
  border-color: var(--dot);
  box-shadow: 0 0 12px var(--dot);
  transform: scale(1.28);
}

.dots a.is-active::before,
.dots a:hover::before {
  opacity: 1;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--accent);
  transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

.btn-arrow {
  font-family: var(--mono);
  font-size: 13px;
  transition: transform 0.25s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 24px rgba(var(--accent-rgb), 0.32);
}

.btn:hover .btn-arrow {
  transform: translate(3px, -3px);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: #2a2a2a;
}

.btn-ghost:hover {
  background: var(--ink);
  color: var(--on-accent);
  border-color: var(--ink);
  box-shadow: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--ink);
  appearance: none;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.chip:hover {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}

.chip-empty {
  color: var(--muted);
  border-style: dashed;
  border-color: var(--line);
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: pulse 2.2s ease infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.45;
    transform: scale(0.8);
  }
}

.snap {
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

/* Hero */
.hero {
  position: relative;
  min-height: 100svh;
  height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 28px 48px 28px;
  overflow: hidden;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(var(--accent-rgb), 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--accent-rgb), 0.07) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse at 50% 40%, #000 35%, transparent 78%);
  animation: gridshift 28s linear infinite;
}

@keyframes gridshift {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 72px 72px;
  }
}

.hero-scan {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    180deg,
    transparent 0 3px,
    rgba(0, 0, 0, 0.08) 3px 4px
  );
  opacity: 0.35;
}

.hero-photo {
  position: absolute;
  inset: 0;
  margin: 0;
  background: radial-gradient(ellipse at 70% 40%, rgba(var(--accent-rgb), 0.16), transparent 50%);
}

.hero-photo.has-photo {
  background-size: cover;
  background-position: center;
}

.photo-slide {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 1.1s ease;
}

.photo-slide.is-on {
  opacity: 1;
}

.hero-photo.has-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(10, 14, 20, 0.35), rgba(10, 14, 20, 0.88));
}

.hero-logo {
  position: absolute;
  right: 120px;
  top: 46%;
  z-index: 0;
  width: min(40vw, 540px);
  margin: 0;
  transform: translateY(-50%);
  pointer-events: none;
}

.hero-logo img {
  display: block;
  width: 100%;
  height: auto;
  opacity: 0.9;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 28%, #000 100%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 28%, #000 100%);
  filter: drop-shadow(0 0 36px rgba(199, 125, 255, 0.32));
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: var(--max);
}

.hero h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(48px, 8.6vw, 108px);
  line-height: 1.02;
  letter-spacing: 0.02em;
}

.hero-line {
  display: block;
}

.hero-line-outline {
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(242, 243, 239, 0.82);
  text-stroke: 1.5px rgba(242, 243, 239, 0.82);
}

.hero-lead {
  margin: 36px 0 0;
  max-width: 420px;
  color: #d0d7e2;
  font-size: 16px;
}

.hero-actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 28px 0 0;
}

.hero-meta {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  list-style: none;
  margin: 56px 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.hero-meta li {
  min-width: 0;
  padding: 20px 28px 8px 28px;
  border-right: 1px solid var(--line);
}

.hero-meta li:last-child {
  border-right: 0;
}

.hero-meta span {
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
}

.hero-meta li:nth-child(1) span {
  color: var(--c-build);
}

.hero-meta li:nth-child(2) span {
  color: var(--c-service);
}

.hero-meta li:nth-child(3) span {
  color: var(--c-cs);
}

.hero-meta li:nth-child(4) span {
  color: var(--c-community);
}

.hero-meta strong {
  display: block;
  margin-top: 8px;
  font-size: 15px;
  font-weight: 600;
}

.hero-meta em {
  display: block;
  margin-top: 4px;
  font-style: normal;
  color: var(--muted);
  font-size: 14px;
}

.hero h1 {
  color: #fff;
}

.hero-line-solid {
  color: #fff;
}

.scroll-cue {
  position: absolute;
  right: 56px;
  bottom: 132px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.scroll-cue-line {
  width: 1px;
  height: 56px;
  background: linear-gradient(180deg, var(--accent), transparent);
  animation: cue 1.8s ease infinite;
}

@keyframes cue {
  0% {
    transform: scaleY(0.3);
    transform-origin: top;
    opacity: 0;
  }
  40% {
    transform: scaleY(1);
    opacity: 1;
  }
  100% {
    transform: scaleY(1);
    transform-origin: bottom;
    opacity: 0;
  }
}

/* Chapters */
.chapter {
  position: relative;
  min-height: 100svh;
  height: 100svh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  background: var(--bg);
  overflow: hidden;
  --cut: 12vw;
  --seam-rot: atan(calc(var(--cut) / 100svh));
  --split: 52.5%;
}

.chapter-flip {
  grid-template-columns: 0.95fr 1.05fr;
  --split: 47.5%;
}

.chapter-visual {
  position: relative;
  margin: 0;
  min-height: 100svh;
  background:
    radial-gradient(ellipse at 50% 50%, rgba(var(--accent-rgb), 0.1), transparent 55%),
    linear-gradient(180deg, #12151c, #0a0e14);
  overflow: hidden;
}

.chapter-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.7;
}

.chapter-visual.has-photo {
  background-color: #0a0e14;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
}

.chapter-visual.has-photo::before {
  opacity: 0;
}

.chapter-visual.has-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg, rgba(10, 14, 20, 0.12), rgba(10, 14, 20, 0.28));
}

.chapter-flip .chapter-visual.has-photo::after {
  background: linear-gradient(-90deg, rgba(10, 14, 20, 0.12), rgba(10, 14, 20, 0.28));
}

.chapter-visual[data-photo-fit="contain"] {
  background: #f4f6f8;
}

.chapter-visual[data-photo-fit="contain"].has-photo::after {
  background: linear-gradient(90deg, rgba(10, 14, 20, 0.04), rgba(10, 14, 20, 0.1));
}

.chapter-flip .chapter-visual[data-photo-fit="contain"].has-photo::after {
  background: linear-gradient(-90deg, rgba(10, 14, 20, 0.04), rgba(10, 14, 20, 0.1));
}

.chapter-visual[data-photo-fit="contain"] .visual-code {
  color: #5a6573;
}

.visual-code {
  position: absolute;
  left: 28px;
  bottom: 28px;
  z-index: 2;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.16em;
  color: color-mix(in srgb, var(--glow) 75%, white);
}

.chapter-copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100svh;
  padding: 56px 7vw 48px calc(var(--cut) + 4vw);
  background: var(--panel);
  clip-path: polygon(0 0, 100% 0, 100% 100%, var(--cut) 100%);
  margin-left: calc(-1 * var(--cut));
}

.chapter-flip .chapter-copy {
  order: -1;
  margin-left: 0;
  margin-right: calc(-1 * var(--cut));
  padding: 56px calc(var(--cut) + 4vw) 48px 7vw;
  clip-path: polygon(0 0, 100% 0, calc(100% - var(--cut)) 100%, 0 100%);
}

.chapter-copy-inner {
  position: relative;
  z-index: 1;
  max-width: 34rem;
}

.chapter-copy::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 18vw;
  background: linear-gradient(90deg, transparent, var(--panel) 70%);
  pointer-events: none;
}

.chapter-flip .chapter-copy::before {
  left: auto;
  right: 0;
  background: linear-gradient(-90deg, transparent, var(--panel) 70%);
}

.chapter-seam {
  position: absolute;
  top: -8%;
  left: calc(var(--split) - var(--cut) / 2);
  z-index: 3;
  width: 2px;
  height: 116%;
  margin-left: -1px;
  background: linear-gradient(180deg, transparent 4%, var(--glow) 16%, var(--glow) 84%, transparent 96%);
  transform-origin: 50% 50%;
  transform: rotate(var(--seam-rot));
  box-shadow: 0 0 18px var(--glow);
  pointer-events: none;
  opacity: 0.92;
}

.chapter-flip .chapter-seam {
  left: calc(var(--split) + var(--cut) / 2);
  right: auto;
  transform: rotate(calc(-1 * var(--seam-rot)));
}

.chapter-index {
  margin: 0 0 10px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.14em;
  color: color-mix(in srgb, var(--glow) 80%, white);
}

.chapter h2 {
  margin: 0 0 18px;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(28px, 3.4vw, 42px);
  line-height: 1.2;
  letter-spacing: 0.015em;
}

.chapter-lead {
  margin: 0 0 28px;
  max-width: 42em;
  color: #c9d1d9;
}

.title-mark {
  font-style: normal;
  font-weight: inherit;
  color: var(--glow, var(--accent));
}

.chapter-points {
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
  display: grid;
  gap: 16px;
}

.chapter-points li {
  display: grid;
  gap: 4px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.chapter-points strong {
  font-size: 15px;
}

.chapter-points span {
  color: var(--muted);
  font-size: 15px;
}

.chapter .btn {
  align-self: flex-start;
  margin-top: 8px;
}

.chapter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.chapter-actions .btn {
  margin-top: 0;
}

/* Reveal */
.hero-inner,
.hero-actions,
.hero-meta,
.chapter-copy-inner {
  opacity: 0;
  transform: translateY(22px);
  animation: rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.hero-meta {
  animation-delay: 0.18s;
}

.hero-actions {
  animation-delay: 0.1s;
}

.chapter-copy-inner {
  animation: none;
  opacity: 1;
  transform: none;
}

.chapter.is-in .chapter-copy-inner {
  animation: rise 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Contact + footer share one snap screen */
.endcap {
  height: 100svh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: #080b10;
  overflow: hidden;
}

.endcap-cta {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 88px 48px 20px;
  max-width: var(--max);
}

.endcap-cta h2 {
  margin: 0 0 16px;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(32px, 4.6vw, 52px);
  line-height: 1.18;
  letter-spacing: 0.01em;
}

.endcap-cta p {
  margin: 0 0 28px;
  max-width: 36em;
  color: #c9d1d9;
}

.endcap-cta .btn {
  align-self: flex-start;
}

.endcap.is-in .endcap-cta {
  animation: rise 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.endcap .footer {
  flex: 0 0 auto;
  padding: 24px 48px 28px;
}

.endcap .footer-bottom {
  margin-top: 24px;
}

/* Footer */
.footer {
  padding: 64px 48px 28px;
  background: #080b10;
  border-top: 1px solid var(--line);
}

.footer-top {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 32px;
  max-width: var(--max);
}

.footer-mark {
  margin: 0 0 8px;
  font-family: var(--mono);
  font-size: 22px;
  color: var(--accent);
}

.footer-name {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.footer-label {
  margin: 0 0 12px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
}

.footer-col a {
  color: #c9d1d9;
  transition: color 0.2s ease;
}

.footer-col a:hover {
  color: var(--accent);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 48px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-family: var(--mono);
}

.to-top:hover {
  color: var(--accent);
}

/* Inner pages */
.page {
  min-height: 100svh;
  padding: calc(var(--nav-h) + 56px) 48px 0;
}

.page-hero {
  max-width: 860px;
}

.page-kicker {
  margin: 0 0 16px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.page-hero h1 {
  margin: 0 0 20px;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(32px, 4.6vw, 52px);
  line-height: 1.18;
  letter-spacing: 0.01em;
}

.page-lead {
  margin: 0;
  max-width: 42em;
  color: #c9d1d9;
  font-size: 16px;
}

.page-visual {
  position: relative;
  margin: 40px 0 0;
  min-height: min(52vh, 520px);
  overflow: hidden;
  border: 1px solid var(--line);
  background-color: var(--panel);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.page-visual[data-photo-fit="contain"] {
  background-color: #f4f6f8;
}

.page-body {
  max-width: 720px;
  padding: 48px 0 24px;
}

.page-body p {
  margin: 0 0 16px;
  color: #c9d1d9;
}

.page-points {
  list-style: none;
  margin: 28px 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.page-points li {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.page-points strong {
  display: block;
  margin-bottom: 4px;
}

.page-points span {
  color: var(--muted);
  font-size: 14px;
}

.page-note {
  margin: 36px 0 0;
  padding: 16px 18px;
  border: 1px dashed var(--line);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.dir {
  max-width: 880px;
  margin-top: 56px;
  padding-bottom: 24px;
}

.dir-block {
  margin: 0 0 48px;
}

.dir-block h2 {
  margin: 0 0 4px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.dir-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-strong);
}

.dir-head span {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.dir-row {
  display: grid;
  grid-template-columns: minmax(120px, 200px) 1fr;
  gap: 12px 28px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}

.dir-name {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.dir-index {
  display: block;
  margin-bottom: 4px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.dir-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.dir-links a {
  font-family: var(--mono);
  font-size: 13px;
  color: #d0d7e2;
  transition: color 0.2s ease;
}

.dir-links a:hover {
  color: var(--accent);
}

.dir-links a span {
  opacity: 0.55;
}

/* News */
.news-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 36px 0 8px;
}

.news-filters .chip {
  --chip: var(--accent);
  --chip-ink: var(--on-accent);
  border-color: color-mix(in srgb, var(--chip) 45%, var(--line-strong));
  color: var(--chip);
}

.news-filters .chip[data-tag="all"] { --chip: var(--c-home); }
.news-filters .chip[data-tag="build"] { --chip: var(--c-build); }
.news-filters .chip[data-tag="service"] { --chip: var(--c-service); }
.news-filters .chip[data-tag="cs"] { --chip: var(--c-cs); }
.news-filters .chip[data-tag="community"] { --chip: var(--c-community); }

.news-filters .chip.is-on,
.news-filters .chip:hover {
  background: var(--chip);
  border-color: var(--chip);
  color: var(--chip-ink);
}

.news-feed {
  display: grid;
  gap: 18px;
  margin: 28px 0 48px;
  max-width: 760px;
}

.news-card {
  padding: 22px 0;
  border-top: 1px solid var(--line);
}

.news-card:first-child {
  border-top: 0;
  padding-top: 0;
}

.news-card time,
.news-detail-view time {
  display: block;
  margin-bottom: 8px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.news-card h3 {
  margin: 0 0 10px;
  font-family: var(--display);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.news-card h3 a:hover {
  color: var(--accent);
}

.news-card p {
  margin: 0;
  color: #c9d1d9;
}

.news-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.news-more:hover {
  color: var(--ink);
}

.news-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px !important;
}

.news-tag,
.news-strip-more {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.news-tag[data-tag="build"] { color: var(--c-build); }
.news-tag[data-tag="service"] { color: var(--c-service); }
.news-tag[data-tag="cs"] { color: var(--c-cs); }
.news-tag[data-tag="community"] { color: var(--c-community); }

.news-tag:hover,
.news-strip-more:hover {
  color: var(--ink);
}

.news-empty {
  color: var(--muted);
}

.news-strip {
  max-width: 720px;
  margin: 48px 0 24px;
  padding-top: 8px;
}

.news-strip .dir-head h2 {
  margin: 0;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.news-strip .news-card h3 {
  font-size: 22px;
}

.news-card.is-compact .news-more {
  margin-top: 10px;
}

.news-detail-view {
  max-width: 760px;
  padding-bottom: 48px;
}

.news-back {
  margin: 0 0 28px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.news-back a {
  color: var(--muted);
}

.news-back a:hover {
  color: var(--accent);
}

.news-detail-view h1 {
  margin: 0 0 16px;
  font-family: var(--display);
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.18;
}

.news-article {
  margin-top: 28px;
  font-size: 16px;
  line-height: 1.75;
  color: #c9d1d9;
}

.news-article > * {
  margin: 0 0 1em;
}

.news-article h2,
.news-article h3,
.news-article h4 {
  margin: 1.6em 0 0.6em;
  font-family: var(--display);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.01em;
}

.news-article h2 { font-size: 28px; }
.news-article h3 { font-size: 22px; }
.news-article h4 { font-size: 18px; }

.news-article a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.news-article ul,
.news-article ol {
  padding-left: 1.3em;
}

.news-article li {
  margin: 0 0 0.4em;
}

.news-article blockquote {
  margin: 1.2em 0;
  padding: 4px 0 4px 16px;
  border-left: 2px solid var(--accent);
  color: var(--ink);
}

.news-article img,
.news-article figure {
  display: block;
  max-width: 100%;
  margin: 1.4em 0;
}

.news-article figcaption {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}

.news-article pre,
.news-article code {
  font-family: var(--mono);
  font-size: 13px;
}

.news-article pre {
  padding: 14px 16px;
  overflow-x: auto;
  border: 1px solid var(--line);
  background: var(--panel);
}

.news-article hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2em 0;
}

@media (max-width: 720px) {
  .dir-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

body.is-page .dots,
body.is-page .scroll-progress {
  display: none;
}

body.is-page .nav {
  background: rgba(10, 14, 20, 0.72);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

/* Responsive */
@media (max-width: 1100px) {
  .hero {
    padding: calc(var(--nav-h) + 24px) 28px 28px;
    height: auto;
    min-height: 100svh;
  }

  body.is-home .hero,
  body.is-home .chapter,
  body.is-home .endcap {
    height: auto;
    min-height: auto;
  }

  .hero-logo {
    width: min(70vw, 480px);
    right: 28px;
    top: 36%;
    opacity: 0.55;
  }

  .hero-meta {
    grid-template-columns: 1fr 1fr;
  }

  .hero-meta li {
    padding: 18px 20px 10px;
  }

  .hero-meta li:nth-child(2) {
    border-right: 0;
  }

  .scroll-cue,
  .dots {
    display: none;
  }

  .endcap {
    height: auto;
    min-height: auto;
    overflow: visible;
  }

  .endcap-cta {
    padding: 48px 20px 20px;
  }

  .chapter,
  .chapter-flip {
    grid-template-columns: 1fr;
    height: auto;
    min-height: auto;
    overflow: visible;
  }

  .chapter-visual {
    min-height: 46svh;
  }

  .chapter-copy,
  .chapter-flip .chapter-copy {
    order: 0;
    min-height: auto;
    margin: 0;
    padding: 40px 28px 56px;
    clip-path: none;
  }

  .chapter-copy-inner {
    max-width: none;
  }

  .chapter-copy::before,
  .chapter-seam {
    display: none;
  }

  .chapter-copy {
    background-image: linear-gradient(180deg, transparent, var(--panel) 18%);
    margin-top: -48px;
  }

  .footer {
    padding: 40px 28px 24px;
  }

  .footer-top {
    grid-template-columns: 1fr 1fr;
  }

  .page {
    padding: calc(var(--nav-h) + 40px) 28px 0;
  }
}

@media (max-width: 720px) {
  body {
    font-size: 15px;
  }

  .nav {
    padding: 8px 16px 6px;
    grid-template-columns: auto 1fr;
    height: auto;
    min-height: var(--nav-h);
  }

  .nav-links {
    display: flex;
    grid-column: 1 / -1;
    order: 3;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 0 2px;
  }

  .nav-cta {
    justify-self: end;
  }

  .page {
    padding: calc(var(--nav-h) + 56px) 20px 0;
  }

  .hero {
    padding: calc(var(--nav-h) + 16px) 20px 24px;
    justify-content: flex-end;
    height: auto;
    min-height: 100svh;
  }

  .hero h1 {
    font-size: clamp(40px, 12vw, 64px);
    letter-spacing: 0.01em;
  }

  .hero-meta {
    display: none;
  }

  .hero-lead {
    font-size: 14px;
  }

  .hero-logo {
    width: min(92vw, 420px);
    right: -12%;
    top: 30%;
    opacity: 0.38;
  }

  .footer-top,
  .footer-bottom {
    grid-template-columns: 1fr;
    flex-direction: column;
  }
}

@media (hover: none), (pointer: coarse) {
  html.has-custom-cursor,
  html.has-custom-cursor *,
  html.has-custom-cursor *::before,
  html.has-custom-cursor *::after,
  body,
  a,
  button {
    cursor: auto !important;
  }

  a,
  button {
    cursor: pointer !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.has-snap {
    scroll-snap-type: none;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .hero-inner,
  .hero-actions,
  .hero-meta,
  .chapter-copy-inner {
    opacity: 1;
    transform: none;
  }
}
