/* ==========================================================================
 * kr10o/carrd-threejs - style.css
 * Served via: https://cdn.jsdelivr.net/gh/kr10o/carrd-threejs@main/style.css
 * Parent-Column Adaptive Layout + High-Relief Heavyweight Cotton Tokens
 * ========================================================================== */

@property --ts-turn-progress {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}

@property --ts-turn-velocity {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}

@property --ts-cursor-x {
  syntax: "<percentage>";
  inherits: true;
  initial-value: 50%;
}

@property --ts-cursor-y {
  syntax: "<percentage>";
  inherits: true;
  initial-value: 50%;
}

@property --ts-dof-blur {
  syntax: "<number>";
  inherits: true;
  initial-value: 14;
}

.tshirt-hero-bg {
  max-height: 100vh;
  max-height: 100dvh;
  overflow: hidden;
}

@property --ts-exposure {
  syntax: "<number>";
  inherits: true;
  initial-value: 1.02;
}

#carrd-app-root.tshirt-hero-bg {
  /* --- 1. Parent-Column Adaptive Layout & Squircle Tokens --- */
  --ts-bg-void: transparent;
  --ts-bg-stage: #dfdcd4;
  --ts-min-height: 400px;
  --ts-aspect-ratio: 2 / 3;
  --ts-squircle-radius: clamp(20px, 2.8vw, 44px);
  --ts-frame-pad: 0px;
  --ts-frame-border-width: 1px;
  --ts-frame-border-color: rgba(255, 255, 255, 0.16);
  --ts-frame-shadow: 0 22px 60px rgba(0, 0, 0, 0.10);
  --ts-frame-inset-glow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
  --ts-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ts-reveal-duration: 0.65s;

  /* --- 2. High-Relief Cotton Texture & Studio Lighting Tokens --- */
  --ts-shirt-color: #f5f5f5;
  --ts-shirt-roughness: 0.4;
  --ts-shirt-bump: 0.01;        /* Boosted 2.6x for deep heavyweight jersey relief */
  --ts-collar-bump: 0.02;       /* Deep 1x1 rib collar texture */
  --ts-knit-repeat: 289;         /* Tighter, sharper knit loop density */
  --ts-knit-cavity: 0.002;       /* Micro-shadow depth inside knit stitch pores */
  --ts-wall-color: #e4e1d8;
  --ts-wall-roughness: 3.5;
  --ts-wall-bump: 0.35;
  --ts-sun-color: #ffeff2;
  --ts-sun-intensity: 0.9;
  --ts-rim-color: #dcebff;
  --ts-rim-intensity: 0.62;
  --ts-hemi-intensity: 0.32;
  --ts-fill-intensity: 0.10;
  --ts-exposure: 1;
  --ts-dof-blur: 11;
  --ts-focal-range: 0.5;
  --ts-ao-intensity: 0,5;
  --ts-print-roughness: 0.1;
  --ts-print-emboss: 0.5;
  --ts-knit-bleed: 0.02;

  /* --- 3. Live CSSOM Telemetry Tokens --- */
  --ts-turn-progress: 0;
  --ts-turn-velocity: 0;
  --ts-cursor-x: 50%;
  --ts-cursor-y: 50%;

  /* Snaps 100% into parent Carrd column or container */
  position: relative;
  width: 100%;
  height: 100%;
  min-height: var(--ts-min-height);
  aspect-ratio: var(--ts-aspect-ratio);
  margin: 0;
  padding: var(--ts-frame-pad);
  background-color: var(--ts-bg-void);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  box-sizing: border-box;
  display: flex;
  flex: 1 1 auto;
  align-items: stretch;
  justify-content: center;
}

/* Optional Full-Viewport Override if data-layout="fullscreen" is set */
#carrd-app-root.tshirt-hero-bg[data-layout="fullscreen"] {
  --ts-bg-void: #b9b9b9;
  --ts-frame-pad: clamp(10px, 1.4vw, 20px);
  width: 100vw;
  height: 100vh;
  min-width: 100vw;
  min-height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  aspect-ratio: auto;
  margin: calc(50% - 50vw);
}

#carrd-app-root *,
#carrd-app-root *::before,
#carrd-app-root *::after {
  box-sizing: border-box;
}

#carrd-app-root .tshirt-squircle-frame {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: inherit;
  flex: 1 1 auto;
  background-color: var(--ts-bg-stage);
  border-radius: var(--ts-squircle-radius);
  corner-shape: squircle;
  border: var(--ts-frame-border-width) solid var(--ts-frame-border-color);
  box-shadow: var(--ts-frame-shadow), var(--ts-frame-inset-glow);
  overflow: hidden;
  contain: layout paint style;
  transform: translateZ(0);
  transition:
    border-color 0.45s var(--ts-ease-out),
    box-shadow 0.45s var(--ts-ease-out);
}

#carrd-app-root[data-turning="true"] .tshirt-squircle-frame {
  border-color: rgba(255, 232, 194, 0.45);
}

#carrd-app-root .tshirt-squircle-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 3;
  background: radial-gradient(
    550px circle at var(--ts-cursor-x) var(--ts-cursor-y),
    rgba(255, 255, 255, 0.06) 0%,
    transparent 65%
  );
  box-shadow: inset 0 0 0 1px rgba(
    255,
    255,
    255,
    calc(0.08 + var(--ts-turn-velocity) * 0.35)
  );
  transition: opacity 0.10s var(--ts-ease-out);
}

#carrd-app-root .tshirt-canvas-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  opacity: 0;
  pointer-events: auto;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  will-change: transform, opacity;
  transition: opacity var(--ts-reveal-duration) var(--ts-ease-out);
}

#carrd-app-root[data-state="ready"] .tshirt-canvas-stage {
  opacity: 1;
}

#carrd-app-root .tshirt-canvas-stage canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  outline: none;
}

@media (max-width: 468px) {
  #carrd-app-root.tshirt-hero-bg {
    --ts-min-height: 300px;
    --ts-dof-blur: 6;
  }
}

#carrd-app-root.tshirt-hero-bg:not([data-layout="fullscreen"]) {
  height: auto;
  min-height: 0;
  max-height: 100vh;
  max-height: 100dvh;
  aspect-ratio: var(--ts-aspect-ratio);
}
