/* Rollcage: what every page shares. Light and calm: a sky up top, white cards, black pills,
   the product shown in clean windows on soft coloured panels. Tokens first, then the base,
   the nav, the sky and its clouds, product windows, the footer, Cmd+K and the reveals. Each
   page adds its own stylesheet on top (landing.css, docs.css, try.css, play.css, lost.css). */

:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --ink: #0b1220;
  --body: #3a4356;
  --muted: #6b7386;
  --faint: #9aa2b3;
  --line: rgba(11, 18, 32, 0.08);
  --line-2: rgba(11, 18, 32, 0.14);
  --sky-top: #5a93e4;
  --sky-mid: #86b6ee;
  --sky-low: #c6dff8;
  --brand: #5f9be9;
  --blue: #2f6fdc;
  --red: #d64545;
  --amber: #c98a1b;
  --green: #1f9d63;
  --radius: 22px;
  --radius-lg: 32px;
  --shadow: 0 1px 2px rgba(11, 18, 32, 0.05), 0 18px 48px -20px rgba(11, 18, 32, 0.22);
  --shadow-soft: 0 1px 2px rgba(11, 18, 32, 0.04), 0 8px 24px -12px rgba(11, 18, 32, 0.14);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font: 400 16px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
h1, h2, h3 { color: var(--ink); margin: 0; font-weight: 700; letter-spacing: -0.035em; line-height: 1.05; }
p { margin: 0; }
a { color: inherit; }
code { font-family: var(--mono); font-size: 0.9em; }
button { font: inherit; color: inherit; }
img, svg { display: block; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 8px; }
main:focus { outline: none; }

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 28px; }
.sr-only, .hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 10px; text-decoration: none; }
.skip:focus { top: 12px; }

/* Pills: the one button shape */
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 20px; border-radius: 999px; border: 0;
  background: var(--ink); color: #fff; font-weight: 600; font-size: 15px; text-decoration: none;
  cursor: pointer; transition: transform 0.2s var(--ease), background 0.2s;
}
.pill:hover { background: #1c2740; }
.pill:active { transform: scale(0.98); }
.pill:disabled { opacity: 0.5; cursor: default; }
.pill-light { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.pill-light:hover { background: #f8f9fb; }

/* ---------------------------------------------------------------- nav */
.nav { position: fixed; inset: 0 0 auto; z-index: 50; transition: background 0.3s, box-shadow 0.3s; }
.nav[data-solid], .nav[data-open] { background: rgba(255, 255, 255, 0.86); backdrop-filter: saturate(1.4) blur(16px); -webkit-backdrop-filter: saturate(1.4) blur(16px); box-shadow: 0 1px 0 var(--line); }
.nav-in { display: flex; align-items: center; gap: 36px; max-width: 1360px; margin: 0 auto; padding: 0 28px; height: 68px; }
.brand { display: inline-flex; text-decoration: none; }
.logo { height: 30px; width: auto; --mark-fill: #5f9be9; --wordmark: var(--ink); }
.nav-links { display: flex; gap: 28px; }
.nav-links a, .nav-signin { color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 500; opacity: 0.86; }
.nav-links a:hover, .nav-signin:hover { opacity: 1; }
.nav-end { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.nav-search { width: 38px; height: 38px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--ink); }
.nav-search:hover { background: rgba(11, 18, 32, 0.06); }
.nav-search svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.menu-btn { display: none; width: 42px; height: 42px; border: 0; border-radius: 50%; background: transparent; cursor: pointer; position: relative; }
.menu-btn span { position: absolute; left: 12px; right: 12px; height: 1.8px; background: var(--ink); border-radius: 2px; transition: transform 0.25s var(--ease); }
.menu-btn span:first-child { top: 17px; }
.menu-btn span:last-child { top: 23px; }
.nav[data-open] .menu-btn span:first-child { transform: translateY(3px) rotate(45deg); }
.nav[data-open] .menu-btn span:last-child { transform: translateY(-3px) rotate(-45deg); }
.menu { display: none; }
.nav-links a[aria-current="page"], .menu a[aria-current="page"] { opacity: 1; font-weight: 600; }

/* ---------------------------------------------------------------- the sky */
.sky { position: relative; overflow: hidden; background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 52%, var(--sky-low) 100%); }
/* Clouds: the #cloud symbol, drifting slowly */
.clouds { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.cloud { position: absolute; height: auto; filter: drop-shadow(0 18px 24px rgba(40, 90, 160, 0.2)); }
@media (prefers-reduced-motion: no-preference) {
  .cloud { animation: drift 70s ease-in-out infinite alternate; }
}
@keyframes drift { from { transform: translateX(-18px); } to { transform: translateX(26px); } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- the other pages' sky */
/* The top of the docs, Try it and the playground: the home page's sky, shorter. */
.page-hero .sky { padding: 150px 24px 136px; }
.page-hero-in { position: relative; z-index: 2; max-width: 880px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; text-align: center; }
.page-hero h1 { font-size: clamp(38px, 5.2vw, 68px); letter-spacing: -0.047em; line-height: 1.03; text-wrap: balance; }
.page-hero .sub { margin-top: 18px; max-width: 620px; font-size: clamp(16.5px, 1.5vw, 19px); line-height: 1.55; color: rgba(11, 18, 32, 0.72); }
.page-hero .sub code { font-size: 0.88em; padding: 1px 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.55); color: var(--ink); }
.k1 { width: 400px; left: -120px; bottom: -64px; }
.k2 { width: 230px; left: 27%; bottom: -100px; }
.k3 { width: 470px; right: -90px; bottom: -90px; }
.k4 { width: 170px; right: 14%; top: 30%; opacity: 0.6; filter: blur(1.5px); }
.k5 { width: 140px; left: 9%; top: 28%; opacity: 0.55; filter: blur(1.5px); }
@media (prefers-reduced-motion: no-preference) {
  .k2, .k4 { animation-duration: 90s; animation-direction: alternate-reverse; }
  .k5 { animation-duration: 110s; }
}

/* Soft coloured panels, for product windows to sit on */
.t-blue { background: linear-gradient(140deg, #6f9fef, #a9c8f6 60%, #d3e4fb); }
.t-violet { background: linear-gradient(140deg, #8c7cf0, #b7a8f6 55%, #e3dafc); }
.t-peach { background: linear-gradient(140deg, #f08d6b, #f6b79a 55%, #fbe0d1); }
.t-sky { background: linear-gradient(160deg, #5a93e4, #9cc3f2 60%, #d7e8fb); }
.t-green { background: linear-gradient(140deg, #4fb98b, #94d7b6 55%, #d6f1e4); }

/* Product windows */
.win { width: 100%; max-width: 560px; background: var(--surface); border-radius: 18px; box-shadow: 0 30px 60px -28px rgba(11, 18, 32, 0.45); overflow: hidden; text-align: left; }
.win.narrow { max-width: 430px; }
.win-bar { display: flex; align-items: center; gap: 7px; height: 40px; padding: 0 16px; border-bottom: 1px solid var(--line); background: #fafbfc; }
.win-bar i { width: 10px; height: 10px; border-radius: 50%; background: #e3e6ec; }
.win-bar span { margin-left: 10px; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.win-body { padding: 22px; }
.term { background: #0f1522; }
.term .win-bar { background: #161d2c; border-color: rgba(255, 255, 255, 0.06); }
.term .win-bar i { background: #2a3346; }
.term .win-bar span { color: #8d97ab; }
.term .win-body { font: 400 13.5px/1.75 var(--mono); color: #dfe6f3; }
.term .pr { color: #7aa7f0; margin-right: 6px; }
.term .dim { color: #8d97ab; }
.term .good { color: #6fd3a4; }

/* Footer */
.foot { padding: 0 0 48px; }
.foot .foot-in { display: flex; justify-content: space-between; gap: 40px; padding-top: 56px; padding-bottom: 56px; border-top: 1px solid var(--line); }
.foot-cols { display: flex; gap: 72px; }
.foot-cols div { display: flex; flex-direction: column; gap: 10px; }
.foot-cols h3 { font-size: 13.5px; letter-spacing: 0; color: var(--ink); margin-bottom: 4px; }
.foot-cols a { color: var(--muted); text-decoration: none; font-size: 14px; }
.foot-cols a:hover { color: var(--ink); }
.foot-base { display: flex; justify-content: space-between; gap: 20px; font-size: 13px; color: var(--faint); }

/* Command palette */
.palette { position: fixed; inset: 0; z-index: 80; display: none; align-items: flex-start; justify-content: center; padding: 14vh 20px 20px; background: rgba(11, 18, 32, 0.32); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.palette[data-open] { display: flex; }
.palette-box { width: 100%; max-width: 600px; background: #fff; border-radius: 20px; box-shadow: 0 40px 80px -30px rgba(11, 18, 32, 0.5); overflow: hidden; }
.palette-box input { width: 100%; border: 0; outline: none; padding: 20px 22px; font: 400 17px var(--font); color: var(--ink); border-bottom: 1px solid var(--line); }
.palette-list { max-height: 50vh; overflow: auto; padding: 8px; }
.palette-group { padding: 10px 12px 6px; font-size: 12px; font-weight: 600; color: var(--faint); }
.palette-item { width: 100%; display: flex; justify-content: space-between; gap: 16px; align-items: baseline; text-align: left; border: 0; background: none; cursor: pointer; padding: 10px 12px; border-radius: 12px; color: var(--ink); font-size: 15px; }
.palette-item small { color: var(--faint); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette-item .mono { font-family: var(--mono); font-size: 13.5px; }
.palette-item[aria-selected="true"] { background: #f1f4fa; }
.palette-empty { padding: 18px; color: var(--muted); font-size: 14px; }
.palette-foot { display: flex; gap: 18px; padding: 10px 18px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--faint); }
/* A hit in a docs section's text: the words around it, under the section's name. */
.palette-item.has-snip { flex-direction: column; align-items: stretch; gap: 3px; }
.palette-item.has-snip small { color: var(--muted); font-size: 13px; line-height: 1.5; white-space: normal; }
.palette-item small mark { padding: 0 2px; border-radius: 3px; background: #fdecc8; color: var(--ink); }
kbd { font: 500 11.5px var(--mono); padding: 1px 6px; border-radius: 6px; background: #f1f3f7; color: var(--muted); margin-right: 3px; }

/* ---------------------------------------------------------------- the engine's answer */
/* What Rollcage's engine says about a command, as the Command X-ray, the config builder and
   the playground show it (inside .engine-out). */
.engine-out .xray-cmd { position: relative; overflow: hidden; padding: 18px 20px; border-radius: 14px; background: #f6f7f9; box-shadow: inset 0 0 0 1px var(--line); font: 400 14.5px/1.65 var(--mono); color: var(--ink); white-space: pre-wrap; word-break: break-word; }
.engine-out .xray-cmd .ps { margin-right: 8px; color: var(--green); }
.engine-out .xray-cmd .hl { border-radius: 4px; background: #fde4e4; color: #a32b2b; box-shadow: 0 0 0 2px #fde4e4; }
.engine-out .xray-cmd .k { color: #6a4fd6; }
.engine-out .xray-cmd .s { color: #1d7f52; }
.engine-out .xray-cmd .f { color: var(--blue); }
.engine-out .xray-cmd .v { color: #a5660a; }
.engine-out .xray-cmd .hl span { color: inherit; }
/* A soft light passes over a new command once. */
.engine-out .xray-cmd::after { content: ""; position: absolute; inset: 0 auto 0 -30%; width: 30%; background: linear-gradient(90deg, transparent, rgba(95, 155, 233, 0.18), transparent); opacity: 0; pointer-events: none; }
.engine-out .xray-cmd.scan::after { animation: scan 0.9s var(--ease); }
@keyframes scan { 0% { left: -30%; opacity: 1; } 100% { left: 110%; opacity: 0.6; } }
.engine-out .verdict { display: flex; align-items: center; gap: 14px; }
.engine-out .verdict-icon { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: #eef1f5; color: var(--muted); }
.engine-out .verdict-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.engine-out .verdict b { display: block; color: var(--ink); font-size: 20px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.25; }
.engine-out .verdict small { display: block; margin-top: 2px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.engine-out .verdict[data-kind="safe"] .verdict-icon { background: rgba(31, 157, 99, 0.12); color: var(--green); }
.engine-out .verdict[data-kind="production"] .verdict-icon, .engine-out .verdict[data-kind="block"] .verdict-icon { background: rgba(214, 69, 69, 0.1); color: var(--red); }
.engine-out .verdict[data-kind="ask"] .verdict-icon { background: rgba(124, 92, 240, 0.12); color: #6a4fd6; }
.engine-out .verdict[data-kind="warn"] .verdict-icon, .engine-out .verdict[data-kind="destructive"] .verdict-icon { background: rgba(201, 138, 27, 0.13); color: var(--amber); }
.engine-out .verdict[data-kind="loading"] .verdict-icon { background: rgba(47, 111, 220, 0.1); color: var(--blue); }
.engine-out .findings { display: grid; gap: 10px; }
.engine-out .findings:empty { display: none; }
.engine-out .finding { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 12px; align-items: start; padding: 14px 16px; border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2); color: var(--ink); font-size: 14.5px; line-height: 1.5; }
.engine-out .finding .rule { color: var(--muted); font: 500 12px/1.8 var(--mono); text-decoration: none; }
.engine-out .finding a.rule:hover { color: var(--blue); text-decoration: underline; }
.engine-out .finding .dbs, .engine-out .finding .inner { grid-column: 2; min-width: 0; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.engine-out .finding .inner code { padding: 1px 6px; border-radius: 6px; background: #f1f3f7; color: var(--ink); font-size: 12.5px; }
.engine-out .tag { display: inline-block; height: 24px; padding: 0 10px; border-radius: 999px; background: #eef1f5; color: var(--muted); font-size: 12.5px; font-weight: 600; line-height: 24px; white-space: nowrap; }
.engine-out .tag::first-letter { text-transform: uppercase; }
.engine-out .tag.safe { background: rgba(31, 157, 99, 0.12); color: #157a4b; }
.engine-out .tag.warn { background: rgba(201, 138, 27, 0.14); color: #87590b; }
.engine-out .tag.prod { background: rgba(214, 69, 69, 0.11); color: #b13434; }
.engine-out .tag.ask { background: rgba(124, 92, 240, 0.12); color: #5b41c8; }
.engine-out .said { padding: 14px 16px; border-radius: 14px; background: #f4f8fe; box-shadow: inset 0 0 0 1px rgba(47, 111, 220, 0.16); color: var(--body); font-size: 15px; line-height: 1.55; }
.engine-out .said strong { color: var(--ink); }
.engine-out .said code { padding: 1px 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.85); color: var(--ink); font-size: 13px; }
.engine-out .said[data-kind="safe"] { background: #f0f9f4; box-shadow: inset 0 0 0 1px rgba(31, 157, 99, 0.18); }
.engine-out .said[data-kind="warn"], .engine-out .said[data-kind="destructive"] { background: #fdf7ec; box-shadow: inset 0 0 0 1px rgba(201, 138, 27, 0.2); }
.engine-out .said[data-kind="production"], .engine-out .said[data-kind="block"] { background: #fdf3f3; box-shadow: inset 0 0 0 1px rgba(214, 69, 69, 0.16); }
.engine-out .said[data-kind="none"] { display: none; }
.engine-out .spinner { display: block; width: 20px; height: 20px; border: 2.2px solid rgba(47, 111, 220, 0.2); border-top-color: var(--blue); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.engine-out .xray-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; line-height: 1.5; }
.engine-out .xray-foot-btns { display: flex; flex-wrap: wrap; gap: 6px 18px; }

/* A word from Rollcage, at the bottom of the screen (home.js) */
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 90; display: flex; align-items: center; gap: 12px; width: max-content; max-width: min(580px, calc(100% - 32px)); padding: 12px 18px 12px 14px; border-radius: 18px; background: var(--surface); color: var(--ink); font-size: 14.5px; line-height: 1.45; box-shadow: 0 1px 2px rgba(11, 18, 32, 0.06), 0 24px 48px -16px rgba(11, 18, 32, 0.35); opacity: 0; transform: translate(-50%, 16px); pointer-events: none; transition: transform 0.35s var(--ease), opacity 0.25s; }
.toast[data-on] { opacity: 1; transform: translate(-50%, 0); }
.toast svg { flex: none; width: 26px; height: 26px; --mark-fill: #5f9be9; }
.toast code { padding: 1px 6px; border-radius: 6px; background: #f1f3f7; font-size: 13px; overflow-wrap: anywhere; }
.toast small { display: block; margin-top: 2px; color: var(--muted); font-size: 12.5px; }

/* Arriving gently */
html.js [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
html.js [data-reveal].in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  html.js [data-reveal] { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------- smaller screens */
@media (max-width: 860px) {
  .nav-links, .nav-signin, .nav-end > .pill { display: none; }
  .menu-btn { display: block; }
  .nav[data-open] .menu { display: flex; flex-direction: column; gap: 4px; padding: 8px 20px 20px; }
  .menu a { color: var(--ink); text-decoration: none; font-size: 17px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
  .menu a.pill { margin-top: 12px; color: #fff; border: 0; }
  .nav-in { padding: 0 16px; gap: 16px; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .win-body { padding: 16px; }
  .foot-in { flex-direction: column; }
  .foot-cols { gap: 48px; }
  .foot-base { flex-direction: column; }
  .page-hero .sky { padding: 112px 16px 100px; }
  .k1 { width: 260px; left: -90px; bottom: -44px; }
  .k3 { width: 300px; right: -110px; bottom: -56px; }
  .k2, .k4, .k5 { display: none; }
  .toast { bottom: 16px; font-size: 14px; }
}
