/* ─── BUTTONS ──────────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #000;
  font-weight: 700;
  font-size: 15px;
  padding: 14px 28px;
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.2s;
  box-shadow: 0 0 40px rgba(var(--accent-rgb), 0.2);
}

.btn-primary:hover {
  background: var(--accent-dim);
  transform: translateY(-1px);
  box-shadow: 0 4px 48px rgba(var(--accent-rgb), 0.3);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface2);
  color: var(--text);
  font-weight: 600;
  font-size: 15px;
  padding: 14px 28px;
  border-radius: 10px;
  text-decoration: none;
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: var(--surface);
  border-color: rgba(255,255,255,0.14);
  transform: translateY(-1px);
}

/* ─── HERO IDENTITY (product pages) ───────────────────────────────── */
.hero {
  padding-top: 120px;
  padding-bottom: 56px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 60px; left: 50%;
  transform: translateX(-50%);
  width: 800px; height: 400px;
  background: radial-gradient(ellipse at center, rgba(var(--accent-rgb), 0.07) 0%, transparent 70%);
  pointer-events: none;
}

.hero-identity {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin-bottom: 48px;
  position: relative;
}

.hero-icon-wrap { position: relative; }

.hero-icon-glow {
  position: absolute;
  inset: -20px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(var(--accent-rgb), 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.hero-icon {
  width: 120px;
  height: 120px;
  border-radius: 28px;
  box-shadow: 0 12px 56px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.08);
  display: block;
  position: relative;
}

.hero-name {
  font-size: 48px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  background: linear-gradient(135deg, #ffffff 40%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-byline {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--subtle);
  margin-top: 8px;
}

/* ─── SPLIT LAYOUT ─────────────────────────────────────────────────── */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.split.reverse { direction: rtl; }
.split.reverse > * { direction: ltr; }

@media (max-width: 860px) {
  .split, .split.reverse { grid-template-columns: 1fr; direction: ltr; }
  .split.reverse > * { direction: ltr; }
}

.split-text h2 { font-size: clamp(28px, 3.5vw, 40px); margin-bottom: 16px; }

.split-text p {
  font-size: 16px;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 16px;
}

.split-text ul {
  list-style: none;
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.split-text li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 15px;
  color: var(--muted);
}

.split-text li::before {
  content: '✓';
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
  margin-top: 2px;
  flex-shrink: 0;
}

/* ─── CARD SECTION (contained card) ───────────────────────────────── */
.card-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px 80px;
}

.card-inner {
  background: linear-gradient(135deg, var(--surface) 0%, rgba(20,20,31,0.6) 100%);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 72px;
  position: relative;
  overflow: hidden;
}

.card-inner::before {
  content: '';
  position: absolute;
  top: -100px; right: -100px;
  width: 500px; height: 500px;
  background: radial-gradient(ellipse, rgba(var(--accent-rgb), 0.04) 0%, transparent 70%);
  pointer-events: none;
}

.card-inner .split-text h2 { font-size: clamp(28px, 3.5vw, 40px); }

/* ─── TOOL CARDS ───────────────────────────────────────────────────── */
.tool-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 700px) {
  .tool-cards { grid-template-columns: 1fr; }
}

.tool-card {
  background: linear-gradient(160deg, rgba(var(--accent-rgb), 0.04) 0%, var(--surface) 55%);
  border: 1px solid var(--border);
  border-top-color: rgba(var(--accent-rgb), 0.2);
  border-radius: 14px;
  padding: 24px;
}

.tool-card-name {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.tool-card p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

/* ─── COLORSPACE PILLS ─────────────────────────────────────────────── */
.colorspace-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 32px;
}

.colorspace-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 18px;
}

.colorspace-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.colorspace-pill span {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  font-family: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', monospace;
}

/* ─── PARAM TABLE ──────────────────────────────────────────────────── */
.param-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 8px;
}

.param-group-header {
  padding: 9px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: rgba(var(--accent-rgb), 0.04);
}

.param-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}

.param-row:last-child { border-bottom: none; }

.param-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  font-family: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', monospace;
  flex-shrink: 0;
}

.param-desc {
  font-size: 13px;
  color: var(--muted);
  text-align: right;
  line-height: 1.5;
}

/* ─── CONTROLS LAYOUT ──────────────────────────────────────────────── */
.controls-layout {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 48px;
  align-items: start;
  margin-top: 40px;
}

.controls-aside { position: sticky; top: 84px; }

.controls-aside p {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 24px;
}

.controls-aside img {
  display: block;
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #000;
}

@media (max-width: 860px) {
  .controls-layout { grid-template-columns: 1fr; }
  .controls-aside  { position: static; }
}

/* ─── SCREENSHOT FRAME ─────────────────────────────────────────────── */
.screenshot-frame {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #000;
  box-shadow: 0 32px 100px rgba(0,0,0,0.7), 0 0 60px rgba(var(--accent-rgb), 0.04);
}

.screenshot-frame img { display: block; width: 100%; height: auto; }

.screenshot-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 700px) {
  .screenshot-pair { grid-template-columns: 1fr; }
}

/* ─── FROM RETROGRADE LABS ─────────────────────────────────────────── */
.from-rl {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px 80px;
}

.from-rl-inner {
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px;
  background: var(--surface);
}

.from-rl-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.from-rl-header img { height: 28px; width: auto; }

.from-rl-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--subtle);
}

.from-rl-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

@media (max-width: 800px) {
  .from-rl-cards { grid-template-columns: 1fr; }
}

.from-rl-card {
  display: block;
  text-decoration: none;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-top: 2px solid rgba(var(--card-accent-rgb, var(--accent-rgb)), 0.3);
  border-radius: 14px;
  padding: 24px;
  transition: border-color 0.2s;
}

.from-rl-card:hover { border-color: rgba(255,255,255,0.15); }

.from-rl-card-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  margin-bottom: 16px;
  overflow: hidden;
}

.from-rl-card-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

.from-rl-card-icon-emoji {
  width: 48px; height: 48px;
  border-radius: 12px;
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.from-rl-card h3 {
  font-size: 15px;
  font-weight: 650;
  margin-bottom: 6px;
  color: var(--card-accent-color, var(--text));
}

.from-rl-card p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 16px;
}

.from-rl-card-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--subtle);
  display: flex;
  align-items: center;
  gap: 4px;
}

.from-rl-card:hover .from-rl-card-link { color: var(--muted); }

/* ─── MOBILE ───────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .card-section  { padding-left: 16px; padding-right: 16px; }
  .card-inner    { padding: 32px 20px; }
  .from-rl       { padding-left: 16px; padding-right: 16px; }
  .from-rl-inner { padding: 28px 20px; }
  .hero { padding-left: 20px; padding-right: 20px; }
  .hero-name { font-size: 36px; }
}

/* ─── CART FAB ──────────────────────────────────────────────────────── */
.cart-fab {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--accent);
  color: #000;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 100px;
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(var(--accent-rgb), 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  font-family: inherit;
}
.cart-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(var(--accent-rgb), 0.5);
}
.cart-fab-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.cart-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  background: #000;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  border-radius: 100px;
  line-height: 1;
}

/* ─── CART OVERLAY & DRAWER ─────────────────────────────────────────── */
.cart-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.cart-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}
.cart-drawer {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: 360px;
  max-width: 100vw;
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s ease;
}
.cart-overlay.is-open .cart-drawer {
  transform: translateX(0);
}

/* ─── CART HEADER ───────────────────────────────────────────────────── */
.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.cart-header h2 {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  color: var(--text);
  letter-spacing: -0.01em;
}
.cart-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 6px;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  font-family: inherit;
}
.cart-close:hover {
  background: var(--surface2);
  color: var(--text);
}

/* ─── CART ITEMS ────────────────────────────────────────────────────── */
.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}
.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  transition: background 0.15s;
}
.cart-item:hover {
  background: var(--surface2);
}
.cart-item-icon {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 8px;
}
.cart-item-info {
  flex: 1;
  min-width: 0;
}
.cart-item-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.cart-item-price {
  font-size: 13px;
  color: var(--muted);
}
.cart-item-remove {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 6px;
  color: var(--subtle);
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
  font-family: inherit;
}
.cart-item-remove:hover {
  background: var(--surface2);
  color: var(--text);
}

/* ─── CART EMPTY STATE ──────────────────────────────────────────────── */
.cart-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--subtle);
  font-size: 14px;
  padding: 40px 24px;
}

/* ─── CART FOOTER ───────────────────────────────────────────────────── */
.cart-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
}
.cart-checkout-btn {
  width: 100%;
  justify-content: center;
}

/* ─── PURCHASE SECTION ──────────────────────────────────────────────── */
.purchase-section {
  padding: 0 40px 48px;
  max-width: 1200px;
  margin: 0 auto;
}
.purchase-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 2px solid var(--accent);
  border-radius: 12px;
}
.purchase-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.purchase-amount {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}
.purchase-type {
  font-size: 13px;
  color: var(--muted);
}
.purchase-inner .btn-primary {
  margin-left: auto;
}

@media (max-width: 640px) {
  .purchase-section { padding-left: 16px; padding-right: 16px; }
  .purchase-inner { padding: 20px; flex-wrap: wrap; }
  .purchase-inner .btn-primary { margin-left: 0; width: 100%; justify-content: center; }
  .cart-drawer { width: 100vw; }
}
