:root {
  color-scheme: dark;
  --bg: #121212;
  --bg-raised: #181818;
  --surface: #181818;
  --surface-strong: #1f1f1f;
  --surface-soft: #252525;
  --text: #ffffff;
  --body: #cbcbcb;
  --muted: #b3b3b3;
  --muted-soft: #7c7c7c;
  --line: #252525;
  --line-strong: #4d4d4d;
  --accent: #2997ff;
  --accent-strong: #2997ff;
  --accent-soft: #17263a;
  --lime: #5ac8fa;
  --amber: #5ac8fa;
  --danger: #ff826c;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  --max: 1220px;
  --header-height: 64px;
  --display: "Paperlogy", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --body-font: "Paperlogy", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --doodle-font: "Caveat", "Paperlogy", cursive;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --bg-raised: #fbfbfd;
  --surface: #f5f5f7;
  --surface-strong: #f5f5f7;
  --surface-soft: #e8e8ed;
  --text: #1d1d1f;
  --body: #2c2c2f;
  --muted: #3f3f44;
  --muted-soft: #5c5c61;
  --line: #d2d2d7;
  --line-strong: #b8b8bd;
  --accent: #0071e3;
  --accent-strong: #0066cc;
  --accent-soft: #e8f2ff;
  --lime: #2997ff;
  --amber: #5ac8fa;
  --danger: #b54836;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 24px);
  overflow-x: hidden;
}

body {
  margin: 0;
  padding-top: var(--header-height);
  overflow-x: hidden;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(31, 31, 31, 0.88), transparent 360px),
    radial-gradient(circle at 12% 10%, rgba(41, 151, 255, 0.1), transparent 30rem),
    radial-gradient(circle at 88% 18%, rgba(90, 200, 250, 0.08), transparent 26rem),
    var(--bg);
  font-family: var(--body-font);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.7;
  letter-spacing: 0;
  text-rendering: optimizeLegibility;
  transition: background 220ms ease, color 220ms ease;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  opacity: 0.28;
  background-image: linear-gradient(rgba(117, 166, 192, 0.042) 1px, transparent 1px), linear-gradient(90deg, rgba(117, 166, 192, 0.042) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, black, transparent 70%);
}

html[data-theme="light"] body::before {
  opacity: 0.18;
}

html[data-theme="light"] body {
  background:
    linear-gradient(180deg, rgba(255, 254, 250, 0.76), transparent 420px),
    radial-gradient(circle at 12% 10%, rgba(41, 151, 255, 0.13), transparent 30rem),
    radial-gradient(circle at 88% 18%, rgba(90, 200, 250, 0.1), transparent 26rem),
    var(--bg);
}

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

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

button {
  font: inherit;
}

::selection {
  color: var(--bg);
  background: var(--lime);
}

.site-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  min-height: var(--header-height);
  padding: 14px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 85%, transparent);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(18px);
}

.brand {
  justify-self: start;
}

.header-actions {
  justify-self: end;
}

.brand,
.nav,
.header-actions,
.language-toggle,
.hero-actions,
.case-links,
.contact-links,
.tag-list {
  display: flex;
  align-items: center;
}

.brand {
  flex: 0 0 auto;
  gap: 10px;
  font-family: var(--display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  width: 25px;
}

.brand-mark i {
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 65%, transparent);
}

.brand-mark i:nth-child(2) {
  background: var(--lime);
}

.brand-mark i:nth-child(3) {
  background: var(--amber);
}

.nav {
  justify-content: center;
  gap: clamp(14px, 2.6vw, 28px);
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

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

.nav a,
.role-switch,
.header-cta,
.theme-toggle,
.language-button {
  white-space: nowrap;
}

.nav a {
  position: relative;
  padding: 6px 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
  transition: color 160ms ease;
}

.nav a::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  content: "";
  background: var(--accent);
  opacity: 0;
  transform: scaleX(0.5);
  transition: opacity 160ms ease, transform 160ms ease;
}

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

.nav a:hover::after,
.nav a.is-active::after {
  opacity: 1;
  transform: scaleX(1);
}

.header-actions {
  flex: 0 0 auto;
  gap: 8px;
}

.role-switch {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.role-switch::before {
  width: 5px;
  height: 5px;
  margin-right: 7px;
  border-radius: 50%;
  content: "";
  background: var(--accent);
}

.role-switch:hover {
  border-color: var(--line-strong);
  color: var(--text);
  background: var(--surface);
}

.language-toggle {
  gap: 2px;
  min-height: 40px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.language-button {
  min-width: 34px;
  min-height: 32px;
  padding: 0 9px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

.language-button.is-active {
  color: var(--bg);
  background: var(--lime);
}

.theme-toggle {
  display: inline-grid;
  width: 40px;
  height: 40px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--accent);
  background: transparent;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.theme-toggle:hover {
  border-color: var(--line-strong);
  background: var(--surface);
  transform: translateY(-1px);
}

.theme-toggle span {
  font-size: 16px;
  line-height: 1;
}

.header-cta,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.header-cta {
  padding: 0 18px;
  border: 1px solid var(--accent);
  color: #fff;
  background: var(--accent-strong);
}

.header-cta:hover,
.button:hover {
  transform: translateY(-2px);
}

.header-cta:hover,
.button.primary:hover {
  background: var(--accent);
}

main {
  overflow: hidden;
}

.hero,
.section {
  width: min(var(--max), calc(100% - 40px));
  margin-inline: auto;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "copy";
  grid-template-rows: 1fr;
  align-items: start;
  gap: 0;
  row-gap: clamp(8px, 1.4vh, 16px);
  min-height: min(720px, calc(100vh - var(--header-height)));
  padding: clamp(30px, 5vh, 52px) 0 52px;
}

.hero-gridline {
  position: absolute;
  top: 52px;
  right: 0;
  bottom: 0;
  left: 47%;
  z-index: -1;
  pointer-events: none;
  opacity: 0.36;
  background:
    linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 12%, transparent) 1px, transparent 1px),
    linear-gradient(180deg, transparent, color-mix(in srgb, var(--accent) 10%, transparent) 1px, transparent 1px);
  background-size: 96px 96px;
  mask-image: linear-gradient(90deg, transparent, black 22%, black 78%, transparent);
}

.hero-copy {
  grid-area: copy;
  position: relative;
  z-index: 1;
  max-width: 720px;
}

.hero-art {
  position: absolute;
  z-index: 0;
  top: 86px;
  right: 2%;
  width: min(48%, 580px);
  height: min(620px, calc(100% - 96px));
  pointer-events: none;
  display: grid;
  place-items: end center;
  background: transparent;
  border-radius: 28px;
  mask-image: linear-gradient(to bottom, black 0%, black 68%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 0%, black 68%, transparent 100%);
}

.hero-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  mix-blend-mode: screen;
  filter: drop-shadow(0 20px 30px rgb(0 0 0 / 35%));
}

.role-proof {
  display: flex;
  gap: 0;
  max-width: 640px;
  margin-top: 28px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.role-proof > div {
  flex: 1 1 0;
  min-width: 0;
  padding: 14px 15px 15px;
  border-right: 1px solid var(--line);
  background: transparent;
}

.role-proof > div:last-child {
  border-right: 0;
}

.role-proof span,
.role-proof strong,
.role-proof small {
  display: block;
}

.role-proof span {
  color: var(--accent);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
}

.role-proof strong {
  margin-top: 9px;
  color: var(--text);
  font-size: 13px;
}

.role-proof small {
  overflow: hidden;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.proof-doodle {
  display: block;
  width: 28px;
  height: 28px;
  margin-top: 6px;
  object-fit: contain;
  opacity: 0.28;
  filter: invert(1);
  transition: opacity 200ms ease, transform 200ms ease;
}

html[data-theme="light"] .proof-doodle {
  filter: invert(0.1) sepia(1) saturate(3) hue-rotate(185deg) brightness(0.45);
  opacity: 0.32;
}


.role-orbit {
  grid-area: orbit;
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: clamp(10px, 1.6vw, 18px);
  min-height: clamp(78px, 9vh, 96px);
  pointer-events: none;
}

.role-token,
.symbol-token {
  position: relative;
  z-index: 2;
  --hover-y: 0px;
  --rotation: 0deg;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  border: 1px solid var(--line-strong);
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  transform: translate3d(0, var(--hover-y), 0) rotate(var(--rotation));
  transition: transform 180ms ease, background 180ms ease, color 180ms ease, border-color 180ms ease;
}

.role-token:hover,
.symbol-token:hover {
  --hover-y: -4px;
  border-color: var(--accent);
  color: #ffffff;
  background: var(--accent);
}

.role-token {
  padding: 10px 18px;
  border-radius: 999px;
  font-size: clamp(13px, 1.2vw, 16px);
  font-weight: 500;
}

.symbol-token {
  width: clamp(45px, 4.6vw, 58px);
  height: clamp(45px, 4.6vw, 58px);
  border-radius: 50%;
  font-size: clamp(22px, 2.5vw, 32px);
  line-height: 1;
}

.token-role {
  order: 2;
  margin-top: 13px;
  border-color: color-mix(in srgb, var(--accent) 44%, var(--line));
  --rotation: -4deg;
}

.token-gameplay {
  order: 4;
  margin-top: 27px;
  border-color: color-mix(in srgb, var(--amber) 52%, var(--line));
  --rotation: -2deg;
}

.token-signal {
  order: 1;
  margin-top: 4px;
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
  --rotation: 3deg;
}

.token-tooling {
  order: 5;
  margin-top: 7px;
  border-color: color-mix(in srgb, var(--lime) 48%, var(--line));
  --rotation: 2deg;
}

.token-debug {
  order: 6;
  margin-top: 32px;
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  --rotation: 1deg;
}

.token-down {
  order: 3;
  margin-top: 22px;
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
  --rotation: 0deg;
}

.token-down:hover {
  color: #ffffff;
}

html[data-theme="light"] .role-token,
html[data-theme="light"] .symbol-token {
  background: rgba(255, 253, 248, 0.72);
}

html[data-theme="light"] .role-token:hover,
html[data-theme="light"] .symbol-token:hover {
  color: #ffffff;
  background: var(--accent);
}

.hero-kicker,
.eyebrow,
.section-index,
.project-number,
.case-label,
.tooling-number {
  font-family: var(--display);
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 24px;
  color: var(--lime);
  font-size: 11px;
  font-weight: 800;
}

.live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--lime) 13%, transparent), 0 0 18px color-mix(in srgb, var(--lime) 62%, transparent);
}

.hero h1 {
  max-width: 760px;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(48px, 5.3vw, 76px);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.07em;
}

.hero-name,
.hero-role {
  display: block;
}

.hero-name {
  color: var(--accent);
  font-size: 0.56em;
  font-weight: 700;
  letter-spacing: -0.06em;
  line-height: 1.3;
}

.hero-role {
  max-width: 820px;
  margin-top: 0.04em;
  font-family: var(--doodle-font);
  font-size: clamp(58px, 7.2vw, 102px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0.01em;
  text-wrap: balance;
}

.hero-stack {
  margin: 10px 0 0;
  color: var(--accent);
  font-family: var(--doodle-font);
  font-size: clamp(22px, 2vw, 28px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.hero-intro {
  max-width: 650px;
  margin: 22px 0 0;
  color: var(--body);
  font-size: clamp(19px, 1.65vw, 22px);
  line-height: 1.78;
  word-break: keep-all;
  white-space: pre-line;
}

.hero-actions {
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 32px;
}

.button {
  padding: 0 19px;
  border: 1px solid transparent;
}

.button.primary {
  color: #fff;
  background: var(--accent-strong);
  box-shadow: 0 12px 26px color-mix(in srgb, var(--accent-strong) 22%, transparent);
}

.button.secondary {
  border-color: var(--line-strong);
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 72%, transparent);
}

.button.secondary:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 32px;
}

.tag-list {
  flex-wrap: wrap;
  gap: 7px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--body);
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}

.tag.accent-tag {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  color: var(--accent);
}

.tag.lime-tag {
  border-color: color-mix(in srgb, var(--lime) 42%, var(--line));
  color: var(--lime);
}

.section {
  padding: clamp(84px, 8vw, 108px) 0;
  border-top: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 40px;
}

.section-heading > div:first-child {
  flex: 1 1 auto;
  min-width: 0;
}

.compact-heading {
  align-items: center;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
}

/* ── Doodle Icon Eyebrow Decoration (duma-icons MIT) ── */
.eyebrow-icon {
  display: block;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  object-fit: contain;
  opacity: 0.55;
  filter: invert(1);
  transition: opacity 220ms ease, filter 220ms ease, transform 260ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.section-heading:hover .eyebrow-icon,
.eyebrow:hover .eyebrow-icon {
  opacity: 0.9;
  transform: rotate(-8deg) scale(1.15);
}

html[data-theme="light"] .eyebrow-icon {
  filter: invert(0.1) sepia(1) saturate(3) hue-rotate(185deg) brightness(0.45);
  opacity: 0.6;
}

html[data-theme="light"] .section-heading:hover .eyebrow-icon,
html[data-theme="light"] .eyebrow:hover .eyebrow-icon {
  opacity: 0.95;
}


h2,
h3,
p {
  word-break: keep-all;
  overflow-wrap: break-word;
}

h2,
h3 {
  margin: 0;
  font-family: var(--display);
  letter-spacing: -0.055em;
  text-wrap: balance;
}

h2 {
  max-width: 860px;
  font-size: clamp(26px, 2.5vw, 36px);
  font-weight: 800;
  line-height: 1.3;
  text-wrap: balance;
}

h3 {
  font-size: clamp(20px, 1.8vw, 26px);
  font-weight: 750;
  line-height: 1.3;
  text-wrap: balance;
}

.section-note {
  flex: 0 1 640px;
  max-width: 640px;
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
  text-align: right;
  word-break: keep-all;
  overflow-wrap: break-word;
  text-wrap: balance;
  white-space: pre-line;
}

.section-index {
  flex: 0 0 auto;
  color: var(--muted-soft);
  font-size: 11px;
  font-weight: 800;
}

.guardian-project-section {
  display: grid;
  gap: 22px;
  align-content: start;
  grid-auto-rows: min-content;
}

.guardian-project-heading {
  margin-bottom: 4px;
}

.project-chapter {
  padding-top: 28px;
  border-top: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
}

.project-chapter .section-heading {
  margin-bottom: 28px;
}

.project-map {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.project-map-card {
  display: flex;
  flex-direction: column;
  min-height: 270px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.project-map-card:hover {
  border-color: var(--line-strong);
  background: var(--surface-strong);
  transform: translateY(-5px);
}

.project-map-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  height: auto;
  padding: 20px;
}

.project-map-media {
  overflow: hidden;
  aspect-ratio: 16 / 9;
  margin: -20px -20px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.project-map-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #080a10;
}

.map-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 20px;
}

.project-number {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
}

.project-status {
  padding: 3px 7px;
  border: 1px solid color-mix(in srgb, var(--lime) 45%, var(--line));
  border-radius: 4px;
  color: var(--lime);
  font-family: var(--display);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.project-map-card .project-map-title {
  font-size: 22px;
  line-height: 1.3;
}

.project-map-card .project-map-desc {
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
  word-break: keep-all;
}

.project-map-card .tag-list {
  margin-top: auto;
  padding-top: 20px;
}

.project-map-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 14px 20px 18px;
  border-top: 1px solid var(--line);
}

.project-map-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: color var(--transition-fast, 0.2s ease), border-color var(--transition-fast, 0.2s ease), background var(--transition-fast, 0.2s ease), transform var(--transition-fast, 0.2s ease);
}

.project-map-link-btn:hover {
  color: #ffffff;
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  transform: translateY(-1px);
}

.case-layout,
.agent-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(290px, 0.85fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: start;
}

.contribution-content { display: grid; gap: 0; }
.contribution-top,
.contribution-areas { padding: 0 0 30px; border-bottom: 1px solid var(--line); background: transparent; }
.contribution-top { position: relative; isolation: isolate; display: grid; grid-template-areas: "main evidence"; grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr); column-gap: clamp(28px, 4vw, 52px); align-items: start; overflow: hidden; padding: clamp(24px, 3vw, 38px); border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line)); border-radius: 16px; background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 8%, var(--surface)) 0%, color-mix(in srgb, var(--surface) 90%, transparent) 55%, color-mix(in srgb, var(--bg) 92%, transparent) 100%); }
.contribution-top::before { position: absolute; inset: 0; z-index: -1; content: ""; opacity: .5; background: linear-gradient(90deg, transparent 0 50%, color-mix(in srgb, var(--accent) 12%, transparent) 50.05%, transparent 50.15%) 0 0 / 72px 100%, radial-gradient(circle at 8% 12%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 24%); mask-image: linear-gradient(90deg, black, transparent 78%); }
.contribution-areas { padding-top: 34px; border-bottom: 0; }
.contribution-main { grid-area: main; display: flex; flex-direction: column; gap: 28px; min-width: 0; }
.contribution-metrics { display: grid; grid-area: metrics; grid-template-columns: max-content repeat(3, minmax(max-content, 1fr)); column-gap: clamp(20px, 2.4vw, 36px); align-self: start; }
.contribution-metric { min-width: 0; padding: 6px 0; border-right: 0; }
.contribution-metric:first-child { padding-left: 0; }
.contribution-metric:last-child { padding-right: 0; border-right: 0; }
.contribution-metric strong { display: block; color: var(--accent); font-size: clamp(26px, 3vw, 42px); letter-spacing: -.04em; line-height: .95; white-space: nowrap; }
.contribution-metric:not(.is-primary) strong { font-size: clamp(24px, 2.4vw, 36px); }
.contribution-metric span { display: block; margin-top: 10px; color: var(--muted); font-size: 12px; line-height: 1.35; letter-spacing: -.02em; white-space: nowrap; }
.contribution-metric.is-primary strong { font-size: clamp(52px, 5.6vw, 80px); }
.contribution-metric.is-primary span { color: var(--body); font-weight: 700; }
.contribution-story { display: grid; grid-area: story; grid-template-columns: 1fr; gap: 12px; align-items: start; padding: 0; border-top: 0; border-bottom: 0; }
.contribution-story p { max-width: 640px; margin: 0; color: var(--text); font-family: var(--display); font-size: 20px; font-weight: 600; letter-spacing: -0.04em; line-height: 1.5; word-break: keep-all; }
.contribution-story small { display: block; margin: 0; color: var(--muted-soft); font: 10px/1.55 "SFMono-Regular", Consolas, monospace; text-align: left; }
.contribution-areas { display: grid; grid-template-columns: 1fr; gap: 18px; }
.contribution-areas-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.contribution-areas-heading h3 { margin: 0; font-size: 18px; }
.contribution-areas-heading p { max-width: 360px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; text-align: right; word-break: keep-all; }
.contribution-area-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 24px; }
.contribution-area { min-height: 0; padding: 16px 0 18px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; }
.contribution-area > span { color: var(--accent); font: 10px "SFMono-Regular", Consolas, monospace; }
.contribution-area strong { display: block; margin-top: 12px; font-size: 15px; }
.contribution-area p { margin: 7px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.contribution-project-evidence { grid-area: evidence; align-self: stretch; padding: 0 0 0 28px; border: 0; border-left: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); border-radius: 0; background: transparent; }
.contribution-top .contribution-project-evidence { min-width: 0; }
.contribution-evidence-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.contribution-evidence-head strong { font-size: 16px; }
.contribution-evidence-head span { color: var(--muted); font: 10px "SFMono-Regular", Consolas, monospace; }
.contribution-evidence-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 16px 0; }
.contribution-top .contribution-evidence-list { grid-template-columns: 1fr; }
.contribution-evidence-list div { display: grid; gap: 5px; }
.contribution-evidence-list strong { color: var(--accent); font-size: 10px; }
.contribution-evidence-list span { color: var(--body); font-size: 14px; line-height: 1.5; }
.contribution-evidence-metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.contribution-evidence-metrics div,
.contribution-evidence-metrics a {
  padding: 12px 0 0;
  border-top: 1px solid var(--line);
  background: transparent;
  text-decoration: none;
  display: block;
  transition: border-color var(--transition-fast, 0.2s ease), transform var(--transition-fast, 0.2s ease);
}
.contribution-evidence-metrics a:hover {
  border-top-color: var(--accent);
}
.contribution-evidence-metrics a:hover strong {
  color: var(--accent-hover, #ffffff);
}
.contribution-evidence-metrics a:hover span {
  color: var(--accent);
}
.contribution-evidence-metrics strong { display: block; color: var(--accent); font-size: 22px; transition: color var(--transition-fast, 0.2s ease); }
.contribution-evidence-metrics span { color: var(--muted); font-size: 11px; line-height: 1.45; transition: color var(--transition-fast, 0.2s ease); }

.case-main,
.agent-copy {
  min-width: 0;
}

.case-layout.has-case-visual {
  grid-template-columns: minmax(360px, 1.05fr) minmax(0, 1.45fr);
  gap: clamp(24px, 4vw, 64px);
}

.case-visual {
  position: relative;
  display: block;
  overflow: hidden;
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-strong);
}

.case-visual-wrap {
  min-width: 0;
}

.media-disclaimer {
  margin: 10px 2px 0;
  color: var(--muted-soft);
  font-size: 11px;
  line-height: 1.55;
  letter-spacing: -.01em;
}

.case-visual img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #0a0d12;
}

.case-visual .media-badge { right: 12px; bottom: 12px; left: auto; }

.case-label {
  margin: 0 0 15px;
  color: var(--lime);
  font-size: 11px;
  font-weight: 800;
}

.case-summary,
.agent-summary {
  max-width: 700px;
  margin: 24px 0 0;
  color: var(--body);
  font-size: 19px;
  line-height: 1.82;
  word-break: keep-all;
}

.case-summary p,
.agent-summary p {
  margin: 0 0 16px;
}

.case-summary p:last-child,
.agent-summary p:last-child {
  margin-bottom: 0;
}

.case-scope {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px 18px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.case-scope li {
  position: relative;
  padding-left: 13px;
  color: var(--body);
  font-size: 17px;
  line-height: 1.45;
  word-break: keep-all;
}

.case-scope li::before {
  position: absolute;
  top: 0.52em;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  content: "";
}

.case-links {
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-size: 15px;
  font-weight: 500;
}

.text-link:hover {
  color: var(--lime);
}

.system-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-top: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.flow-node {
  position: relative;
  min-height: 103px;
  padding: 15px 14px;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 75%, transparent);
}

.flow-node:last-child {
  border-right: 0;
}

.flow-node:not(:last-child)::after {
  position: absolute;
  top: 50%;
  right: -7px;
  z-index: 1;
  width: 12px;
  height: 12px;
  border-top: 1px solid var(--accent);
  border-right: 1px solid var(--accent);
  content: "";
  background: var(--surface);
  transform: translateY(-50%) rotate(45deg);
}

.flow-node small,
.flow-node strong {
  display: block;
}

.flow-node small {
  color: var(--accent);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
}

.flow-node strong {
  margin-top: 15px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
}

.evidence-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.evidence-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 17px 19px;
  border-bottom: 1px solid var(--line);
}

.evidence-panel-header span {
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
}

.evidence-panel-header strong {
  color: var(--lime);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
}

.evidence-list {
  margin: 0;
  padding: 4px 19px 13px;
  list-style: none;
}

.evidence-list li {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.evidence-list li:last-child {
  border-bottom: 0;
}

.evidence-list strong {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.evidence-list span {
  color: var(--body);
  font-size: 13px;
  line-height: 1.5;
  word-break: keep-all;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
  padding: 0 19px 20px;
}

.metric-box {
  padding: 12px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-raised);
}

.metric-box strong,
.metric-box span {
  display: block;
}

.metric-box strong {
  color: var(--accent);
  font-family: var(--display);
  font-size: 20px;
  letter-spacing: -0.04em;
}

.metric-box span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.3;
}

.agent-layout {
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  align-items: start;
}

.agent-visual {
  position: relative;
  aspect-ratio: 1835 / 1032;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-strong);
}

.agent-visual img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  object-fit: contain;
  object-position: center;
  opacity: 0.9;
  filter: saturate(0.82) contrast(1.04);
}

.agent-visual::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background: linear-gradient(180deg, transparent 48%, color-mix(in srgb, var(--bg) 80%, transparent));
}

.media-badge {
  position: absolute;
  bottom: 16px;
  left: 16px;
  z-index: 1;
  padding: 5px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  color: var(--text);
  background: color-mix(in srgb, var(--bg) 76%, transparent);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
}

.agent-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.agent-copy .tag-list {
  margin-top: 25px;
}

.agent-process {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 28px;
}

.process-step {
  min-height: 112px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}

.process-step small {
  color: var(--accent);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
}

.process-step strong {
  display: block;
  margin-top: 14px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
}

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

.debug-card,
.tool-card,
.audio-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
}

.debug-card {
  display: flex;
  flex-direction: column;
  min-height: 310px;
  padding: 22px;
}

.debug-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.tool-card-header,
.audio-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.debug-card-header .debug-case-badge {
  flex: 0 0 auto;
  white-space: nowrap;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 4px;
  padding: 2px 6px;
  line-height: 1.2;
}

.tool-card-header span {
  color: var(--muted-soft);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
}

.debug-card-header .compact-tags {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 4px;
  min-width: 0;
}

.debug-card-header .compact-tags .tag {
  flex: 0 0 auto;
  min-width: 0;
  min-height: 22px;
  height: 22px;
  padding: 0 7px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  line-height: 1;
}

.debug-case-icon {
  display: block;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin: 3px 0 0;
  object-fit: contain;
  opacity: 0.55;
  filter: invert(1);
  transition: opacity 200ms ease, transform 260ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.debug-card:hover .debug-case-icon {
  opacity: 0.85;
  transform: rotate(-8deg) scale(1.15);
}

html[data-theme="light"] .debug-case-icon {
  filter: invert(0.1) sepia(1) saturate(3) hue-rotate(185deg) brightness(0.45);
  opacity: 0.62;
}

html[data-theme="light"] .debug-card:hover .debug-case-icon {
  opacity: 0.88;
}

.debug-card-title,
.tool-card h3,
.audio-card h3 {
  margin-top: 18px;
  font-size: 20px;
  line-height: 1.35;
}

.debug-card-title {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-height: 54px;
}

.debug-card-title span {
  min-width: 0;
}

.debug-card > p,
.tool-card > p,
.audio-card > p {
  margin: 13px 0 0;
  color: var(--body);
  font-size: 16px;
  line-height: 1.65;
  word-break: keep-all;
}

.debug-card .debug-card-summary {
  min-height: 92px;
  margin-bottom: 16px;
}

.debug-card details {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.debug-card summary {
  padding: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.debug-card summary::-webkit-details-marker {
  display: none;
}

.debug-card summary::after {
  float: right;
  content: "+";
  color: var(--muted);
  font-size: 17px;
  font-weight: 400;
  line-height: 1;
}

.debug-card details[open] summary::after {
  content: "−";
}

.debug-evidence-body {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.debug-evidence-block {
  padding: 10px 12px;
  background: color-mix(in srgb, var(--surface) 65%, transparent);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.debug-evidence-title {
  margin-bottom: 6px;
}

.debug-evidence-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 2px 7px;
  border-radius: 4px;
  line-height: 1.3;
}

.debug-evidence-tag.badge-problem {
  color: #ff7b72;
  background: rgba(255, 123, 114, 0.12);
  border: 1px solid rgba(255, 123, 114, 0.25);
}

.debug-evidence-tag.badge-solution {
  color: #7ee787;
  background: rgba(126, 231, 135, 0.12);
  border: 1px solid rgba(126, 231, 135, 0.25);
}

.debug-evidence-text {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
  word-break: keep-all;
}

.debug-evidence-item {
  position: relative;
  margin: 8px 0 0;
  padding-left: 14px;
  font-size: 16.5px;
  line-height: 1.7;
  color: var(--muted);
  word-break: keep-all;
}

.debug-evidence-item::before {
  content: "•";
  position: absolute;
  left: 3px;
  top: 0;
  color: var(--accent);
  font-weight: 700;
}

.debug-item-head {
  color: var(--text);
  font-weight: 700;
  margin-right: 4px;
}

.debug-item-body {
  color: var(--body);
}

.debug-card .debug-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: color var(--transition-fast, 0.2s ease), transform var(--transition-fast, 0.2s ease);
}

.debug-card .debug-link:hover {
  color: #ffffff;
  text-decoration: underline;
}

.debug-card-visual {
  display: block;
  width: calc(100% + 50px);
  height: 150px;
  margin: -25px -25px 22px;
  object-fit: cover;
  border-bottom: 1px solid var(--line);
}

.tooling-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: 16px;
  align-items: stretch;
}

.tool-card {
  position: relative;
  min-height: 280px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
}

.tool-card.featured {
  display: flex;
  flex-direction: column;
  grid-column: 1;
  grid-row: span 2;
  align-self: stretch;
  gap: 18px;
  height: auto;
  overflow: hidden;
}

.tool-card.featured::after {
  position: absolute;
  right: -90px;
  bottom: -110px;
  width: 300px;
  height: 300px;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent);
  border-radius: 50%;
  content: "";
  box-shadow: 0 0 0 24px color-mix(in srgb, var(--accent) 4%, transparent), 0 0 0 48px color-mix(in srgb, var(--accent) 3%, transparent);
  opacity: 0.48;
  filter: blur(1.5px);
  pointer-events: none;
}

.tooling-number {
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
}

.tool-card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}

.tool-doodle {
  display: block;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  object-fit: contain;
  opacity: 0.45;
  filter: invert(1);
  transition: opacity 200ms ease, transform 260ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tool-card:hover .tool-doodle {
  opacity: 0.78;
  transform: rotate(-8deg) scale(1.15);
}

html[data-theme="light"] .tool-doodle {
  filter: invert(0.1) sepia(1) saturate(3) hue-rotate(185deg) brightness(0.45);
  opacity: 0.52;
}

html[data-theme="light"] .tool-card:hover .tool-doodle {
  opacity: 0.82;
}

.tool-card.featured .tool-doodle {
  width: 26px;
  height: 26px;
}

.tool-card.featured h3 {
  margin-top: 10px;
}

.tool-card.featured .tag-list {
  margin-top: 16px;
}

.tool-card .tag-list {
  margin-top: 24px;
}

.tool-card:not(.featured) {
  min-height: 0;
  padding: 20px;
  border: 1px solid var(--line);
}

.tool-card:not(.featured) h3 {
  margin-top: 8px;
  font-size: clamp(18px, 1.55vw, 22px);
}

.tool-card:not(.featured) > div > p {
  margin: 10px 0 0;
  font-size: 15.5px;
  line-height: 1.55;
}

.tool-card:not(.featured) .tag-list {
  display: none;
}

.tool-card:not(.featured) .case-links {
  margin-top: 16px;
}

.dry-run-panel {
  position: relative;
  z-index: 1;
  align-self: center;
  padding: 15px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
}

.dry-run-panel span,
.dry-run-panel strong {
  display: block;
}

.tool-media {
  position: relative;
  z-index: 1;
  align-self: stretch;
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--bg);
  aspect-ratio: 16 / 9;
  min-height: 190px;
}

.tool-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tool-card:not(.featured) .tool-media img {
  object-fit: contain;
  background: #080a10;
}

.tool-card:not(.featured) .tool-media {
  min-height: 160px;
  margin: 0 0 14px;
}
.tool-card.featured .tool-media {
  width: 100%;
  flex: 0 0 auto;
  min-height: 0;
  aspect-ratio: 16 / 9;
}

.tool-card.featured .tool-media img {
  object-fit: cover;
  object-position: 92% center;
}

.tool-placeholder {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  border-style: dashed;
  background: radial-gradient(circle at 78% 26%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 36%), var(--surface-strong);
  color: var(--muted);
}

.tool-placeholder span { color: var(--accent); font: 10px "SFMono-Regular", Consolas, monospace; letter-spacing: .1em; }
.tool-placeholder strong { color: var(--text); font-size: 20px; }
.tool-placeholder small { font-size: 11px; }

.dry-run-panel span {
  color: var(--muted);
}

.dry-run-panel strong {
  margin-top: 8px;
  color: var(--lime);
}

.dry-run-panel code {
  display: block;
  margin-top: 13px;
  color: var(--body);
  line-height: 1.7;
  white-space: pre-wrap;
}

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

.audio-card {
  min-height: 0;
  padding: 26px 28px 28px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.audio-card:last-child { border-right: 0; }

.audio-card-header {
  align-items: center;
}

.audio-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  border-radius: 8px;
  color: var(--accent);
  background: var(--accent-soft);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
}

.audio-card h3 {
  margin-top: 20px;
  word-break: keep-all;
}

.audio-card p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
  word-break: keep-all;
}

.discography-wrap {
  border: 0;
  border-radius: 0;
  background: transparent;
}

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

.discography-stat {
  padding: 22px;
  border-right: 1px solid var(--line);
}

.discography-stat:last-child {
  border-right: 0;
}

.discography-stat strong,
.discography-stat span {
  display: block;
}

.discography-stat strong {
  color: var(--accent);
  font-family: var(--display);
  font-size: 34px;
  letter-spacing: -0.06em;
}

.discography-stat span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.discography-body {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 30px;
  padding: 30px 0;
}

.discography-body p {
  max-width: 430px;
  margin: 0;
  color: var(--body);
  white-space: pre-line;
  font-size: 15px;
  line-height: 1.7;
  word-break: keep-all;
}

.release-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.release-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 11px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  color: var(--body);
  font-size: 12px;
}

.release-list li span:last-child {
  flex: 0 0 auto;
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
}

.contact-section {
  padding-bottom: 118px;
}

.contact-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: end;
  overflow: hidden;
  padding: clamp(28px, 5vw, 58px);
  border: 1px solid color-mix(in srgb, var(--accent) 37%, var(--line));
  border-radius: 12px;
  background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 12%, var(--surface)), var(--surface) 60%);
  box-shadow: var(--shadow);
}

.contact-card::after {
  position: absolute;
  top: -160px;
  right: -120px;
  width: 420px;
  height: 420px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: 50%;
  content: "";
  box-shadow: 0 0 0 25px color-mix(in srgb, var(--accent) 5%, transparent), 0 0 0 50px color-mix(in srgb, var(--accent) 4%, transparent);
  opacity: 0.48;
  filter: blur(1.5px);
  pointer-events: none;
}

.contact-copy {
  position: relative;
  z-index: 1;
}

.contact-copy .eyebrow {
  margin-bottom: 16px;
}

.contact-copy h2 {
  max-width: 650px;
  font-size: clamp(32px, 4.5vw, 58px);
  white-space: pre-line;
}

.contact-copy p {
  max-width: 620px;
  margin: 20px 0 0;
  color: var(--body);
  font-size: 18px;
  line-height: 1.7;
  word-break: keep-all;
  white-space: pre-line;
}

.contact-links {
  position: relative;
  z-index: 1;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
}

.contact-links a {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 17px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 76%, transparent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.01em;
  box-shadow: 0 8px 18px rgb(0 0 0 / 12%);
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.contact-links a::after {
  margin-left: 9px;
  color: currentColor;
  content: "↗";
  font-size: 14px;
  line-height: 1;
  transition: transform 160ms ease;
}

.contact-links .contact-primary {
  min-width: 116px;
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
  box-shadow: 0 8px 18px color-mix(in srgb, var(--accent) 22%, transparent);
}

.contact-links a:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-2px);
}

.contact-links .contact-primary:hover {
  color: #fff;
  background: var(--accent-strong);
}

.contact-links a:hover::after {
  transform: translate(2px, -2px);
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(var(--max), calc(100% - 40px));
  margin-inline: auto;
  padding: 0 0 34px;
  color: var(--muted-soft);
  font-size: 11px;
}

.footer-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.print-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  min-height: 32px;
  padding: 0;
  border: 0;
  color: transparent;
  background: transparent;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  opacity: 0;
}

.footer-doodle {
  display: block;
  width: 14px;
  height: 14px;
  object-fit: contain;
  opacity: 0.38;
  filter: invert(1);
  transition: opacity 200ms ease, transform 260ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.footer-line:hover .footer-doodle {
  opacity: 0.7;
  transform: rotate(-8deg) scale(1.15);
}

html[data-theme="light"] .footer-doodle {
  filter: invert(0.1) sepia(1) saturate(3) hue-rotate(185deg) brightness(0.45);
  opacity: 0.42;
}

html[data-theme="light"] .footer-line:hover .footer-doodle {
  opacity: 0.72;
}

[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 600ms ease, transform 600ms ease;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 4px;
}

@media (max-width: 1120px) {
  .site-header {
    gap: 14px;
  }

  .nav {
    gap: 16px;
  }

  .nav a {
    font-size: 12px;
  }

  .role-switch {
    display: none;
  }

  .hero {
    gap: 42px;
  }

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

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 30px;
  }

  .section-note {
    flex: 0 1 auto;
    width: 100%;
    max-width: none;
    margin: 0;
    text-align: left;
  }
}

/* 13-inch MacBooks commonly expose a 1280–1440px CSS viewport. Keep the
   desktop header single-row, but give the menu a bounded lane so it cannot
   push the brand or controls into one another. */
@media (max-width: 1440px) {
  .site-header {
    gap: 12px;
    padding-inline: clamp(18px, 3vw, 36px);
  }

  .nav {
    justify-content: center;
    gap: clamp(8px, 0.9vw, 13px);
    padding-inline: 2px;
  }

  .nav a {
    font-size: clamp(12px, 1.02vw, 14px);
  }

  .header-actions {
    gap: 6px;
  }

  .role-switch {
    min-height: 34px;
    padding-inline: 9px;
    font-size: 11px;
  }

  .role-switch::before {
    margin-right: 5px;
  }

  .header-cta {
    padding-inline: 14px;
  }

  .hero-copy {
    max-width: min(640px, 52vw);
  }

  .hero-art {
    right: 0;
    width: min(44%, 540px);
  }
}

/* Short laptop viewports (13-inch MacBook at 800–900px high) need a
   shallower hero so the copy and artwork keep their visual hierarchy above
   the fold instead of forcing an oversized crop. */
@media (max-width: 1440px) and (max-height: 900px) {
  .hero {
    min-height: min(660px, calc(100svh - var(--header-height)));
    padding-top: clamp(26px, 4vh, 42px);
    padding-bottom: 40px;
  }

  .hero-art {
    top: 72px;
    height: min(560px, calc(100svh - 160px));
  }

  .hero-kicker {
    margin-bottom: 18px;
  }

  .hero-intro {
    margin-top: 18px;
    line-height: 1.65;
  }

  .hero-actions,
  .hero-tags {
    margin-top: 24px;
  }

  .role-proof {
    margin-top: 24px;
  }
}

@media (max-width: 860px) {
  :root {
    --header-height: 96px;
  }

  body {
    padding-top: var(--header-height);
  }

  .site-header {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand actions"
      "nav nav";
    gap: 4px 10px;
    min-height: var(--header-height);
    padding: 10px 18px 8px;
  }

  .brand {
    grid-area: brand;
    justify-self: start;
  }

  .nav {
    grid-area: nav;
    justify-content: flex-start;
    justify-self: stretch;
    gap: 16px;
    overflow-x: auto;
    min-width: 0;
    width: 100%;
    margin: 0;
    padding: 2px 2px 6px;
    scrollbar-width: none;
  }

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

  .header-actions {
    grid-area: actions;
    justify-self: end;
    margin-left: 0;
    gap: 5px;
  }

  .header-cta {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    grid-template-areas:
      "copy";
    grid-template-rows: auto auto;
    min-height: auto;
    padding-top: 28px;
    padding-bottom: 40px;
  }

  .hero-copy {
    max-width: 100%;
  }

  .hero-art {
    top: 88px;
    right: -2%;
    width: 46%;
    height: 420px;
    opacity: .72;
  }

  .hero-gridline {
    top: 40%;
    left: 0;
    opacity: 0.32;
  }

  .role-orbit {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px;
    min-height: 0;
    overflow: visible;
  }

  .section-heading > div:first-child {
    flex: 0 1 auto;
    width: 100%;
  }

  .role-token,
  .symbol-token {
    margin-top: 0;
    transform: none;
    flex: 0 0 auto;
  }

  .section {
    padding: 56px 0;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 30px;
  }

  .section-note {
    flex: 0 1 auto;
    width: 100%;
    max-width: none;
    margin: 0;
    text-align: left;
  }

  .case-layout,
  .agent-layout,
  .tooling-grid,
  .discography-body {
    grid-template-columns: 1fr;
  }

  .case-layout.has-case-visual { grid-template-columns: 1fr; }
  .contribution-evidence-list { grid-template-columns: 1fr; }
  .contribution-project-evidence { padding: 24px 0 0; border-top: 1px solid var(--line); border-left: 0; }

  .agent-visual {
    max-height: none;
  }

  .tool-card.featured {
    grid-row: auto;
  }

  .tool-card.featured .tool-media {
    flex: 0 0 auto;
    min-height: 190px;
    aspect-ratio: 16 / 9;
  }

  .contact-card {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .contact-links {
    justify-content: flex-start;
  }
}

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

  .site-header {
    gap: 2px 8px;
    padding-top: 8px;
    padding-bottom: 6px;
    padding-inline: 16px;
  }

  .brand {
    font-size: 15px;
  }

  .nav {
    gap: 14px;
  }

  .nav a {
    font-size: 12px;
  }

  .header-cta {
    display: none;
  }

  .hero,
  .section,
  .footer {
    width: min(100% - 32px, var(--max));
  }

  .hero {
    grid-template-areas:
      "art"
      "copy";
    padding-top: 20px;
    padding-bottom: 40px;
    row-gap: 12px;
  }

  .role-orbit {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px;
    overflow: visible;
    margin-inline: 0;
    padding: 0;
    min-height: 0;
  }

  .role-token,
  .symbol-token {
    flex: 0 0 auto;
  }

  .role-token {
    padding: 8px 12px;
    white-space: nowrap;
    font-size: 12px;
  }

  .hero h1 {
    font-size: clamp(43px, 13vw, 70px);
  }

  .hero-art {
    grid-area: art;
    position: relative;
    top: auto;
    right: auto;
    width: min(86vw, 360px);
    height: 300px;
    margin: 0 auto;
    overflow: hidden;
    opacity: .9;
    mask-image: linear-gradient(to bottom, black 0%, black 82%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 0%, black 82%, transparent 100%);
  }

  .hero-art img {
    object-fit: cover;
    object-position: 50% 8%;
  }

  html[data-theme="light"] .hero-art img {
    mix-blend-mode: multiply;
  }

  .hero-intro {
    font-size: 16px;
    line-height: 1.72;
  }

  .hero-actions .button {
    flex: 1 1 100%;
  }

  .hero-tags {
    overflow-x: auto;
    margin-inline: -16px;
    padding: 0 16px 2px;
    scrollbar-width: none;
  }

  .hero-tags::-webkit-scrollbar {
    display: none;
  }

  .hero-tags,
  .hero-tags .tag-list {
    flex-wrap: nowrap;
  }

  .hero-tags .tag {
    flex: 0 0 auto;
    min-height: 28px;
    padding: 0 9px;
    font-size: 11px;
  }

  .section {
    padding: 44px 0;
  }

  .project-chapter {
    padding-top: 22px;
  }

  .project-chapter .section-heading {
    margin-bottom: 20px;
  }

  h2 {
    font-size: clamp(31px, 9vw, 44px);
  }

  .project-map,
  .debug-grid,
  .activities-grid,
  .audio-grid {
    grid-template-columns: 1fr;
  }

  .audio-card {
    padding-inline: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .audio-card:last-child { border-bottom: 0; }

  .project-map-card {
    min-height: 0;
  }

  .project-map-card h3 {
    min-height: 0;
  }

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

  .flow-node {
    min-height: 95px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .flow-node:nth-child(2n) {
    border-right: 0;
  }

  .flow-node:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .flow-node:not(:last-child)::after {
    display: none;
  }

  .evidence-list li {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .agent-visual,
  .agent-visual img {
    min-height: 0;
  }

  .tool-card.featured {
    display: block;
  }

  .contribution-top,
  .contribution-areas {
    grid-template-columns: 1fr;
  }

  .contribution-main {
    display: contents;
  }

  .contribution-top {
    grid-template-areas:
      "metrics"
      "evidence"
      "story";
  }

  .contribution-story {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .contribution-story small,
  .contribution-areas-heading p {
    text-align: left;
  }

  .contribution-areas-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .contribution-story {
    padding-top: 20px;
    padding-left: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .dry-run-panel {
    margin-top: 24px;
  }

  .discography-stats {
    grid-template-columns: 1fr;
  }

  .discography-stat {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .discography-stat:last-child {
    border-bottom: 0;
  }

  .release-list {
    grid-template-columns: 1fr;
  }

  .contact-card {
    padding: 28px 21px;
  }

  .footer {
    flex-direction: column;
    padding-bottom: 24px;
  }
}

@media (max-width: 480px) {
  :root {
    --header-height: 90px;
  }

  .site-header {
    padding-inline: 12px;
  }

  .brand {
    gap: 7px;
    font-size: 14px;
  }

  .brand-mark {
    width: 21px;
  }

  .nav {
    gap: 12px;
  }

  .nav a {
    font-size: 12px;
  }

  .language-toggle {
    min-height: 36px;
    padding: 2px;
  }

  .language-button {
    min-width: 29px;
    min-height: 29px;
    padding-inline: 6px;
    font-size: 11px;
  }

  .theme-toggle {
    width: 34px;
    height: 34px;
  }

  .hero,
  .section,
  .footer {
    width: min(100% - 24px, var(--max));
  }

  .hero {
    padding-top: 52px;
    padding-bottom: 48px;
  }

  .hero-art {
    width: min(92vw, 340px);
    height: 280px;
  }

  .section {
    padding: 54px 0;
  }

  .section-heading {
    margin-bottom: 24px;
  }

  .contribution-top {
    padding: 20px 18px;
    border-radius: 13px;
  }

  .contribution-metric {
    padding-inline: 8px;
  }

  .contribution-metric:first-child {
    padding-left: 0;
  }

  .contribution-metric:last-child {
    padding-right: 0;
  }

  .contribution-metric.is-primary strong {
    font-size: clamp(44px, 15vw, 62px);
  }

  .contribution-story p,
  .case-summary,
  .agent-summary {
    font-size: 18px;
  }
}

.activities-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}
.activity-card {
  display: flex;
  flex-direction: column;
  align-self: stretch;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.activity-media { position:relative; display:block; overflow:hidden; aspect-ratio:16/9; border:0; border-radius:0; background:var(--surface-strong); }
.activity-media img { width:100%; height:100%; object-fit:cover; transition:transform 280ms ease; }
.activity-media:hover img { transform:scale(1.03); }
.activity-media .media-badge {
  right: 12px;
  bottom: 12px;
  left: auto;
  padding: 7px 11px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  font-family: var(--body-font);
  font-size: 11px;
  font-weight: 700;
}
.activity-content {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  padding: 20px 22px 22px;
}
.activity-meta { display:flex; flex-wrap:wrap; gap:8px 12px; color:var(--muted); font-size:11px; }
.activity-meta span:not(.activity-number) + span { padding-left:12px; border-left:1px solid var(--line); }
.activity-number { color:var(--accent); font-weight:800; }
.activity-card h3 {
  margin: 16px 0 10px;
  font-size: clamp(20px, 2.1vw, 27px);
  line-height: 1.25;
  min-height: calc(1.25em * 2);
}
.activity-card p { margin:0; color:var(--muted); font-size:16px; line-height:1.65; }
.activity-card .compact-tags { margin-top: auto; padding-top: 16px; }
.activity-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  margin-top: 14px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}
.activity-secondary:hover { border-color: var(--accent); color: var(--accent); }

.ai-cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 80;
  width: 34px;
  height: 34px;
  border: 1px solid color-mix(in srgb, var(--accent) 52%, transparent);
  border-radius: 50%;
  color: var(--text);
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, #fff 16%, transparent), transparent 30%), color-mix(in srgb, var(--accent) 12%, var(--bg));
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 6%, transparent), 0 0 20px color-mix(in srgb, var(--accent) 24%, transparent);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transform: translate3d(var(--cursor-x, 50vw), var(--cursor-y, 50vh), 0) translate(-50%, -50%) scale(.72);
  transition: opacity 180ms ease, transform 180ms ease;
  will-change: transform;
}

.ai-cursor::before {
  position: absolute;
  inset: -5px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
  border-top-color: transparent;
  border-left-color: transparent;
  border-radius: 50%;
  content: "";
  transform: rotate(-34deg);
}

.ai-cursor::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 80%, transparent);
  content: "";
  transform: translate(-50%, -50%);
}

.ai-cursor-glyph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--accent);
  font-size: 14px;
  opacity: .82;
  line-height: 1;
}

.ai-cursor.is-visible {
  opacity: .92;
  transform: translate3d(var(--cursor-x, 50vw), var(--cursor-y, 50vh), 0) translate(-50%, -50%) scale(1);
}

.ai-cursor.is-hovering {
  border-color: color-mix(in srgb, #3ddc84 78%, transparent);
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, #fff 16%, transparent), transparent 30%), color-mix(in srgb, #3ddc84 16%, var(--bg));
  box-shadow: 0 0 0 7px color-mix(in srgb, #3ddc84 10%, transparent), 0 0 26px color-mix(in srgb, #3ddc84 42%, transparent);
  transform: translate3d(var(--cursor-x, 50vw), var(--cursor-y, 50vh), 0) translate(-50%, -50%) scale(1.18);
}

.ai-cursor.is-hovering::after {
  background: #3ddc84;
  box-shadow: 0 0 12px color-mix(in srgb, #3ddc84 85%, transparent);
}

.ai-cursor.is-hovering .ai-cursor-glyph {
  color: #3ddc84;
}

.ai-cursor.is-idle::before {
  animation: ai-cursor-ring 7s linear infinite;
}

@keyframes ai-cursor-ring {
  from { transform: rotate(-34deg); }
  to { transform: rotate(326deg); }
}

@media (max-width: 720px), (pointer: coarse) {
  .ai-cursor { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

@media (max-width: 620px) {
  .activities-grid { grid-template-columns: 1fr; }
  .contribution-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 0; }
  .contribution-metric.is-primary { grid-column: span 2; }
  .contribution-metric span { white-space: normal; }
  .contribution-metric:nth-child(2) { border-right: 0; }
  .contribution-metric:nth-child(3) { padding-left: 0; }
  .contribution-metric:nth-child(4) { padding-right: 0; border-right: 0; }
  .contribution-area-grid { grid-template-columns: 1fr; }
}

.scroll-top-btn {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 90;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(16px);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.9);
  transition: opacity 220ms ease, transform 220ms ease, visibility 220ms ease, background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.scroll-top-btn.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.scroll-top-doodle {
  display: block;
  width: 22px;
  height: 22px;
  transition: transform 260ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.scroll-top-btn:hover {
  color: #ffffff;
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.45);
}

.scroll-top-btn:hover .scroll-top-doodle {
  transform: rotate(-8deg) scale(1.12);
}

html[data-theme="light"] .scroll-top-btn {
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  border-color: var(--line);
}

html[data-theme="light"] .scroll-top-btn:hover {
  color: #ffffff;
  background: var(--accent);
  border-color: var(--accent);
}

@media (max-width: 720px) {
  .scroll-top-btn {
    right: 18px;
    bottom: 18px;
    width: 42px;
    height: 42px;
  }
}

@page {
  size: A4 landscape;
  margin: 16mm;
}

@media print {
  html {
    overflow: visible;
    scroll-padding-top: 0;
  }

  body {
    padding-top: 0;
    background: var(--bg) !important;
    font-size: 16px;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .site-header,
  .scroll-top-btn,
  .ai-cursor,
  .print-btn,
  .hero-gridline {
    display: none !important;
  }

  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }

  img {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  main {
    overflow: visible !important;
  }

  .hero,
  .section,
  .footer {
    width: 100%;
    max-width: none;
  }

  .hero {
    position: relative;
    min-height: 0;
    height: 178mm;
    max-height: 178mm;
    padding: 0;
    overflow: hidden !important;
    break-inside: avoid;
    page-break-inside: avoid;
    break-after: page;
    page-break-after: always;
  }

  .hero-copy {
    max-width: 52%;
  }

  .hero-kicker {
    margin-bottom: 8px;
  }

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

  .hero-stack {
    font-size: 16px;
  }

  .hero-intro {
    margin-top: 8px;
    font-size: 16px;
    line-height: 1.5;
  }

  .hero-actions {
    margin-top: 10px;
  }

  .button,
  .button.primary,
  .contact-links a,
  .contact-links .contact-primary {
    box-shadow: none !important;
  }

  .contact-card::after {
    display: none;
  }

  .hero-tags {
    margin-top: 8px;
  }

  .role-proof {
    margin-top: 10px;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .role-proof > div {
    padding: 8px 10px 10px;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .hero-art {
    top: 2mm;
    right: 0;
    bottom: 2mm;
    width: 46%;
    height: auto;
    opacity: 1;
    overflow: hidden !important;
    border-radius: 0;
    mask-image: none !important;
    -webkit-mask-image: none !important;
    place-items: center;
  }

  .hero-art img {
    width: 100%;
    height: 100%;
    object-fit: contain !important;
    object-position: center !important;
    mix-blend-mode: screen !important;
    filter: none !important;
  }

  html[data-theme="light"] .hero-art img {
    mix-blend-mode: multiply !important;
  }

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

  .section-heading {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8mm;
    margin-bottom: 3mm;
    break-after: avoid;
    page-break-after: avoid;
  }

  .section-heading > div:first-child,
  .section-note {
    flex: 0 1 auto !important;
    width: auto;
    max-width: 58%;
  }

  .section-note {
    max-width: 40%;
    margin: 0;
    text-align: right;
    font-size: 11px;
    line-height: 1.4;
  }

  h2 {
    font-size: 22px;
  }

  .section > .section-heading,
  .debugging-chapter > .section-heading {
    break-after: page;
    page-break-after: always;
    break-inside: avoid;
    page-break-inside: avoid;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 8mm;
    min-height: 168mm;
    margin: 0;
    padding: 0 8mm;
  }

  .section > .section-heading > div:first-child,
  .debugging-chapter > .section-heading > div:first-child,
  .section > .section-heading .section-note,
  .debugging-chapter > .section-heading .section-note {
    width: 100%;
    max-width: 190mm;
    flex: 0 0 auto !important;
    text-align: left;
  }

  .section > .section-heading .eyebrow,
  .debugging-chapter > .section-heading .eyebrow {
    margin: 0;
    font-size: 14px;
  }

  .section > .section-heading h2,
  .debugging-chapter > .section-heading h2 {
    font-size: 52px;
    line-height: 1.12;
    max-width: 190mm;
  }

  .section > .section-heading .section-note,
  .debugging-chapter > .section-heading .section-note {
    max-width: 150mm;
    font-size: 16px;
    line-height: 1.55;
    color: var(--muted);
  }

  .guardian-project-section {
    gap: 3mm;
    break-inside: auto;
  }

  .project-chapter {
    padding-top: 3mm;
  }

  .contribution-chapter {
    break-before: avoid;
    page-break-before: avoid;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .contribution-content,
  .contribution-top {
    break-before: avoid;
    page-break-before: avoid;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .contribution-top {
    grid-template-areas: "main evidence";
    padding: 7mm 8mm;
    row-gap: 5mm;
    column-gap: 8mm;
  }

  .contribution-main {
    display: flex;
    flex-direction: column;
    gap: 5mm;
  }

  .contribution-metrics {
    grid-template-columns: max-content repeat(3, minmax(max-content, 1fr));
    column-gap: 8mm;
  }

  .contribution-metric.is-primary strong {
    font-size: 48px;
  }

  .contribution-metric strong {
    font-size: 28px;
  }

  .contribution-metric span {
    margin-top: 4px;
    font-size: 11px;
  }

  .contribution-story p {
    font-size: 17px;
    line-height: 1.55;
  }

  .contribution-evidence-head strong {
    font-size: 18px;
  }

  .contribution-evidence-list span {
    font-size: 16px;
    line-height: 1.5;
  }

  .contribution-evidence-metrics strong {
    font-size: 24px;
  }

  .contribution-evidence-metrics span {
    font-size: 11px;
  }

  .contribution-areas {
    padding-top: 3mm;
    padding-bottom: 0;
    border-bottom: 0;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .contribution-area {
    padding: 6px 0 8px;
  }

  .contribution-area strong {
    margin-top: 6px;
    font-size: 14px;
  }

  .contribution-area p {
    margin-top: 3px;
    font-size: 13px;
    line-height: 1.45;
  }

  .project-map-card,
  .tool-card,
  .activity-card,
  .contact-card {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .case-chapter {
    break-before: page;
    page-break-before: always;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .case-layout.has-case-visual {
    grid-template-columns: 1.05fr 1fr;
    gap: 6mm;
    align-items: start;
  }

  .case-visual-wrap,
  .case-visual {
    min-width: 0;
    overflow: hidden;
  }

  .case-visual img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    max-height: 110mm;
    object-fit: contain !important;
    object-position: center;
    background: #0a0d12;
  }

  .case-main h3 {
    font-size: 20px;
  }

  .case-summary p {
    font-size: 15.5px;
    line-height: 1.5;
    margin: 0 0 2mm;
  }

  .case-scope {
    gap: 1.2mm 6mm;
    margin: 0 0 2mm;
  }

  .case-scope li {
    font-size: 14px;
    line-height: 1.45;
  }

  .debugging-chapter {
    break-before: page;
    page-break-before: always;
    padding-top: 0;
  }

  .print-page-slot {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    align-content: center;
    gap: 6mm;
    width: 100%;
    height: 172mm;
    min-height: 172mm;
    max-height: 172mm;
    box-sizing: border-box;
    overflow: hidden;
    break-inside: avoid;
    page-break-inside: avoid;
    break-after: page;
    page-break-after: always;
  }

  .print-page-slot:last-child {
    break-after: auto;
    page-break-after: auto;
  }

  .debug-grid {
    display: block;
    gap: 0;
  }

  .debug-card {
    display: grid;
    grid-template-columns: 0.95fr 1.05fr;
    grid-template-rows: auto auto auto auto;
    align-items: center;
    align-content: center;
    column-gap: 6mm;
    row-gap: 2mm;
    width: 100%;
    min-height: 0;
    height: auto;
    max-height: 164mm;
    margin: 0;
    padding: 4mm;
    overflow: visible;
    break-before: page;
    page-break-before: always;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .print-page-slot .debug-card {
    break-before: auto;
    page-break-before: auto;
  }

  .debug-card-visual {
    grid-column: 1;
    grid-row: 1 / 5;
    align-self: center;
    justify-self: center;
    width: 100%;
    height: auto;
    max-height: 120mm;
    margin: 0;
    object-fit: contain;
    object-position: center;
    border: 0;
    border-radius: 8px;
  }

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

  .debug-card-title {
    grid-column: 2;
    grid-row: 2;
    min-height: 0;
    margin-top: 0;
    font-size: 18px;
  }

  .debug-card-summary {
    grid-column: 2;
    grid-row: 3;
    min-height: 0;
    margin: 0;
    font-size: 15.5px;
    line-height: 1.5;
  }

  .debug-card details {
    grid-column: 2;
    grid-row: 4;
    margin-top: 0;
    padding-top: 1.5mm;
    overflow: visible;
  }

  .debug-card summary {
    display: none;
  }

  .debug-evidence-body {
    font-size: 14px;
    line-height: 1.48;
  }

  .debug-evidence-block {
    margin: 0 0 1.5mm;
  }

  .debug-evidence-text,
  .debug-evidence-item {
    font-size: 14px;
    line-height: 1.48;
  }

  .debug-card .debug-link {
    display: none;
  }

  .project-section,
  .tooling-section,
  .activities-section,
  .contact-section {
    break-before: page;
    page-break-before: always;
    padding: 0;
    border-top: 0;
    margin: 0;
  }

  .project-map {
    display: block;
    min-height: 0;
    break-inside: auto;
    page-break-inside: auto;
  }

  .project-map-card {
    flex: 0 0 calc((100% - 6mm) / 2);
    width: calc((100% - 6mm) / 2);
    max-width: calc((100% - 6mm) / 2);
    min-height: 0;
    height: auto;
    box-sizing: border-box;
    break-before: auto;
    page-break-before: auto;
    break-after: auto;
    page-break-after: auto;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .project-map > .project-map-card:nth-child(2),
  .project-map > .project-map-card:nth-child(4) {
    break-after: page;
    page-break-after: always;
  }

  .print-page-slot.is-single .project-map-card {
    flex: 0 0 70%;
    width: 70%;
    max-width: 70%;
  }

  .project-map-body {
    padding: 8px 10px 10px;
  }

  .project-map-media {
    margin: -8px -10px 8px;
    aspect-ratio: auto;
    height: auto;
    overflow: hidden;
    background: #080a10;
  }

  .project-map-media img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 78mm;
    object-fit: contain;
    object-position: center;
    background: #080a10;
  }

  .print-page-slot.is-single .project-map-media img {
    max-height: 92mm;
  }

  .project-map-card .project-map-title {
    font-size: 17px;
  }

  .project-map-card .project-map-desc {
    margin-top: 6px;
    font-size: 13.5px;
    line-height: 1.5;
  }

  .map-card-top {
    margin-bottom: 8px;
  }

  .tooling-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-content: center;
    align-items: stretch;
    gap: 5mm;
    min-height: 160mm;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .tool-card,
  .tool-card.featured {
    flex: 0 0 calc((100% - 10mm) / 3);
    width: calc((100% - 10mm) / 3);
    max-width: calc((100% - 10mm) / 3);
    grid-column: auto !important;
    grid-row: auto !important;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    min-height: 0;
    height: auto;
    padding: 8px;
    gap: 6px;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .tool-card.featured::after {
    display: none;
  }

  .tool-card .tool-media,
  .tool-card.featured .tool-media {
    min-height: 0;
    aspect-ratio: 16 / 9;
  }

  .tool-card .tool-media img,
  .tool-card.featured .tool-media img {
    height: 100%;
    object-fit: contain;
    background: #080a10;
  }

  .tool-card h3,
  .tool-card.featured h3 {
    margin-top: 4px;
    font-size: 17px;
  }

  .tool-card p,
  .tool-card:not(.featured) > div > p {
    font-size: 13.5px;
    line-height: 1.5;
  }

  .activities-grid {
    display: block;
    min-height: 0;
  }

  .activity-card {
    flex: 0 0 calc((100% - 6mm) / 2);
    width: calc((100% - 6mm) / 2);
    max-width: calc((100% - 6mm) / 2);
    height: auto;
    min-height: 0;
    box-sizing: border-box;
    break-before: auto;
    page-break-before: auto;
    break-after: auto;
    page-break-after: auto;
  }

  .activities-grid > .activity-card:nth-child(2) {
    break-after: page;
    page-break-after: always;
  }

  .activity-media .media-badge {
    display: none;
  }

  .activity-media {
    aspect-ratio: 16 / 9;
  }

  .activity-media img {
    object-fit: cover;
    object-position: center;
  }

  .contact-section {
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    padding: 18mm 0 0;
    border-top: 0;
    break-after: avoid;
    page-break-after: avoid;
  }

  .contact-card {
    break-inside: avoid;
    page-break-inside: avoid;
    break-after: avoid;
    page-break-after: avoid;
    width: 100%;
  }

  .contact-copy h2 {
    font-size: 36px;
  }

  .footer {
    break-before: avoid;
    page-break-before: avoid;
    break-inside: avoid;
    page-break-inside: avoid;
    margin-top: 6mm;
    padding-bottom: 0;
    justify-content: space-between;
  }
}
