/* MedComp specimen dashboard · warm paper workshop · live component shelf */
* { box-sizing: border-box; }

@property --wipe-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

html {
  overflow-x: clip;
  overscroll-behavior-y: none;
  background: var(--paper);
  scroll-behavior: auto;
}

body {
  margin: 0;
  min-width: 0;
  min-height: 100svh;
  overflow-x: clip;
  overscroll-behavior-y: none;
  background:
    radial-gradient(circle at 82% 10%, rgba(160,74,42,.10), transparent 34rem),
    linear-gradient(180deg, var(--paper-soft), var(--paper) 42%, var(--paper-deep));
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--terracotta); color: var(--paper-soft); }
body.sheet-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg, video { display: block; max-width: 100%; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }

.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip-link {
  position: fixed;
  left: 16px;
  top: -72px;
  z-index: 1000;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--paper-soft);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 12px;
  transition: top var(--dur-base) var(--ease-out);
}
.skip-link:focus-visible { top: 16px; }

.app-shell {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  width: min(1540px, 100%);
  margin-inline: auto;
  min-height: 100svh;
}

.rail {
  position: sticky;
  top: 0;
  align-self: start;
  min-height: 100svh;
  padding: 28px 20px;
  border-right: 1px solid var(--line);
  background: rgba(244,239,230,.66);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 34px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(24,19,15,.16);
  border-radius: var(--radius-ui);
  background: var(--paper-soft);
  box-shadow: 4px 4px 0 rgba(160,74,42,.12);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 850;
}
.brand strong { display: block; font-size: 17px; line-height: 1; }
.brand small { display: block; margin-top: 4px; color: var(--muted); font-family: var(--font-mono); font-size: 11px; }

.rail-block { margin-bottom: 22px; }
.search-label,
.kicker {
  display: block;
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 750;
  color: var(--terracotta);
  text-transform: uppercase;
}
.search-input {
  width: 100%;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-ui);
  background: rgba(251,247,239,.82);
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(255,255,255,.8) inset;
}
.search-input::placeholder { color: var(--faint); }

.filter-list {
  display: grid;
  gap: 8px;
  margin-bottom: 28px;
}
.filter-btn {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-ui);
  background: transparent;
  padding: 9px 11px;
  color: var(--muted);
  transition: transform var(--dur-base) var(--ease-out), border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.filter-btn:hover { transform: translateY(-1px); background: rgba(251,247,239,.60); color: var(--ink); }
.filter-btn[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper-soft);
  border-color: var(--ink);
  box-shadow: 3px 4px 0 rgba(160,74,42,.18);
}
.filter-btn span:last-child { font-family: var(--font-mono); font-size: 11px; opacity: .72; }

.rail-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-ui);
  background: rgba(251,247,239,.48);
  color: var(--muted);
  font-size: 13px;
}
.rail-note p { margin: 0; }
.dot {
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(88,106,73,.12);
  flex: 0 0 auto;
}

.main {
  min-width: 0;
  padding: 34px clamp(18px, 3vw, 46px) 56px;
}
.hero-block {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(260px, .65fr);
  gap: 24px;
  align-items: end;
  padding: 38px 0 28px;
  border-bottom: 1px solid var(--line);
}
h1, h2, h3, p, figure { margin: 0; }
h1 {
  max-width: 14ch;
  font-family: var(--font-display);
  font-size: clamp(42px, 6vw, 78px);
  font-weight: 400;
  line-height: .98;
  letter-spacing: -.015em;
  text-wrap: balance;
}
.hero-copy {
  color: var(--muted);
  max-width: 44rem;
  font-size: clamp(15px, 1.2vw, 17px);
}
.stats-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0 34px;
}
.stats-strip div {
  min-height: 84px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-ui);
  background: rgba(251,247,239,.42);
}
.stats-strip strong { font-family: var(--font-display); font-size: 34px; font-weight: 400; line-height: 1; }
.stats-strip span { color: var(--muted); font-family: var(--font-mono); font-size: 11px; }
.library-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 14px;
}
.library-head h2 {
  font-family: var(--font-display);
  font-size: clamp(30px, 3vw, 44px);
  font-weight: 400;
  line-height: 1;
}
.result-count { color: var(--muted); font-family: var(--font-mono); font-size: 12px; }

.component-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.component-card {
  position: relative;
  min-width: 0;
  display: grid;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-ui);
  color: inherit;
  background: rgba(251,247,239,.58);
  box-shadow: var(--shadow-soft);
  overflow: clip;
  isolation: isolate;
  text-align: left;
  transition: transform var(--dur-base) var(--ease-out), border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.component-card:hover {
  transform: translateY(-3px);
  border-color: rgba(160,74,42,.34);
  background: rgba(251,247,239,.78);
  box-shadow: var(--shadow-card);
}
.component-card:active { transform: translateY(-1px) scale(.996); }
.card-preview {
  min-height: 236px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 80% 18%, rgba(160,74,42,.10), transparent 12rem),
    linear-gradient(135deg, rgba(255,255,255,.30), rgba(232,223,209,.36));
  border-bottom: 1px solid var(--line);
}
.card-info { padding: 15px; }
.card-info h3 { font-size: 17px; line-height: 1.15; font-weight: 750; }
.empty-state {
  grid-column: 1 / -1;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-ui);
  color: var(--muted);
  background: rgba(251,247,239,.52);
}

/* shared specimen frame */
.specimen {
  --px: 0;
  --py: 0;
  width: 100%;
  min-height: 236px;
  display: grid;
  place-items: center;
  padding: clamp(16px, 3vw, 28px);
  overflow: hidden;
  isolation: isolate;
}
.dark-specimen {
  background: radial-gradient(circle at 50% 20%, rgba(199,53,40,.18), transparent 22rem), linear-gradient(135deg, #050607, #15181b 52%, #090a0b);
  color: var(--chalk);
}
.paper-specimen { color: var(--ink); }

/* Light wipe border */
.wipe-card {
  width: min(310px, 88%);
  position: relative;
  padding: 2px;
  border-radius: 22px;
  background: conic-gradient(from var(--wipe-angle), var(--red), var(--red-dark) 26%, var(--chalk) 42%, var(--red) 55%, #6f7880 74%, var(--red));
  animation: wipe-rotate 4.5s linear infinite;
  box-shadow: 0 20px 64px rgba(0,0,0,.34);
}
.wipe-card__inner {
  min-height: 154px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: #090a0b;
  color: var(--chalk);
  padding: 22px;
  box-shadow: 0 1px 0 rgba(255,255,255,.12) inset;
}
.wipe-card__inner img { width: min(170px, 78%); max-height: 92px; object-fit: contain; filter: drop-shadow(0 12px 24px rgba(0,0,0,.35)); }
@keyframes wipe-rotate { to { --wipe-angle: 360deg; } }

/* Gooey CTA */
.gooey-demo { background: radial-gradient(circle at 50% 40%, rgba(199,53,40,.20), transparent 18rem), #050607; }
.gooey-cta {
  --mx: 0px;
  --my: 0px;
  --goo-w: 210px;
  --goo-h: 70px;
  --goo-label: 156px;
  --goo-arrow: 70px;
  --goo-arrow-start: -132px;
  position: relative;
  display: inline-flex;
  align-items: center;
  width: var(--goo-w);
  height: var(--goo-h);
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: #08090a;
  transform: translate3d(var(--mx), var(--my), 0);
  transition: transform 220ms var(--ease-out);
}
.gooey-cta__label,
.gooey-cta__arrow {
  position: absolute;
  inset-block: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  background: var(--chalk);
  color: #08090a;
  transition: transform 600ms cubic-bezier(.34,1.56,.64,1), background-color 200ms ease, color 200ms ease;
}
.gooey-cta__label {
  inset-inline-end: 0;
  min-inline-size: var(--goo-label);
  padding-inline: 1.1rem;
  z-index: 2;
  font-size: clamp(14px, 2vw, 18px);
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}
.gooey-cta__arrow {
  inset-inline-end: 0;
  inline-size: var(--goo-arrow);
  z-index: 1;
  font-size: clamp(18px, 3vw, 28px);
  transform: translateX(var(--goo-arrow-start));
}
.gooey-cta:hover .gooey-cta__arrow,
.gooey-cta:focus-visible .gooey-cta__arrow { transform: translateX(0); }
.gooey-cta:hover .gooey-cta__label,
.gooey-cta:focus-visible .gooey-cta__label,
.gooey-cta:hover .gooey-cta__arrow,
.gooey-cta:focus-visible .gooey-cta__arrow { background: var(--red); color: var(--chalk); }
.gooey-cta:active { transform: translate3d(var(--mx), calc(var(--my) + 1px), 0) scale(.985); }
.card-preview .gooey-cta { --goo-w: 172px; --goo-h: 56px; --goo-label: 124px; --goo-arrow: 56px; --goo-arrow-start: -104px; }

/* Vertical phrase rotator */
.rotator-specimen { background: radial-gradient(circle at 50% 24%, rgba(199,53,40,.19), transparent 22rem), #050607; }
.rotator-window {
  position: relative;
  display: grid;
  place-items: center;
  width: min(94%, 720px);
  height: clamp(74px, 12vw, 132px);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 14%, #000 86%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 14%, #000 86%, transparent 100%);
}
.rotator-word {
  position: absolute;
  display: block;
  white-space: nowrap;
  color: rgba(242,242,238,.94);
  font-size: clamp(42px, 8vw, 92px);
  font-weight: 780;
  line-height: 1.05;
  letter-spacing: -.04em;
  text-shadow: 0 14px 44px rgba(0,0,0,.45);
  transition: transform 650ms var(--ease-out), opacity 650ms var(--ease-out), filter 650ms var(--ease-out);
  will-change: transform, opacity, filter;
}
.card-preview .rotator-word { font-size: clamp(32px, 5vw, 48px); }
.card-preview .rotator-window { height: 78px; }
.rotator-word.is-entering { transform: translateY(110%); opacity: 0; filter: blur(10px); }
.rotator-word.is-current { transform: translateY(0); opacity: 1; filter: blur(0); }
.rotator-word.is-exiting { transform: translateY(-110%); opacity: 0; filter: blur(10px); }

/* Split arrow CTA */
.split-demo { background: linear-gradient(135deg, rgba(255,255,255,.35), rgba(232,223,209,.48)); }
.split-cta {
  --mx: 0px;
  --my: 0px;
  --split-body: 230px;
  --split-arrow: 62px;
  --split-height: 70px;
  --split-travel: 170px;
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: var(--split-height);
  padding-left: calc(var(--split-arrow) + 14px);
  border: 0;
  background: transparent;
  color: var(--white);
  transform: translate3d(var(--mx), var(--my), 0);
  transition: transform 220ms var(--ease-out);
}
.split-main {
  min-width: var(--split-body);
  min-height: var(--split-height);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 28px;
  border: 0;
  border-radius: 6px;
  background: var(--red);
  font-weight: 900;
  font-size: clamp(16px, 2vw, 22px);
  line-height: 1;
  box-shadow: 0 8px 0 var(--red-dark), 0 20px 52px rgba(199,53,40,.18);
  transition: transform 260ms var(--ease-out), background var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.split-dot {
  position: absolute;
  left: 0;
  top: 50%;
  display: grid;
  place-items: center;
  width: var(--split-arrow);
  height: var(--split-arrow);
  border: 0;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 8px 0 var(--red-dark), 0 18px 42px rgba(199,53,40,.18);
  transform: translate3d(0, -50%, 0) rotate(0deg);
  transition: transform 260ms var(--ease-out), background var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
  font-size: clamp(18px, 3vw, 28px);
  font-weight: 900;
}
.split-cta:hover .split-dot,
.split-cta:focus-visible .split-dot { transform: translate3d(var(--split-travel), -50%, 0) rotate(12deg); background: var(--red-dark); }
.split-cta:hover .split-main,
.split-cta:focus-visible .split-main { transform: translate3d(calc(var(--split-arrow) * -1.15), -2px, 0) rotate(-1.5deg); }
.split-cta:active { transform: translate3d(var(--mx), calc(var(--my) + 1px), 0) scale(.985); }
.card-preview .split-cta { --split-body: 148px; --split-arrow: 46px; --split-height: 54px; --split-travel: 112px; }
.card-preview .split-main { font-size: 15px; box-shadow: 0 6px 0 var(--red-dark), 0 16px 34px rgba(199,53,40,.14); }
.card-preview .split-dot { box-shadow: 0 6px 0 var(--red-dark), 0 14px 28px rgba(199,53,40,.14); }

/* Shader mesh */
.shader-specimen { background: #050507; }
.shader-mesh {
  position: relative;
  width: min(620px, 92%);
  min-height: clamp(170px, 26vw, 310px);
  overflow: hidden;
  border-radius: 28px;
  background: #050507;
  box-shadow: 0 24px 80px rgba(0,0,0,.34), 0 0 0 1px rgba(255,255,255,.08) inset;
  transform: rotateX(calc(var(--py) * -2deg)) rotateY(calc(var(--px) * 2deg));
  transition: transform 90ms linear;
}
.shader-mesh::before {
  content: "";
  position: absolute;
  inset: -28%;
  background:
    radial-gradient(circle at 18% 24%, rgba(199,53,40,.95), transparent 30%),
    radial-gradient(circle at 66% 22%, rgba(199,53,40,.36), transparent 20%),
    radial-gradient(circle at 76% 30%, rgba(105,105,105,.74), transparent 28%),
    radial-gradient(circle at 48% 76%, rgba(95,20,17,.92), transparent 34%),
    radial-gradient(circle at 82% 76%, rgba(95,20,17,.48), transparent 26%),
    radial-gradient(circle at 78% 78%, rgba(255,255,255,.15), transparent 18%),
    #050507;
  filter: blur(20px) saturate(1.22);
  animation: mesh-shift 10s var(--ease-in-out) infinite alternate;
  transform: translate3d(calc(var(--px) * -16px), calc(var(--py) * -12px), 0);
}
.shader-mesh::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-radial-gradient(circle at 30% 20%, rgba(255,255,255,.055) 0 1px, transparent 1px 5px);
  mix-blend-mode: overlay;
  opacity: .26;
}
.shader-mesh span,
.shader-mesh i {
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(199,53,40,.20), transparent 62%);
  filter: blur(10px);
  animation: shader-breathe 7s var(--ease-in-out) infinite alternate;
}
.shader-mesh i { inset: 28% 12% 8% 48%; background: radial-gradient(circle, rgba(242,242,238,.16), transparent 60%); animation-delay: -2s; }
@keyframes mesh-shift { to { transform: translate3d(-5%, 4%, 0) rotate(8deg) scale(1.08); } }
@keyframes shader-breathe { to { transform: translate3d(8%, -4%, 0) scale(1.16); opacity: .74; } }

/* Pulsing orbit */
.orbit-specimen { background: #050607; }
.orbit-shader {
  position: relative;
  width: clamp(116px, 22vw, 190px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  isolation: isolate;
}
.orbit-shader::before {
  content: "";
  position: absolute;
  inset: 14%;
  border-radius: inherit;
  background: conic-gradient(from var(--wipe-angle), var(--red), var(--red-dark), #7f858c, var(--chalk), var(--red));
  filter: blur(10px);
  opacity: .78;
  animation: wipe-rotate 5.8s linear infinite, orbit-pulse 2.4s var(--ease-in-out) infinite;
}
.orbit-shader span {
  position: relative;
  z-index: 2;
  width: 42%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, rgba(255,255,255,.42), rgba(199,53,40,.72) 38%, rgba(8,9,10,.9) 70%);
  box-shadow: 0 0 34px rgba(199,53,40,.38);
}
.orbit-shader svg { position: absolute; inset: 0; animation: orbit-spin 18s linear infinite; }
.orbit-shader circle { fill: none; stroke: rgba(242,242,238,.54); stroke-width: .55; stroke-dasharray: 2 6; }
@keyframes orbit-pulse { 50% { transform: scale(1.11); opacity: .96; } }
@keyframes orbit-spin { to { transform: rotate(360deg); } }

/* Media roller */
.video-roller-specimen { background: linear-gradient(135deg, rgba(255,255,255,.32), rgba(232,223,209,.42)); }
.media-roller {
  --reel-w: 108px;
  --reel-h: 192px;
  display: grid;
  justify-items: center;
  gap: 12px;
  width: min(100%, 520px);
}
.media-roller[data-carousel-size="large"] { --reel-w: clamp(150px, 24vw, 190px); --reel-h: clamp(266px, 42vw, 338px); }
.roller-stage {
  position: relative;
  width: min(100%, 560px);
  height: calc(var(--reel-h) + 22px);
  overflow: hidden;
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
  isolation: isolate;
  border-radius: 24px;
}
.roller-stage::before,
.roller-stage::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 130;
  width: clamp(22px, 9vw, 72px);
  pointer-events: none;
}
.roller-stage::before { left: 0; background: linear-gradient(90deg, var(--paper) 0%, rgba(244,239,230,.70) 22%, transparent 100%); }
.roller-stage::after { right: 0; background: linear-gradient(270deg, var(--paper) 0%, rgba(244,239,230,.70) 22%, transparent 100%); }
.media-roller.is-dragging .roller-stage { cursor: grabbing; }
.roller-card {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: var(--card-z, 1);
  width: var(--reel-w);
  height: var(--reel-h);
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border-radius: 22px;
  background: #111417;
  box-shadow: 0 16px 52px rgba(24,19,15,.16), 0 1px 0 rgba(255,255,255,.18) inset;
  opacity: var(--card-opacity, 1);
  transform: translate3d(calc(-50% + var(--card-x, 0px)), calc(-50% + var(--card-y, 0px)), 0) rotate(var(--card-rot, 0deg)) scale(var(--card-scale, 1));
  transform-origin: 50% 72%;
  backface-visibility: hidden;
  will-change: transform, opacity;
  transition: transform 280ms var(--ease-out), opacity 220ms var(--ease-out), filter 220ms var(--ease-out), box-shadow 220ms var(--ease-out);
}
.roller-card video { width: 100%; height: 100%; object-fit: cover; }
.roller-card::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(0,0,0,0.02), rgba(0,0,0,0.22)); opacity: .18; }
.roller-card.is-active { box-shadow: 0 20px 68px rgba(24,19,15,.18), 0 1px 0 rgba(255,255,255,.18) inset; }
.roller-controls { display: flex; gap: 10px; }
.roller-controls button,
.sound-toggle {
  min-width: 44px;
  min-height: 44px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(24,19,15,.16);
  border-radius: 50%;
  background: rgba(251,247,239,.92);
  color: var(--ink);
  box-shadow: 2px 3px 0 rgba(24,19,15,.10);
  transition: transform var(--dur-base) var(--ease-out), background var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.roller-controls button:hover,
.sound-toggle:hover { transform: translateY(-2px); background: var(--paper-soft); box-shadow: 3px 5px 0 rgba(24,19,15,.12); }
.roller-controls button:active,
.sound-toggle:active { transform: translateY(0) scale(.965); }

/* Story rail */
.story-specimen { background: linear-gradient(135deg, rgba(255,255,255,.32), rgba(232,223,209,.46)); }
.story-rail {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(8px, 2vw, 18px);
  width: min(620px, 94%);
  align-items: center;
}
.story-card {
  min-width: 0;
  aspect-ratio: 9 / 16;
  border-radius: 22px;
  overflow: hidden;
  background: #111417;
  box-shadow: 0 18px 62px rgba(24,19,15,.16);
  transform: translateY(12px) rotate(-1deg);
  transition: transform 520ms var(--ease-out), filter 280ms var(--ease-out);
}
.story-card:nth-child(2) { transform: translateY(-18px) rotate(1deg); }
.story-card:nth-child(3) { transform: translateY(10px) rotate(1.5deg); }
.story-rail:hover .story-card { filter: saturate(.85); }
.story-rail:hover .story-card:hover { transform: translateY(-24px) scale(1.025); filter: none; }
.story-card video { width: 100%; height: 100%; object-fit: cover; }

/* Tethered product */
.tether-scene {
  --cup-x: 0px;
  --cup-y: 0px;
  --cup-rot: 0deg;
  --cup-scale: 1;
  --shadow-x: 0px;
  --shadow-y: 0px;
  --shadow-scale: 1;
  position: relative;
  width: min(360px, 90%);
  min-height: 236px;
  display: grid;
  place-items: center;
}
.tether-card {
  position: absolute;
  inset: 22px 20px 28px;
  border-radius: 24px;
  background: radial-gradient(circle at 30% 20%, #f2e2c4, transparent 28%), linear-gradient(135deg, #2d1512, #c73528 52%, #f2e2c4);
  box-shadow: 0 24px 72px rgba(61,20,16,.22);
  overflow: hidden;
}
.tether-card::after {
  content: "";
  position: absolute;
  inset: 15%;
  border: 1px solid rgba(255,250,242,.22);
  border-radius: 18px;
}
.cup-wrap {
  position: relative;
  z-index: 2;
  width: clamp(105px, 20vw, 148px);
  transform: translate3d(var(--cup-x), var(--cup-y), 0) rotate(var(--cup-rot)) scale(var(--cup-scale));
  transition: transform 45ms linear;
  will-change: transform;
}
.cup-wrap img { width: 100%; height: auto; filter: drop-shadow(0 24px 30px rgba(24,19,15,.25)); }
.cup-shadow {
  position: absolute;
  left: 50%;
  bottom: 34px;
  width: 118px;
  height: 22px;
  border-radius: 50%;
  background: rgba(24,19,15,.22);
  filter: blur(9px);
  transform: translate3d(calc(-50% + var(--shadow-x)), var(--shadow-y), 0) scale(var(--shadow-scale));
  transition: transform 45ms linear;
}

/* Cup parallax */
.cup-parallax-specimen { background: #08090a; }
.cup-parallax {
  --px: 0;
  --py: 0;
  position: relative;
  width: min(520px, 92%);
  min-height: clamp(230px, 34vw, 360px);
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 30px;
  background: radial-gradient(circle at 50% 20%, rgba(199,53,40,.22), transparent 18rem), #0d0e10;
  box-shadow: 0 28px 90px rgba(0,0,0,.34), 0 0 0 1px rgba(255,255,255,.08) inset;
}
.cup-layer {
  position: absolute;
  border-radius: 999px;
  transform: translate3d(calc(var(--px) * var(--depth-x)), calc(var(--py) * var(--depth-y)), 0);
  transition: transform 80ms linear;
}
.cup-layer--back { --depth-x: -18px; --depth-y: -10px; width: 76%; height: 32%; background: linear-gradient(90deg, transparent, rgba(199,53,40,.28), transparent); top: 18%; }
.cup-layer--mid { --depth-x: 24px; --depth-y: 16px; width: 42%; height: 18%; background: rgba(242,242,238,.10); bottom: 20%; filter: blur(6px); }
.cup-parallax__cup {
  position: relative;
  z-index: 3;
  width: clamp(118px, 22vw, 178px);
  filter: drop-shadow(0 34px 40px rgba(0,0,0,.42));
  transform: translate3d(calc(var(--px) * -22px), calc(-18px + var(--py) * -16px), 0) rotate(calc(var(--px) * -5deg));
  transition: transform 80ms linear;
}
.cup-parallax__shadow {
  position: absolute;
  left: 50%;
  bottom: 52px;
  width: 160px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0,0,0,.48);
  filter: blur(12px);
  transform: translate3d(calc(-50% + var(--px) * 10px), calc(var(--py) * 4px), 0) scale(.96);
  transition: transform 80ms linear;
}

/* Stacked parallax cards */
.parallax-card-stack {
  --px: 0;
  --py: 0;
  position: relative;
  width: min(420px, 92%);
  min-height: 260px;
  display: grid;
  place-items: center;
  perspective: 1000px;
}
.parallax-card-stack figure {
  position: absolute;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid rgba(24,19,15,.14);
  box-shadow: 0 24px 70px rgba(61,49,38,.18);
  transition: transform 90ms linear;
}
.parallax-card-stack figure:nth-child(1) { width: 56%; aspect-ratio: 4 / 5; transform: translate3d(calc(-58px + var(--px) * -18px), calc(16px + var(--py) * -10px), 0) rotate(-7deg); }
.parallax-card-stack figure:nth-child(2) { width: 52%; aspect-ratio: 9 / 13; transform: translate3d(calc(58px + var(--px) * 24px), calc(-8px + var(--py) * 16px), 0) rotate(5deg); z-index: 2; }
.parallax-card-stack figure:nth-child(3) { width: 46%; aspect-ratio: 4 / 5; transform: translate3d(calc(0px + var(--px) * 8px), calc(52px + var(--py) * 28px), 0) rotate(1deg); z-index: 3; }
.parallax-card-stack img { width: 100%; height: 100%; object-fit: cover; }

/* Deck */
.deck-stage {
  position: relative;
  width: min(410px, 96%);
  height: 252px;
  perspective: 1200px;
  touch-action: pan-y;
}
.deck-card {
  position: absolute;
  left: 0;
  top: 0;
  width: min(318px, calc(100% - 72px));
  height: 202px;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(24,19,15,.16);
  background: var(--paper-soft);
  box-shadow: 0 24px 72px rgba(61,49,38,.20), 0 1px 0 rgba(255,255,255,.84) inset;
  cursor: grab;
  user-select: none;
  will-change: transform, opacity;
  transition: transform 340ms var(--ease-out), opacity 260ms var(--ease-out);
}
.deck-card.is-front:active { cursor: grabbing; }
.deck-card.is-dragging { transition: none; z-index: 10; }
.deck-chrome {
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 10px;
  border-bottom: 1px solid rgba(24,19,15,.10);
  background: rgba(255,255,255,.24);
}
.deck-dots { display: flex; gap: 4px; }
.deck-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); }
.deck-dots i:first-child { background: var(--terracotta); }
.deck-body { position: relative; height: calc(100% - 30px); overflow: hidden; }
.deck-body img { width: 100%; height: 100%; object-fit: cover; }

/* Drawn wordmark */
.draw-demo { background: linear-gradient(135deg, rgba(255,255,255,.38), rgba(232,223,209,.42)); }
.draw-wordmark {
  width: min(620px, 94%);
  height: auto;
  color: var(--ink);
  overflow: visible;
  filter: url(#hand-soften);
}
.draw-wordmark path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw-line 3.6s var(--ease-out) infinite;
}
.draw-wordmark path:nth-child(2) { animation-delay: 120ms; }
.draw-wordmark path:nth-child(3) { animation-delay: 240ms; }
.draw-wordmark path:nth-child(4) { animation-delay: 360ms; }
.draw-wordmark path:nth-child(5) { animation-delay: 480ms; }
.draw-wordmark path:nth-child(6) { animation-delay: 600ms; }
@keyframes draw-line {
  0% { stroke-dashoffset: 1; opacity: 0; }
  8% { opacity: .96; }
  54%, 78% { stroke-dashoffset: 0; opacity: .96; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}

/* Sound toggle */
.sound-demo { background: linear-gradient(135deg, rgba(255,255,255,.38), rgba(232,223,209,.46)); }
.sound-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: auto;
  border-radius: var(--radius-pill);
  padding: 0 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
}
.sound-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid currentColor;
  background: var(--terracotta);
  box-shadow: 0 0 0 4px rgba(160,74,42,.12);
  transition: transform 220ms var(--ease-out), box-shadow 220ms var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.sound-toggle:hover .sound-dot { transform: scale(1.18); box-shadow: 0 0 0 8px rgba(160,74,42,.12); }
.sound-toggle[aria-pressed="false"] { color: var(--muted); }
.sound-toggle[aria-pressed="false"] .sound-dot { background: transparent; box-shadow: none; }

/* Photo spread */
.spread-demo { background: linear-gradient(135deg, rgba(255,255,255,.36), rgba(232,223,209,.45)); }
.photo-spread {
  position: relative;
  width: min(360px, 84%);
  padding-bottom: 74px;
}
.photo-main,
.photo-detail {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(24,19,15,.16);
  background: var(--paper-soft);
  box-shadow: var(--shadow-card);
}
.photo-main { height: clamp(160px, 28vw, 238px); }
.photo-main img,
.photo-detail img { width: 100%; height: 100%; object-fit: cover; }
.photo-main img { transition: transform 650ms var(--ease-out); }
.photo-detail {
  position: absolute;
  right: -6px;
  bottom: 0;
  width: 48%;
  height: clamp(96px, 16vw, 144px);
  transform: rotate(3deg) translateY(20px);
  transition: transform 520ms var(--ease-out);
}
.photo-spread:hover .photo-detail { transform: rotate(-1deg) translate(-12px, 8px); }
.photo-spread:hover .photo-main img { transform: scale(1.035); }

/* Candle + sweep buttons */
.candle-demo,
.sweep-demo { background: linear-gradient(135deg, rgba(255,255,255,.38), rgba(232,223,209,.46)); }
.candle-btn {
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  border: 1px solid rgba(82,44,16,.34);
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, #e7bc61 0%, #98651f 100%);
  color: #24150d;
  font-weight: 850;
  box-shadow: 0 18px 42px rgba(92,46,8,.22), inset 0 1px rgba(255,255,255,.38);
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.candle-btn:hover { transform: translateY(-2px); box-shadow: 0 22px 50px rgba(92,46,8,.30), inset 0 1px rgba(255,255,255,.42); }
.candle-btn:active { transform: translateY(0) scale(.985); }
.sweep-btn {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 26px;
  border: 1px solid var(--ink);
  border-radius: 6px;
  background: var(--ink);
  color: var(--paper-soft);
  box-shadow: 5px 6px 0 rgba(24,19,15,.14);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 850;
  transition: transform var(--dur-base) var(--ease-out), background var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.sweep-btn span { position: relative; z-index: 1; }
.sweep-btn::before {
  content: '';
  width: 8px;
  height: 8px;
  margin-right: 10px;
  background: currentColor;
  transform: rotate(6deg);
  transition: transform 260ms var(--ease-out);
}
.sweep-btn::after {
  content: '';
  position: absolute;
  inset: -44% -30%;
  z-index: 0;
  background: linear-gradient(112deg, transparent 38%, rgba(255,255,255,.34) 50%, transparent 62%);
  opacity: 0;
  transform: translate3d(-66%, 0, 0) rotate(3deg);
  transition: transform 520ms var(--ease-out), opacity 180ms var(--ease-out);
  pointer-events: none;
}
.sweep-btn:hover { background: var(--terracotta); box-shadow: 6px 7px 0 rgba(24,19,15,.14); }
.sweep-btn:hover::before { transform: rotate(14deg) scale(1.12); }
.sweep-btn:hover::after { opacity: .7; transform: translate3d(66%, 0, 0) rotate(3deg); }
.sweep-btn:active { transform: translateY(1px) scale(.985); box-shadow: 2px 2px 0 rgba(24,19,15,.12); }

/* Detail sheet */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 180;
  background: rgba(24,19,15,.34);
  backdrop-filter: blur(4px);
}
.detail-sheet {
  position: fixed;
  inset: 18px 18px 18px auto;
  z-index: 190;
  width: min(880px, calc(100vw - 36px));
  display: grid;
  grid-template-rows: auto auto auto minmax(96px, 1fr);
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--paper-soft);
  box-shadow: 0 32px 100px rgba(24,19,15,.28);
  transform: translateX(calc(100% + 28px));
  opacity: 0;
  pointer-events: none;
  transition: transform 300ms var(--ease-out), opacity 220ms var(--ease-out);
  overflow: auto;
}
.detail-sheet.is-open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}
.sheet-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.sheet-top h2 {
  font-family: var(--font-display);
  font-size: clamp(34px, 5vw, 58px);
  font-weight: 400;
  line-height: .98;
  letter-spacing: -.01em;
}
.icon-close {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(24,19,15,.16);
  border-radius: var(--radius-ui);
  background: var(--paper);
  font-size: 28px;
  line-height: 1;
  transition: transform var(--dur-base) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.icon-close:hover { transform: translateY(-1px); background: var(--paper-soft); }
.sheet-preview {
  min-height: clamp(300px, 50svh, 438px);
  border: 1px solid var(--line);
  border-radius: var(--radius-ui);
  overflow: hidden;
  background: var(--paper);
}
.sheet-preview .specimen { width: 100%; min-height: clamp(300px, 50svh, 438px); }
.sheet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.copy-btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid rgba(24,19,15,.16);
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--paper-soft);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  transition: transform var(--dur-base) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.copy-btn:hover { transform: translateY(-1px); background: var(--terracotta); }
.copy-btn:active { transform: translateY(0) scale(.98); }
.sheet-meta {
  min-height: 0;
  overflow: auto;
  padding-right: 6px;
  display: grid;
  align-content: start;
  gap: 8px;
}
.sheet-meta h3 {
  margin-top: 10px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--terracotta);
  text-transform: uppercase;
}
.sheet-meta p,
.sheet-meta li { color: var(--muted); font-size: 14px; }
.sheet-meta p#sheetSource {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink);
  word-break: break-word;
}
.sheet-meta ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 250;
  padding: 10px 14px;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--paper-soft);
  font-family: var(--font-mono);
  font-size: 12px;
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1180px) {
  .component-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-sheet { width: min(780px, calc(100vw - 36px)); }
}

@media (max-width: 820px) {
  .app-shell { display: block; }
  .rail {
    position: relative;
    min-height: 0;
    padding: 18px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .brand { margin-bottom: 18px; }
  .filter-list { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-bottom: 12px; }
  .filter-btn { min-height: 38px; justify-content: center; }
  .filter-btn span:last-child { display: none; }
  .rail-note { display: none; }
  .main { padding: 22px 14px 42px; }
  .hero-block { grid-template-columns: 1fr; padding-top: 18px; }
  h1 { max-width: 12ch; font-size: clamp(38px, 9vw, 56px); }
  .stats-strip { grid-template-columns: 1fr 1fr 1fr; }
  .stats-strip div { min-height: 70px; padding: 12px; }
  .stats-strip strong { font-size: 28px; }
  .detail-sheet { inset: 10px; width: auto; border-radius: var(--radius-ui); }
  .sheet-preview { min-height: 360px; }
  .sheet-preview .specimen { min-height: 360px; }
}

@media (max-width: 560px) {
  .filter-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-block { gap: 14px; }
  .hero-copy { font-size: 14px; }
  .stats-strip { gap: 8px; margin: 16px 0 26px; }
  .stats-strip div { min-height: 64px; }
  .stats-strip strong { font-size: 24px; }
  .stats-strip span { font-size: 10px; }
  .library-head { align-items: start; flex-direction: column; }
  .component-grid { grid-template-columns: 1fr; }
  .card-preview { min-height: 214px; }
  .specimen { min-height: 214px; padding: 14px; }
  .split-cta { --split-body: 150px; --split-arrow: 46px; --split-height: 54px; --split-travel: 112px; }
  .sheet-preview .split-cta { --split-body: 172px; --split-arrow: 50px; --split-height: 58px; --split-travel: 128px; }
  .media-roller[data-carousel-size="large"] { --reel-w: clamp(126px, 38vw, 150px); --reel-h: clamp(224px, 68vw, 266px); }
  .story-rail { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding: 8px 28px 12px 4px; mask-image: linear-gradient(90deg, #000 0%, #000 84%, transparent 100%); }
  .story-card { flex: 0 0 min(72%, 180px); scroll-snap-align: start; transform: none !important; }
  .deck-stage { height: 218px; }
  .deck-card { width: min(262px, calc(100vw - 86px)); height: 168px; }
  .detail-sheet { inset: 0; border-radius: 0; border-left: 0; border-right: 0; }
  .sheet-preview { min-height: 314px; }
  .sheet-preview .specimen { min-height: 314px; }
}

@media (max-width: 360px) {
  .main { padding-inline: 10px; }
  .rail { padding-inline: 10px; }
  .stats-strip { grid-template-columns: 1fr; }
  .card-info { padding: 13px; }
  .gooey-cta { --goo-w: 160px; --goo-h: 54px; --goo-label: 116px; --goo-arrow: 54px; --goo-arrow-start: -98px; }
  .sheet-preview .rotator-word { font-size: 36px; }
  .sheet-preview .split-cta { --split-body: 148px; --split-arrow: 46px; --split-height: 54px; --split-travel: 110px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
  }
  .cup-wrap,
  .cup-shadow,
  .rotator-word { transition: none !important; }
  .draw-wordmark path { stroke-dashoffset: 0 !important; opacity: 1 !important; }
}


/* Peter clean fidelity pass · 2026-06-18
   Purpose: remove Codex/marketing shell, keep only a quiet specimen library, and preserve source component behavior. */
body {
  background: var(--paper-soft);
  color: var(--ink);
}
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.app-shell {
  display: block;
  width: 100%;
  min-height: 100svh;
  margin: 0;
}
.rail {
  position: sticky;
  top: 0;
  z-index: 80;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(130px, auto) minmax(160px, 280px) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px clamp(12px, 2vw, 28px);
  border-right: 0;
  border-bottom: 1px solid rgba(24, 19, 15, .12);
  background: rgba(251, 247, 239, .94);
  backdrop-filter: none;
}
.brand {
  margin: 0;
  gap: 0;
}
.brand strong {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1;
  font-weight: 760;
  letter-spacing: 0;
}
.brand small {
  display: block;
  margin-top: 5px;
  font-family: var(--font-body);
  font-size: 12px;
  color: rgba(24, 19, 15, .46);
  letter-spacing: 0;
}
.rail-block {
  margin: 0;
}
.search-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
.search-input {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(24, 19, 15, .14);
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
  font-size: 13px;
}
.search-input:focus {
  border-color: rgba(24, 19, 15, .36);
  outline: none;
}
.filter-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
  margin: 0;
}
.filter-btn {
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(24, 19, 15, .48);
  font-size: 12px;
  font-weight: 560;
  letter-spacing: 0;
  transition: color 160ms var(--ease-out), background 160ms var(--ease-out), transform 160ms var(--ease-out);
}
.filter-btn:hover {
  transform: none;
  background: rgba(24, 19, 15, .055);
  color: var(--ink);
}
.filter-btn[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper-soft);
  border: 0;
  box-shadow: none;
}
.main {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: clamp(10px, 1.4vw, 20px);
}
.hero-block,
.stats-strip,
.library-head,
.rail-note {
  display: none !important;
}
.component-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: rgba(24, 19, 15, .12);
  border: 1px solid rgba(24, 19, 15, .12);
}
.component-card {
  border: 0;
  border-radius: 0;
  background: var(--paper-soft);
  box-shadow: none;
  overflow: hidden;
  transition: background 160ms var(--ease-out), color 160ms var(--ease-out);
}
.component-card:hover {
  transform: none;
  border-color: transparent;
  background: #f7f1e7;
  box-shadow: none;
}
.component-card:active {
  transform: none;
}
.card-preview {
  min-height: clamp(210px, 20vw, 300px);
  border-bottom: 1px solid rgba(24, 19, 15, .10);
  background: #f8f4ed;
}
.card-info {
  padding: 12px 14px 13px;
}
.card-info h3 {
  font-size: 13px;
  line-height: 1.2;
  font-weight: 620;
  letter-spacing: 0;
}
.specimen {
  min-height: inherit;
  padding: clamp(14px, 2.4vw, 28px);
}
.paper-specimen,
.split-demo,
.video-roller-specimen,
.story-specimen {
  background: #f8f4ed;
}
.dark-specimen,
.gooey-demo,
.rotator-specimen,
.shader-specimen,
.orbit-specimen,
.cup-parallax-specimen {
  background: #050607;
}
.sheet-backdrop {
  background: rgba(24, 19, 15, .22);
  backdrop-filter: none;
}
.detail-sheet {
  inset: 10px 10px 10px auto;
  width: min(820px, calc(100vw - 20px));
  grid-template-rows: auto minmax(260px, 1fr) auto auto;
  gap: 10px;
  padding: 12px;
  border-radius: 0;
  border: 1px solid rgba(24, 19, 15, .16);
  background: var(--paper-soft);
  box-shadow: none;
}
.sheet-top {
  padding: 0 0 10px;
  border-bottom: 1px solid rgba(24, 19, 15, .10);
}
.sheet-top h2 {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 680;
  line-height: 1;
  letter-spacing: 0;
}
.icon-close {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(24, 19, 15, .14);
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
}
.sheet-preview {
  min-height: clamp(300px, 58svh, 620px);
  border-radius: 0;
  border: 1px solid rgba(24, 19, 15, .10);
  background: #f8f4ed;
}
.sheet-actions {
  display: flex;
  gap: 8px;
  padding: 0;
}
.copy-btn {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  box-shadow: none;
  font-size: 12px;
  font-weight: 620;
}
.sheet-meta {
  padding: 0;
  border-top: 0;
  color: rgba(24, 19, 15, .50);
  font-family: var(--font-mono);
  font-size: 10px;
}
.sheet-meta h3,
#sheetIdea,
#sheetNotes {
  display: none;
}
#sheetSource {
  word-break: break-word;
}
.toast {
  border-radius: 999px;
  box-shadow: none;
}

/* Original Mravenisko gooey CTA behavior */
.gooey-cta {
  --mx: 0px;
  --my: 0px;
  position: relative;
  display: inline-flex;
  align-items: center;
  width: auto;
  inline-size: auto;
  block-size: 38px;
  min-inline-size: 98px;
  border-radius: var(--radius-pill);
  border: 0;
  background: transparent;
  color: var(--ash, #08090a);
  transform: translate3d(var(--mx), var(--my), 0);
  transition: transform 220ms var(--ease-out);
}
.gooey-cta__label,
.gooey-cta__arrow {
  position: absolute;
  inset-block: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  background: var(--chalk);
  color: #08090a;
  transition: transform 600ms cubic-bezier(0.34, 1.56, 0.64, 1), background-color 200ms ease, color 200ms ease;
}
.gooey-cta__label {
  inset-inline-end: 0;
  min-inline-size: 88px;
  padding-inline: 1.1rem;
  z-index: 2;
  font-size: .75rem;
  font-weight: 850;
  line-height: 1;
  text-transform: uppercase;
}
.gooey-cta__arrow {
  inset-inline-end: 0;
  inline-size: 38px;
  z-index: 1;
  transform: translateX(-34px);
}
.gooey-cta__arrow svg {
  opacity: 0;
  transform: translate(-30px, 30px) scale(0.5);
  transition: transform 600ms cubic-bezier(0.25, 1, 0.5, 1), opacity 600ms cubic-bezier(0.25, 1, 0.5, 1);
}
.gooey-cta:hover .gooey-cta__arrow,
.gooey-cta:focus-visible .gooey-cta__arrow {
  transform: translateX(-94px);
}
.gooey-cta:hover .gooey-cta__arrow svg,
.gooey-cta:focus-visible .gooey-cta__arrow svg {
  opacity: 1;
  transform: translate(0, 0) scale(1);
  transition: transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1), opacity 200ms ease;
}
.gooey-cta:hover .gooey-cta__label,
.gooey-cta:focus-visible .gooey-cta__label,
.gooey-cta:hover .gooey-cta__arrow,
.gooey-cta:focus-visible .gooey-cta__arrow {
  background: var(--red);
  color: var(--chalk);
}
.gooey-cta:active { transform: translate3d(var(--mx), calc(var(--my) + 1px), 0) scale(.985); }

/* Original AMC split CTA behavior */
.cta-split {
  --mx: 0px;
  --my: 0px;
  --tilt: 0deg;
  --cta-travel: 0px;
  --cta-gap: 0.46rem;
  position: relative;
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 2.42rem;
  color: #f4f4f4;
  transform: translate3d(var(--mx), var(--my), 0) rotate(var(--tilt));
  transition: transform 260ms var(--ease-out);
  white-space: nowrap;
}
.cta-split.is-external { padding-left: calc(2.24rem + var(--cta-gap)); }
.cta-main {
  z-index: 2;
  min-width: 5.8rem;
  padding: 0.66rem 0.98rem;
  border: 1px solid #780815;
  border-radius: 0.42rem;
  background: #ff0a18;
  color: #f4f4f4;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  box-shadow: 0 0.2rem 0 #780815;
  transition: transform 260ms var(--ease-out);
}
.cta-dot {
  position: absolute;
  left: 0;
  top: 50%;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 2.24rem;
  height: 2.24rem;
  border: 1px solid #780815;
  border-radius: 50%;
  background: #ff0a18;
  color: #f4f4f4;
  box-shadow: 0 0.2rem 0 #780815;
  transform: translate3d(0, -50%, 0) rotate(0deg);
  transition: transform 260ms var(--ease-out);
}
.cta-split:hover .cta-main,
.cta-split:focus-visible .cta-main {
  transform: rotate(-2.4deg) translate3d(-0.08rem, -0.04rem, 0);
}
.cta-split.is-external:hover .cta-dot,
.cta-split.is-external:focus-visible .cta-dot {
  transform: translate3d(var(--cta-travel), -50%, 0) rotate(10deg);
}
.cta-split.is-external:hover .cta-main,
.cta-split.is-external:focus-visible .cta-main {
  transform: translate3d(calc(-2.24rem - var(--cta-gap)), -0.04rem, 0) rotate(-2.4deg);
}
.cta-split:active {
  transform: translate3d(var(--mx), calc(var(--my) + 0.04rem), 0) rotate(var(--tilt)) scale(0.985);
}

/* Source-like BorderRotate implementation */
.wipe-card {
  background-image:
    linear-gradient(#08090a, #08090a),
    conic-gradient(from var(--wipe-angle), #c73528 0%, #5f1411 37%, #f2f2ee 30%, #5f1411 33%, #c73528 40%, #c73528 50%, #5f1411 77%, #f2f2ee 80%, #5f1411 83%, #c73528 90%);
  background-clip: padding-box, border-box;
  background-origin: padding-box, border-box;
  background-color: #08090a;
  border: 2px solid transparent;
  border-radius: 20px;
  padding: 0;
  box-shadow: none;
}
.wipe-card__inner {
  min-height: 150px;
  background: transparent;
  border-radius: 18px;
  box-shadow: none;
}

@media (max-width: 980px) {
  .rail {
    grid-template-columns: 1fr minmax(150px, 240px);
  }
  .filter-list {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
  .component-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 560px) {
  .rail {
    grid-template-columns: 1fr;
    gap: 9px;
  }
  .brand small { display: none; }
  .component-grid {
    grid-template-columns: 1fr;
  }
  .card-preview { min-height: 224px; }
  .detail-sheet {
    inset: 8px;
    width: calc(100vw - 16px);
  }
}

/* remove empty-grid slab from uneven component counts */
.component-grid {
  background: transparent;
  border: 0;
  gap: 10px;
}
.component-card {
  border: 1px solid rgba(24, 19, 15, .12);
}
.component-card:hover {
  border-color: rgba(24, 19, 15, .28);
}


/* Hand-drawn MedComp wordmark */
.brand {
  min-width: 0;
}
.brand-logo {
  display: grid;
  gap: 1px;
  min-width: 0;
}
.brand-wordmark {
  width: clamp(118px, 11vw, 152px);
  height: auto;
  overflow: visible;
  color: var(--ink);
  filter: url(#hand-soften);
}
.brand-wordmark text {
  font-family: var(--font-display);
  font-size: 43px;
  font-weight: 600;
  letter-spacing: -0.065em;
  line-height: 1;
  transform-origin: 8px 50px;
}
.brand-wordmark__ghost {
  fill: rgba(24, 19, 15, .16);
  stroke: none;
  transform: translate(1.1px, 1px) rotate(-0.25deg);
}
.brand-wordmark__stroke {
  fill: transparent;
  stroke: currentColor;
  stroke-width: 1.65px;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 760;
  stroke-dashoffset: 760;
  animation: medcomp-wordmark-draw 2.8s var(--ease-out) 180ms forwards;
}
.brand:hover .brand-wordmark__stroke,
.brand:focus-visible .brand-wordmark__stroke {
  stroke: var(--terracotta);
}
@keyframes medcomp-wordmark-draw {
  0% { stroke-dashoffset: 760; opacity: .2; }
  16% { opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .brand-wordmark__stroke {
    animation: none;
    stroke-dashoffset: 0;
  }
}
@media (max-width: 560px) {
  .brand-wordmark {
    width: 128px;
  }
}


/* Refined wordmark: clear filled type + one hand-drawn underline, no doubled text. */
.brand-wordmark__fill {
  fill: currentColor;
  stroke: none;
  opacity: .98;
}
.brand-wordmark__underline {
  fill: none;
  stroke: var(--terracotta);
  stroke-width: 2.2px;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  opacity: .82;
  animation: medcomp-underline-draw 1.15s var(--ease-out) 520ms forwards;
}
.brand:hover .brand-wordmark__underline,
.brand:focus-visible .brand-wordmark__underline {
  stroke: var(--red);
  opacity: 1;
}
@keyframes medcomp-underline-draw {
  to { stroke-dashoffset: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .brand-wordmark__underline {
    animation: none;
    stroke-dashoffset: 0;
  }
}


/* Navbar motion + iPhone-Photos-style grid density */
:root {
  --grid-columns: 4;
  --grid-gap: 10px;
}
.rail {
  grid-template-columns: auto minmax(136px, 220px) auto minmax(0, 1fr);
  gap: 8px;
  padding: 6px clamp(8px, 1.3vw, 18px);
  border-bottom: 0;
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  transition: transform 240ms var(--ease-out), opacity 180ms var(--ease-out);
  will-change: transform;
}
.rail.is-hidden {
  transform: translate3d(0, calc(-100% - 12px), 0);
  opacity: 0;
  pointer-events: none;
}
.brand {
  margin: 0;
}
.brand-wordmark {
  width: clamp(106px, 9vw, 134px);
}
.brand small {
  margin-top: 0;
  font-size: 10px;
  color: rgba(24, 19, 15, .42);
}
.rail-block {
  margin: 0;
}
.search-input {
  min-height: 32px;
  padding: 0 11px;
  border-radius: 999px;
  border-color: rgba(24, 19, 15, .12);
  background: transparent;
  font-size: 12px;
}
.search-input:focus {
  background: rgba(251, 247, 239, .72);
}
.density-control {
  min-width: 142px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 2px;
  color: rgba(24, 19, 15, .52);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
  white-space: nowrap;
}
.density-control input {
  width: 88px;
  accent-color: var(--ink);
  cursor: ew-resize;
}
.density-control output {
  min-width: 18px;
  text-align: right;
  color: var(--ink);
}
.filter-list {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 2px;
  isolation: isolate;
}
.filter-indicator {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 0;
  width: var(--indicator-w, 0px);
  height: var(--indicator-h, 0px);
  border-radius: 999px;
  background: var(--ink);
  transform: translate3d(var(--indicator-x, 0px), var(--indicator-y, 0px), 0);
  transition:
    transform 300ms cubic-bezier(.22, 1, .36, 1),
    width 300ms cubic-bezier(.22, 1, .36, 1),
    height 300ms cubic-bezier(.22, 1, .36, 1);
  pointer-events: none;
}
.filter-btn {
  position: relative;
  z-index: 1;
  min-height: 28px;
  padding: 0 9px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(24, 19, 15, .50);
  box-shadow: none;
  font-size: 11px;
  font-weight: 620;
  transition: color 160ms var(--ease-out), transform 160ms var(--ease-out);
}
.filter-btn:hover {
  transform: none;
  background: transparent;
  color: var(--ink);
}
.filter-btn[aria-pressed="true"] {
  background: transparent;
  color: var(--paper-soft);
  border: 0;
  box-shadow: none;
}
.filter-btn:active {
  transform: scale(.97);
}
.component-grid {
  grid-template-columns: repeat(var(--grid-columns), minmax(0, 1fr)) !important;
  gap: var(--grid-gap) !important;
  transition: gap 180ms var(--ease-out);
}
.component-card {
  min-width: 0;
  transition: border-color 160ms var(--ease-out), background 160ms var(--ease-out), opacity 160ms var(--ease-out);
}
.card-preview {
  aspect-ratio: 1 / .82;
  min-height: 0 !important;
  height: auto;
  overflow: hidden;
}
.card-preview > .specimen {
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: clamp(6px, 1.2vw, 18px);
  overflow: hidden;
}
.card-info {
  min-width: 0;
  padding: 9px 10px 10px;
}
.card-info h3 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
html[data-grid-density="medium"] {
  --grid-gap: 7px;
}
html[data-grid-density="medium"] .card-info {
  padding: 7px 8px 8px;
}
html[data-grid-density="medium"] .card-info h3 {
  font-size: 11px;
}
html[data-grid-density="dense"] {
  --grid-gap: 5px;
}
html[data-grid-density="dense"] .card-info {
  padding: 5px 6px 6px;
}
html[data-grid-density="dense"] .card-info h3 {
  font-size: 9px;
  opacity: .78;
}
html[data-grid-density="dense"] .card-preview > .specimen {
  padding: 4px;
}
html[data-grid-density="micro"] {
  --grid-gap: 3px;
}
html[data-grid-density="micro"] .component-card {
  border-color: rgba(24, 19, 15, .09);
}
html[data-grid-density="micro"] .card-info {
  display: none;
}
html[data-grid-density="micro"] .card-preview {
  aspect-ratio: 1;
}
html[data-grid-density="micro"] .card-preview > .specimen {
  padding: 2px;
}
html[data-grid-density="micro"] .card-preview .gooey-cta,
html[data-grid-density="micro"] .card-preview .cta-split,
html[data-grid-density="micro"] .card-preview .orbit-shader,
html[data-grid-density="micro"] .card-preview .tether-scene,
html[data-grid-density="micro"] .card-preview .cup-parallax,
html[data-grid-density="micro"] .card-preview .parallax-card-stack,
html[data-grid-density="micro"] .card-preview .media-roller,
html[data-grid-density="micro"] .card-preview .story-rail,
html[data-grid-density="micro"] .card-preview .shader-mesh,
html[data-grid-density="micro"] .card-preview .wipe-card {
  transform: scale(.74);
  transform-origin: center;
}
@media (max-width: 760px) {
  .rail {
    grid-template-columns: auto minmax(118px, 1fr) auto;
    align-items: center;
  }
  .filter-list {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
  .density-control {
    justify-self: end;
    min-width: 112px;
  }
  .density-control span {
    display: none;
  }
  .density-control input {
    width: 70px;
  }
}
@media (max-width: 560px) {
  .rail {
    grid-template-columns: 1fr auto;
    padding: 5px 8px;
  }
  .brand-wordmark {
    width: 112px;
  }
  .rail-block {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .density-control {
    grid-column: 2;
    grid-row: 1;
  }
  .filter-list {
    grid-column: 1 / -1;
    grid-row: 3;
  }
}
@media (prefers-reduced-motion: reduce) {
  .rail,
  .filter-indicator,
  .component-grid,
  .filter-btn {
    transition: none;
  }
}


/* Density fit patch: at tiny gallery sizes, shrink the specimen itself instead of cropping it. */
html[data-grid-density="micro"] .card-preview > .specimen {
  padding: 3px;
  display: grid;
  place-items: center;
}
html[data-grid-density="micro"] .card-preview .wipe-card {
  width: calc(100% - 10px);
  border-radius: 12px;
  padding: 1px;
  transform: none;
}
html[data-grid-density="micro"] .card-preview .wipe-card__inner {
  min-height: 44px;
  padding: 6px;
  border-radius: 10px;
}
html[data-grid-density="micro"] .card-preview .wipe-card__inner img {
  width: 88%;
  max-height: 30px;
}
html[data-grid-density="micro"] .card-preview .gooey-cta {
  transform: translate3d(var(--mx), var(--my), 0) scale(.58);
}
html[data-grid-density="micro"] .card-preview .rotator-window {
  width: 190px;
  height: 42px;
  transform: scale(.34);
  transform-origin: center;
}
html[data-grid-density="micro"] .card-preview .rotator-word {
  font-size: 28px;
}
html[data-grid-density="micro"] .card-preview .cta-split {
  transform: translate3d(var(--mx), var(--my), 0) rotate(var(--tilt)) scale(.54);
}
html[data-grid-density="micro"] .card-preview .shader-mesh {
  width: calc(100% - 10px);
  min-height: 46px;
  border-radius: 12px;
  transform: rotateX(calc(var(--py) * -2deg)) rotateY(calc(var(--px) * 2deg));
}
html[data-grid-density="micro"] .card-preview .orbit-shader {
  width: 44px;
  transform: none;
}
html[data-grid-density="micro"] .card-preview .media-roller {
  --reel-w: 18px;
  --reel-h: 32px;
  width: 70px;
  gap: 2px;
  transform: none;
}
html[data-grid-density="micro"] .card-preview .roller-stage {
  width: 70px;
  height: 42px;
  border-radius: 10px;
}
html[data-grid-density="micro"] .card-preview .roller-card {
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(24,19,15,.14);
}
html[data-grid-density="micro"] .card-preview .story-rail {
  width: 58px;
  gap: 3px;
  transform: none;
}
html[data-grid-density="micro"] .card-preview .story-card {
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(24,19,15,.14);
}
html[data-grid-density="micro"] .card-preview .tether-scene {
  width: 60px;
  min-height: 50px;
  transform: none;
}
html[data-grid-density="micro"] .card-preview .tether-card {
  inset: 6px 5px 8px;
  border-radius: 10px;
}
html[data-grid-density="micro"] .card-preview .cup-wrap {
  width: 28px;
}
html[data-grid-density="micro"] .card-preview .cup-shadow {
  bottom: 7px;
  width: 28px;
  height: 6px;
  filter: blur(3px);
}
html[data-grid-density="micro"] .card-preview .cup-parallax {
  width: 60px;
  min-height: 50px;
  border-radius: 12px;
  transform: none;
}
html[data-grid-density="micro"] .card-preview .cup-parallax__cup {
  width: 28px;
  transform: translate3d(calc(var(--px) * -6px), calc(-4px + var(--py) * -4px), 0) rotate(calc(var(--px) * -4deg));
}
html[data-grid-density="micro"] .card-preview .cup-parallax__shadow {
  bottom: 8px;
  width: 34px;
  height: 7px;
  filter: blur(4px);
}
html[data-grid-density="micro"] .card-preview .parallax-card-stack {
  width: 62px;
  min-height: 50px;
  transform: none;
}
html[data-grid-density="micro"] .card-preview .parallax-card-stack figure {
  border-radius: 6px;
  box-shadow: 0 5px 14px rgba(61,49,38,.16);
}
html[data-grid-density="micro"] .card-preview .parallax-card-stack figure:nth-child(1) {
  width: 54%;
  transform: translate3d(calc(-12px + var(--px) * -4px), calc(4px + var(--py) * -3px), 0) rotate(-7deg);
}
html[data-grid-density="micro"] .card-preview .parallax-card-stack figure:nth-child(2) {
  width: 50%;
  transform: translate3d(calc(12px + var(--px) * 5px), calc(-3px + var(--py) * 4px), 0) rotate(5deg);
  z-index: 2;
}
html[data-grid-density="micro"] .card-preview .parallax-card-stack figure:nth-child(3) {
  width: 44%;
  transform: translate3d(calc(0px + var(--px) * 3px), calc(13px + var(--py) * 5px), 0) rotate(1deg);
  z-index: 3;
}
html[data-grid-density="dense"] .card-preview .rotator-window {
  width: 240px;
  transform: scale(.58);
  transform-origin: center;
}
html[data-grid-density="dense"] .card-preview .shader-mesh,
html[data-grid-density="dense"] .card-preview .cup-parallax,
html[data-grid-density="dense"] .card-preview .tether-scene,
html[data-grid-density="dense"] .card-preview .parallax-card-stack {
  min-height: 96px;
}


/* Tiny-density visibility corrections: no blank rotator frame, no clipped CTA. */
html[data-grid-density="micro"] .card-preview .wipe-card {
  width: calc(100% - 6px);
}
html[data-grid-density="micro"] .card-preview .wipe-card__inner {
  min-height: 50px;
  padding: 5px;
}
html[data-grid-density="micro"] .card-preview .wipe-card__inner img {
  max-height: 38px;
}
html[data-grid-density="micro"] .card-preview .rotator-window {
  position: relative;
  width: 190px;
  height: 42px;
  transform: scale(.34);
  transform-origin: center;
}
html[data-grid-density="micro"] .card-preview .rotator-word {
  left: 50%;
  top: 50%;
  font-size: 28px;
  opacity: 1 !important;
  filter: none !important;
  transition: none !important;
}
html[data-grid-density="micro"] .card-preview .rotator-word.is-current {
  transform: translate(-50%, -50%) !important;
}
html[data-grid-density="micro"] .card-preview .rotator-word.is-entering,
html[data-grid-density="micro"] .card-preview .rotator-word.is-exiting {
  display: none !important;
}
html[data-grid-density="micro"] .card-preview .cta-split {
  --cta-gap: .22rem;
  transform: translate3d(var(--mx), var(--my), 0) rotate(var(--tilt)) scale(.42);
}


/* Tiny-density final fit: use real micro dimensions, not scaled oversized boxes. */
html[data-grid-density="micro"] .card-preview .rotator-window {
  width: calc(100% - 6px);
  height: 36px;
  transform: none;
  overflow: hidden;
}
html[data-grid-density="micro"] .card-preview .rotator-word {
  left: 50%;
  top: 50%;
  font-size: 10px;
  letter-spacing: -.02em;
  max-width: 100%;
  overflow: hidden;
  text-overflow: clip;
  opacity: 1 !important;
  filter: none !important;
  transition: none !important;
}
html[data-grid-density="micro"] .card-preview .rotator-word.is-current {
  transform: translate(-50%, -50%) !important;
}
html[data-grid-density="micro"] .card-preview .cta-split {
  transform-origin: left center;
}


/* Fancy Components import batch · adapted to MedComp static specimens */
.image-trail-specimen {
  background:
    radial-gradient(circle at 24% 22%, rgba(199, 53, 40, .13), transparent 11rem),
    linear-gradient(135deg, rgba(251, 247, 239, .72), rgba(232, 223, 209, .42));
}
.image-trail-stage {
  position: relative;
  width: min(100%, 360px);
  min-height: 220px;
  overflow: hidden;
  border: 1px solid rgba(24, 19, 15, .12);
  border-radius: 24px;
  background:
    radial-gradient(circle at 80% 14%, rgba(160, 74, 42, .18), transparent 8rem),
    linear-gradient(145deg, rgba(251, 247, 239, .94), rgba(232, 223, 209, .62));
  cursor: crosshair;
  touch-action: none;
}
.trail-anchor {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 104px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%) rotate(-7deg);
  border-radius: 28px;
  background: rgba(251, 247, 239, .72);
  box-shadow: 0 18px 42px rgba(61, 49, 38, .18);
  pointer-events: none;
}
.trail-anchor img {
  width: 76%;
  height: 76%;
  object-fit: contain;
  filter: drop-shadow(0 10px 16px rgba(61,49,38,.16));
}
.trail-anchor span {
  position: absolute;
  inset: auto 14px 14px auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 7px rgba(199, 53, 40, .11);
}
.trail-field {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.trail-item {
  position: absolute;
  left: 0;
  top: 0;
  display: none;
  width: 74px;
  aspect-ratio: 4 / 5;
  border-radius: 18px;
  pointer-events: none;
  will-change: transform, opacity, filter;
  overflow: hidden;
  box-shadow: 0 14px 34px rgba(61, 49, 38, .24);
}
.trail-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.trail-item--wide {
  width: 98px;
  aspect-ratio: 5 / 3.4;
}
.trail-item--poster {
  width: 62px;
  aspect-ratio: 9 / 16;
}
.trail-blob {
  width: 54px;
  aspect-ratio: 1;
  border-radius: 40% 60% 48% 52%;
  background: var(--terracotta);
  box-shadow: 0 10px 28px rgba(160, 74, 42, .28);
}
.trail-blob--ink { background: var(--ink); }
.trail-blob--red { background: var(--red); }

.path-marquee-specimen {
  background: radial-gradient(circle at 50% 44%, rgba(199, 53, 40, .16), transparent 18rem), #070808;
}
.path-marquee {
  --path-d: path('M20 82 C64 8 118 124 168 50 C204 10 236 32 240 86');
  position: relative;
  width: min(100%, 360px);
  aspect-ratio: 2 / 1;
  color: var(--chalk);
  transform: translateZ(0);
}
.path-marquee svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.path-marquee__guide {
  fill: none;
  stroke: rgba(242, 242, 238, .22);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-dasharray: 4 8;
}
.path-token {
  position: absolute;
  left: 0;
  top: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(242, 242, 238, .24);
  border-radius: 999px;
  background: rgba(242, 242, 238, .08);
  color: var(--chalk);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 760;
  offset-path: var(--path-d);
  offset-rotate: 0deg;
  offset-distance: 0%;
  animation: medcomp-path-marquee 9.5s linear infinite;
  animation-delay: calc(var(--i) * -1.58s);
  box-shadow: 0 12px 32px rgba(0,0,0,.24);
  will-change: offset-distance;
}
.path-token:nth-of-type(2n) {
  background: rgba(199, 53, 40, .34);
  border-color: rgba(199, 53, 40, .52);
}
.path-marquee:hover .path-token { animation-play-state: paused; }
@keyframes medcomp-path-marquee { to { offset-distance: 100%; } }

.text-highlighter-specimen {
  background: linear-gradient(135deg, rgba(251,247,239,.92), rgba(232,223,209,.62));
}
.text-highlighter-stage {
  max-width: min(88%, 460px);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 12px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(24px, 4.8vw, 48px);
  font-weight: 600;
  line-height: 1.1;
  text-align: center;
}
.fancy-highlight {
  --marker: rgba(199, 53, 40, .28);
  display: inline;
  padding-inline: .03em;
  background-image: linear-gradient(var(--marker), var(--marker));
  background-repeat: no-repeat;
  background-position: 0% 78%;
  background-size: 0% 62%;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  transition: background-size 520ms cubic-bezier(.16, 1, .3, 1);
}
.fancy-highlight[data-dir="rtl"] {
  --marker: rgba(160, 74, 42, .24);
  background-position: 100% 78%;
}
.fancy-highlight[data-dir="ttb"] {
  --marker: rgba(88, 106, 73, .22);
  background-position: 0% 0%;
  background-size: 100% 0%;
}
.text-highlighter-stage:hover .fancy-highlight,
.text-highlighter-stage.is-lit .fancy-highlight {
  background-size: 100% 62%;
}
.text-highlighter-stage:hover .fancy-highlight[data-dir="ttb"],
.text-highlighter-stage.is-lit .fancy-highlight[data-dir="ttb"] {
  background-size: 100% 62%;
}
.card-preview .text-highlighter-stage {
  font-size: clamp(16px, 2.7vw, 26px);
  max-width: 94%;
  gap: 5px 8px;
}
.card-preview .path-marquee { width: min(100%, 260px); }
.card-preview .path-token { min-width: 34px; min-height: 22px; padding: 0 7px; font-size: 8px; }
.card-preview .image-trail-stage { min-height: 178px; width: min(100%, 270px); }
.card-preview .trail-anchor { width: 76px; border-radius: 20px; }
.card-preview .trail-item { width: 54px; border-radius: 13px; }
.card-preview .trail-item--wide { width: 72px; }
.card-preview .trail-item--poster { width: 44px; }
.card-preview .trail-blob { width: 40px; }

html[data-grid-density="dense"] .card-preview .image-trail-stage,
html[data-grid-density="dense"] .card-preview .path-marquee {
  transform: scale(.78);
  transform-origin: center;
}
html[data-grid-density="dense"] .card-preview .text-highlighter-stage {
  font-size: 14px;
}
html[data-grid-density="micro"] .card-preview .image-trail-stage {
  width: calc(100% - 6px);
  min-height: 52px;
  border-radius: 12px;
  transform: none;
}
html[data-grid-density="micro"] .card-preview .trail-anchor {
  width: 30px;
  border-radius: 8px;
}
html[data-grid-density="micro"] .card-preview .trail-anchor span {
  width: 6px;
  height: 6px;
  inset: auto 5px 5px auto;
  box-shadow: none;
}
html[data-grid-density="micro"] .card-preview .trail-item {
  width: 18px;
  border-radius: 5px;
}
html[data-grid-density="micro"] .card-preview .trail-blob { width: 16px; }
html[data-grid-density="micro"] .card-preview .path-marquee {
  width: calc(100% - 4px);
  transform: none;
}
html[data-grid-density="micro"] .card-preview .path-token {
  min-width: 16px;
  min-height: 10px;
  padding: 0 3px;
  font-size: 4px;
  border-width: .5px;
}
html[data-grid-density="micro"] .card-preview .path-marquee__guide { stroke-width: .8; }
html[data-grid-density="micro"] .card-preview .text-highlighter-stage {
  max-width: calc(100% - 6px);
  gap: 2px 4px;
  font-size: 7px;
  line-height: 1.05;
}
html[data-grid-density="micro"] .card-preview .fancy-highlight {
  transition: none;
  background-size: 100% 58%;
}
@media (prefers-reduced-motion: reduce) {
  .path-token,
  .fancy-highlight {
    animation: none;
    transition: none;
  }
  .path-token { offset-distance: calc(var(--i) * 16%); }
  .fancy-highlight { background-size: 100% 62%; }
}


/* React Bits import batch · static MedComp adaptations */
.dot-field-specimen,
.dither-specimen,
.particles-specimen,
.rb-carousel-specimen,
.circular-gallery-specimen,
.decrypted-specimen {
  background: radial-gradient(circle at 50% 40%, rgba(199,53,40,.16), transparent 16rem), #080809;
}
.dot-field-container,
.dither-container,
.particles-container {
  position: relative;
  width: min(100%, 420px);
  min-height: 250px;
  overflow: hidden;
  border: 1px solid rgba(244,239,230,.12);
  border-radius: 24px;
  background: #09090a;
  touch-action: none;
}
.dot-field-container canvas,
.dither-container,
.particles-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.dot-glow {
  position: absolute;
  left: 0;
  top: 0;
  width: calc(var(--gr, 160px) * 2);
  height: calc(var(--gr, 160px) * 2);
  pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(244,239,230,.42), rgba(199,53,40,.20) 32%, transparent 67%);
  transform: translate3d(calc(var(--gx, 50%) - var(--gr, 160px)), calc(var(--gy, 50%) - var(--gr, 160px)), 0);
  mix-blend-mode: screen;
  will-change: transform, opacity;
}

.rb-carousel {
  position: relative;
  width: min(100%, 336px);
  min-height: 250px;
  overflow: hidden;
  padding: 16px 16px 38px;
  border: 1px solid rgba(244,239,230,.14);
  border-radius: 24px;
  perspective: 1000px;
  background: linear-gradient(135deg, rgba(244,239,230,.08), rgba(199,53,40,.10)), #0d0b0e;
  touch-action: pan-y;
}
.rb-carousel-track {
  display: flex;
  gap: 16px;
  min-height: 196px;
  transition: transform 520ms cubic-bezier(.16, 1, .3, 1);
  will-change: transform;
}
.rb-carousel.is-dragging .rb-carousel-track { transition: none; }
.rb-carousel-item {
  position: relative;
  flex: 0 0 calc(100% - 32px);
  min-height: 196px;
  display: grid;
  align-content: space-between;
  padding: 20px;
  border: 1px solid rgba(244,239,230,.16);
  border-radius: 14px;
  background: radial-gradient(circle at 72% 16%, rgba(199,53,40,.23), transparent 8rem), #1b1722;
  color: var(--chalk);
  transform: rotateY(var(--ry, 0deg));
  transform-origin: center;
  transition: transform 520ms cubic-bezier(.16, 1, .3, 1), opacity 280ms ease;
  cursor: grab;
}
.rb-carousel-item:active { cursor: grabbing; }
.rb-carousel-item span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--chalk);
  color: #120f17;
  font-weight: 900;
}
.rb-carousel-item h4 {
  margin: 0 0 4px;
  color: var(--chalk);
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 500;
  line-height: 1;
}
.rb-carousel-item p {
  color: rgba(244,239,230,.72);
  font-family: var(--font-mono);
  font-size: 11px;
}
.rb-carousel-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 14px;
  display: flex;
  justify-content: center;
  gap: 9px;
}
.rb-carousel-dots button {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(244,239,230,.28);
  transition: transform 180ms var(--ease-out), background 180ms var(--ease-out);
}
.rb-carousel-dots button.is-active { background: var(--chalk); transform: scale(1.22); }

.decrypted-specimen { color: var(--chalk); }
.decrypted-text {
  display: inline-block;
  max-width: 90%;
  color: var(--chalk);
  font-family: var(--font-mono);
  font-size: clamp(22px, 4vw, 46px);
  font-weight: 800;
  line-height: 1.05;
  text-align: center;
  white-space: pre-wrap;
}
.decrypted-text .encrypted { color: rgba(199,53,40,.88); text-shadow: 0 0 16px rgba(199,53,40,.22); }
.decrypted-text .revealed { color: var(--chalk); }

.bubble-menu-specimen {
  overflow: hidden;
  background: radial-gradient(circle at 52% 48%, rgba(199,53,40,.10), transparent 12rem), var(--paper-soft);
}
.bubble-menu-demo {
  position: relative;
  width: min(100%, 420px);
  min-height: 248px;
  pointer-events: none;
}
.bubble-menu-demo .bubble {
  position: absolute;
  top: 16px;
  z-index: 3;
  min-width: 48px;
  height: 48px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(24,19,15,.12);
  border-radius: 999px;
  background: var(--paper-soft);
  box-shadow: 0 10px 24px rgba(61,49,38,.13);
  color: var(--ink);
  font-family: var(--font-mono);
  font-weight: 850;
  pointer-events: auto;
}
.bubble-menu-demo .logo-bubble { left: 16px; padding-inline: 16px; }
.bubble-menu-demo .toggle-bubble { right: 16px; border: 0; }
.toggle-bubble span {
  display: block;
  width: 23px;
  height: 2px;
  margin: 3px 0;
  border-radius: 999px;
  background: var(--ink);
  transition: transform 260ms var(--ease-out), opacity 180ms var(--ease-out);
}
.bubble-menu-demo.is-open .toggle-bubble span:first-child { transform: translateY(4px) rotate(45deg); }
.bubble-menu-demo.is-open .toggle-bubble span:last-child { transform: translateY(-4px) rotate(-45deg); }
.bubble-pill-list {
  position: absolute;
  inset: 88px 12px 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: center;
  gap: 6px;
  padding: 0;
  margin: 0;
  list-style: none;
}
.bubble-pill-list li { display: contents; }
.bubble-pill-list a,
.bubble-pill-list .bubble-pill-static {
  min-height: 54px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper-soft);
  font-family: var(--font-display);
  font-size: clamp(18px, 3vw, 33px);
  line-height: 1;
  transform: scale(.08) translateY(18px);
  opacity: 0;
  transition: transform 520ms cubic-bezier(.34,1.56,.64,1), opacity 220ms ease, background 180ms ease;
  transition-delay: calc(var(--i) * 46ms);
  pointer-events: auto;
}
.bubble-menu-demo.is-open .bubble-pill-list a,
.bubble-pill-list .bubble-pill-static {
  opacity: 1;
  transform: scale(1) rotate(var(--rot));
}
.bubble-pill-list a:hover { background: var(--red); }
.bubble-pill-list a:active { transform: scale(.96) rotate(var(--rot)); }

.circular-gallery-specimen { overflow: hidden; }
.rb-circular-gallery {
  position: relative;
  width: min(100%, 520px);
  min-height: 280px;
  overflow: hidden;
  border: 1px solid rgba(244,239,230,.12);
  border-radius: 24px;
  background: radial-gradient(circle at 50% 18%, rgba(199,53,40,.17), transparent 14rem), #070808;
  cursor: grab;
  perspective: 900px;
  touch-action: pan-y;
}
.rb-circular-gallery:active { cursor: grabbing; }
.rb-circular-gallery figure {
  position: absolute;
  left: 50%;
  top: 48%;
  width: clamp(86px, 33%, 168px);
  margin: 0;
  transform: translate3d(-50%, -50%, 0) translateX(var(--x, 0)) translateY(var(--arc, 0)) rotateZ(var(--rz, 0deg)) scale(var(--s, 1));
  opacity: var(--o, 1);
  transition: opacity 180ms ease;
  will-change: transform, opacity;
}
.rb-circular-gallery img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 13px;
  box-shadow: 0 18px 42px rgba(0,0,0,.30);
}
.rb-circular-gallery figcaption {
  margin-top: 9px;
  color: var(--chalk);
  font-family: var(--font-mono);
  font-size: 10px;
  text-align: center;
}

.tilted-card-specimen {
  background: linear-gradient(135deg, rgba(251,247,239,.96), rgba(232,223,209,.66));
}
.rb-tilted-card {
  --rx: 0deg;
  --ry: 0deg;
  --scale: 1;
  --cx: 50%;
  --cy: 50%;
  position: relative;
  width: min(80%, 260px);
  height: min(80%, 260px);
  display: grid;
  place-items: center;
  margin: 0;
  perspective: 800px;
}
.rb-tilted-card__inner {
  position: relative;
  width: min(100%, 220px);
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 18px;
  transform: rotateX(var(--rx)) rotateY(var(--ry)) scale(var(--scale));
  transform-style: preserve-3d;
  transition: transform 260ms cubic-bezier(.16,1,.3,1);
  box-shadow: 0 24px 55px rgba(61,49,38,.22);
}
.rb-tilted-card__inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.rb-tilted-card__inner span {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 2;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(244,239,230,.86);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 820;
  transform: translateZ(34px);
}
.rb-tilted-card figcaption {
  position: absolute;
  left: var(--cx);
  top: var(--cy);
  z-index: 5;
  padding: 5px 9px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--paper-soft);
  font-family: var(--font-mono);
  font-size: 10px;
  opacity: 0;
  pointer-events: none;
  transform: translate3d(12px, 12px, 0) rotate(-4deg);
  transition: opacity 160ms ease;
}

.card-preview .dot-field-container,
.card-preview .dither-container,
.card-preview .particles-container { width: min(100%, 272px); min-height: 180px; border-radius: 18px; }
.card-preview .rb-carousel { width: min(100%, 272px); min-height: 180px; padding: 12px 12px 28px; border-radius: 18px; }
.card-preview .rb-carousel-track { min-height: 136px; gap: 12px; }
.card-preview .rb-carousel-item { min-height: 136px; padding: 14px; flex-basis: calc(100% - 24px); }
.card-preview .rb-carousel-item h4 { font-size: 18px; }
.card-preview .rb-carousel-item p { font-size: 9px; }
.card-preview .rb-carousel-item span { width: 26px; height: 26px; }
.card-preview .decrypted-text { font-size: clamp(15px, 2.8vw, 28px); }
.card-preview .bubble-menu-demo { width: min(100%, 272px); min-height: 180px; }
.card-preview .bubble-menu-demo .bubble { top: 10px; height: 38px; min-width: 38px; }
.card-preview .bubble-pill-list { inset: 66px 8px 8px; gap: 4px; }
.card-preview .bubble-pill-list a,
.bubble-pill-list .bubble-pill-static { min-height: 40px; font-size: 15px; }
.card-preview .rb-circular-gallery { width: min(100%, 300px); min-height: 184px; border-radius: 18px; }
.card-preview .rb-tilted-card { width: min(86%, 190px); height: 190px; }
.card-preview .rb-tilted-card__inner { width: 150px; border-radius: 14px; }

html[data-grid-density="dense"] .card-preview .dot-field-container,
html[data-grid-density="dense"] .card-preview .dither-container,
html[data-grid-density="dense"] .card-preview .particles-container,
html[data-grid-density="dense"] .card-preview .rb-carousel,
html[data-grid-density="dense"] .card-preview .rb-circular-gallery,
html[data-grid-density="dense"] .card-preview .bubble-menu-demo,
html[data-grid-density="dense"] .card-preview .rb-tilted-card {
  transform: scale(.78);
  transform-origin: center;
}
html[data-grid-density="micro"] .card-preview .dot-field-container,
html[data-grid-density="micro"] .card-preview .dither-container,
html[data-grid-density="micro"] .card-preview .particles-container {
  width: calc(100% - 6px);
  min-height: 52px;
  border-radius: 10px;
}
html[data-grid-density="micro"] .card-preview .rb-carousel,
html[data-grid-density="micro"] .card-preview .rb-circular-gallery,
html[data-grid-density="micro"] .card-preview .bubble-menu-demo,
html[data-grid-density="micro"] .card-preview .rb-tilted-card {
  width: calc(100% - 6px);
  min-height: 52px;
  height: 52px;
  transform: none;
  border-radius: 10px;
}
html[data-grid-density="micro"] .card-preview .rb-carousel { padding: 4px; }
html[data-grid-density="micro"] .card-preview .rb-carousel-track,
html[data-grid-density="micro"] .card-preview .rb-carousel-item { min-height: 40px; }
html[data-grid-density="micro"] .card-preview .rb-carousel-item { padding: 5px; border-radius: 7px; }
html[data-grid-density="micro"] .card-preview .rb-carousel-item h4,
html[data-grid-density="micro"] .card-preview .rb-carousel-item p,
html[data-grid-density="micro"] .card-preview .rb-carousel-dots,
html[data-grid-density="micro"] .card-preview .rb-circular-gallery figcaption,
html[data-grid-density="micro"] .card-preview .rb-tilted-card figcaption { display: none; }
html[data-grid-density="micro"] .card-preview .rb-carousel-item span { width: 14px; height: 14px; font-size: 7px; }
html[data-grid-density="micro"] .card-preview .decrypted-text { font-size: 7px; }
html[data-grid-density="micro"] .card-preview .bubble-menu-demo .bubble { top: 4px; height: 18px; min-width: 18px; font-size: 6px; }
html[data-grid-density="micro"] .card-preview .bubble-pill-list { inset: 28px 4px 4px; gap: 2px; }
html[data-grid-density="micro"] .card-preview .bubble-pill-list a,
.bubble-pill-list .bubble-pill-static { min-height: 12px; font-size: 5px; }
html[data-grid-density="micro"] .card-preview .rb-circular-gallery figure { width: 34px; }
html[data-grid-density="micro"] .card-preview .rb-tilted-card__inner { width: 42px; border-radius: 6px; }
html[data-grid-density="micro"] .card-preview .rb-tilted-card__inner span { display: none; }

@media (max-width: 520px) {
  .bubble-pill-list { grid-template-columns: 1fr; }
  .bubble-pill-list a,
.bubble-pill-list .bubble-pill-static { min-height: 42px; transform: scale(.08) translateY(12px); }
  .bubble-menu-demo.is-open .bubble-pill-list a,
.bubble-pill-list .bubble-pill-static { transform: scale(1); }
  .rb-carousel { width: min(100%, 310px); }
  .rb-circular-gallery figure { width: clamp(76px, 35%, 132px); }
}
@media (prefers-reduced-motion: reduce) {
  .rb-carousel-track,
  .rb-carousel-item,
  .bubble-pill-list a,
  .rb-tilted-card__inner { transition: none; }
}


/* React Bits visual QA polish */
.card-preview .dither-container {
  width: min(100%, 248px);
  min-height: 166px;
  transform: scale(.94);
  transform-origin: center;
  box-shadow: inset 0 0 0 10px rgba(9,10,11,.18), 0 12px 28px rgba(0,0,0,.10);
}
.card-preview .rb-tilted-card {
  width: min(88%, 224px);
  height: 214px;
}
.card-preview .rb-tilted-card__inner {
  width: 176px;
}
html[data-grid-density="micro"] .card-preview .dither-container,
html[data-grid-density="micro"] .card-preview .rb-tilted-card,
html[data-grid-density="micro"] .card-preview .rb-tilted-card__inner {
  transform: none;
}
