/* Function Health-inspired showroom system.
   Scope: gallery chrome only. App artwork, phone geometry and app.js are retained. */

@font-face {
  font-family: "FH Editorial";
  src: url("./assets/theme-function/bodoni-moda-400.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "FH Editorial";
  src: url("./assets/theme-function/bodoni-moda-400-italic.ttf") format("truetype");
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "FH Editorial CJK";
  src: url("./assets/theme-function/noto-serif-sc-400-display.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  unicode-range: U+3000-303F, U+3400-9FFF, U+FF00-FFEF;
}

@font-face {
  font-family: "FH Sans";
  src: url("./assets/theme-function/source-sans-3-400.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "FH Sans";
  src: url("./assets/theme-function/source-sans-3-600.ttf") format("truetype");
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --fh-canvas: #fef9ef;
  --fh-surface: #f5eee1;
  --fh-surface-hover: #eee4d5;
  --fh-ink: #2a2b2f;
  --fh-secondary: #6d655b;
  --fh-line: #ddd6ca;
  --fh-line-strong: #c7bcad;
  --fh-accent: #b05a36;
  --fh-accent-hover: #8f462a;
  --fh-accent-soft: #f0e1d4;
  --fh-focus: #8f462a;
  --fh-radius-small: 6px;
  --fh-radius-control: 12px;
  --fh-radius-panel: 24px;
  --fh-radius-pill: 999px;
  --fh-font-ui: "FH Sans", "PingFang HK", "PingFang SC", "Noto Sans SC", sans-serif;
  --fh-font-editorial: "FH Editorial CJK", "FH Editorial", "Noto Serif SC", "Songti SC", serif;
  --fh-font-latin: "FH Editorial", Georgia, serif;
  --fh-space-1: 4px;
  --fh-space-2: 8px;
  --fh-space-3: 12px;
  --fh-space-4: 16px;
  --fh-space-5: 24px;
  --fh-space-6: 32px;
  --fh-space-7: 48px;
  --fh-ease: cubic-bezier(.25, 1, .5, 1);
}

html,
body {
  background: var(--fh-canvas);
  color: var(--fh-ink);
}

body {
  font-family: var(--fh-font-ui);
  caret-color: var(--fh-accent);
}

::selection {
  color: var(--fh-ink);
  background: #e7cdb9;
}

.showcase-shell button:focus-visible,
.overview button:focus-visible,
.overview-card:focus-visible,
.brand:focus-visible {
  outline: 2px solid var(--fh-focus);
  outline-offset: 4px;
  box-shadow: none;
}

.ambient {
  background: var(--fh-canvas);
}

.ambient::before,
.ambient::after,
.ambient .orb,
.ambient .grain,
.stage::before,
.stage::after,
.phone-scene::before,
.phone-scene::after,
.stage .orbit {
  display: none;
}

.showcase-shell {
  grid-template-rows: 80px minmax(0, 1fr) 56px;
  gap: 0;
  width: 100%;
  height: 100svh;
  min-height: 680px;
  padding: 0 32px;
}

.topbar,
.footer-bar {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  color: var(--fh-ink);
}

.topbar {
  padding: 0 8px;
  border-bottom: 1px solid var(--fh-line);
}

.brand-logo {
  width: 112px;
  filter: none;
  opacity: 1;
}

.project-meta {
  gap: 12px;
  font-family: var(--fh-font-ui);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: .015em;
  color: var(--fh-secondary);
}

.project-meta i {
  width: 4px;
  height: 4px;
  background: var(--fh-accent);
  box-shadow: none;
}

.icon-button,
.overview-close {
  width: 44px;
  height: 44px;
  border: 1px solid var(--fh-line-strong);
  border-radius: var(--fh-radius-pill);
  color: var(--fh-ink);
  background: transparent;
  box-shadow: none;
  transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.icon-button:hover,
.overview-close:hover {
  color: var(--fh-canvas);
  border-color: var(--fh-ink);
  background: var(--fh-ink);
  box-shadow: none;
  transform: none;
}

.viewer {
  grid-template-columns: 210px minmax(460px, 1fr) 288px;
  gap: 0;
}

.version-nav,
.details-panel {
  border: 0;
  border-radius: 0;
  color: var(--fh-ink);
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.version-nav {
  padding: 32px 18px 28px 0;
}

.version-nav > .eyebrow {
  padding-left: 12px;
  font-family: var(--fh-font-ui);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .075em;
  color: var(--fh-secondary);
  text-shadow: none;
}

.version-list {
  gap: 16px;
  margin: 24px 0;
}

.version-item {
  grid-template-columns: 25px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-height: 80px;
  margin: 0;
  padding: 15px 12px;
  border: 0;
  border-radius: var(--fh-radius-control);
  background: transparent;
  color: var(--fh-ink);
  opacity: 1;
  box-shadow: none;
  transition: background-color 180ms ease, color 180ms ease;
}

.version-item::before {
  display: none;
}

.version-item:hover {
  border-color: transparent;
  background: var(--fh-surface);
  color: var(--fh-ink);
  opacity: 1;
  transform: none;
}

.version-item.active {
  border-color: transparent;
  background: var(--fh-accent-soft);
  color: var(--fh-ink);
  box-shadow: none;
}

.version-index,
.version-item.active .version-index {
  padding-top: 0;
  font-family: var(--fh-font-latin);
  font-size: 23px;
  font-style: italic;
  font-weight: 400;
  line-height: 24px;
  color: var(--fh-accent);
  text-shadow: none;
}

.version-text strong {
  font-family: var(--fh-font-ui);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.55;
}

.version-text span,
.version-item.active .version-text span {
  margin-top: 5px;
  font-family: var(--fh-font-ui);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0;
  color: var(--fh-secondary);
}

.nav-foot {
  gap: 12px;
  padding: 0 12px;
}

.progress-track {
  height: 2px;
  border-radius: 0;
  background: var(--fh-line);
}

.progress-track i {
  border-radius: 0;
  background: var(--fh-accent);
  box-shadow: none;
}

.nav-foot > span,
.nav-foot b {
  font-family: var(--fh-font-ui);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--fh-secondary);
}

.nav-foot b {
  font-weight: 600;
  color: var(--fh-ink);
}

.stage {
  margin: 20px 12px;
  border: 0;
  border-radius: var(--fh-radius-panel);
  background: var(--fh-surface);
  box-shadow: none;
}

/* Keep artwork on its native image-rendering path instead of filtering the
   complete phone into an offscreen bitmap. The scene only uses 2D motion. */
.phone-scene,
.phone-deck {
  perspective: none;
}

.phone.reference-image-device {
  filter: none;
  box-shadow: 0 22px 20px rgba(66, 46, 27, .16);
  animation-fill-mode: backwards;
}

.phone.reference-image-device:hover {
  filter: none;
  box-shadow: 0 26px 23px rgba(66, 46, 27, .19);
}

.phone-shadow {
  opacity: .35;
  background: rgba(87, 67, 45, .18);
  filter: blur(24px);
}

.stage-arrow {
  width: 44px;
  height: 44px;
  border: 1px solid var(--fh-line-strong);
  border-radius: var(--fh-radius-pill);
  color: var(--fh-ink);
  background: var(--fh-canvas);
  opacity: 1;
  box-shadow: none;
  transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.stage-arrow:hover {
  border-color: var(--fh-accent);
  color: var(--fh-canvas);
  background: var(--fh-accent);
  box-shadow: none;
}

.stage-hint {
  font-family: var(--fh-font-ui);
  font-size: 10px;
  letter-spacing: .015em;
  color: var(--fh-secondary);
}

.stage-hint i {
  width: 3px;
  height: 3px;
  background: var(--fh-accent);
  box-shadow: none;
}

.details-panel {
  padding: 32px 0 24px 20px;
}

.details-top {
  justify-content: flex-end;
  min-height: 24px;
}

.details-top > .eyebrow {
  display: none;
}

.version-code {
  padding: 5px 9px;
  border: 0;
  border-radius: var(--fh-radius-small);
  font-family: var(--fh-font-ui);
  font-size: 10px;
  font-weight: 600;
  color: var(--fh-accent);
  background: var(--fh-accent-soft);
  box-shadow: none;
}

.details-panel .detail-main {
  top: 0;
  min-height: 0;
  padding: 14px 4px 20px 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--fh-line-strong) transparent;
}

.details-panel .detail-main::-webkit-scrollbar {
  width: 3px;
}

.details-panel .detail-main::-webkit-scrollbar-thumb {
  border-radius: 3px;
  background: var(--fh-line-strong);
}

.detail-main h2 {
  max-width: none;
  margin-bottom: 20px;
  font-family: var(--fh-font-editorial);
  font-size: clamp(25px, 2.1vw, 33px);
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -.025em;
  color: var(--fh-ink);
  text-shadow: none;
  text-wrap: balance;
}

.details-panel #detailDescription,
.details-panel .detail-main > p {
  max-width: none;
  font-family: var(--fh-font-ui);
  font-size: 12px;
  line-height: 1.9;
  color: var(--fh-secondary);
}

.details-panel .interaction-description {
  margin-top: 22px;
  padding-top: 20px;
  border-top-color: var(--fh-line);
  font-size: 11px;
  line-height: 1.85;
  color: var(--fh-secondary);
}

.details-panel .interaction-description strong {
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--fh-ink);
}

.details-panel .interaction-description + .palette-block {
  margin-top: 24px;
}

.palette-block > span {
  font-family: var(--fh-font-ui);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .025em;
  color: var(--fh-secondary);
}

.palette {
  gap: 10px;
  margin-top: 12px;
}

.palette button {
  width: 27px;
  height: 27px;
  border: 3px solid var(--fh-canvas);
  box-shadow: 0 0 0 1px var(--fh-line);
}

.keywords span {
  border-color: var(--fh-line);
  color: var(--fh-secondary);
  background: transparent;
  box-shadow: none;
}

.details-panel .detail-actions {
  top: 0;
  flex-shrink: 0;
  grid-template-columns: 1fr;
  margin-top: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--fh-line);
}

.upload-button,
.play-button {
  min-height: 44px;
  padding: 12px 20px;
  border: 0;
  border-radius: var(--fh-radius-pill);
  font-family: var(--fh-font-ui);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .015em;
  color: var(--fh-canvas);
  background: var(--fh-accent);
  box-shadow: none;
}

.upload-button:hover,
.play-button:hover,
.play-button.is-playing {
  border-color: transparent;
  color: var(--fh-canvas);
  background: var(--fh-accent-hover);
  box-shadow: none;
}

.footer-bar {
  padding: 0 8px;
  border-top: 1px solid var(--fh-line);
}

.overview-button {
  min-height: 36px;
  padding: 7px 14px;
  border: 1px solid var(--fh-line-strong);
  border-radius: var(--fh-radius-pill);
  font-family: var(--fh-font-ui);
  font-size: 12px;
  font-weight: 500;
  color: var(--fh-ink);
  background: transparent;
}

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

.footer-bar p {
  font-family: var(--fh-font-ui);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: .055em;
  color: var(--fh-secondary);
}

.keyboard-hints {
  gap: 6px;
}

.keyboard-hints kbd {
  border-color: var(--fh-line);
  border-radius: var(--fh-radius-small);
  font-family: var(--fh-font-ui);
  color: var(--fh-secondary);
  background: transparent;
  box-shadow: none;
}

.overview {
  padding: 40px;
  color: var(--fh-ink);
  background: var(--fh-canvas);
}

.overview-head {
  margin-bottom: 28px;
}

.overview-head .eyebrow {
  display: none;
}

.overview-head h2 {
  margin: 0;
  font-family: var(--fh-font-editorial);
  font-size: clamp(26px, 3vw, 42px);
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -.025em;
  color: var(--fh-ink);
}

.overview-grid {
  gap: 16px;
  border: 0;
  background: transparent;
}

.overview-card {
  border: 0;
  border-radius: 16px;
  color: var(--fh-ink);
  background: var(--fh-surface);
  box-shadow: none;
}

.overview-card::before {
  display: none;
}

.overview-card:hover {
  background: var(--fh-surface-hover);
}

.overview-card-top {
  font-family: var(--fh-font-ui);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--fh-secondary);
}

.overview-card-footer strong {
  font-family: var(--fh-font-editorial);
  font-size: 21px;
  font-weight: 400;
  color: var(--fh-ink);
}

.overview-card-footer small {
  margin-top: 7px;
  font-family: var(--fh-font-ui);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--fh-secondary);
}

.mini-phone {
  border-color: #60574f;
  background: #242320;
  box-shadow: 0 18px 26px rgba(66, 46, 27, .17);
}

.toast {
  padding: 12px 20px;
  border: 0;
  border-radius: var(--fh-radius-control);
  font-family: var(--fh-font-ui);
  font-size: 12px;
  color: var(--fh-canvas);
  background: var(--fh-ink);
  box-shadow: 0 10px 24px rgba(42, 43, 47, .13);
  backdrop-filter: none;
}

@media (min-width: 1600px) {
  .showcase-shell { padding-inline: 48px; }
  .viewer { grid-template-columns: 240px minmax(540px, 1fr) 330px; }
  .details-panel { padding-left: 28px; }
  .version-text strong { font-size: 14px; }
  .version-text span { font-size: 12px; }
  .details-panel #detailDescription { font-size: 13px; }
}

@media (min-width: 821px) and (max-width: 1100px) {
  .showcase-shell { padding-inline: 20px; }
  .viewer { grid-template-columns: 172px minmax(390px, 1fr) 232px; }
  .version-nav { padding-right: 12px; }
  .version-item { grid-template-columns: 22px minmax(0, 1fr); gap: 7px; padding-inline: 9px; }
  .version-text strong { font-size: 12px; }
  .version-text span { font-size: 10px; }
  .details-panel { padding-left: 14px; }
  .detail-main h2 { font-size: 25px; }
  .stage { margin-inline: 6px; }
}

@media (max-width: 820px) {
  .showcase-shell {
    grid-template-rows: 72px auto 56px;
    width: 100%;
    height: auto;
    min-height: 100svh;
    padding: 0 16px;
  }
  .topbar { padding-inline: 4px; }
  .brand-logo { width: 104px; }
  .project-meta { font-size: 11px; }
  .viewer { display: flex; flex-direction: column; gap: 0; }
  .stage { order: 1; width: 100%; min-height: 610px; margin: 16px 0 0; border-radius: 20px; }
  .version-nav { order: 2; padding: 24px 0; border-bottom: 1px solid var(--fh-line); }
  .version-nav > .eyebrow { padding-left: 6px; }
  .version-list { margin: 16px 0 0; gap: 8px; }
  .version-item { display: grid; min-height: 80px; grid-template-columns: 1fr; align-content: start; gap: 8px; padding: 12px 10px; }
  .version-index { display: block; font-size: 21px; line-height: 22px; }
  .version-text strong { font-size: 12px; line-height: 1.5; white-space: normal; overflow: visible; }
  .version-text span { font-size: 10px; line-height: 1.4; }
  .details-panel { order: 3; padding: 28px 4px; border: 0; }
  .details-panel .detail-main { padding: 14px 0 18px; overflow: visible; }
  .detail-main h2 { max-width: 20em; font-size: 30px; }
  .details-panel #detailDescription { max-width: 60ch; font-size: 13px; line-height: 1.9; }
  .details-panel .interaction-description { max-width: 70ch; font-size: 12px; }
  .details-panel .detail-actions { width: min(100%, 340px); margin-top: 8px; }
  .footer-bar { padding: 0 4px; }
  .overview { padding: 24px 20px; }
  .overview-grid { gap: 12px; }
}

@media (max-width: 520px) {
  .showcase-shell { padding-inline: 12px; grid-template-rows: 64px auto 56px; }
  .topbar { grid-template-columns: 1fr auto; }
  .project-meta { display: none; }
  .top-actions { grid-column: 2; }
  .icon-button { width: 40px; height: 40px; }
  .stage { min-height: 560px; border-radius: 16px; }
  .version-item { padding: 12px 7px; border-radius: 10px; }
  .version-text strong { font-size: 11px; }
  .version-text span { display: none; }
  .detail-main h2 { font-size: 28px; }
  .stage-arrow { width: 40px; height: 40px; }
  .overview-head h2 { max-width: 9em; font-size: 28px; }
  .overview-card { padding: 14px 10px; border-radius: 12px; }
  .overview-card-footer strong { font-size: 17px; line-height: 1.5; }
  .overview-card-footer small { font-size: 10px; }
}

/* Scheme 01 uses a concise rationale label instead of a display headline. */
.details-panel .detail-main h2.is-compact-title {
  margin-bottom: 16px;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

@media (min-width: 821px) {
  /* Equal top/bottom tracks give both sidebars the page's shared centerline. */
  .version-nav,
  .details-panel {
    display: grid;
    grid-template-rows: 96px minmax(0, 1fr) 96px;
    padding-block: 0;
  }

  .version-nav > .eyebrow {
    grid-row: 1;
    align-self: start;
    margin-top: 32px;
  }

  .version-nav > .nav-foot {
    grid-row: 3;
    align-self: end;
    margin-bottom: 28px;
  }

  .version-list,
  .details-panel .detail-main {
    grid-row: 2;
    position: relative;
    min-height: 0;
    margin-block: 0;
    top: -50px;
    transform: none;
    justify-content: safe center;
    overflow-y: auto;
  }

  .version-list { scrollbar-width: thin; }
  .version-list > .version-item { flex-shrink: 0; }

  .details-panel .detail-main {
    padding-block: 0;
  }

  .details-panel .detail-actions {
    grid-row: 3;
    align-self: end;
    margin-top: 0;
    margin-bottom: 24px;
  }
}
