:root {
  --page-bg: #eceff4;
  --card-bg: #ffffff;
  --ink: #0f1419;
  --muted: #5a6578;
  --subtle: #8b95a8;
  --vital: #1bc7a1;
  --vital-dark: #0d8f74;
  --site-dark: #080a0f;
  --site-surface: #151a24;
  --hairline: rgba(15, 20, 25, 0.1);
  --radius: 16px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --font: 'Inter', system-ui, sans-serif;
  --display: 'Outfit', var(--font);
  --mono: 'IBM Plex Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--page-bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

button { font-family: inherit; cursor: pointer; }

.app {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 20px 140px;
}

/* Header */
.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 28px;
}

.back {
  font-size: 14px;
  color: var(--muted);
  font-weight: 500;
}

.back:hover { color: var(--vital-dark); }

.topbar-links {
  display: flex;
  gap: 8px;
}

.topbar-links a {
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--card-bg);
  border: 1px solid var(--hairline);
  color: var(--muted);
  transition: border-color 0.2s, color 0.2s;
}

.topbar-links a:hover {
  border-color: var(--vital);
  color: var(--vital-dark);
}

.studio-header .tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--vital-dark);
  margin-bottom: 10px;
}

.studio-header h1 {
  font-family: var(--display);
  font-size: clamp(1.75rem, 4.5vw, 2.35rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-bottom: 10px;
  max-width: 18ch;
}

.studio-header .lead {
  color: var(--muted);
  font-size: 15px;
  max-width: 58ch;
  line-height: 1.65;
}

/* Controls */
.studio-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 28px;
  align-items: flex-end;
  margin: 28px 0 24px;
  padding: 20px 22px;
  background: var(--card-bg);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.control-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--subtle);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: var(--page-bg);
  color: var(--muted);
  transition: all 0.2s var(--ease);
}

.chip:hover {
  border-color: rgba(27, 199, 161, 0.4);
  color: var(--ink);
}

.chip.active {
  background: var(--site-dark);
  border-color: var(--site-dark);
  color: #fff;
}

.chips-context .chip.active {
  background: var(--vital);
  border-color: var(--vital);
  color: #041210;
}

.control-size {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.control-size input[type='range'] {
  width: 140px;
  accent-color: var(--vital);
}

.size-val {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  min-width: 3ch;
}

/* Spotlight */
.spotlight {
  margin-bottom: 24px;
  background: var(--card-bg);
  border: 2px solid var(--vital);
  border-radius: calc(var(--radius) + 4px);
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(27, 199, 161, 0.12);
  animation: spotlight-in 0.4s var(--ease);
}

@keyframes spotlight-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.spotlight-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  min-height: 280px;
}

.spotlight-preview,
.spotlight-stage {
  display: grid;
  place-items: center;
  padding: 40px 24px;
  min-height: 280px;
}

.spotlight-meta {
  padding: 32px 28px;
  border-left: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.spotlight-num {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--vital-dark);
  margin-bottom: 6px;
}

.spotlight-meta h2 {
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}

.spotlight-meta p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.55;
}

.spotlight-use {
  margin-top: 10px !important;
  font-size: 13px !important;
  color: var(--vital-dark) !important;
  font-weight: 500;
}

.spotlight-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.btn {
  font-size: 13px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: all 0.2s var(--ease);
}

.btn-primary {
  background: var(--vital);
  color: #041210;
  border-color: var(--vital);
}

.btn-primary:hover { filter: brightness(1.05); }

.btn-ghost {
  background: transparent;
  border-color: var(--hairline);
  color: var(--muted);
}

.btn-ghost:hover {
  border-color: var(--vital);
  color: var(--vital-dark);
}

.btn-sm { font-size: 12px; padding: 8px 14px; }

.context-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1px;
  background: var(--hairline);
  border-top: 1px solid var(--hairline);
}

.strip-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 8px 14px;
  background: var(--card-bg);
  border: none;
  color: var(--subtle);
  font-size: 10px;
  font-family: var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background 0.2s;
}

.strip-item:hover { background: var(--page-bg); }

.strip-item.active {
  background: rgba(27, 199, 161, 0.08);
  color: var(--vital-dark);
  box-shadow: inset 0 -2px 0 var(--vital);
}

.strip-stage {
  width: 100%;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  overflow: hidden;
}

/* Compare */
.compare-dock {
  margin-bottom: 24px;
  padding: 20px 22px;
  background: var(--card-bg);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
}

.compare-title {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--subtle);
  margin-bottom: 14px;
}

.compare-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 14px;
}

.compare-cell p {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
}

.compare-stage {
  min-height: 140px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  padding: 24px;
}

/* Grid */
.grid-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--subtle);
  margin-bottom: 14px;
}

.logo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.logo-card {
  background: var(--card-bg);
  border: 2px solid transparent;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease), transform 0.25s var(--ease);
  box-shadow: 0 1px 3px rgba(15, 20, 25, 0.06);
}

.logo-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(15, 20, 25, 0.08);
}

.logo-card:focus-visible {
  outline: 2px solid var(--vital);
  outline-offset: 2px;
}

.logo-card.is-pick {
  border-color: var(--vital);
  box-shadow: 0 0 0 1px var(--vital), 0 12px 40px rgba(27, 199, 161, 0.15);
}

.logo-card.is-compare {
  border-color: rgba(27, 199, 161, 0.5);
}

.logo-card.is-star::before {
  content: '★';
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  font-size: 14px;
  color: var(--vital);
}

.logo-card { position: relative; }

.card-stage {
  min-height: 148px;
  display: grid;
  place-items: center;
  padding: 28px 16px;
}

.card-info {
  padding: 14px 16px 16px;
  border-top: 1px solid var(--hairline);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.card-num {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--vital-dark);
  font-weight: 500;
}

.card-tags {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--subtle);
}

.card-info h3 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.card-info p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

/* Context backgrounds */
.bg-site { background: var(--site-dark); }
.bg-white { background: #ffffff; }
.bg-nav { background: var(--site-surface); padding: 20px; }
.bg-app { background: linear-gradient(160deg, #1a2030, #0c0f16); }
.bg-social { background: radial-gradient(circle at 30% 20%, #2a3548, #0a0d12); }
.bg-email { background: #f4f6f9; }

.logo-render {
  transform-origin: center center;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Nav mock */
.nav-mock {
  width: 100%;
  max-width: 220px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(8, 10, 15, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-mock.compact { max-width: 200px; }

.nav-mock .logo-slot {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.nav-mock .cta-fake {
  font-size: 9px;
  font-weight: 600;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--vital);
  color: #041210;
  white-space: nowrap;
}

.capsule-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* App / social / email frames */
.app-frame {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: linear-gradient(160deg, #1a2030, #0c0f16);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: grid;
  place-items: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.social-frame {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1bc7a1, #0d8f74);
  display: grid;
  place-items: center;
  box-shadow: 0 4px 16px rgba(27, 199, 161, 0.35);
}

.social-frame .squircle,
.social-frame .mark-ring,
.social-frame .mark-circle {
  transform: scale(0.85);
}

.email-frame {
  width: 100%;
  max-width: 240px;
  padding: 14px 16px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

/* Logo building blocks */
.logo-row {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.stack-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.squircle {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 13px;
  background: linear-gradient(160deg, #1a2030, #0c0f16);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.squircle .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--vital);
  position: relative;
  z-index: 1;
}

.squircle.lg { width: 56px; height: 56px; border-radius: 15px; }
.squircle.lg .dot { width: 14px; height: 14px; }
.squircle.sm { width: 28px; height: 28px; border-radius: 8px; }
.squircle.sm .dot { width: 7px; height: 7px; }

.squircle.pulse-ring .ring {
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  border: 1.5px solid var(--vital);
  opacity: 0.5;
  animation: ring-pulse 2.4s ease-in-out infinite;
}

@keyframes ring-pulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.08); opacity: 0.2; }
}

.word {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.055em;
  line-height: 1;
  font-size: 1.75rem;
}

.word.on-dark {
  background: linear-gradient(165deg, #fff 0%, #b8f5e8 50%, var(--vital) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.word.on-dark-flat { color: #e8edf5; }
.word.on-dark-flat .a { color: var(--vital); }
.word.on-light { color: #0a0d12; }
.word.on-light .a { color: var(--vital-dark); }

.word.mono-up,
.mono-up {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 500;
  color: #e8edf5;
}

.bg-white .word.mono-up,
.bg-email .word.mono-up { color: #0a0d12; }

.a-only {
  font-family: var(--display);
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--vital);
}

.mark-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--vital);
}

.mark-circle.sm { width: 24px; height: 24px; }

.mark-ring {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--vital);
  display: grid;
  place-items: center;
}

.mark-ring .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--vital);
}

.mark-v svg { width: 40px; height: 40px; display: block; }

.mark-pulse { width: 72px; height: auto; display: block; }

.mark-shield svg { width: 36px; height: auto; display: block; }

.mark-arrow svg { width: 48px; height: auto; display: block; }

.mark-capsule .pill {
  display: block;
  width: 36px;
  height: 16px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--vital), var(--vital-dark));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.mark-prism {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  transform: rotate(45deg);
  flex-shrink: 0;
}

.mark-nexus svg { width: 48px; height: auto; display: block; }

.mark-invite {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 10px;
  border-radius: 999px;
  background: rgba(27, 199, 161, 0.12);
  border: 1px solid rgba(27, 199, 161, 0.35);
}

.mark-invite .pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--vital);
}

.mark-invite .invite-txt {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--vital);
  font-weight: 500;
}

.bg-white .mark-invite,
.bg-email .mark-invite {
  background: rgba(27, 199, 161, 0.08);
}

.bg-white .mark-invite .invite-txt,
.bg-email .mark-invite .invite-txt { color: var(--vital-dark); }

.mark-line {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.mark-line .rule {
  width: 28px;
  height: 2px;
  background: var(--vital);
  border-radius: 1px;
}

.mark-line .rule.dark { background: var(--vital-dark); }

/* Bottom bar */
.bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
  background: #fff;
  border-top: 1px solid var(--hairline);
  box-shadow: 0 -8px 32px rgba(15, 20, 25, 0.08);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  transform: translateY(100%);
  transition: transform 0.35s var(--ease);
}

.bar.visible { transform: translateY(0); }

.bar-picks {
  font-size: 14px;
  color: var(--muted);
}

.bar-picks strong { color: var(--vital-dark); }

.bar-shortlist { color: var(--subtle); font-size: 13px; }

@media (max-width: 900px) {
  .spotlight-inner { grid-template-columns: 1fr; }
  .spotlight-meta { border-left: none; border-top: 1px solid var(--hairline); }
  .context-strip { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 600px) {
  .studio-controls { flex-direction: column; align-items: stretch; }
  .context-strip { grid-template-columns: repeat(2, 1fr); }
  .compare-row { grid-template-columns: 1fr; }
  .logo-grid { grid-template-columns: 1fr; }
}
