/* ═══════════════════════════════════════════════════
   HUMANITEE — Mobile-First Responsive Design
   Base: 375px - 430px (mobile)
   ═══════════════════════════════════════════════════ */

/* ─── CSS Variables ─────────────────────────────── */
:root {
  --color-bg: #ffffff;
  --color-text: #0a0a0a;
  --color-muted: #6f6f6f;
  --color-border: #e9e9e9;
  --color-soft: #f6f6f6;
  
  --btn: #111111;
  --btnText: #ffffff;
  --text: #0a0a0a;
  --line: #e9e9e9;
  
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  --spacing-2xl: 4rem;
  
  --radius-sm: 0.5rem;
  --radius-md: 1rem;
  --radius-lg: 1.5rem;
  --radius-full: 999px;
  
  --container-max: 1280px;
}

/* ─── Reset & Base Styles ──────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

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

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* ─── Container (Mobile Base) ──────────────────── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ─── Header (Mobile Base) ─────────────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: 3000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 3rem;
  max-width: none;
}

.logo {
  font-size: 1.012rem;
  font-weight: 900;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding-left: calc(3rem - 40px);
}

/* Desktop nav hidden on mobile */
.nav {
  display: none;
}

/* Mobile menu button */
.menu-btn {
  position: absolute;
  left: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3100;
  width: 2.25rem;
  height: 2.25rem;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  border: none;
  border-radius: 0;
  transition: all 0.2s;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.menu-btn span {
  width: 1.1rem;
  height: 2px;
  background: #111;
  border-radius: 2px;
  transition: all 0.3s;
}

.menu-btn.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.menu-btn.active span:nth-child(2) {
  opacity: 0;
}

.menu-btn.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ─── Nav Overlay ───────────────────────────────── */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.nav-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* ─── Nav Sidebar ───────────────────────────────── */
.nav-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  max-width: 85vw;
  background: #fff;
  z-index: 2000;
  transform: translateX(-100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  padding: 1.5rem 1.25rem;
}

.nav-sidebar.open {
  transform: translateX(0);
}

.nav-sidebar-head {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 2rem;
}

.nav-sidebar-close {
  font-size: 1.25rem;
  padding: 0.25rem 0.5rem;
  color: #111;
  line-height: 1;
  border-radius: var(--radius-sm);
  transition: opacity 0.2s;
}

.nav-sidebar-close:hover {
  opacity: 0.6;
}

.sidebar-group {
  margin-bottom: 2rem;
}

.sidebar-group-title {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #999;
  margin-bottom: 0.75rem;
}

.sidebar-link {
  display: block;
  font-size: 1.125rem;
  font-weight: 600;
  color: #111;
  padding: 0.625rem 0;
  border-bottom: 1px solid #f0f0f0;
  transition: color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.sidebar-link:last-child {
  border-bottom: none;
}

.sidebar-link:active {
  color: #888;
}

/* Mobile nav panel */
.nav.open {
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 4rem;
  left: 1rem;
  right: 1rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  gap: 0.5rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.nav a {
  padding: 0.75rem 1rem;
  font-weight: 600;
  color: var(--color-text);
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}

.nav a:hover,
.nav a:active {
  background: var(--color-soft);
}

/* ─── Typography (Mobile Base) ─────────────────── */
.eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: 1rem;
}

.section-kicker {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: clamp(1.75rem, 6vw, 3rem);
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1.1;
  margin-bottom: 1rem;
}

/* ─── Buttons (Mobile Base) ────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0 1.5rem;
  font-weight: 700;
  font-size: 0.9375rem;
  border-radius: var(--radius-full);
  transition: all 0.25s;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary {
  background: var(--color-text);
  color: var(--color-bg);
}

.btn-primary.fade-out {
  opacity: 0;
  transform: scale(0.94);
  transition: opacity 0.6s ease, transform 0.6s ease;
  pointer-events: none;
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  background: var(--color-bg);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn-secondary:active {
  background: var(--color-soft);
}

.btn-small {
  min-height: 2.5rem;
  padding: 0 1.25rem;
  font-size: 0.875rem;
}

/* ─── Hero Section (Mobile Base) ───────────────── */
.hero {
  padding: 0;
  text-align: center;
}

.hero-desktop-grid {
  width: 100%;
}

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

.hero-desktop-eyebrow,
.hero-desktop-desc,
.hero-secondary-btn {
  display: none;
}

.hero-title {
  font-size: clamp(2.5rem, 12vw, 5rem);
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 0.95;
  margin-bottom: 1rem;
}

.hero-h-wrap {
  display: contents;
}

.hero-the {
  display: none;
}

.hero-home-link {
  color: inherit;
  display: inline-block;
}

.hero-counter {
  margin: 0 auto 1.5rem;
  padding: 0.75rem 1rem;
  max-width: 26rem;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.hero-counter-label {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: 0.45rem;
}

.hero-counter-value {
  font-size: clamp(1.75rem, 8vw, 3.25rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
}

.hero-desc {
  max-width: 32rem;
  margin: 0 auto 2rem;
  font-size: 1.0625rem;
  color: var(--color-muted);
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  margin-bottom: 1rem;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--color-muted);
  margin-bottom: 1rem;
  margin-top: 25px;
}

.story-btn {
  width: 100%;
  background: #000;
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 0.65rem 1.8rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  margin-top: -20px;
}

.hero-flow-box {
  position: relative;
  width: 100%;
  max-width: 820px;
  min-height: 0;
  margin: 0 auto;
}

.hero-flow-static {
  position: relative;
  z-index: 1;
}

.inline-modal-host {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: none;
  pointer-events: none;
}

.inline-modal-host.active {
  display: block;
  pointer-events: auto;
}

.hero-flow-box.flow-open {
  min-height: 385px;
}

.hero-flow-box.flow-open .hero-flow-static {
  display: none;
}

.hero-image {
  max-width: 600px;
  margin: 0 auto;
}

.hero-image-wrap {
  position: relative;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding-bottom: 0;
}

/* Pick Your Size button (appears after double-tap on carousel) */
.pick-size-btn {
  display: block;
  margin: 1.25rem auto 0;
  padding: 10px 32px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border-radius: 50px;
  background: #111;
  color: #fff;
  border: none;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.pick-size-btn.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.pick-size-btn:active {
  background: #333;
}

.hero-image img {
  display: block;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  filter: drop-shadow(0 10px 40px rgba(0, 0, 0, 0.12));
}

/* ─── 3D Carousel ───────────────────────────────── */
.carousel-scene {
  position: relative;
  width: 100%;
  height: 684px;
  perspective: 1200px;
  overflow: visible;
  margin-top: -150px;
}

.carousel-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transform-style: preserve-3d;
  width: 0;
  height: 0;
}

.carousel {
  position: relative;
  width: 0;
  height: 0;
  transform-style: preserve-3d;
  transform-origin: center center;
  transition: transform 0.7s ease;
  transform: rotateX(-5deg) rotateY(0deg);
  will-change: transform;
}

.carousel__cell {
  position: absolute;
  width: 302px;
  height: 302px;
  top: -151px;
  left: -151px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.4s ease;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.carousel__cell::after {
  content: '';
  position: absolute;
  bottom: -14px;
  width: 100%;
  height: 12px;
  background: rgba(0, 0, 0, 0.18);
  filter: blur(8px);
  border-radius: 50%;
  z-index: -1;
}

.carousel__cell img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: width 0.6s ease, height 0.6s ease;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.1));
}

.carousel__cell-label {
  position: absolute;
  bottom: -42px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #555;
  white-space: nowrap;
  transition: opacity 0.4s ease;
  opacity: 0;
}

.carousel__cell.active {
  opacity: 1;
  cursor: pointer;
}

.carousel__cell.hovered img {
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.22));
  transform: scale(1.04);
  transition: transform 0.25s ease, filter 0.25s ease;
}

.carousel__cell.active img {
  width: 562px;
  height: 562px;
}

.carousel__cell.zoom-selected img {
  width: 787px;
  height: 787px;
}

.carousel__cell.active .carousel__cell-label {
  opacity: 1;
}



/* ─── Sections (Mobile Base) ───────────────────── */
.categories-section,
.products-section,
.statement-section,
.newsletter-section {
  padding: 3rem 0;
}

.categories-section {
  margin-top: -150px;
}

.section-header {
  text-align: center;
  margin-bottom: 2rem;
}

.section-desc {
  max-width: 34rem;
  margin: 0 auto;
  color: var(--color-muted);
  font-size: 1rem;
}

/* ─── Categories Grid (Mobile Base) ────────────── */
.categories-grid {
  display: grid;
  gap: 1rem;
}

.category-card {
  background: var(--color-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  min-height: 12rem;
  transition: transform 0.3s;
}

.category-card:active {
  transform: scale(0.98);
}

.category-content h3 {
  font-size: 1.25rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 0.75rem;
}

.category-content p {
  color: var(--color-muted);
  font-size: 0.9375rem;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.link {
  font-weight: 700;
  font-size: 0.9375rem;
}

/* ─── Products Grid (Mobile Base) ──────────────── */
.products-grid {
  display: grid;
  gap: 1.25rem;
}

.product-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
}

.product-card:active {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.product-image {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--color-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.product-image img {
  max-width: 80%;
  height: auto;
  object-fit: contain;
}

.badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: var(--radius-full);
}

.product-info {
  padding: 1.25rem;
}

.product-info h3 {
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 0.5rem;
}

.price {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.product-desc {
  color: var(--color-muted);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

/* ─── Statement Section (Mobile Base) ──────────── */
.statement {
  background: var(--color-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 1.5rem;
  text-align: center;
}

.statement h2 {
  font-size: clamp(1.75rem, 6vw, 3rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.1;
  margin-bottom: 1.25rem;
}

.statement p {
  max-width: 40rem;
  margin: 0 auto;
  color: var(--color-muted);
  font-size: 1.0625rem;
  line-height: 1.65;
}

/* ─── Newsletter Section (Mobile Base) ─────────── */
.newsletter-section {
  text-align: center;
}

.newsletter-section h2 {
  font-size: clamp(1.5rem, 5vw, 2.5rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 0.75rem;
}

.newsletter-section > p {
  color: var(--color-muted);
  margin-bottom: 2rem;
  font-size: 1rem;
}

.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  max-width: 28rem;
  margin: 0 auto;
}

.newsletter-form input {
  min-height: 3rem;
  padding: 0 1.25rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.newsletter-form input:focus {
  border-color: var(--color-text);
}

.form-note {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: var(--color-muted);
}

/* ─── Footer (Mobile Base) ─────────────────────── */
.footer {
  border-top: 1px solid var(--color-border);
  padding: 2.5rem 0 2rem;
  margin-top: 3rem;
}

.footer-grid {
  display: grid;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-col h4 {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

.footer-col a,
.footer-col p {
  display: block;
  color: var(--color-muted);
  font-size: 0.9375rem;
  margin-bottom: 0.625rem;
  line-height: 1.5;
}

.footer-bottom {
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
  text-align: center;
  font-size: 0.875rem;
  color: var(--color-muted);
}

.footer-bottom p {
  margin-bottom: 0.5rem;
}

.footer-bottom a {
  text-decoration: underline;
}

/* ═══════════════════════════════════════════════════
   MODAL/SUBWINDOW ORDER FLOW
   ═══════════════════════════════════════════════════ */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  z-index: 9999;
  overflow: hidden;
}

.modal-overlay.inline-mode {
  position: absolute;
  inset: 0;
  background: #fff;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  overflow: auto;
}

.modal-overlay.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay.inline-mode.active {
  display: block;
}

.modal-mobile {
  position: relative;
  width: 100%;
  max-width: 600px;
  height: 100vh;
  background: #fff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-overlay.inline-mode .modal-mobile {
  max-width: none;
  width: 100%;
  height: 100%;
  background: #fff;
}

.modal-overlay.inline-mode .sub-track {
  height: 100%;
}

.modal-overlay.inline-mode .modal-header {
  height: 52px;
  background: #fff;
}

.modal-overlay.inline-mode .sub-step {
  background: #fff;
  padding: 16px 18px 14px 18px;
}

.modal-overlay.inline-mode .sub-step:nth-child(3) {
  justify-content: flex-start;
  gap: 12px;
  padding-top: 16px;
}

@media (min-width: 64rem) {
  .modal-overlay {
    background: rgba(245, 245, 245, 0.96);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .modal-mobile {
    max-width: none;
    width: 100%;
    height: 100vh;
    background: #f5f5f5;
  }

  .modal-header {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 28px;
    background: #f5f5f5;
  }

  .sub-step {
    max-width: 1200px;
    margin: 0 auto;
    padding: 26px 28px 24px 28px;
    background: #f5f5f5;
  }

  .hero-flow-box {
    min-height: 460px;
  }

  /* Inline flow cleanup on desktop: no grey blocks, no centered brand text */
  .modal-overlay.inline-mode .modal-header {
    justify-content: flex-start;
    border-bottom: 1px solid #f0f0f0;
  }

  .modal-overlay.inline-mode .modal-header-brand {
    display: none;
  }

  .modal-overlay.inline-mode .sub-step:nth-child(2) .sub-title {
    display: none;
  }

  /* Show all three tees at once on PC */
  .modal-overlay.inline-mode .weight-selector {
    margin: 0;
    justify-content: flex-start;
  }

  .modal-overlay.inline-mode .modal-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    padding: 0;
    overflow: visible;
  }

  .modal-overlay.inline-mode .modal-option {
    width: 100%;
    max-width: none;
    min-width: 0;
    margin: 0;
    background: #fff;
    border: 1px solid #f1f1f1;
  }

  .modal-overlay.inline-mode .modal-option.selected {
    background: #fff;
    border-color: #111;
  }

  .modal-overlay.inline-mode .modal-option img {
    max-height: 420px;
    padding: 12px;
  }

  /* Keep intro title/tagline separated when navigating back */
  .modal-overlay.inline-mode .sub-intro {
    justify-content: flex-start;
    gap: 10px;
    padding-top: 8px;
  }

  .modal-overlay.inline-mode .sub-intro h2 {
    margin-bottom: 0;
  }

  .modal-overlay.inline-mode .sub-tagline {
    margin-top: 0;
    margin-bottom: 10px;
  }
}

/* Fixed header */
.modal-header {
  position: relative;
  width: 100%;
  height: 60px;
  background: #fff;
  border-bottom: 1px solid #eee;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  z-index: 10;
}

.back-btn {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  transition: opacity 0.2s;
}

.back-btn:hover {
  opacity: 0.6;
}

.back-btn .arrow-icon {
  display: block;
  width: 14px;
  height: 14px;
  border-left: 3px solid #222;
  border-bottom: 3px solid #222;
  transform: rotate(45deg);
}

.modal-header-brand {
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: opacity 0.2s;
}

.modal-header-brand:hover {
  opacity: 0.7;
}

.header-brand-name {
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #000;
}

.sub-track {
  display: flex;
  width: 600%;
  height: 100%;
  flex: 1;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.sub-step {
  flex: none;
  width: calc(100% / 6);
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 40px 30px 30px 30px;
  overflow-y: auto;
  background: #fff;
  text-align: center;
}

.sub-step:nth-child(3) {
  padding-top: 20px !important;
  justify-content: flex-start !important;
  gap: 12px !important;
}

.sub-intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-evenly;
  height: 100%;
  width: 100%;
}

.sub-intro h2 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 8px;
  margin-top: 0;
  color: #000;
}

.sub-tagline {
  font-size: 0.7rem;
  color: #888;
  margin-bottom: 0;
  margin-top: -70px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  font-weight: 600;
}

.modal-counter {
  padding: 0.5rem 1rem;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  text-align: center;
}

.sub-title {
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #222;
  margin-bottom: 20px;
  margin-top: 0;
}

.sub-desc {
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 20px;
  line-height: 1.5;
}

.intro-img-wrap {
  position: relative;
  display: inline-block;
  margin: 0;
}

.intro-tee {
  width: 380px;
  max-width: 90vw;
  object-fit: contain;
  display: block;
}

.start-btn {
  display: inline-block;
  flex: none;
  width: auto;
  padding: 8px 30px;
  font-size: 0.85rem;
  letter-spacing: 1.5px;
  border-radius: 50px;
  background: transparent;
  color: #888;
  border: 3px solid #000;
  margin: 0;
  cursor: pointer;
  transition: all 0.2s;
}

.start-btn:hover {
  border-color: #000;
  color: #000;
  background: transparent;
}

.start-btn:active {
  background: #000;
  color: #fff;
  border-color: #000;
}

#btnSizeNext {
  margin-top: 16px;
}

#btnDetailsNext {
  margin-top: 107px;
}

/* Weight continue button */
.weight-continue {
  margin-top: auto;
  margin-bottom: 0;
  display: inline-block;
  flex: none;
  width: auto;
  padding: 8px 30px;
  font-size: 0.85rem;
  letter-spacing: 1.5px;
  border-radius: 50px;
  background: transparent;
  color: #888;
  border: 3px solid #000;
  cursor: pointer;
  transition: all 0.2s;
}

.weight-continue:hover {
  border-color: #000;
  color: #000;
  background: transparent;
}

.weight-continue:active {
  background: #000;
  color: #fff;
  border-color: #000;
}

/* Weight section (step 1) */
.weight-selector {
  position: relative;
  width: 100%;
  margin: -80px 0 0 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.nav-arrow {
  display: none;
}

.nav-arrow:hover {
  opacity: 0.7;
}

.nav-arrow:active {
  transform: scale(0.9);
}

.arrow-left-icon,
.arrow-right-icon {
  display: none;
}

.modal-options-container {
  width: 100%;
  overflow: hidden;
  position: relative;
}

.modal-options {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  scroll-behavior: smooth;
  padding: 0 20px;
  justify-content: flex-start;
}

.modal-options::-webkit-scrollbar {
  display: none;
}

.modal-option {
  width: calc(100% - 40px);
  max-width: 420px;
  min-width: 300px;
  cursor: pointer;
  border: none;
  border-radius: 14px;
  overflow: hidden;
  background: #fafafa;
  transition: background 0.2s, transform 0.2s;
  scroll-snap-align: center;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 auto;
}

.modal-option:hover {
  transform: translateY(-4px);
}

.modal-option.selected {
  background: #e8e8e8;
}

.modal-option img {
  width: 100%;
  height: auto;
  max-height: 588px;
  object-fit: contain;
  padding: 20px;
  background: #fff;
  display: block;
  margin: 0 auto;
}

.modal-option span {
  display: block;
  width: 100%;
  padding: 12px 0;
  font-size: 0.75rem;
  font-weight: 300;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #000;
  border-top: 1px solid #e0e0e0;
  text-align: center;
  margin-top: 0;
}

/* Size grid */
.size-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(3, auto);
  gap: 12px;
  margin-top: 0;
  margin-bottom: 0;
  max-width: 380px;
  margin-left: auto;
  margin-right: auto;
}

.size-box {
  padding: 0;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 1px;
  transition: border 0.2s, background 0.2s;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 70px;
}

.size-box:hover {
  border-color: #999;
}

.size-box.selected {
  border-color: #000;
  background: rgba(0, 0, 0, 0.05);
}

/* Form */
.sub-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
  text-align: left;
  width: 100%;
}

.sub-input {
  width: 100%;
  padding: 11px 14px;
  background: #f8f8f8;
  border: 1px solid #ddd;
  border-radius: 8px;
  color: #222;
  font-size: 0.9rem;
  outline: none;
  transition: border 0.2s;
}

.sub-input:focus {
  border-color: #000;
}

.sub-input::placeholder {
  color: #aaa;
}

/* Returning banner */
.returning-banner {
  background: #f0f9e8;
  border: 1px solid #4a4;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 16px;
  text-align: center;
}

.returning-banner h4 {
  color: #2a7;
  margin-bottom: 4px;
}

/* Order review */
.order-review {
  text-align: left;
  margin-bottom: 16px;
}

.review-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #eee;
  font-size: 0.85rem;
}

.review-row span {
  color: #888;
}

.review-returning {
  color: #2a7;
  font-size: 0.82rem;
  margin-bottom: 10px;
  text-align: center;
}

/* Payment */
.payment-box {
  text-align: center;
  margin-bottom: 12px;
}

.payment-total {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 14px;
}

.payment-method-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 20px 0 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.payment-methods {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  justify-content: center;
}

.payment-method {
  flex: 1;
  max-width: 180px;
  padding: 16px 12px;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  background: #fafafa;
  text-align: center;
}

.payment-method:hover {
  border-color: #999;
  transform: translateY(-2px);
}

.payment-method.selected {
  border-color: #000;
  background: rgba(0, 0, 0, 0.05);
}

.payment-icon {
  display: block;
  width: auto;
  height: 40px;
  margin: 0 auto 8px;
  object-fit: contain;
  filter: grayscale(100%);
}

.payment-name {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.payment-note {
  color: #aaa;
  font-size: 0.75rem;
  margin-top: 8px;
  font-style: italic;
}

/* Confirmation */
.confirmation {
  text-align: center;
}

.confirm-icon {
  font-size: 2.5rem;
  color: #2a7;
  margin-bottom: 8px;
}

.big-number {
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: 3px;
  color: #000;
  margin: 14px 0;
  padding: 16px;
  border: 2px solid #000;
  border-radius: 12px;
  background: #f8f8f8;
}

.confirm-details {
  text-align: left;
  margin-top: 16px;
}

.confirm-email-note {
  color: #888;
  font-size: 0.8rem;
  margin-top: 16px;
  font-style: italic;
}

/* Nav buttons */
.sub-nav {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  width: 100%;
}

.sub-nav span {
  flex: 1;
}

.sub-btn {
  flex: 1;
  padding: 8px 20px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: all 0.2s;
}

.sub-btn.sub-next {
  background: #000;
  color: #fff;
}

.sub-btn.sub-next:hover {
  background: #333;
}

.sub-btn.sub-next:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.sub-btn.sub-back {
  flex: none;
  width: auto;
  padding: 8px 22px;
  font-size: 0.82rem;
  border-radius: 50px;
  background: transparent;
  color: #888;
  border: 1px solid #ddd;
}

.sub-btn.sub-back:hover {
  border-color: #000;
  color: #000;
}

/* Mini popup */
.mini-popup {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
}

.mini-popup.show {
  display: flex;
}

.mini-popup-content {
  background: #fff;
  padding: 24px 30px;
  border-radius: 12px;
  max-width: 320px;
  text-align: center;
}

.mini-popup-content p {
  font-size: 0.95rem;
  margin-bottom: 18px;
  color: #333;
}

.popup-ok {
  background: #000;
  color: #fff;
  border: none;
  padding: 10px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: background 0.2s;
}

.popup-ok:hover {
  background: #333;
}

body.modal-open {
  overflow: hidden;
}

/* ─── Luxury Confirmation Popup ─────────────────── */
.luxury-popup {
  position: fixed;
  inset: 0;
  background: #0a0a0a;
  z-index: 100000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease;
}

.luxury-popup.active {
  pointer-events: auto;
}

.luxury-popup.shown {
  opacity: 1;
}

.luxury-popup-inner {
  max-width: 540px;
  width: 100%;
  padding: 3rem 2rem 4rem;
  text-align: center;
  color: #fff;
}

.luxury-number-area {
  padding: 2rem 0;
}

.luxury-num-label {
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: #555;
  margin-bottom: 1rem;
}

.luxury-number {
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #fff;
  line-height: 1;
}

.luxury-divider {
  width: 40px;
  height: 1px;
  background: #2a2a2a;
  margin: 2rem auto;
}

.luxury-title {
  font-size: clamp(1rem, 4vw, 1.5rem);
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 1.75rem;
}

.luxury-body p {
  font-size: 0.875rem;
  color: #777;
  line-height: 1.85;
  margin-bottom: 0.875rem;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

.luxury-verify {
  color: #aaa !important;
  font-style: italic;
}

.luxury-verify strong {
  font-weight: 700;
  color: #ccc;
}

.luxury-final {
  font-size: 1rem !important;
  font-weight: 700 !important;
  color: #fff !important;
  margin-top: 2rem !important;
}

.luxury-close-btn {
  margin-top: 3rem;
  display: inline-block;
  padding: 0.75rem 2.5rem;
  border: 1px solid #2a2a2a;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #444;
  transition: border-color 0.3s, color 0.3s;
  font-family: inherit;
}

.luxury-close-btn:hover {
  border-color: #fff;
  color: #fff;
}

@media (max-width: 600px) {
  .hero-flow-box.flow-open {
    min-height: 385px;
  }
    margin: -80px 0 0 0;
  }

  .nav-arrow {
    display: none;
  }

  .modal-options-container {
    width: 100%;
  }

  .modal-options {
    gap: 15px;
    padding: 0 15px;
  }

  .modal-option {
    width: calc(100% - 30px);
    max-width: 360px;
    min-width: 280px;
  }

  .modal-option img {
    max-height: 532px;
    padding: 15px;
  }

  .size-grid {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(3, auto);
    gap: 10px;
    max-width: 100%;
    margin-top: 0;
  }

  .size-box {
    min-height: 60px;
    font-size: 0.85rem;
  }

  .sub-step {
    padding: 30px 20px 20px 20px;
  }

  .big-number {
    font-size: 1.6rem;
    padding: 12px;
  }
}

/* ═══════════════════════════════════════════════════
   TABLET BREAKPOINT (768px+)
   ═══════════════════════════════════════════════════ */
@media (min-width: 64rem) {
  .container {
    padding: 0 2rem;
  }

  /* Header */
  .menu-btn {
    display: none !important;
  }

  .nav-sidebar,
  .nav-overlay {
    display: none !important;
  }

  .nav {
    display: flex !important;
    position: static;
    flex-direction: row;
    align-items: center;
    gap: 2rem;
    background: none;
    border: none;
    padding: 0;
    box-shadow: none;
  }

  .nav a {
    padding: 0;
    font-size: 0.9375rem;
    color: var(--color-muted);
    font-weight: 600;
  }

  .nav a:hover {
    color: var(--color-text);
    background: none;
  }

  /* Hero */
  .hero {
    padding: 0 0 4rem;
  }

  .hero-actions {
    flex-direction: row;
    justify-content: center;
  }

  /* Categories */
  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }

  /* Products */
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  /* Footer */
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
  }

  .footer-bottom p {
    margin-bottom: 0;
  }
}

@media (max-width: 47.99rem) {
  .header {
    display: none;
  }

  .hero {
    padding-top: 1rem;
  }
}

/* ─── Mobile: riduci altezza carousel ────────────── */
@media (max-width: 47.99rem) {
  .ht3d-control-btn { display: none; }
    height: 320px;
    margin-top: 0;
  }
  .hero-copy-panel {
    position: relative;
    z-index: 10;
    margin-top: -10px;
  }
  .hero-image-wrap {
    max-width: 100%;
    overflow: visible;
  }
  .ht3d-carousel {
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    margin-left: 0;
    margin-top: -15rem;
  }
  .categories-section {
    margin-top: -430px;
  }
  .hero-title {
    text-align: center;
    padding-top: 1.5rem;
    overflow: visible;
  }
  .hero-h-wrap {
    position: relative;
    display: inline-block;
    overflow: visible;
  }
  .hero-the {
    display: block;
    position: absolute;
    top: calc(-0.35em - 5px);
    left: 3px;
    font-size: 0.27em;
    font-weight: 900;
    letter-spacing: 0.15em;
    color: #000;
    line-height: 1;
    white-space: nowrap;
    z-index: 10;
  }
}

/* ─── Tablet only (768px – 1023px): carousel centrato ── */
@media (min-width: 48rem) and (max-width: 63.99rem) {
  .ht3d-control-btn { display: none; }
  .carousel-scene {
    height: 380px;
    margin-top: 0;
  }
  .carousel__cell {
    width: 150px;
    height: 150px;
    top: -75px;
    left: -75px;
  }
  .carousel__cell.active img {
    width: 280px;
    height: 280px;
  }
  .hero-copy-panel {
    position: relative;
    z-index: 10;
    margin-top: -10px;
  }
  .hero-image-wrap {
    max-width: 100%;
    overflow: visible;
  }
  .ht3d-carousel {
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    margin-left: 0;
    margin-top: -15rem;
  }
  .categories-section {
    margin-top: -430px;
  }
  .hero-title {
    text-align: center;
    padding-top: 1.5rem;
    overflow: visible;
  }
  .hero-h-wrap {
    position: relative;
    display: inline-block;
    overflow: visible;
  }
  .hero-the {
    display: block;
    position: absolute;
    top: calc(-0.35em - 5px);
    left: 3px;
    font-size: 0.27em;
    font-weight: 900;
    letter-spacing: 0.15em;
    color: #000;
    line-height: 1;
    white-space: nowrap;
    z-index: 10;
  }
}

/* ═══════════════════════════════════════════════════
   DESKTOP BREAKPOINT (1024px+)
   ═══════════════════════════════════════════════════ */
@media (min-width: 64rem) {
  .header .container {
    justify-content: space-between;
    min-height: 4.875rem;
    padding: 0 2.5rem;
  }

  .logo {
    display: inline-block;
    font-size: 1.25rem;
    letter-spacing: 0.22em;
    margin-left: 30px;
  }

  .hero {
    min-height: calc(100vh - 4.875rem);
    display: flex;
    align-items: flex-start;
    text-align: left;
    padding: 0 0 3.5rem;
  }

  .hero-desktop-grid {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    align-items: flex-start;
    gap: 1rem;
    overflow: visible;
  }

  .hero-copy-panel {
    max-width: 580px;
    padding-left: 0;
    padding-top: 2.5rem;
    margin-left: calc(1rem - (100vw - min(1280px, 100vw)) / 2);
  }

  .hero-desktop-eyebrow,
  .hero-desktop-desc,
  .hero-secondary-btn {
    display: inline-flex;
  }

  .hero-desktop-eyebrow {
    display: inline-block;
    margin-bottom: 1rem;
  }

  .hero-title {
    font-size: clamp(4.25rem, 9vw, 8rem);
    margin-bottom: 1.25rem;
  }

  .hero-counter {
    margin: 0 0 1.4rem;
  }

  .hero-desktop-desc {
    max-width: 560px;
    margin: 0 0 1.5rem;
    color: var(--color-muted);
    line-height: 1.45;
  }

  .hero-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    margin-bottom: 1.4rem;
  }

  .hero-meta {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 0;
  }

  .hero-flow-box {
    max-width: 100%;
    margin: 0;
    overflow: visible;
    transform: translateY(3rem);
  }

  .hero-flow-box.flow-open {
    min-height: 385px;
  }

  .hero-flow-static {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
  }

  .hero-image-wrap {
    max-width: 100%;
    padding-bottom: 0;
  }

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

  .hero-image img {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    filter: drop-shadow(0 22px 55px rgba(0, 0, 0, 0.15));
  }

  /* 3D Carousel — desktop */
  .carousel-scene {
    height: 828px;
  }

  .carousel__cell {
    width: 288px;
    height: 288px;
    top: -144px;
    left: -144px;
  }

  .carousel__cell.active img {
    width: 691px;
    height: 691px;
  }

  .hero-start-btn {
    position: absolute;
    left: 50%;
    bottom: -56px;
    margin: 0;
    transform: translateX(-50%) translateY(10px);
  }

  .hero-start-btn.visible {
    transform: translateX(-50%) translateY(0);
  }

  .container {
    padding: 0 2.5rem;
  }

  /* Typography */
  .section-title {
    font-size: 3rem;
  }

  .hero-counter {
    display: block;
  }

  /* Sections */
  .categories-section,
  .products-section,
  .statement-section,
  .newsletter-section {
    padding: 4rem 0;
  }

  /* Products */
  .products-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.75rem;
  }

  /* Statement */
  .statement {
    padding: 4rem 3rem;
  }

  .statement h2 {
    font-size: 3rem;
  }

  .statement p {
    font-size: 1.125rem;
  }

  /* Newsletter */
  .newsletter-form {
    flex-direction: row;
  }

  .newsletter-form input {
    flex: 1;
  }

  .newsletter-form button {
    flex-shrink: 0;
  }

  /* Footer */
  .footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
  }
}

/* ═══════════════════════════════════════════════════
   LARGE DESKTOP (1440px+)
   ═══════════════════════════════════════════════════ */
@media (min-width: 90rem) {
  .hero {
    padding: 0 0 4rem;
  }

  .categories-section,
  .products-section,
  .statement-section,
  .newsletter-section {
    padding: 5rem 0;
  }

  .section-header {
    margin-bottom: 3rem;
  }
}

/* ═══════════════════════════════════════════════════
   INTERACTION IMPROVEMENTS
   ═══════════════════════════════════════════════════ */

/* Hover states only on devices that support hover */
@media (hover: hover) {
  .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  }

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

  .category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
  }

  .product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
  }

  .menu-btn:hover {
    background: var(--color-soft);
  }
}

/* Focus styles for accessibility */
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--color-text);
  outline-offset: 2px;
}

/* Prevent layout shift */

img {
  content-visibility: auto;
}

/* Smooth animations */
* {
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── HT3D CSS Carousel ─────────────────────────── */
.ht3d-carousel {
  --_diam:  61.2rem;
  --_r:     calc(var(--_diam) / 2);
  --_iw:    16.1rem;
  --_ih:    24.2rem;
  --_dur:   28s;
  --_ease:  250ms ease-out;
  --_play:  running;
  --_dir:   paused;

  perspective:        1000px;
  perspective-origin: 50% 20%;
  width:  var(--_diam);
  height: var(--_diam);
  position: relative;
}

/* Control buttons */
.ht3d-control-btn {
  z-index: 2;
  width: 1.1rem;
  height: 3.5rem;
  background: rgba(0,0,0,0.12);
  opacity: 0.35;
  transition: opacity var(--_ease);
  position: absolute;
  top: calc(var(--_r) - 1.75rem);
}
.ht3d-control-btn:hover                        { opacity: 0.6; }
.ht3d-control-btn:has(input:checked)           { opacity: 0.85; }
.ht3d-control-btn input {
  appearance: none;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}
.ht3d-control-btn.left  {
  clip-path: polygon(0% 50%, 100% 0%, 100% 100%);
  left: 0;
}
.ht3d-control-btn.right {
  clip-path: polygon(0% 0%, 100% 50%, 0% 100%);
  right: 0;
}
.ht3d-carousel:has(.ht3d-control-btn.left  input:checked) { --_dir:  running; }
.ht3d-carousel:has(.ht3d-control-btn.right input:checked) { --_dir:  paused;  }

/* Rotation wrapper */
.ht3d-rotation-dir {
  transform: translateZ(calc(var(--_r) * -1));
  transform-style: preserve-3d;
  animation: ht3d-rev calc(var(--_dur) / 2) reverse linear infinite var(--_dir);
  transition: all var(--_ease);
}
@keyframes ht3d-rev {
  from { transform: translateZ(calc(-30.6rem)) rotateY(0deg);   }
  to   { transform: translateZ(calc(-30.6rem)) rotateY(360deg); }
}
@keyframes ht3d-fwd {
  from { transform: rotateY(0deg);   }
  to   { transform: rotateY(360deg); }
}

/* Item list */
.ht3d-item-wrapper {
  transform-style: inherit;
  width: inherit;
  height: inherit;
  list-style: none;
  position: relative;
  animation: ht3d-fwd var(--_dur) linear infinite var(--_play);
  transition: all var(--_ease);
}
.ht3d-rotation-dir:has(.ht3d-item:hover) {
  --_play: paused;
  --_dir:  paused;
}

/* Individual item */
.ht3d-item {
  --_rot: calc(360 / var(--_n) * var(--_i) * 1deg);
  left:      calc(var(--_r) - var(--_iw) / 2);
  top:       calc(var(--_r) - var(--_ih) / 2);
  transform: rotateY(var(--_rot)) translateZ(var(--_r));
  transform-style: inherit;
  width:  var(--_iw);
  height: var(--_ih);
  transition: all var(--_ease);
  position: absolute;
}
.ht3d-item:hover {
  transform: rotateY(var(--_rot)) translateZ(calc(var(--_r) * 1.08));
}

/* Image (via ::after so ::before is free for reflection) */
.ht3d-item a {
  display: block;
  width: 100%;
  height: 100%;
  text-indent: -9999px;
  background-image: var(--_img);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,0.13));
  transition: filter var(--_ease);
}
.ht3d-item:hover a {
  filter: drop-shadow(0 12px 32px rgba(0,0,0,0.22));
}

/* Reflection */
.ht3d-item::before {
  content: '';
  width: inherit;
  height: 50%;
  background-image:
    linear-gradient(to top, rgba(255,255,255,0) 0%, rgba(255,255,255,0.97) 50%),
    var(--_img);
  background-repeat: no-repeat;
  background-position: center top;
  background-size: contain;
  pointer-events: none;
  filter: blur(0.35rem) opacity(0.5);
  transform-style: inherit;
  transform-origin: center bottom;
  transform: rotateX(90deg) rotateZ(180deg) rotateY(180deg);
  position: absolute;
}

/* Ground shadow */
.ht3d-ground {
  left:      calc(var(--_r) - var(--_diam) / 2);
  top:       calc(var(--_r) - var(--_diam) / 2);
  transform: rotateX(90deg) translateZ(calc(var(--_ih) / -2.2));
  width:  var(--_diam);
  height: var(--_diam);
  border-radius: 50%;
  background: radial-gradient(ellipse 40% 18% at 50% 50%, rgba(0,0,0,0.22) 0%, rgba(0,0,0,0.08) 45%, rgba(255,255,255,0) 75%);
  opacity: 0.6;
  position: absolute;
  filter: blur(0.4rem);
}
.ht3d-item-wrapper:has(.ht3d-item:hover) .ht3d-ground { opacity: 0.85; }

/* ─── Humanitee Story Popup ─────────────────────── */
.story-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.2s ease;
  padding: 1.5rem;
}

.story-popup-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.story-popup {
  background: #fff;
  max-width: 640px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  border-radius: 0.5rem;
  padding: 3rem 2.5rem 2.5rem;
  position: relative;
  transform: translateY(20px);
  transition: transform 1.2s ease;
}

.story-popup-overlay.active .story-popup {
  transform: translateY(0);
}

.story-popup-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  font-size: 1.1rem;
  background: none;
  border: none;
  cursor: pointer;
  color: #555;
  line-height: 1;
  padding: 0.25rem;
  transition: color 0.2s;
}

.story-popup-close:hover {
  color: #000;
}

.story-popup-content h2 {
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  margin-bottom: 2rem;
}

.story-popup-content p {
  font-size: 1rem;
  line-height: 1.8;
  color: #333;
  margin-bottom: 1.25rem;
}

.story-popup-content em {
  font-style: italic;
  color: #555;
}

.story-popup-signature {
  margin-top: 2rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #000 !important;
}

.story-divider {
  border: none;
  border-top: 1px solid #e9e9e9;
  margin: 2rem 0;
}
