* {
  box-sizing: border-box;
}

:root {
  --holo-ink: #172026;
  --holo-muted: #5b6470;
  --holo-line: #d9dde5;
  --holo-panel: #f7f9fb;
  --holo-blue: #1b8fd3;
  --holo-teal: #00a99d;
  --holo-pink: #d84f8a;
  --holo-orange: #f08a32;
  --holo-yellow: #ffd25a;
  --content-max-width: 1120px;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--holo-ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background: #ffffff;
  overflow-x: hidden;
}

a {
  color: #126ba1;
}

.holo-hero {
  background:
    radial-gradient(circle at 12% 12%, rgba(255, 210, 90, 0.22), transparent 30%),
    linear-gradient(118deg, #122029 0%, #225b70 42%, #9c3f6e 73%, #cf6d36 100%);
}

.header-container {
  min-height: 610px;
  padding: 46px 54px 38px;
}

.header-content {
  color: #fff8e8;
}

.header-content h1 {
  color: #ffffff;
  font-weight: 850;
  letter-spacing: 0;
}

.header-content h2 {
  color: #ffe08a;
  font-weight: 760;
}

.header-content p {
  color: #fff6df;
  overflow-wrap: anywhere;
}

.header-content strong {
  color: #ffffff;
}

.brand-mark {
  display: inline-block;
  background: linear-gradient(95deg, #ff7bc2 0%, #35b8ff 45%, #00d4c0 75%, #ffd25a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.icon-container {
  margin-top: 22px;
  gap: 12px;
}

.icon-item {
  align-items: flex-start;
  color: #fff5dd;
  font-size: 0.98rem;
  line-height: 1.45;
}

.icon-item img {
  width: 28px;
  height: 28px;
  margin-top: 2px;
  filter: invert(91%) sepia(21%) saturate(853%) hue-rotate(347deg) brightness(105%) contrast(101%);
}

.button-container a.button,
.button-container .button {
  border-radius: 8px;
  border: 1px solid rgba(255, 210, 90, 0.62);
  background: #fff2cf;
  color: #15202b;
  display: inline-flex;
  gap: 0.55rem;
  align-items: center;
  justify-content: center;
  min-height: 42px;
}

.button-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.button-container a.button:hover {
  background: #ffd25a;
  color: #111820;
}

.button-container .button-disabled {
  opacity: 0.62;
  cursor: not-allowed;
}

.header-image img {
  max-width: 100%;
  border-radius: 8px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.24);
  background: #ffffff;
}

.byline {
  margin-bottom: 32px;
  padding: 14px 5px 16px;
  background: #ffffff;
}

.byline-container {
  max-width: 900px;
  gap: 28px;
  justify-content: center;
}

.byline-column {
  min-width: 220px;
}

.byline-column h3 {
  margin-bottom: 0.35em;
  color: var(--holo-muted);
  font-size: 0.92rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.affiliation-link {
  color: var(--holo-ink);
  font-size: 1rem;
  line-height: 1.55;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid var(--holo-line);
  border-radius: 8px;
  background: var(--holo-panel);
  color: var(--holo-ink);
  font-weight: 700;
}

.page-main {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 0 48px 64px;
}

.section {
  margin: 46px 0 58px;
}

.section:first-child {
  margin-top: 22px;
}

.section h1 {
  margin: 0 0 18px;
  font-size: 2rem;
  line-height: 1.15;
}

.section h2 {
  margin: 34px 0 12px;
  font-size: 1.35rem;
  line-height: 1.25;
}

.text {
  max-width: 880px;
  margin-left: auto;
  margin-right: auto;
  color: var(--holo-ink);
  font-size: 1.06rem;
  line-height: 1.68;
}

.abstract {
  font-size: 1.08rem;
}

.tldr {
  max-width: 980px;
  margin: 24px auto 0;
  padding: 12px 16px;
  border-left: 5px solid var(--holo-teal);
  border-radius: 8px;
  background: #edf9f7;
  color: #173234;
  line-height: 1.55;
}

.figure-block {
  margin: 28px auto;
  max-width: 1040px;
}

.figure-block img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--holo-line);
  border-radius: 8px;
  background: #ffffff;
}

.figure-block figcaption {
  max-width: 900px;
  margin: 10px auto 0;
  color: var(--holo-muted);
  font-size: 0.95rem;
  line-height: 1.5;
  text-align: center;
}

.figure-scroll {
  --figure-mobile-width: 720px;
}

.figure-scroll-wide {
  --figure-mobile-width: 920px;
}

.teaser-figure img {
  border: 0;
  box-shadow: 0 12px 34px rgba(20, 32, 42, 0.12);
}

.agent-grid,
.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  max-width: 980px;
  margin: 24px auto;
}

.agent-card,
.metric-card {
  min-height: 168px;
  padding: 18px;
  border: 1px solid var(--holo-line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(25, 36, 48, 0.06);
}

.agent-card h3,
.metric-card h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.agent-card p,
.metric-card p {
  margin: 0;
  color: var(--holo-muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.agent-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-bottom: 12px;
  border-radius: 8px;
  color: #ffffff;
  font-weight: 850;
}

.agent-label.arranger {
  background: var(--holo-pink);
}

.agent-label.modeler {
  background: var(--holo-blue);
}

.agent-label.refiner {
  background: var(--holo-teal);
}

.code-panel {
  max-width: 900px;
  margin: 24px auto;
  border: 1px solid #25313d;
  border-radius: 8px;
  overflow: hidden;
  background: #111820;
  color: #e6edf3;
  box-shadow: 0 10px 28px rgba(17, 24, 32, 0.18);
}

.code-panel-header {
  padding: 10px 14px;
  border-bottom: 1px solid #2d3a48;
  color: #aeb8c4;
  font-size: 0.9rem;
}

.code-panel pre {
  margin: 0;
  padding: 18px;
  overflow-x: auto;
  font-size: 0.95rem;
  line-height: 1.55;
}

.code-panel code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.code-key {
  color: #35b8ff;
}

.code-string {
  color: #ffd25a;
}

.code-num {
  color: #ff9fbf;
}

.results-stack {
  display: grid;
  gap: 28px;
}

.mesh-note {
  color: var(--holo-muted);
  font-size: 0.94rem;
}

.interactive-shell {
  max-width: 1040px;
  margin: 28px auto;
  border: 1px solid var(--holo-line);
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(25, 36, 48, 0.08);
}

.interactive-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid var(--holo-line);
  background: #f8fafc;
}

.interactive-toolbar h2 {
  margin: 0 0 4px;
  font-size: 1.1rem;
}

.interactive-toolbar p {
  margin: 0;
  color: var(--holo-muted);
  font-size: 0.94rem;
  line-height: 1.45;
}

.interactive-reset {
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid #cbd3df;
  border-radius: 8px;
  background: #ffffff;
  color: var(--holo-ink);
  cursor: pointer;
  font-weight: 700;
}

.interactive-reset:disabled {
  cursor: wait;
  opacity: 0.55;
}

.interactive-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  min-height: 560px;
}

.interactive-sidebar {
  border-right: 1px solid var(--holo-line);
  background: #fbfcfe;
  overflow: auto;
}

.interactive-thumbs {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.interactive-thumb {
  display: grid;
  gap: 7px;
  width: 100%;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--holo-ink);
  cursor: pointer;
  text-align: left;
  font-weight: 750;
}

.interactive-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 6px;
  background: #e9edf3;
}

.interactive-thumb:hover,
.interactive-thumb.is-active {
  border-color: #9fc9ee;
  background: #eef7ff;
}

.interactive-main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
}

.interactive-methods {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--holo-line);
}

.interactive-method {
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid #cbd3df;
  border-radius: 8px;
  background: #ffffff;
  color: var(--holo-ink);
  cursor: pointer;
  font-weight: 750;
}

.interactive-method:hover,
.interactive-method.is-active {
  border-color: var(--holo-blue);
  background: #eaf6ff;
  color: #0b5d8d;
}

.interactive-method:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.interactive-method:disabled:hover {
  border-color: #cbd3df;
  background: #ffffff;
  color: var(--holo-ink);
}

.interactive-canvas-wrap {
  position: relative;
  min-height: 470px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(232, 238, 246, 0.62)),
    #f7f9fb;
}

.interactive-canvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 470px;
}

.interactive-status {
  padding: 10px 16px;
  border-top: 1px solid var(--holo-line);
  color: var(--holo-muted);
  font-size: 0.92rem;
}

#holocode-gallery-viewer .interactive-layout {
  height: clamp(620px, 72vh, 780px);
  min-height: 0;
}

#holocode-gallery-viewer .interactive-sidebar {
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

#holocode-gallery-viewer .interactive-thumbs {
  align-content: start;
}

#holocode-gallery-viewer .interactive-main {
  min-height: 0;
}

#holocode-gallery-viewer .interactive-canvas-wrap,
#holocode-gallery-viewer .interactive-canvas {
  min-height: 0;
}

.footer-note {
  margin-top: 48px;
  padding-top: 22px;
  border-top: 1px solid var(--holo-line);
  color: var(--holo-muted);
  font-size: 0.95rem;
  line-height: 1.55;
  text-align: center;
}

@media (min-width: 600px) {
  .header-content h1 {
    font-size: 4rem;
  }

  .header-content h2 {
    margin-top: -0.45em;
    font-size: 2rem;
  }

  .header-image img {
    max-width: 96%;
  }
}

@media (max-width: 768px) {
  .header-container {
    display: block;
    min-height: 0;
    padding: 32px 18px 28px;
    overflow: hidden;
    max-width: 100vw;
  }

  .header-content,
  .header-image {
    width: 100%;
    max-width: 354px;
  }

  .header-image {
    margin-left: 0;
    margin-right: 0;
  }

  .header-content h1 {
    font-size: 3.1rem;
  }

  .header-content h2 {
    width: 100%;
    max-width: 100%;
    font-size: 1.46rem;
    overflow-wrap: anywhere;
  }

  .header-content p {
    width: 100%;
    max-width: 100%;
  }

  .icon-item {
    align-items: flex-start;
  }

  .icon-item div {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .button-container {
    width: 100%;
    max-width: 100%;
    gap: 8px;
  }

  .button-container a.button,
  .button-container .button {
    margin: 0;
    padding: 10px 13px;
    max-width: 100%;
    font-size: 0.98rem;
  }

  .button-container .button-disabled {
    flex-basis: 100%;
  }

  .header-image img {
    width: 100%;
    max-width: 100%;
  }

  .byline-container {
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
  }

  .page-main {
    padding: 0 18px 48px;
  }

  .section {
    margin: 36px 0 46px;
  }

  .section h1 {
    font-size: 1.7rem;
  }

  .figure-scroll {
    margin-left: -18px;
    margin-right: -18px;
    padding: 0 18px 8px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }

  .figure-scroll img {
    width: 100%;
    min-width: var(--figure-mobile-width);
    max-width: none;
  }

  .agent-grid,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .interactive-toolbar {
    grid-template-columns: 1fr;
  }

  .interactive-layout {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .interactive-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--holo-line);
    overflow-x: auto;
  }

  .interactive-thumbs {
    grid-auto-flow: column;
    grid-auto-columns: 160px;
    overflow-x: auto;
  }

  .interactive-canvas-wrap,
  .interactive-canvas {
    min-height: 390px;
  }

  #holocode-gallery-viewer .interactive-layout {
    height: auto;
  }

  #holocode-gallery-viewer .interactive-sidebar {
    overflow-x: auto;
    overflow-y: hidden;
  }

  #holocode-gallery-viewer .interactive-canvas-wrap,
  #holocode-gallery-viewer .interactive-canvas {
    min-height: 390px;
  }
}
