:root {
  color-scheme: dark;
  --ink: #f6f4ef;
  --muted: #a7a29a;
  --line: rgba(255,255,255,.1);
  --card: rgba(18,18,22,.86);
  --accent: #f5b942;
  --bg: #070708;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  color: var(--ink);
  font: 16px/1.55 ui-sans-serif, system-ui, sans-serif;
  background:
    radial-gradient(900px 420px at 10% -10%, rgba(245,185,66,.16), transparent 55%),
    radial-gradient(700px 380px at 100% 0%, rgba(80,90,140,.18), transparent 50%),
    var(--bg);
}
a { color: var(--accent); }
button, input { font: inherit; color: inherit; }
.wrap { width: min(1080px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 72px; }
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.brand img { width: 132px; height: auto; display: block; }
.brand strong { display: block; letter-spacing: .04em; }
.brand span { display: block; color: var(--muted); font-size: 12px; }
.tabs {
  display: flex;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line);
}
.tabs button {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  font-weight: 700;
}
.tabs button[aria-selected="true"] {
  background: var(--accent);
  color: #1a1203;
}
.hero h1 { font-size: clamp(32px, 5vw, 52px); line-height: 1.05; margin: 0 0 10px; letter-spacing: -.03em; }
.hero p { margin: 0; max-width: 640px; color: var(--muted); font-size: 17px; }
.panel { margin-top: 28px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,.28);
  backdrop-filter: blur(16px);
}
.composer { display: flex; gap: 10px; align-items: stretch; }
.composer input {
  flex: 1;
  min-width: 0;
  background: #0c0c0f;
  border: 1px solid #34343c;
  border-radius: 14px;
  padding: 14px 16px;
}
.composer input:focus { outline: 2px solid var(--accent); border-color: transparent; }
button.primary, .ghost {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 750;
  cursor: pointer;
}
button.primary { background: var(--accent); color: #1a1203; }
.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px #3f3f46; }
.flash { margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: #2a1214; color: #fecaca; border: 1px solid #7f1d1d; }
.result { margin-top: 16px; display: grid; gap: 14px; }
.field label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.mono {
  margin: 0;
  padding: 12px;
  border-radius: 12px;
  background: #0c0c0f;
  border: 1px solid var(--line);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  line-height: 1.45;
  word-break: break-all;
}
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.preview { background: #000; border-radius: 16px; overflow: hidden; aspect-ratio: 16/9; border: 1px solid var(--line); }
.preview iframe { width: 100%; height: 100%; border: 0; }
.docs { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 28px; align-items: start; }
.docs article, .code, .code pre, .card { min-width: 0; max-width: 100%; }
.doc-nav { position: sticky; top: 16px; display: grid; gap: 6px; }
.doc-nav a { color: var(--muted); text-decoration: none; font-size: 14px; padding: 6px 0; }
.doc-nav a:hover { color: var(--accent); }
.docs article h2 { margin: 28px 0 8px; font-size: 22px; }
.docs article h2:first-child { margin-top: 0; }
.docs article p { color: #ddd9d2; }
.docs article ul, .docs article ol { color: #ddd9d2; padding-left: 18px; }
.docs article li + li { margin-top: 4px; }
.code { position: relative; margin: 12px 0 18px; }
.code pre {
  margin: 0;
  padding: 16px 78px 16px 14px;
  overflow: auto;
  border-radius: 14px;
  background: #0c0c0f;
  border: 1px solid var(--line);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  line-height: 1.5;
}
.code .ghost { position: absolute; top: 8px; right: 8px; padding: 6px 10px; font-size: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 12px 0 18px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: 12px; letter-spacing: .05em; text-transform: uppercase; }
kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  border: 1px solid #3f3f46;
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 1px 6px;
  background: #141418;
}
.studio [hidden] { display: none !important; }
@media (max-width: 800px) {
  .top, .composer { flex-direction: column; align-items: stretch; }
  .tabs { width: 100%; }
  .tabs button { flex: 1; }
  .docs { grid-template-columns: 1fr; }
  .doc-nav { position: static; grid-auto-flow: column; overflow: auto; gap: 14px; }
}
