:root {
  color-scheme: light;
  --brand-orange: oklch(0.69 0.173 37.3);
  --brand-orange-deep: oklch(0.58 0.185 36.1);
  --brand-blue: oklch(0.339 0.066 227.2);
  --brand-blue-deep: oklch(0.28 0.06 227.2);
  --bg: oklch(1 0 0);
  --surface: oklch(0.972 0.006 227.2);
  --surface-strong: oklch(0.93 0.012 227.2);
  --ink: oklch(0.19 0.034 227.2);
  --muted: oklch(0.43 0.034 227.2);
  --subtle: oklch(0.64 0.02 227.2);
  --primary: var(--brand-blue);
  --primary-deep: var(--brand-blue-deep);
  --accent: var(--brand-orange);
  --line: oklch(0.89 0.01 227.2);
  --shadow: 0 24px 80px oklch(0.18 0.04 227.2 / 0.14);
  --radius-lg: 30px;
  --radius-md: 18px;
  --radius-sm: 12px;
  font-family:
    Poppins, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@font-face {
  font-family: Poppins;
  src: url("/assets/fonts/poppins-300.woff2") format("woff2");
  font-style: normal;
  font-weight: 300;
  font-display: swap;
}

@font-face {
  font-family: Poppins;
  src: url("/assets/fonts/poppins-400.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: Poppins;
  src: url("/assets/fonts/poppins-700.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: transparent;
}

button,
a {
  font: inherit;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid oklch(0.69 0.173 37.3 / 0.9);
  outline-offset: 3px;
}

.shell {
  width: min(1520px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.topbar {
  width: 100%;
  margin-bottom: 0;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(1520px, 100%);
  margin: 0 auto;
  padding: 14px 24px;
}

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

.brand-logo {
  display: block;
  width: 84px;
  height: auto;
}

.brand-logo-large {
  width: min(240px, 68vw);
}

.review-label {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.review-label {
  margin: 0;
}

h1,
h2,
p {
  text-wrap: pretty;
}

h1 {
  max-width: 13ch;
  margin: 0;
  font-size: clamp(2.3rem, 6vw, 5.2rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 700;
  text-decoration: none;
  transition:
    transform 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease;
}

.button:hover,
.option-tab:hover {
  transform: translateY(-1px);
}

.button:active,
.option-tab:active {
  transform: translateY(0);
}

.button-primary:hover {
  background: var(--brand-orange);
}

.button-secondary:hover,
.option-tab:hover {
  border-color: oklch(0.78 0.03 227.2);
  background: oklch(1 0 0 / 0.96);
}

.button-primary {
  color: white;
  background: var(--brand-orange-deep);
}

.button-secondary {
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--surface);
}

.control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.option-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.option-select-label {
  display: none;
}

.option-tab {
  border: 1px solid var(--line);
  color: var(--ink);
  background: oklch(1 0 0 / 0.78);
  cursor: pointer;
  transition:
    transform 180ms ease,
    background 180ms ease,
    border-color 180ms ease,
    color 180ms ease;
}

.option-tab {
  min-height: 48px;
  border-radius: 999px;
  padding: 10px 16px;
  text-align: left;
}

.option-tab strong {
  display: block;
  font-size: 0.96rem;
}

.option-tab span {
  display: block;
  max-width: 28ch;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.82rem;
}

.option-tab.is-active {
  border-color: var(--brand-blue);
  color: white;
  background: var(--brand-blue);
}

.option-tab.is-active span {
  color: oklch(0.93 0.018 227.2);
}

.preview-stage {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: oklch(0.972 0.006 227.2 / 0.82);
  box-shadow: var(--shadow);
}

.preview-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
  background: oklch(1 0 0 / 0.72);
}

.preview-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.preview-meta h2 {
  margin: 0;
  font-size: 1.18rem;
  letter-spacing: -0.02em;
}

.preview-meta p {
  margin: 5px 0 0;
  color: var(--muted);
}

.browser-frame {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0;
  background: white;
  transition:
    border-radius 220ms ease,
    box-shadow 220ms ease;
}

.browser-chrome {
  display: flex;
  gap: 7px;
  align-items: center;
  height: 34px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.browser-chrome span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--surface-strong);
}

.preview-viewport {
  width: 100%;
  overflow: hidden;
  background: white;
}

iframe {
  display: block;
  transform-origin: top left;
  width: 100%;
  height: min(78vh, 860px);
  min-height: 560px;
  border: 0;
  background: white;
}

.loading-browser-page,
.error-browser-page {
  display: grid;
  min-height: min(62vh, 640px);
  place-content: center;
  padding: clamp(32px, 8vw, 96px);
  text-align: center;
}

.loading-browser-page {
  justify-items: center;
}

.loading-status {
  width: 12px;
  height: 12px;
  margin-bottom: 18px;
  border-radius: 999px;
  background: var(--brand-orange-deep);
  box-shadow: 0 0 0 8px oklch(0.58 0.185 36.1 / 0.12);
  animation: loadingPulse 1.2s ease-in-out infinite;
}

.loading-browser-page h1 {
  max-width: 20ch;
  margin: 0 auto;
  font-size: clamp(1.55rem, 3vw, 2.6rem);
  line-height: 1.08;
}

.loading-browser-page p:last-child {
  max-width: 42ch;
  margin: 14px auto 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
}

@keyframes loadingPulse {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(0.92);
  }

  50% {
    opacity: 1;
    transform: scale(1);
  }
}

.error-code {
  margin: 0 0 14px;
  color: var(--brand-orange-deep);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.error-browser-page h1 {
  max-width: 18ch;
  margin: 0 auto;
  font-size: clamp(1.7rem, 4vw, 3.4rem);
  line-height: 1.02;
}

.error-browser-page p:last-child {
  max-width: 46ch;
  margin: 18px auto 0;
  color: var(--muted);
  font-size: clamp(0.95rem, 1.5vw, 1.08rem);
  line-height: 1.7;
}

@media (max-width: 860px) {
  .shell {
    padding: 16px;
  }

  .control-row,
  .preview-meta {
    align-items: stretch;
    flex-direction: column;
  }

  h1 {
    max-width: 11ch;
    font-size: clamp(2.25rem, 13vw, 4.1rem);
  }

  .review-label {
    align-self: flex-start;
  }

  .preview-actions {
    display: none;
  }

  .preview-stage:not(.error-stage) .preview-meta {
    display: none;
  }

  .option-tabs {
    display: none;
  }

  .option-select-label {
    display: grid;
    position: relative;
    gap: 8px;
    width: 100%;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .option-select-label::after {
    position: absolute;
    right: 22px;
    bottom: 19px;
    width: 9px;
    height: 9px;
    border-right: 2px solid var(--ink);
    border-bottom: 2px solid var(--ink);
    content: "";
    pointer-events: none;
    transform: rotate(45deg);
  }

  .option-select-label select {
    appearance: none;
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 0 68px 0 14px;
    color: var(--ink);
    background: white;
    font: inherit;
    font-size: 1rem;
    font-weight: 700;
  }

  iframe {
    max-width: none;
  }
}

@media (max-width: 520px) {
  .shell {
    padding: 10px;
  }

  .topbar-inner {
    padding: 12px 10px;
  }

  .preview-meta {
    padding: 14px;
  }

  .preview-stage {
    border-radius: 22px;
  }

  .loading-browser-page,
  .error-browser-page {
    min-height: 56vh;
    padding: 34px 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
