:root {
  --ink: #15202b;
  --muted: #64707d;
  --paper: #fbfcfd;
  --panel: #ffffff;
  --line: #d9e1e8;
  --go: #007d9c;
  --go-bright: #00add8;
  --navy: #172a3a;
  --warm: #fff4d6;
  --warm-line: #e5b94a;
  --shadow: 0 18px 55px rgba(23, 42, 58, .12);
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--paper); }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 15%, rgba(0, 173, 216, .08), transparent 26rem),
    var(--paper);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.5;
}

a { color: var(--go); text-decoration: none; }
a:hover { text-decoration: underline; }
code, kbd, textarea { font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace; }

.site-header {
  height: 66px;
  padding: 0 clamp(20px, 4vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(217, 225, 232, .8);
  background: rgba(251, 252, 253, .9);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink) !important;
  font-weight: 700;
  letter-spacing: -.02em;
}
.brand:hover { text-decoration: none; }
.brand-logo {
  display: block;
  width: 53px;
  height: 20px;
}
.header-link { font-size: 14px; font-weight: 650; }

.playground-main {
  width: min(1440px, 100%);
  margin: 0 auto;
  min-height: calc(100vh - 130px);
  padding: clamp(40px, 7vw, 94px) clamp(20px, 5vw, 74px) 70px;
  display: grid;
  grid-template-columns: minmax(310px, .78fr) minmax(520px, 1.35fr);
  gap: clamp(44px, 7vw, 110px);
  align-items: center;
}

.intro { max-width: 545px; }
.eyebrow {
  margin: 0 0 18px;
  color: var(--go);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.intro h1 {
  margin: 0;
  font-size: clamp(44px, 5vw, 72px);
  line-height: .98;
  letter-spacing: -.06em;
  font-weight: 760;
}
.intro h1 span { color: var(--go); }
.lede {
  margin: 28px 0;
  color: var(--muted);
  font-size: clamp(17px, 1.45vw, 20px);
  line-height: 1.65;
}
.lede code { padding: 2px 6px; border: 1px solid var(--line); border-radius: 4px; background: white; color: var(--ink); font-size: .86em; }

.expiry-card {
  display: grid;
  gap: 4px;
  margin: 30px 0;
  padding: 16px 18px;
  border: 1px solid var(--warm-line);
  border-left-width: 4px;
  border-radius: 7px;
  background: var(--warm);
  color: #56420e;
  font-size: 14px;
}
.expiry-card strong { font-size: 15px; }

.editor-card {
  overflow: hidden;
  min-width: 0;
  border: 1px solid #263d4d;
  border-radius: 12px;
  background: #142330;
  box-shadow: var(--shadow), 0 0 0 7px rgba(0, 125, 156, .05);
}
.editor-toolbar, .editor-footer {
  min-height: 52px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: #d8e4eb;
  background: #1b3040;
  font-size: 13px;
}
.editor-toolbar > div { display: flex; align-items: center; gap: 16px; }
.editor-toolbar .muted, .source-count, .editor-footer > span { color: #8fa4b2; font-weight: 400; }
.traffic-lights { display: flex; gap: 6px; }
.traffic-lights i { display: block; width: 9px; height: 9px; border-radius: 50%; background: #e76f51; }
.traffic-lights i:nth-child(2) { background: #e9c46a; }
.traffic-lights i:nth-child(3) { background: #58b87a; }
.form-error { margin: 0; padding: 13px 18px; display: grid; gap: 2px; color: #ffe5e5; background: #7a2932; font-size: 13px; }
.code-editor {
  display: block;
  width: 100%;
  height: min(60vh, 610px);
  min-height: 430px;
  resize: vertical;
  margin: 0;
  padding: 24px;
  border: 0;
  border-radius: 0;
  outline: none;
  color: #d9e7ee;
  caret-color: #60d4f1;
  background: #142330;
  font-size: 14px;
  line-height: 1.72;
  tab-size: 4;
}
.code-editor::selection { background: #17617a; }
.editor-footer { min-height: 64px; border-top: 1px solid #294252; }

.run-button, .api-button {
  border: 0;
  border-radius: 6px;
  padding: 10px 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  color: white !important;
  background: var(--go);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 125, 156, .22);
}
.run-button:hover, .api-button:hover { background: #006b86; text-decoration: none; }
.run-button kbd { padding-left: 11px; border-left: 1px solid rgba(255,255,255,.25); color: #c6ebf5; font-size: 11px; }
.run-button[disabled] { opacity: .65; cursor: wait; }

.site-footer {
  min-height: 64px;
  padding: 18px clamp(20px, 4vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: white;
  font-size: 13px;
}

/* Documentation page */
.docs-page { background: var(--paper); }
.docs-header { position: sticky; top: 0; z-index: 30; gap: clamp(12px, 3vw, 32px); background: rgba(255,255,255,.94); }
.docs-header .brand, .docs-header .api-button { flex: 0 0 auto; }
.header-package {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}
.header-package span { font: 700 11px/1.3 monospace; letter-spacing: .08em; text-transform: uppercase; }
.header-package code { overflow: hidden; color: var(--ink); font-size: 14px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.api-button { padding: 8px 12px; box-shadow: none; }
.api-button code { color: inherit; font-size: 12px; }
.expiration-banner {
  padding: 11px clamp(20px, 4vw, 64px);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--warm-line);
  color: #604b13;
  background: var(--warm);
  font-size: 13px;
  text-align: center;
}
.expiration-banner form { margin: 0; }
.permanent-button {
  padding: 6px 10px;
  border: 1px solid #b28722;
  border-radius: 6px;
  color: #604b13;
  background: #fffaf0;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.permanent-button:hover { background: white; }
.package-hero {
  padding: 44px clamp(24px, 8vw, 130px) 40px;
  color: white;
  background: linear-gradient(118deg, #172a3a 0%, #16394b 64%, #006d88 140%);
}
.package-kicker { margin-bottom: 5px; color: #7ed7ed; font: 700 12px/1.3 monospace; text-transform: uppercase; letter-spacing: .13em; }
.package-hero h1 { margin: 0 0 8px; color: white; font-size: clamp(34px, 4vw, 52px); letter-spacing: -.045em; }
.package-hero .import-path code { color: #b7d9e3; font-size: 14px; }
.package-hero p { margin: 20px 0 0; color: #c7d9df; font-size: 14px; }
.package-hero a { color: #7ed7ed; }
.mobile-doc-nav { display: none; }
.mobile-doc-nav label { color: var(--muted); font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.mobile-doc-nav select { width: 100%; margin-top: 7px; padding: 10px 34px 10px 11px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: white; font: 14px/1.3 inherit; }
.documentation-layout {
  width: min(1310px, 100%);
  margin: 0 auto;
  padding: 42px clamp(20px, 4vw, 56px) 80px;
  display: grid;
  grid-template-columns: 230px minmax(0, 860px);
  gap: clamp(40px, 6vw, 84px);
  justify-content: center;
  background: var(--paper);
}
.documentation-outline { min-width: 0; }
.outline-sticky { position: sticky; top: 94px; max-height: calc(100vh - 120px); overflow: auto; padding-right: 12px; }
.outline-label { margin-bottom: 11px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.documentation-outline .UnitOutline { font-size: 13px; }
.documentation-outline .outline-sticky > ul > li > a { color: var(--ink); font-weight: 700; }
.documentation-outline a { color: var(--muted); }
.documentation-outline a:hover { color: var(--go); }
.documentation-article { min-width: 0; }
.documentation-article [id] { scroll-margin-top: 82px; }
.documentation-article .UnitDoc { margin: 0; }
.documentation-article .UnitDoc-title { margin: 0 0 24px; color: var(--ink); font-size: 24px; }
.documentation-article .Documentation { color: var(--ink); }
.documentation-article .Documentation a:not(.Documentation-idLink),
.documentation-article .Documentation a:not(.Documentation-idLink):link,
.documentation-article .Documentation a:not(.Documentation-idLink):visited { color: #00647d; }
.documentation-article .Documentation pre a:not(.Documentation-idLink),
.documentation-article .Documentation pre a:not(.Documentation-idLink):link,
.documentation-article .Documentation pre a:not(.Documentation-idLink):visited { color: #007d9c; }
@media (prefers-color-scheme: dark) {
  .documentation-article .Documentation pre a:not(.Documentation-idLink),
  .documentation-article .Documentation pre a:not(.Documentation-idLink):link,
  .documentation-article .Documentation pre a:not(.Documentation-idLink):visited { color: #62d4ef; }
}
.documentation-article .Documentation pre { box-shadow: inset 0 0 0 1px rgba(0,0,0,.015); }
.docs-footer { padding-left: clamp(20px, 8vw, 130px); padding-right: clamp(20px, 8vw, 130px); }

.message-page { min-height: 100vh; }
.message-card { width: min(600px, calc(100% - 40px)); margin: 13vh auto; padding: 52px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: var(--shadow); text-align: center; }
.message-code { color: var(--go); font: 700 12px/1 monospace; letter-spacing: .12em; }
.message-card h1 { margin: 18px 0 10px; font-size: 38px; letter-spacing: -.04em; }
.message-card p { margin: 0 auto 28px; max-width: 460px; color: var(--muted); }

.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; }

@media (max-width: 940px) {
  .playground-main { grid-template-columns: 1fr; align-items: start; }
  .intro { max-width: 720px; }
  .code-editor { height: 520px; }
  .documentation-layout { grid-template-columns: 1fr; }
  .documentation-outline { display: none; }
  .mobile-doc-nav { display: block; margin: 22px 20px 0; }
}

@media (max-width: 620px) {
  .site-header { height: 58px; padding: 0 16px; }
  .brand { font-size: 14px; }
  .header-link { display: none; }
  .playground-main { padding: 40px 16px 55px; gap: 38px; }
  .intro h1 { font-size: 45px; }
  .editor-card { border-radius: 8px; }
  .code-editor { min-height: 420px; height: 58vh; padding: 18px; font-size: 13px; }
  .editor-footer > span, .run-button kbd { display: none; }
  .expiration-banner { display: grid; gap: 2px; padding: 10px 16px; }
  .expiration-banner span { font-size: 12px; }
  .docs-header { backdrop-filter: none; }
  .docs-header .brand span, .header-package span { display: none; }
  .header-package { justify-content: flex-start; }
  .header-package code { font-size: 13px; }
  .api-button { font-size: 12px; }
  .package-hero { padding: 34px 20px; }
  .documentation-layout { padding: 30px 18px 60px; }
  .message-card { padding: 38px 24px; }
}
