:root {
  color-scheme: light;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: #dededb;
  --soft: #f4f4f1;
  --paper: #fbfbf8;
  --white: #fff;
  --accent: #2f6f4e;
  --accent-soft: #e8f2ec;
  --danger: #9b2c2c;
  --radius: 18px;
  --ease-out: cubic-bezier(.23, 1, .32, 1);
}

* { box-sizing: border-box; }
html { background: var(--paper); }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 85% 0%, rgba(47, 111, 78, .08), transparent 28rem),
    var(--paper);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}
button { color: inherit; font: inherit; }
button:focus-visible, a:focus-visible { outline: 3px solid rgba(47, 111, 78, .35); outline-offset: 3px; }
.shell { width: min(calc(100% - 40px), 1120px); margin: 0 auto; padding: 56px 0 96px; }
.hero { display: flex; align-items: end; justify-content: space-between; gap: 32px; padding-bottom: 36px; border-bottom: 1px solid var(--line); }
.eyebrow { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #4e9b70; box-shadow: 0 0 0 4px rgba(78, 155, 112, .13); }
h1, h2, p { margin-top: 0; }
h1 { max-width: 720px; margin-bottom: 14px; font-size: clamp(40px, 7vw, 78px); line-height: .98; letter-spacing: -.055em; }
h2 { margin-bottom: 0; font-size: 28px; letter-spacing: -.035em; }
.hero__copy { max-width: 610px; margin-bottom: 0; color: var(--muted); font-size: 18px; }
.flow { display: flex; align-items: center; gap: 9px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: rgba(255, 255, 255, .65); font-size: 13px; white-space: nowrap; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 24px 0 72px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, .72); box-shadow: 0 10px 30px rgba(29, 29, 31, .04); }
.toolbar__label { display: block; margin-bottom: 3px; color: var(--muted); font-size: 12px; }
code { overflow-wrap: anywhere; font-family: "SFMono-Regular", Consolas, monospace; font-size: 13px; }
.section-heading, .preview__topbar { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.count { display: grid; min-width: 34px; height: 34px; place-items: center; border-radius: 999px; color: var(--muted); background: var(--soft); font-size: 13px; }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.empty-card { grid-column: 1 / -1; padding: 34px; border: 1px dashed #c9c9c5; border-radius: var(--radius); color: var(--muted); background: rgba(255, 255, 255, .45); }
.empty-card h3 { margin: 0 0 16px; color: var(--ink); font-size: 22px; }
.empty-card code { display: inline-block; padding: 10px 12px; border-radius: 9px; color: #49494d; background: var(--soft); }
.card { min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255, 255, 255, .82); box-shadow: 0 18px 50px rgba(29, 29, 31, .045); }
.card__top { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.card h3 { margin: 0 0 8px; font-size: 20px; letter-spacing: -.025em; }
.card p { margin-bottom: 20px; color: var(--muted); }
.badge { padding: 5px 8px; border-radius: 999px; color: var(--accent); background: var(--accent-soft); font-size: 11px; font-weight: 700; white-space: nowrap; }
.card__url { display: block; min-height: 54px; margin-bottom: 16px; padding: 11px 12px; border-radius: 10px; color: #49494d; background: var(--soft); }
.card__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.button, .viewport-button { border: 0; cursor: pointer; transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease, transform 140ms var(--ease-out); }
.button:active, .viewport-button:active { transform: scale(.97); }
.button { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; padding: 0 14px; border-radius: 10px; color: #fff; background: var(--ink); font-size: 13px; font-weight: 650; text-decoration: none; }
.button--secondary { border: 1px solid var(--line); color: var(--ink); background: var(--white); }
.button--quiet { color: var(--accent); background: var(--accent-soft); }
.preview { margin-top: 72px; }
.viewport-switcher { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 11px; background: var(--white); }
.viewport-button { min-width: 56px; height: 32px; padding: 0 9px; border-radius: 7px; color: var(--muted); background: transparent; font-size: 12px; }
.viewport-button.is-active { color: var(--ink); background: var(--soft); }
.preview__empty { display: grid; min-height: 280px; place-items: center; padding: 32px; border: 1px dashed #c9c9c5; border-radius: var(--radius); color: var(--muted); text-align: center; }
.preview__stage { display: flex; min-height: 720px; justify-content: center; padding: 14px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #e6e6e3; }
.preview__stage iframe { width: 100%; min-height: 900px; border: 0; border-radius: 10px; background: var(--white); box-shadow: 0 12px 40px rgba(29, 29, 31, .09); transition: width 220ms var(--ease-out); }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 10; max-width: min(360px, calc(100% - 40px)); padding: 12px 14px; border-radius: 11px; color: #fff; background: #252527; box-shadow: 0 12px 30px rgba(0, 0, 0, .2); opacity: 0; pointer-events: none; transform: translateY(10px); transition: opacity 180ms ease, transform 180ms var(--ease-out); }
.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast.is-error { background: var(--danger); }
.error { padding: 18px; border: 1px solid rgba(155, 44, 44, .2); border-radius: 14px; color: var(--danger); background: #fff3f3; }

@media (hover: hover) and (pointer: fine) {
  .button:hover { background: #343438; }
  .button--secondary:hover { background: var(--soft); }
  .button--quiet:hover { background: #dcece2; }
}

@media (max-width: 760px) {
  .shell { width: min(calc(100% - 28px), 1120px); padding-top: 32px; }
  .hero { align-items: start; flex-direction: column; }
  .flow { max-width: 100%; overflow-x: auto; }
  .toolbar, .section-heading, .preview__topbar { align-items: stretch; flex-direction: column; }
  .toolbar .button { width: 100%; }
  .cards { grid-template-columns: 1fr; }
  .viewport-switcher { align-self: start; }
}

@media (prefers-reduced-motion: reduce) {
  .button, .viewport-button, .preview__stage iframe, .toast { transition-duration: 0ms; }
}
