:root {
  --ink: #102f35;
  --teal: #4f9aa9;
  --teal-pale: #dff1f3;
  --paper: #f5f2ea;
  --white: #fff;
  --line: rgba(16, 47, 53, .14);
  --muted: #667b7f;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--paper); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, a { font: inherit; }
button { color: inherit; }
.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; }
.skip-link { position: fixed; top: -5rem; left: 1rem; z-index: 100; padding: .7rem 1rem; background: white; color: var(--ink); }
.skip-link:focus { top: 1rem; }
:focus-visible { outline: 3px solid #f4c95d; outline-offset: 3px; }

.topbar { height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding: 0 24px; background: var(--ink); color: white; }
.topbar-brand { display: flex; align-items: center; gap: 1rem; color: white; text-decoration: none; }
.topbar-brand img { width: 118px; height: auto; filter: brightness(0) invert(1); }
.topbar-brand span { padding-left: 1rem; border-left: 1px solid rgba(255,255,255,.25); font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.64); }
.topbar-meta { display: flex; gap: .65rem; }
.topbar-meta span { padding: .35rem .6rem; border: 1px solid rgba(255,255,255,.2); border-radius: 100px; font-size: .65rem; font-weight: 700; color: rgba(255,255,255,.7); }

.studio { min-height: calc(100vh - 66px); display: grid; grid-template-columns: 350px minmax(0, 1fr); }
.selector { padding: 38px 28px; border-right: 1px solid var(--line); background: var(--paper); overflow-y: auto; }
.kicker { margin: 0 0 .8rem; color: var(--teal); font-size: .68rem; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.selector h1 { margin: 0 0 1rem; max-width: 12ch; font-size: clamp(2rem, 3vw, 3.3rem); line-height: .98; letter-spacing: -.055em; }
.selector-intro > p:last-child { margin: 0 0 2.2rem; color: var(--muted); font-size: .85rem; line-height: 1.55; }
.variant-list { display: grid; gap: .55rem; }
.variant-card { width: 100%; display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: .75rem; padding: .9rem .8rem; text-align: left; border: 1px solid var(--line); background: rgba(255,255,255,.38); cursor: pointer; transition: background .2s ease, border .2s ease, transform .2s ease; }
.variant-card:hover { transform: translateX(3px); background: white; }
.variant-card.is-active { background: var(--ink); color: white; border-color: var(--ink); }
.variant-number { font-size: .68rem; font-weight: 900; color: var(--teal); }
.variant-copy strong, .variant-copy small { display: block; }
.variant-copy strong { font-size: .82rem; }
.variant-copy small { margin-top: .15rem; font-size: .64rem; color: var(--muted); }
.variant-card.is-active .variant-copy small { color: rgba(255,255,255,.55); }
.variant-arrow { opacity: .5; }
.selector-note { margin-top: 2.5rem; padding: 1rem; border-left: 3px solid var(--teal); background: var(--teal-pale); }
.selector-note strong { font-size: .72rem; }
.selector-note p { margin: .3rem 0 0; color: #4f696e; font-size: .7rem; line-height: 1.5; }

.preview { min-width: 0; padding: 20px; background: #dfe4e2; }
.preview-toolbar { min-height: 58px; display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; padding: 0 .25rem 16px; }
.preview-toolbar > div:first-child { display: flex; align-items: center; gap: .8rem; }
.preview-index { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--teal); color: white; font-size: .68rem; font-weight: 900; }
.preview-toolbar small { display: block; color: var(--muted); font-size: .58rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.preview-toolbar h2 { margin: .08rem 0 0; font-size: .9rem; line-height: 1; }
.toolbar-actions { display: flex; align-items: center; gap: .75rem; }
.device-switcher { display: flex; padding: .2rem; border: 1px solid rgba(16,47,53,.12); border-radius: .45rem; background: rgba(255,255,255,.58); }
.device-switcher button { width: 34px; height: 30px; display: grid; place-items: center; padding: 0; border: 0; border-radius: .3rem; background: transparent; cursor: pointer; }
.device-switcher button.is-active { background: white; box-shadow: 0 2px 8px rgba(16,47,53,.12); color: var(--teal); }
.device-switcher svg { width: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.open-button { display: inline-flex; align-items: center; gap: .35rem; min-height: 36px; padding: 0 .8rem; border-radius: .4rem; background: var(--ink); color: white; text-decoration: none; font-size: .7rem; font-weight: 800; }
.open-button:hover { background: var(--teal); }

.browser-shell { height: calc(100vh - 66px - 40px - 58px); min-height: 560px; display: flex; flex-direction: column; overflow: hidden; border: 1px solid rgba(16,47,53,.14); border-radius: .75rem; background: white; box-shadow: 0 24px 70px rgba(16,47,53,.14); }
.browser-chrome { flex: 0 0 42px; display: grid; grid-template-columns: 80px 1fr 80px; align-items: center; padding: 0 .8rem; background: #f7f8f7; border-bottom: 1px solid #e5e9e7; }
.browser-dots { display: flex; gap: .35rem; }
.browser-dots i { width: 8px; height: 8px; border-radius: 50%; background: #d4dad7; }
.browser-dots i:first-child { background: #e7a8a1; }
.browser-dots i:nth-child(2) { background: #e8d39b; }
.browser-dots i:nth-child(3) { background: #9acfb0; }
.browser-address { justify-self: center; width: min(460px, 70%); padding: .35rem .8rem; text-align: center; border: 1px solid #e1e6e3; border-radius: .35rem; background: white; color: #81908d; font-size: .58rem; }
.frame-stage { flex: 1; min-height: 0; display: flex; justify-content: center; overflow: auto; background: #cfd7d4; }
.frame-wrap { width: 100%; height: 100%; background: white; transition: width .3s ease, height .3s ease, margin .3s ease, box-shadow .3s ease; }
.frame-wrap.is-tablet { width: 820px; height: calc(100% - 28px); margin: 14px auto; box-shadow: 0 8px 30px rgba(16,47,53,.2); }
.frame-wrap.is-mobile { width: 390px; height: calc(100% - 28px); margin: 14px auto; box-shadow: 0 8px 30px rgba(16,47,53,.2); }
iframe { width: 100%; height: 100%; display: block; border: 0; background: white; }

@media (max-width: 980px) {
  .studio { grid-template-columns: 1fr; }
  .selector { border-right: 0; border-bottom: 1px solid var(--line); }
  .selector h1 { max-width: 18ch; }
  .variant-list { grid-template-columns: repeat(2, 1fr); }
  .selector-note { display: none; }
  .browser-shell { height: 75vh; }
}

@media (max-width: 620px) {
  .topbar { padding: 0 14px; }
  .topbar-brand span, .topbar-meta { display: none; }
  .selector { padding: 28px 16px; }
  .variant-list { grid-template-columns: 1fr; }
  .preview { padding: 12px; }
  .preview-toolbar { align-items: flex-start; }
  .preview-toolbar > div:first-child { display: none; }
  .toolbar-actions { width: 100%; justify-content: space-between; }
  .browser-shell { height: 78vh; min-height: 520px; }
  .browser-address { width: 90%; }
  .frame-wrap.is-tablet { width: 100%; height: 100%; margin: 0; }
  .frame-wrap.is-mobile { width: 390px; max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
