@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/inter-latin-wght-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/inter-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg-studio: #131210;
  --bg-elevated: #1c1a17;
  --bg-card: #211e1a;
  --border-subtle: #2e2a24;
  --border-strong: #423c33;
  --text-primary: #f5f2eb;
  --text-secondary: #aba396;
  --text-muted: #787166;
  --wing-orange: #df672a;
  --wing-orange-hover: #c5551c;
  --kraft-base: #c9a37a;
}

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

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background-color: var(--bg-studio);
  color: var(--text-primary);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  -webkit-font-smoothing: antialiased;
}

/* TOPBAR */
.topbar {
  height: 60px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(24, 22, 19, 0.92);
  border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 30;
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-logo {
  height: 26px;
  width: auto;
  display: block;
}

.brand-divider {
  width: 1px;
  height: 18px;
  background: var(--border-strong);
}

.brand-section {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-secondary);
}

.topbar-center {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 6px 12px;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.btn-back:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background: var(--bg-card);
}

.crumb-sep {
  color: var(--text-muted);
}

.crumb-current {
  font-weight: 600;
  color: var(--text-primary);
}

.status-pill {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  font-variant-numeric: tabular-nums;
}

.viewer-mode-switch {
  display: inline-flex;
  background: var(--bg-studio);
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
}

.mode-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.mode-tab.is-active {
  background: var(--wing-orange);
  color: #fff;
}

/* CATALOG VIEW */
.catalog-main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 44px 24px 72px;
}

.catalog-intro {
  margin-bottom: 32px;
}

.catalog-intro-text h1 {
  margin: 0 0 10px;
  font-size: clamp(1.5rem, 2.5vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-primary);
}

.catalog-intro-text p {
  margin: 0;
  max-width: 66ch;
  font-size: 0.975rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(460px, 1fr));
  gap: 24px;
}

.product-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card:hover,
.product-card:focus-visible {
  border-color: var(--wing-orange);
  transform: translateY(-2px);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.45);
  outline: none;
}

.card-stage {
  position: relative;
  height: 290px;
  background: radial-gradient(circle at 50% 42%, #2c2620 0%, #161412 78%);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 950px;
  overflow: hidden;
}

.card-sku-tag {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(19, 18, 16, 0.85);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 6px;
  font-variant-numeric: tabular-nums;
}

.card-3d-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(223, 103, 42, 0.16);
  border: 1px solid rgba(223, 103, 42, 0.45);
  color: #ff9c69;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
}

/* Mini CSS 3D preview inside card */
.card-box-preview {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mini-box {
  position: relative;
  width: 256px;
  height: 191px;
  transform-style: preserve-3d;
  transform: rotateX(-8deg) rotateY(-24deg);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.product-card:hover .mini-box {
  transform: rotateX(-6deg) rotateY(-16deg) scale(1.04);
}

.mini-face {
  position: absolute;
  top: 0;
  display: block;
  backface-visibility: hidden;
  user-select: none;
  pointer-events: none;
}

.mini-front {
  width: 256px;
  height: 191px;
  left: 0;
  top: 0;
  transform: translateZ(19px);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
}

.mini-side {
  width: 38px;
  height: 191px;
  left: 237px;
  top: 0;
  transform: rotateY(90deg);
  filter: brightness(0.76);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.mini-top {
  width: 256px;
  height: 38px;
  left: 0;
  top: -19px;
  transform: rotateX(90deg);
  filter: brightness(1.06);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
}

.mini-shadow {
  position: absolute;
  bottom: -24px;
  width: 260px;
  height: 28px;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0) 72%);
  transform: rotate(-4deg);
  pointer-events: none;
}

.card-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.card-title-row h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.card-status {
  font-size: 0.76rem;
  font-weight: 600;
  color: #8ce39b;
  background: rgba(62, 180, 91, 0.14);
  border: 1px solid rgba(62, 180, 91, 0.35);
  padding: 3px 9px;
  border-radius: 999px;
}

.card-desc {
  margin: 0;
  font-size: 0.89rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.card-specs {
  margin: 0;
  padding: 14px 16px;
  background: var(--bg-studio);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 16px;
}

.card-specs dt {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.card-specs dd {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-top: 4px;
}

.card-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--wing-orange);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 999px;
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.product-card:hover .card-cta {
  background: var(--wing-orange-hover);
}

/* 3D VIEWER SHELL */
.viewer-shell {
  height: calc(100vh - 60px);
  display: grid;
  grid-template-columns: 1fr 330px;
  overflow: hidden;
}

.stage-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 45%, #27221c 0%, #12110f 76%);
  overflow: hidden;
  user-select: none;
}

#canvas-3d {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
}

#canvas-3d:active {
  cursor: grabbing;
}

.stage-hint {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(19, 18, 16, 0.76);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.78rem;
  padding: 6px 14px;
  border-radius: 999px;
  pointer-events: none;
  backdrop-filter: blur(8px);
  white-space: nowrap;
}

.camera-dock {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: rgba(24, 22, 19, 0.9);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  max-width: calc(100% - 24px);
  overflow-x: auto;
}

.camera-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.camera-sep {
  width: 1px;
  height: 20px;
  background: var(--border-strong);
}

.cam-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.cam-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.cam-btn.is-active,
.cam-btn[aria-pressed="true"] {
  background: var(--wing-orange);
  color: #fff;
}

.cam-icon-btn {
  padding: 7px 11px;
}

/* 2D FLAT STAGE */
.stage-2d-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #171513;
  overflow: hidden;
}

.flat-toolbar {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--bg-elevated);
}

.flat-caption {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.btn-download {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  background: var(--wing-orange);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 999px;
}

.flat-scroll {
  flex: 1;
  overflow: auto;
  padding: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.flat-img {
  max-width: 100%;
  max-height: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

/* INSPECTOR PANEL */
.inspector-panel {
  background: var(--bg-elevated);
  border-left: 1px solid var(--border-subtle);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
}

.inspector-sku {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--wing-orange);
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}

.inspector-header h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.3;
}

.inspector-list {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.inspector-item {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.inspector-item dt {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.inspector-item dd {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}

.sub-val {
  color: var(--text-secondary);
  font-weight: 400;
}

.mono-val {
  letter-spacing: 0.04em;
}

.inspector-actions {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.inspector-btn {
  appearance: none;
  border: 1px solid var(--wing-orange);
  background: rgba(223, 103, 42, 0.14);
  color: #ff9c69;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.inspector-btn:hover {
  background: var(--wing-orange);
  color: #fff;
}

.inspector-btn-secondary {
  border-color: var(--border-strong);
  background: var(--bg-card);
  color: var(--text-primary);
}

.inspector-btn-secondary:hover {
  border-color: var(--text-secondary);
  background: var(--border-subtle);
}

@media (max-width: 920px) {
  .catalog-grid {
    grid-template-columns: 1fr;
  }

  .crumb-current {
    display: none;
  }

  .viewer-shell {
    height: auto;
    min-height: calc(100vh - 60px);
    grid-template-columns: 1fr;
    grid-template-rows: 64vh auto;
  }

  .inspector-panel {
    border-left: 0;
    border-top: 1px solid var(--border-subtle);
  }
}
