:root {
  --paper: #f4f6f4;
  --surface: #ffffff;
  --surface-muted: #edf1ee;
  --ink: #18221d;
  --muted: #637069;
  --line: #d6ddd8;
  --line-strong: #aab6af;
  --green: #23664b;
  --green-soft: #e4f0e9;
  --blue: #315f87;
  --blue-soft: #e7eef5;
  --rust: #a45136;
  --rust-soft: #f4e9e4;
  --amber: #93691f;
  --amber-soft: #f5efdf;
  --on-strong: #ffffff;
  --header-bg: rgba(255, 255, 255, 0.96);
  --section-nav-bg: rgba(244, 246, 244, 0.97);
  --lead: #34423b;
  --green-border: #bad2c4;
  --blue-border: #c1d2e1;
  --rust-border: #ddc4b9;
  --amber-text: #614b22;
  --amber-text-strong: #513d17;
  --scan-glow: rgba(35, 102, 75, 0.45);
  --header-height: 54px;
  --content-width: 960px;
  --radius: 6px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --paper: #121714;
  --surface: #1a211d;
  --surface-muted: #222b26;
  --ink: #edf3ef;
  --muted: #9daaa2;
  --line: #303a34;
  --line-strong: #516057;
  --green: #82c7a4;
  --green-soft: #1d382a;
  --blue: #8cb8de;
  --blue-soft: #1d3040;
  --rust: #d38c72;
  --rust-soft: #3a2822;
  --amber: #d1a754;
  --amber-soft: #342d1d;
  --on-strong: #121714;
  --header-bg: rgba(18, 23, 20, 0.96);
  --section-nav-bg: rgba(18, 23, 20, 0.97);
  --lead: #c9d2cc;
  --green-border: #3e6d53;
  --blue-border: #405f78;
  --rust-border: #71493b;
  --amber-text: #e2cc98;
  --amber-text-strong: #f0dba8;
  --scan-glow: rgba(130, 199, 164, 0.34);
}

@view-transition {
  navigation: auto;
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html {
  scroll-behavior: smooth;
}

html.is-restoring-position {
  scroll-behavior: auto;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.75;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

.skip-link {
  position: fixed;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 9px 14px;
  background: var(--ink);
  color: var(--on-strong);
  border-radius: 4px;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: var(--header-height);
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
  view-transition-name: site-header;
}

.site-header__inner {
  width: min(calc(100% - 40px), var(--content-width));
  min-height: var(--header-height);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto minmax(190px, 1fr);
  align-items: end;
  gap: 28px;
}

.site-mark {
  position: relative;
  align-self: end;
  justify-self: start;
  width: 124px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  height: 44px;
  min-width: 124px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  font-weight: 700;
}

.site-mark:hover,
.site-mark:focus-visible {
  background: var(--surface-muted);
}

.site-mark__arrow {
  color: var(--muted);
  font-size: 17px;
  line-height: 1;
  transition: transform 180ms ease;
}

.site-mark--back:hover .site-mark__arrow,
.site-mark--back:focus-visible .site-mark__arrow {
  transform: translateX(-3px);
}

.site-mark__text {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.project-tabs {
  align-self: stretch;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-width: 0;
  gap: 4px;
}

.project-tabs a {
  position: relative;
  height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  white-space: nowrap;
}

.project-tabs a:hover,
.project-tabs a:focus-visible {
  background: var(--surface-muted);
  color: var(--ink);
}

.site-mark[aria-current="page"],
.project-tabs a[aria-current="page"] {
  z-index: 1;
  border-color: var(--line);
  border-radius: 4px 4px 0 0;
  border-bottom-color: var(--paper);
  background: var(--paper);
  color: var(--green);
  font-weight: 700;
  box-shadow: 0 2px 0 var(--paper);
}

.page-top-link::before {
  content: "↑";
  position: absolute;
  left: 5px;
  top: 50%;
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
  opacity: 0;
  transform: translateY(-43%);
  transition: opacity 140ms ease, transform 140ms ease;
}

html.is-scrolled .page-top-link::before {
  opacity: 1;
  transform: translateY(-58%);
}

html.is-scrolled .page-top-link:hover::before,
html.is-scrolled .page-top-link:focus-visible::before {
  color: var(--green);
  transform: translateY(-58%) translateY(-3px);
}

.external-link {
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: max-content;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}

.external-link:hover,
.external-link:focus-visible {
  color: var(--ink);
  text-decoration-color: var(--green);
}

.header-actions {
  align-self: end;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: max-content;
}

.header-tool {
  position: relative;
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

.header-tool:hover,
.header-tool:focus-visible {
  background: var(--surface-muted);
  color: var(--ink);
}

.header-tool[aria-pressed="true"] {
  background: var(--green-soft);
  color: var(--green);
}

.header-tool::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  z-index: 90;
  min-width: max-content;
  padding: 5px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--ink);
  color: var(--on-strong);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -3px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.header-tool:hover::after,
.header-tool:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.tool-icon {
  width: 18px;
  height: 18px;
  display: block;
}

.tool-icon--sun {
  display: none;
}

html[data-theme="dark"] .tool-icon--moon {
  display: none;
}

html[data-theme="dark"] .tool-icon--sun {
  display: block;
}

.presentation-pointer {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 200;
  width: 20px;
  height: 20px;
  border: 1px solid var(--green);
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--green-soft);
  opacity: 0;
  pointer-events: none;
  transform: translate3d(-40px, -40px, 0);
  transition: opacity 140ms ease;
  will-change: transform;
}

.presentation-pointer.is-visible {
  opacity: 0.9;
}

.presentation-trail {
  position: fixed;
  inset: 0;
  z-index: 198;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
}

.pointer-ripple {
  position: fixed;
  z-index: 199;
  width: 38px;
  height: 38px;
  border: 1px solid var(--green);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  animation: pointer-ripple 360ms ease-out forwards;
}

.page-shell {
  width: min(calc(100% - 40px), var(--content-width));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 52px;
  align-items: start;
}

.section-nav {
  position: sticky;
  top: calc(var(--header-height) + 34px);
  padding: 7px 0 20px;
  margin-top: 34px;
}

.section-nav__label {
  display: block;
  padding: 13px 9px 7px;
  color: var(--muted);
  font-family: Consolas, "Courier New", monospace;
  font-size: 11px;
  text-transform: uppercase;
}

.section-nav a {
  display: flex;
  align-items: center;
  min-height: 36px;
  padding: 5px 9px;
  border-left: 2px solid transparent;
  color: var(--muted);
  font-size: 13px;
}

.section-nav a:hover,
.section-nav a:focus-visible {
  border-left-color: var(--rust);
  background: var(--surface);
  color: var(--ink);
}

.page-content {
  min-width: 0;
  padding-bottom: 96px;
}

::view-transition-group(root),
::view-transition-group(site-header) {
  animation-duration: 240ms;
  animation-timing-function: ease-out;
}

::view-transition-old(site-header),
::view-transition-new(site-header) {
  animation: none;
}

::view-transition-old(root) {
  animation: root-out 100ms ease-out both;
}

::view-transition-new(root) {
  animation: root-in 200ms ease-out both;
}

html.fallback-transitions .page-content,
html.fallback-transitions .section-nav {
  animation: fallback-page-in 230ms ease-out both;
}

html.fallback-transitions.page-leaving .page-content,
html.fallback-transitions.page-leaving .section-nav {
  opacity: 0;
  transition: opacity 110ms ease-out;
}

section[id] {
  scroll-margin-top: calc(var(--header-height) + 28px);
}

.project-row[id] {
  scroll-margin-top: calc(var(--header-height) + 28px);
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--green);
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.hero {
  min-height: 430px;
  padding: 76px 0 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-bottom: 1px solid var(--line);
}

.hero__identity {
  display: block;
}

.hero h1,
.project-hero h1 {
  max-width: 880px;
  margin: 0;
  font-family: "Songti SC", SimSun, serif;
  font-size: 48px;
  line-height: 1.2;
  font-weight: 700;
}

.hero__lead,
.project-hero__lead {
  max-width: 800px;
  margin: 24px 0 0;
  color: var(--lead);
  font-size: 19px;
  line-height: 1.75;
}

.hero__meta {
  margin-top: 34px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
}

.tag--green {
  border-color: var(--green-border);
  background: var(--green-soft);
  color: var(--green);
}

.tag--blue {
  border-color: var(--blue-border);
  background: var(--blue-soft);
  color: var(--blue);
}

.tag--rust {
  border-color: var(--rust-border);
  background: var(--rust-soft);
  color: var(--rust);
}

.section-block {
  padding: 72px 0;
  border-bottom: 1px solid var(--line);
}

.section-heading {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  margin-bottom: 34px;
}

.section-heading__index {
  color: var(--rust);
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  font-weight: 700;
  padding-top: 8px;
}

.section-heading h2 {
  margin: 0;
  font-family: "Songti SC", SimSun, serif;
  font-size: 31px;
  line-height: 1.35;
}

.section-heading p {
  max-width: 720px;
  margin: 9px 0 0;
  color: var(--muted);
}

.project-list {
  border-top: 1px solid var(--line-strong);
}

.project-row {
  display: grid;
  grid-template-columns: minmax(260px, 0.95fr) minmax(360px, 1.25fr);
  gap: 46px;
  align-items: center;
  padding: 52px 0;
  border-bottom: 1px solid var(--line);
}

.project-row__number {
  margin-bottom: 18px;
  color: var(--rust);
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  font-weight: 700;
}

.project-row h3 {
  margin: 0;
  font-family: "Songti SC", SimSun, serif;
  font-size: 28px;
  line-height: 1.35;
}

.project-row p {
  margin: 16px 0 0;
  color: var(--muted);
}

.project-row__facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 24px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.project-row__fact {
  padding: 12px 12px 12px 0;
}

.project-row__fact + .project-row__fact {
  padding-left: 16px;
  border-left: 1px solid var(--line);
}

.project-row__fact span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.project-row__fact strong {
  display: block;
  margin-top: 2px;
  font-size: 13px;
}

.detail-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  margin-top: 24px;
  padding: 0 15px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  background: var(--ink);
  color: var(--on-strong);
  font-size: 13px;
  font-weight: 700;
}

.detail-link:hover,
.detail-link:focus-visible {
  background: var(--green);
  border-color: var(--green);
}

.detail-link__arrow {
  font-size: 17px;
  line-height: 1;
  transition: transform 180ms ease;
}

.detail-link:hover .detail-link__arrow,
.detail-link:focus-visible .detail-link__arrow {
  transform: translateX(3px);
}

.project-visual {
  position: relative;
  min-height: 330px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
}

.visual-toolbar {
  height: 44px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 15px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-muted);
}

.visual-toolbar__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line-strong);
}

.visual-toolbar__title {
  margin-left: 8px;
  color: var(--muted);
  font-family: Consolas, "Courier New", monospace;
  font-size: 10px;
}

.skills-demo__body {
  position: relative;
  min-height: 286px;
  display: grid;
  grid-template-columns: 1fr 1.1fr;
}

.file-stack {
  padding: 29px 22px;
  border-right: 1px solid var(--line);
}

.file-item {
  position: relative;
  height: 54px;
  margin-bottom: 12px;
  padding: 11px 12px 8px 36px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
}

.file-item::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 14px;
  width: 13px;
  height: 17px;
  border: 1px solid var(--green);
  border-radius: 2px;
}

.file-item strong,
.file-item span {
  display: block;
  font-family: Consolas, "Courier New", monospace;
}

.file-item strong {
  font-size: 10px;
}

.file-item span {
  color: var(--muted);
  font-size: 8px;
}

.scan-result {
  position: relative;
  padding: 32px 24px;
}

.scan-line {
  position: absolute;
  left: 0;
  right: 0;
  top: 28px;
  height: 2px;
  background: var(--green);
  box-shadow: 0 0 14px var(--scan-glow);
  animation: scan-down 3.2s ease-in-out infinite;
}

.score-ring {
  width: 92px;
  height: 92px;
  margin: 4px auto 24px;
  display: grid;
  place-items: center;
  border: 9px solid var(--green-soft);
  border-top-color: var(--green);
  border-right-color: var(--blue);
  border-radius: 50%;
  color: var(--green);
  font-family: Consolas, "Courier New", monospace;
  font-size: 11px;
  font-weight: 700;
  animation: ring-turn 7s linear infinite;
}

.score-ring span {
  animation: ring-counter-turn 7s linear infinite;
}

.result-bar {
  height: 7px;
  margin-top: 16px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--surface-muted);
}

.result-bar span {
  display: block;
  height: 100%;
  background: var(--blue);
  transform-origin: left;
  animation: bar-grow 2.6s ease-in-out infinite alternate;
}

.result-bar:nth-of-type(3) span {
  width: 72%;
  background: var(--rust);
  animation-delay: 0.35s;
}

.result-bar:nth-of-type(4) span {
  width: 86%;
  background: var(--green);
  animation-delay: 0.7s;
}

.jailbreak-demo__body {
  position: relative;
  min-height: 286px;
  display: grid;
  place-items: center;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 34px 34px;
}

.model-core {
  position: relative;
  z-index: 3;
  width: 102px;
  height: 102px;
  display: grid;
  place-items: center;
  border: 2px solid var(--blue);
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 0 0 12px var(--blue-soft);
  color: var(--blue);
  font-family: Consolas, "Courier New", monospace;
  font-size: 11px;
  font-weight: 700;
}

.attack-node,
.defense-node {
  position: absolute;
  z-index: 4;
  min-width: 88px;
  padding: 8px 12px;
  border-radius: 4px;
  background: var(--surface);
  font-family: Consolas, "Courier New", monospace;
  font-size: 9px;
  font-weight: 700;
  text-align: center;
}

.attack-node {
  left: 11%;
  border: 1px solid var(--rust);
  color: var(--rust);
}

.attack-node--a {
  top: 23%;
}

.attack-node--b {
  bottom: 23%;
  animation-delay: 0.9s;
}

.defense-node {
  right: 10%;
  top: calc(50% - 18px);
  border: 1px solid var(--green);
  color: var(--green);
}

.signal {
  position: absolute;
  z-index: 2;
  left: 24%;
  top: calc(50% - 1px);
  width: 50%;
  height: 2px;
  background: var(--line-strong);
}

.signal::after {
  content: "";
  position: absolute;
  top: -4px;
  left: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--rust);
  animation: signal-travel 2.4s ease-in-out infinite;
}

.shield-pulse {
  position: absolute;
  z-index: 1;
  width: 148px;
  height: 148px;
  border: 1px solid var(--green);
  border-radius: 50%;
  opacity: 0;
  animation: shield-pulse 2.4s ease-out infinite;
}

.project-hero {
  min-height: 470px;
  padding: 78px 0 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-bottom: 1px solid var(--line);
}

.project-hero__kicker {
  margin-bottom: 17px;
  color: var(--rust);
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  font-weight: 700;
}

.project-hero__facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 42px;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}

.project-hero__fact {
  min-height: 88px;
  padding: 16px 20px 15px 0;
}

.project-hero__fact + .project-hero__fact {
  padding-left: 20px;
  border-left: 1px solid var(--line);
}

.project-hero__fact span,
.project-hero__fact strong {
  display: block;
}

.project-hero__fact span {
  color: var(--muted);
  font-size: 11px;
}

.project-hero__fact strong {
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.5;
}

.lead-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.plain-panel {
  min-height: 170px;
  padding: 23px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.plain-panel__label {
  color: var(--rust);
  font-family: Consolas, "Courier New", monospace;
  font-size: 11px;
  font-weight: 700;
}

.plain-panel h3 {
  margin: 10px 0 8px;
  font-size: 17px;
  line-height: 1.5;
}

.plain-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.protocol-table,
.result-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  font-size: 14px;
}

.protocol-table th,
.protocol-table td,
.result-table th,
.result-table td {
  padding: 14px 16px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.protocol-table th,
.result-table th {
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 12px;
}

.status-cell {
  color: var(--green);
  font-weight: 700;
}

.status-cell--pending {
  color: var(--amber);
}

.flow-diagram {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px;
  margin-top: 28px;
}

.flow-step {
  position: relative;
  min-height: 142px;
  padding: 20px 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
}

.flow-step:not(:last-child)::after {
  content: "→";
  position: absolute;
  right: -21px;
  top: calc(50% - 15px);
  color: var(--rust);
  font-size: 21px;
}

.flow-step__index {
  color: var(--rust);
  font-family: Consolas, "Courier New", monospace;
  font-size: 11px;
  font-weight: 700;
}

.flow-step h3 {
  margin: 10px 0 8px;
  font-size: 16px;
}

.flow-step p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.result-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 28px;
  align-items: stretch;
}

.result-figure {
  min-height: 270px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.result-figure__head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.result-figure__head strong {
  font-size: 14px;
}

.result-figure__head span {
  color: var(--muted);
  font-size: 11px;
}

.metric-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) 72px;
  gap: 16px;
  align-items: center;
  margin-top: 24px;
}

.metric-row__label,
.metric-row__state {
  font-size: 12px;
}

.metric-row__state {
  color: var(--muted);
  text-align: right;
}

.metric-track {
  height: 10px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--surface-muted);
}

.metric-track span {
  display: block;
  height: 100%;
  background: var(--green);
}

.metric-row:nth-child(3) .metric-track span {
  width: 64%;
  background: var(--blue);
}

.metric-row:nth-child(4) .metric-track span {
  width: 46%;
  background: var(--rust);
}

.metric-row:nth-child(5) .metric-track span {
  width: 78%;
  background: var(--green);
}

.result-note {
  padding: 23px 24px;
  border-left: 3px solid var(--amber);
  background: var(--amber-soft);
  color: var(--amber-text);
  font-size: 14px;
}

.result-note strong {
  display: block;
  margin-bottom: 8px;
  color: var(--amber-text-strong);
}

.cause-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}

.cause-cell {
  min-height: 158px;
  padding: 21px 18px;
}

.cause-cell + .cause-cell {
  border-left: 1px solid var(--line);
}

.cause-cell span {
  color: var(--rust);
  font-family: Consolas, "Courier New", monospace;
  font-size: 11px;
  font-weight: 700;
}

.cause-cell h3 {
  margin: 9px 0 7px;
  font-size: 15px;
}

.cause-cell p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.boundary-list {
  border-top: 1px solid var(--line-strong);
}

.boundary-row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 22px;
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
}

.boundary-row strong {
  font-size: 13px;
}

.boundary-row p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.page-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding-top: 32px;
  color: var(--muted);
  font-size: 12px;
}

.page-footer a:hover,
.page-footer a:focus-visible {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}

@keyframes scan-down {
  0%, 8% { transform: translateY(0); opacity: 0; }
  18% { opacity: 1; }
  82% { opacity: 1; }
  92%, 100% { transform: translateY(230px); opacity: 0; }
}

@keyframes ring-turn {
  to { transform: rotate(360deg); }
}

@keyframes ring-counter-turn {
  to { transform: rotate(-360deg); }
}

@keyframes bar-grow {
  from { transform: scaleX(0.42); }
  to { transform: scaleX(1); }
}

@keyframes signal-travel {
  0% { transform: translateX(0); background: var(--rust); }
  48% { background: var(--rust); }
  52% { background: var(--blue); }
  100% { transform: translateX(275px); background: var(--green); }
}

@keyframes shield-pulse {
  0% { transform: scale(0.62); opacity: 0.65; }
  75%, 100% { transform: scale(1.18); opacity: 0; }
}

@keyframes root-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes root-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fallback-page-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pointer-ripple {
  from {
    opacity: 0.78;
    transform: translate(-50%, -50%) scale(0.42);
  }
  to {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.35);
  }
}

@media (max-width: 980px) {
  .site-header__inner,
  .page-shell {
    width: min(calc(100% - 32px), var(--content-width));
  }

  .site-header__inner {
    gap: 16px;
  }

  .header-actions .external-link {
    display: none;
  }

  .page-shell {
    grid-template-columns: 142px minmax(0, 1fr);
    gap: 30px;
  }

  .project-row {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .project-visual {
    min-height: 360px;
  }

  .flow-diagram {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .flow-step:nth-child(2)::after {
    display: none;
  }

  .result-stage {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 740px) {
  :root {
    --header-height: 92px;
  }

  .site-header__inner {
    min-height: var(--header-height);
    grid-template-columns: 1fr auto;
    grid-template-rows: 44px 48px;
    gap: 0 14px;
  }

  .site-mark {
    grid-column: 1;
    grid-row: 1;
  }

  .header-actions {
    grid-column: 2;
    grid-row: 1;
  }

  .header-actions .external-link {
    display: none;
  }

  .project-tabs {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .project-tabs::-webkit-scrollbar {
    display: none;
  }

  .project-tabs a {
    height: 44px;
    padding: 0 13px;
  }

  .project-row[id] {
    scroll-margin-top: calc(var(--header-height) + 60px);
  }

  .page-shell {
    display: block;
    width: min(calc(100% - 28px), var(--content-width));
  }

  .section-nav {
    position: sticky;
    top: var(--header-height);
    z-index: 30;
    margin: 0 -14px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    overflow-x: auto;
    border-top: 0;
    border-bottom: 1px solid var(--line);
    background: var(--section-nav-bg);
    scrollbar-width: none;
  }

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

  .section-nav__label {
    display: none;
  }

  .section-nav a {
    min-width: max-content;
    min-height: 44px;
    padding: 5px 11px;
    border-left: 0;
    border-bottom: 2px solid transparent;
  }

  .section-nav a:hover,
  .section-nav a:focus-visible {
    border-left-color: transparent;
    border-bottom-color: var(--rust);
  }

  .hero,
  .project-hero {
    min-height: auto;
    padding: 58px 0 52px;
  }

  .hero h1,
  .project-hero h1 {
    font-size: 36px;
  }

  .hero__lead,
  .project-hero__lead {
    font-size: 17px;
  }

  .section-block {
    padding: 54px 0;
  }

  .section-heading {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 10px;
    margin-bottom: 26px;
  }

  .section-heading h2 {
    font-size: 26px;
  }

  .project-row {
    padding: 38px 0;
  }

  .project-row h3 {
    font-size: 24px;
  }

  .project-visual {
    min-height: 305px;
  }

  .project-hero__facts,
  .lead-grid {
    grid-template-columns: 1fr;
  }

  .project-hero__fact {
    min-height: 0;
    padding: 13px 0;
  }

  .project-hero__fact + .project-hero__fact {
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .flow-diagram,
  .cause-grid {
    grid-template-columns: 1fr;
  }

  .flow-step:not(:last-child)::after {
    content: "↓";
    right: auto;
    left: calc(50% - 8px);
    top: auto;
    bottom: -27px;
  }

  .flow-step:nth-child(2)::after {
    display: block;
  }

  .cause-cell + .cause-cell {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .boundary-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

@media (max-width: 480px) {
  .site-header__inner {
    width: calc(100% - 24px);
  }

  .site-mark__text {
    gap: 0;
  }

  .hero h1,
  .project-hero h1 {
    font-size: 32px;
  }

  .project-row__facts {
    grid-template-columns: 1fr;
  }

  .project-row__fact + .project-row__fact {
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .skills-demo__body {
    grid-template-columns: 1fr;
  }

  .file-stack {
    display: none;
  }

  .metric-row {
    grid-template-columns: 84px minmax(0, 1fr);
  }

  .metric-row__state {
    display: none;
  }

  .page-footer {
    flex-direction: column;
  }
}

@media (pointer: coarse) {
  .header-tool[data-pointer-toggle] {
    display: none;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation-duration: 0.01ms !important;
  }
}
