/* Desktop Studio Early Access card (homepage). Uses the site's theme tokens. */
.ea {
  --ea-r-lg: 22px;
  --ea-r-md: 14px;
  --ea-r-sm: 10px;
  position: relative;
  margin: 0 0 56px;
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: var(--ea-r-lg);
  background:
    radial-gradient(900px 260px at 85% -10%, var(--badge-bg), transparent 70%),
    var(--surface);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  animation: ea-rise .6s cubic-bezier(.2, .7, .2, 1) both;
}
@keyframes ea-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.ea-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 24px; }
.ea-head-copy { max-width: 640px; }
.ea-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px; margin-bottom: 12px;
  border: 1px solid var(--badge-border); border-radius: 999px;
  background: var(--badge-bg); color: var(--badge-color);
  font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
}
.ea h2 { margin: 0 0 8px; font-size: clamp(26px, 3.4vw, 36px); line-height: 1.15; letter-spacing: -.02em; }
.ea-head p { margin: 0; color: var(--text-dim); font-size: 15.5px; line-height: 1.6; }

.ea-cta {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 20px; border-radius: 12px;
  background: var(--btn-bg); color: var(--btn-text); border: 1px solid var(--btn-border);
  box-shadow: var(--btn-glow); text-shadow: var(--btn-text-shadow);
  font-weight: 600; font-size: 14.5px; text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}
.ea-cta svg { transition: transform .2s ease; }
.ea-cta:hover { transform: translateY(-2px); filter: brightness(1.08); }
.ea-cta:hover svg { transform: translateX(4px); }
.ea-cta:focus-visible, .ea-item:focus-visible, .ea-chip:focus-visible, .ea-arrow:focus-visible, .ea-dialog-close:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px;
}

/* Preview stage (two stacked images cross-fade) */
.ea-stage {
  position: relative; aspect-ratio: 2559 / 1390;
  border: 1px solid var(--border); border-radius: var(--ea-r-md);
  background: var(--bg-soft); overflow: hidden;
  box-shadow: 0 18px 40px -22px rgba(0, 0, 0, .55);
}
.ea-stage-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.015); transition: opacity .45s ease, transform .6s cubic-bezier(.2, .7, .2, 1); }
.ea-stage-img.is-current { opacity: 1; transform: none; }

.ea-caption { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin: 16px 2px 0; min-height: 52px; }
.ea-caption-kind { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--badge-color); }
.ea-caption strong { font-size: 17px; text-transform: lowercase; }
.ea-caption p { flex-basis: 100%; margin: 0; color: var(--text-dim); font-size: 14.5px; line-height: 1.6; max-width: 820px; }
.ea-caption.is-swapping > * { animation: ea-fade .35s ease both; }
@keyframes ea-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Single scrolling row */
.ea-row-bar { display: flex; align-items: center; justify-content: space-between; margin: 22px 2px 10px; }
.ea-row-label { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-mute); }
.ea-arrows { display: flex; gap: 8px; }
.ea-arrow {
  width: 36px; height: 36px; display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: 11px; background: var(--surface-hover, var(--surface)); color: var(--text); cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, opacity .18s ease;
}
.ea-arrow:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--accent); }
.ea-arrow:active:not(:disabled) { transform: scale(.94); }
.ea-arrow:disabled { opacity: .35; cursor: default; }

.ea-track {
  display: flex; align-items: stretch; gap: 14px;
  overflow-x: auto; padding: 6px 4px 14px; margin: 0 -4px;
  scroll-snap-type: x proximity; scroll-behavior: smooth;
}
/* Themed, rounded scrollbars (row + dialog body) */
/* Firefox and others: standard properties. Chromium/Safari: the pseudo-elements below
   (scrollbar-color would override them, so it is only applied where they are unsupported). */
@supports not selector(::-webkit-scrollbar) {
  .ea-track, .ea-dialog-body { scrollbar-width: thin; scrollbar-color: var(--border-hover) transparent; }
}
.ea-track::-webkit-scrollbar { height: 8px; }
.ea-dialog-body::-webkit-scrollbar { width: 8px; }
.ea-track::-webkit-scrollbar-track, .ea-dialog-body::-webkit-scrollbar-track { background: var(--border-soft); border-radius: 999px; margin: 0 4px; }
.ea-track::-webkit-scrollbar-thumb, .ea-dialog-body::-webkit-scrollbar-thumb {
  background: var(--border-hover); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box;
  transition: background .2s ease;
}
.ea-track::-webkit-scrollbar-thumb:hover, .ea-dialog-body::-webkit-scrollbar-thumb:hover,
.ea-track::-webkit-scrollbar-thumb:active, .ea-dialog-body::-webkit-scrollbar-thumb:active { background: var(--accent); background-clip: padding-box; }
.ea-track::-webkit-scrollbar-button, .ea-dialog-body::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
.ea-track::-webkit-scrollbar-corner { background: transparent; }

.ea-item {
  flex: 0 0 clamp(180px, 22vw, 232px); scroll-snap-align: start;
  display: flex; flex-direction: column; gap: 10px; padding: 8px 8px 12px;
  border: 1px solid var(--border); border-radius: var(--ea-r-md); background: var(--bg-soft); color: var(--text);
  text-align: left; cursor: pointer; font: inherit;
  transition: transform .22s cubic-bezier(.2, .7, .2, 1), border-color .2s ease, box-shadow .2s ease;
}
.ea-item img { display: block; width: 100%; aspect-ratio: 2559 / 1390; object-fit: cover; border-radius: var(--ea-r-sm); background: var(--surface); }
.ea-item:hover { transform: translateY(-4px); border-color: var(--border-hover); box-shadow: var(--shadow-soft); }
.ea-item.is-selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent), var(--shadow-glow); transform: translateY(-2px); }
.ea-item-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 0 4px; }
.ea-item-name { font-weight: 600; font-size: 14px; text-transform: lowercase; }
.ea-item-kind { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-mute); }
.ea-divider { flex: 0 0 1px; align-self: stretch; margin: 6px 4px; background: var(--border); }

/* Module chips */
.ea-modules { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 18px; margin: 8px 2px 0; padding-top: 18px; border-top: 1px solid var(--border-soft); }
.ea-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.ea-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--bg-soft); color: var(--text);
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.ea-chip:hover { transform: translateY(-2px); border-color: var(--accent); background: var(--badge-bg); }

/* Dialog */
.ea-dialog { padding: 0; border: 0; background: transparent; max-width: min(980px, calc(100vw - 32px)); width: 100%; max-height: calc(100vh - 32px); color: var(--text); overflow: visible; }
.ea-dialog::backdrop { background: rgba(5, 6, 10, 0); backdrop-filter: blur(0); transition: background .28s ease, backdrop-filter .28s ease; }
.ea-dialog.is-in::backdrop { background: rgba(5, 6, 10, .66); backdrop-filter: blur(6px); }
.ea-dialog-card {
  position: relative; display: flex; flex-direction: column; overflow: hidden; max-height: calc(100vh - 32px);
  border: 1px solid var(--border); border-radius: var(--ea-r-lg); background: var(--surface);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .7);
  opacity: 0; transform: translateY(18px) scale(.96); transition: opacity .28s ease, transform .34s cubic-bezier(.2, .8, .2, 1);
}
.ea-dialog.is-in .ea-dialog-card { opacity: 1; transform: none; }
.ea-dialog-shot { background: var(--bg-soft); border-bottom: 1px solid var(--border); }
.ea-dialog-shot img { display: block; width: 100%; height: auto; max-height: 52vh; object-fit: cover; object-position: top; }
.ea-dialog-body { padding: 22px 28px 26px; overflow: auto; }
.ea-dialog-tag { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--badge-color); }
.ea-dialog-body h3 { margin: 6px 0 8px; font-size: 24px; letter-spacing: -.01em; }
.ea-dialog-body p { margin: 0 0 12px; color: var(--text-dim); line-height: 1.65; }
.ea-dialog-body ul { margin: 0 0 14px; padding-left: 20px; color: var(--text); line-height: 1.8; }
.ea-dialog-body li::marker { color: var(--accent); }
.ea-dialog-note { font-size: 13px; color: var(--text-mute) !important; margin: 0 !important; }
.ea-dialog-close {
  position: absolute; top: 14px; right: 14px; z-index: 2; width: 38px; height: 38px; display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); cursor: pointer;
  transition: transform .2s ease, border-color .2s ease;
}
.ea-dialog-close:hover { transform: rotate(90deg); border-color: var(--accent); }

@media (max-width: 640px) {
  .ea { padding: 20px 16px; border-radius: 18px; }
  .ea-item { flex-basis: 70vw; }
  .ea-dialog-body { padding: 18px 18px 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .ea, .ea-stage-img, .ea-item, .ea-chip, .ea-cta, .ea-cta svg, .ea-arrow, .ea-dialog-card, .ea-dialog::backdrop, .ea-dialog-close, .ea-caption.is-swapping > * { animation: none !important; transition: none !important; }
  .ea-track { scroll-behavior: auto; }
}

/* Compact desktop layout: preview on the left, description + modules on the right,
   so the card no longer fills the whole screen. */
@media (min-width: 900px) {
  .ea { padding: 26px 28px 22px; margin-bottom: 48px; display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); grid-template-areas: "head head" "stage caption" "stage modules" "bar bar" "track track"; column-gap: 28px; align-items: start; }
  .ea-head { grid-area: head; margin-bottom: 18px; }
  .ea-head p { font-size: 15px; }
  .ea h2 { font-size: clamp(24px, 2.6vw, 32px); }
  .ea-stage { grid-area: stage; }
  .ea-caption { grid-area: caption; margin: 0; align-self: start; min-height: 0; flex-direction: column; align-items: flex-start; gap: 6px; }
  .ea-caption strong { font-size: 22px; }
  .ea-modules { grid-area: modules; margin: 8px 0 0; align-self: end; flex-direction: column; align-items: flex-start; }
  .ea-row-bar { grid-area: bar; margin-top: 20px; }
  .ea-track { grid-area: track; width: calc(100% + 8px); }
  .ea-item { flex-basis: clamp(150px, 15vw, 186px); }
}

/* Early access end date */
.ea-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-bottom: 12px; }
.ea-badges .ea-badge { margin-bottom: 0; }
.ea-deadline {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px;
  border: 1px solid color-mix(in srgb, var(--accent-warm) 45%, transparent); border-radius: 999px;
  background: color-mix(in srgb, var(--accent-warm) 14%, transparent); color: var(--accent-warm);
  font-size: 12.5px; font-weight: 600;
}
.ea-deadline-left { padding-left: 8px; border-left: 1px solid color-mix(in srgb, var(--accent-warm) 40%, transparent); font-weight: 700; }
.ea-deadline-left:empty { display: none; }
.ea-deadline.is-urgent { animation: ea-pulse 2s ease-in-out infinite; }
.ea-deadline.is-ended { filter: grayscale(1); opacity: .75; }
@keyframes ea-pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent-warm) 40%, transparent); } 50% { box-shadow: 0 0 0 6px transparent; } }
@media (prefers-reduced-motion: reduce) { .ea-deadline.is-urgent { animation: none !important; } }

/* Per-style / per-theme accent, used by the name label and the selected ring */
.ea-item[data-name="classic"],   .ea[data-pick="classic"]   { --hue: #4f8fe8; }
.ea-item[data-name="modern"],    .ea[data-pick="modern"]    { --hue: #22d3ee; }
.ea-item[data-name="robotics"],  .ea[data-pick="robotics"]  { --hue: #a3e635; }
.ea-item[data-name="amethyst"],  .ea[data-pick="amethyst"]  { --hue: #a78bfa; }
.ea-item[data-name="crimson"],   .ea[data-pick="crimson"]   { --hue: #f43f5e; }
.ea-item[data-name="gold"],      .ea[data-pick="gold"]      { --hue: #fbbf24; }
.ea-item[data-name="graphite"],  .ea[data-pick="graphite"]  { --hue: #7ea6c9; }
.ea-item[data-name="monokai"],   .ea[data-pick="monokai"]   { --hue: #b6e354; }
.ea-item[data-name="ocean"],     .ea[data-pick="ocean"]     { --hue: #38bdf8; }

.ea-caption strong {
  --hue: var(--accent);
  display: inline-block; padding: 3px 14px 4px; border-radius: 999px;
  color: var(--hue); border: 1.5px solid var(--hue);
  background: color-mix(in srgb, var(--hue) 14%, transparent);
  box-shadow: 0 0 18px -6px var(--hue);
  transition: color .3s ease, border-color .3s ease, background .3s ease, box-shadow .3s ease;
}
.ea[data-pick] .ea-caption strong { --hue: inherit; }
.ea .ea-caption-kind { color: var(--text-mute); }
.ea-item.is-selected { border-color: var(--hue, var(--accent)); box-shadow: 0 0 0 2px var(--hue, var(--accent)), 0 8px 24px -8px var(--hue, var(--accent)); }
