:root {
  --bg: #f4f1ea;
  --bg-strong: #e9e2d5;
  --surface: rgba(255, 255, 255, 0.74);
  --surface-strong: #ffffff;
  --surface-soft: #f7f4ee;
  --text: #161514;
  --muted: #6a645d;
  --line: rgba(22, 21, 20, 0.08);
  --line-strong: rgba(22, 21, 20, 0.14);
  --accent: #0f766e;
  --accent-soft: rgba(15, 118, 110, 0.1);
  --accent-strong: #0b5c56;
  --danger: #b42318;
  --warning: #9a6700;
  --shadow-lg: 0 30px 80px rgba(23, 20, 14, 0.12);
  --shadow-md: 0 18px 40px rgba(23, 20, 14, 0.08);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --max-width: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.92), transparent 30%),
    radial-gradient(circle at 85% 15%, rgba(15, 118, 110, 0.16), transparent 22%),
    linear-gradient(180deg, #f8f5ef 0%, #f2ede3 100%);
  color: var(--text);
  font-family: "Manrope", sans-serif;
}

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

button,
input,
select {
  font: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.skip-link {
  position: absolute;
  top: -48px;
  left: 16px;
  z-index: 20;
  padding: 10px 14px;
  border-radius: 12px;
  background: #111827;
  color: #fff;
}

.skip-link:focus {
  top: 16px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page-backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.5), transparent 20%),
    radial-gradient(circle at 90% 80%, rgba(15, 118, 110, 0.08), transparent 25%);
}

.site-header,
.page-shell {
  width: min(var(--max-width), calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 24px 0 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 18px;
  background: linear-gradient(135deg, #161514, #2b2824);
  color: #fff;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  box-shadow: var(--shadow-md);
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-name,
.hero h1,
.result-copy h2,
.panel-head h3,
.section-head h3 {
  font-family: "Space Grotesk", sans-serif;
}

.brand-name {
  font-weight: 700;
}

.brand-tag,
.eyebrow,
.hero-text,
.meta,
.panel-head p,
.progress-text,
.subtle-label {
  color: var(--muted);
}

.page-shell {
  position: relative;
  z-index: 1;
  padding-bottom: 42px;
}

.hero {
  display: block;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 0.76rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.9rem, 4vw, 3.7rem);
  line-height: 1;
  letter-spacing: -0.02em;
  max-width: none;
}

.hero-text {
  margin: 16px 0 0;
  max-width: none;
  font-size: 1rem;
  line-height: 1.6;
  white-space: nowrap;
}

.card {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px);
}

.studio-card {
  padding: 26px;
  margin-bottom: 18px;
}

.studio-head {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 16px;
  margin-bottom: 22px;
}

.studio-kicker {
  margin: 0 0 8px;
  color: var(--accent-strong);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.studio-title {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.4rem, 3vw, 2rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
  max-width: 16ch;
}

.field-label {
  display: block;
  margin-bottom: 10px;
  font-size: 0.95rem;
  font-weight: 700;
}

.url-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
}

input,
select,
button {
  border-radius: var(--radius-sm);
}

input,
select {
  width: 100%;
  padding: 16px 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

input:focus,
select:focus {
  outline: none;
  border-color: rgba(15, 118, 110, 0.35);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.08);
}

button {
  border: 1px solid transparent;
  padding: 14px 18px;
  cursor: pointer;
  transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
}

button:hover:not(:disabled),
.download-link:hover {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.6;
  cursor: progress;
}

#analyze-button,
.download-button,
.download-link {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  box-shadow: 0 10px 30px rgba(15, 118, 110, 0.22);
}

.secondary-button {
  background: rgba(255, 255, 255, 0.88);
  border-color: var(--line);
  color: var(--text);
}

.ghost-button {
  background: transparent;
  border-color: var(--line);
  color: var(--muted);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.url-helper {
  min-height: 22px;
  font-size: 0.95rem;
}

.url-helper.warning {
  color: var(--warning);
}

.url-helper.success {
  color: var(--accent);
}

.status {
  display: flex;
  align-items: center;
  min-height: 52px;
  margin: 18px 0 0;
  padding: 14px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-weight: 600;
}

.status.info {
  background: rgba(255, 255, 255, 0.72);
  border-color: var(--line);
}

.status.success {
  background: rgba(15, 118, 110, 0.08);
  border-color: rgba(15, 118, 110, 0.12);
  color: var(--accent-strong);
}

.status.error {
  background: rgba(180, 35, 24, 0.08);
  border-color: rgba(180, 35, 24, 0.14);
  color: var(--danger);
}

.hidden {
  display: none !important;
}

.result-card {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.result-hero {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 22px;
  margin-bottom: 24px;
}

.thumbnail {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  object-fit: cover;
  background: #ece8df;
  box-shadow: var(--shadow-md);
}

.platform-badge {
  display: inline-flex;
  margin: 0 0 10px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.85rem;
  font-weight: 700;
}

.result-copy h2 {
  margin: 0;
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.meta {
  margin: 10px 0 0;
}

.media-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.fact-chip,
.choice-chip {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
}

.fact-chip {
  padding: 9px 12px;
  border-radius: 999px;
  font-size: 0.92rem;
  color: var(--muted);
}

.chooser-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 20px;
}

.chooser-panel {
  padding: 18px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.58);
}

.chooser-panel:last-child {
  position: sticky;
  top: 18px;
  align-self: start;
}

.panel-head {
  margin-bottom: 16px;
}

.panel-head h3 {
  margin: 0;
  font-size: 1.15rem;
}

.panel-head p {
  margin: 6px 0 0;
}

.format-grid {
  display: grid;
  gap: 12px;
}

.format-groups {
  display: grid;
  gap: 18px;
}

.format-group {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 20px;
  border: 1px solid rgba(22, 21, 20, 0.08);
  background: rgba(255, 255, 255, 0.34);
}

.format-group-head h4 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1rem;
}

.format-group-head p {
  margin: 6px 0 0;
  color: var(--muted);
}

.filter-step {
  display: grid;
  gap: 10px;
}

.filter-step + .filter-step,
.format-preview {
  margin-top: 16px;
}

.filter-step-title,
.format-preview-label {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.filter-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--muted);
}

.filter-chip.active {
  background: #161514;
  color: #fff;
  border-color: #161514;
}

.filter-chip-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(22, 21, 20, 0.08);
  color: inherit;
  font-size: 0.78rem;
}

.filter-chip.active .filter-chip-count {
  background: rgba(255, 255, 255, 0.16);
}

.format-preview {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.format-preview.active {
  border-color: rgba(15, 118, 110, 0.28);
  background: linear-gradient(180deg, rgba(15, 118, 110, 0.08), rgba(255, 255, 255, 0.92));
}

.format-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.format-preview-title {
  display: block;
  margin-top: 10px;
}

.format-preview-meta {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.5;
}

.format-option {
  display: grid;
  gap: 10px;
  width: 100%;
  padding: 16px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.8);
}

.format-option.active {
  border-color: rgba(15, 118, 110, 0.28);
  background: linear-gradient(180deg, rgba(15, 118, 110, 0.08), rgba(255, 255, 255, 0.92));
  box-shadow: 0 10px 30px rgba(15, 118, 110, 0.08);
}

.format-empty {
  padding: 14px 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 18px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.46);
}

.format-top,
.format-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.format-title {
  font-weight: 700;
}

.format-type {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f4efe7;
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.format-meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.recommended-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 700;
}

.stack-block + .stack-block,
.selection-summary,
.progress-card,
.download-button {
  margin-top: 16px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.choice-chip {
  padding: 12px 14px;
  color: var(--muted);
}

.choice-chip.active {
  background: #161514;
  color: #fff;
  border-color: #161514;
}

.selection-summary,
.progress-card {
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
}

.selection-summary {
  min-height: 88px;
  line-height: 1.6;
}

.progress-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.progress-label {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.progress-percent {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
}

.progress-bar {
  height: 10px;
  margin-top: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: #ebe5da;
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0f766e, #36b5a1);
  transition: width 0.24s ease;
}

.progress-text {
  margin: 12px 0 0;
  line-height: 1.5;
}

.download-link {
  display: inline-flex;
  justify-content: center;
  width: 100%;
  margin-top: 14px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
}

.download-button {
  width: 100%;
}

@media (max-width: 920px) {
  .chooser-grid,
  .result-hero {
    grid-template-columns: 1fr;
  }

  .chooser-panel:last-child {
    position: static;
  }

  .studio-head {
    grid-template-columns: 1fr;
    display: grid;
  }
}

@media (max-width: 720px) {
  .site-header,
  .page-shell {
    width: min(var(--max-width), calc(100% - 20px));
  }

  .site-header,
  .studio-head {
    display: grid;
  }

  .url-composer {
    grid-template-columns: 1fr;
  }

  .toolbar,
  .progress-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero {
    margin-bottom: 18px;
  }

  .hero h1 {
    font-size: clamp(1.9rem, 8.2vw, 2.8rem);
  }

  .hero-text {
    white-space: normal;
  }

  .result-card {
    margin-top: 20px;
    padding-top: 20px;
  }

  .result-hero {
    gap: 16px;
  }

  .format-top,
  .format-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .studio-card {
    padding: 18px;
  }
}
