/* guise — site styles.
   Dark, gradient-washed, component-forward — adapted from the React Aria
   landing language, colored with guise's own Mantine palette. */

:root {
  /* surfaces */
  --bg: #0c0c0f;
  --bg2: #101014;
  --raise: #16161b;
  --card: #17171d;
  --card2: #1c1c23;
  --line: rgba(255, 255, 255, 0.09);
  --line2: rgba(255, 255, 255, 0.14);

  /* ink */
  --fg: #ededf1;
  --fg2: #a7a7b4;
  --dim: #6d6d79;

  /* guise palette (open-color, shade 6 unless noted) */
  --blue: #228be6; --blue3: #74c0fc; --blue0: #e7f5ff;
  --violet: #7950f2; --violet3: #b197fc;
  --grape: #be4bdb; --grape3: #e599f7;
  --indigo: #4c6ef5;
  --pink: #e64980; --pink4: #f783ac;
  --teal: #12b886; --teal3: #63e6be;
  --cyan: #15aabf;
  --green: #40c057; --green3: #8ce99a;
  --lime: #82c91e;
  --yellow: #fab005;
  --orange: #fd7e14; --orange2: #ffc078;
  --red: #fa5252;
  --gray: #868e96;

  --accent: var(--violet);
  --maxw: 1140px;
  --r: 16px;

  --sans: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
  --body: "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg2);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--sans); color: var(--fg); font-weight: 700; letter-spacing: -0.02em; line-height: 1.05; margin: 0; }
p { margin: 0; }
code, pre { font-family: var(--mono); }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* gradient word */
.grad, .ital {
  background: linear-gradient(100deg, var(--blue), var(--violet) 45%, var(--grape));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.ital { font-style: normal; }

/* ---------- header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(150%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { max-width: var(--maxw); margin: 0 auto; padding: 13px 24px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--sans); font-weight: 800; color: var(--fg); letter-spacing: -0.02em; font-size: 18px; }
.brand-mark { width: 16px; height: 16px; border-radius: 6px; background: linear-gradient(135deg, var(--blue), var(--violet) 50%, var(--grape)); box-shadow: 0 0 16px rgba(121, 80, 242, 0.6); }
.topnav { display: flex; align-items: center; gap: 6px; }
.topnav a { padding: 7px 13px; border-radius: 999px; color: var(--fg2); font-size: 14.5px; font-weight: 500; transition: 0.15s; }
.topnav a:hover { color: var(--fg); background: var(--raise); }
.topnav a.active { color: var(--fg); background: var(--raise); }
.topnav .ext { color: var(--dim); }
.navtoggle { display: none; background: none; border: 0; color: var(--fg); font-size: 22px; cursor: pointer; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: 999px; font-family: var(--sans); font-weight: 600; font-size: 15px; cursor: pointer; transition: 0.16s; border: 1px solid transparent; }
.btn-primary { background: #f1f1f4; color: #0c0c0f; }
.btn-primary:hover { background: #fff; transform: translateY(-1px); }
.btn-ghost { background: rgba(255, 255, 255, 0.04); color: var(--fg); border-color: var(--line2); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.09); }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; padding: 92px 0 40px; text-align: center; }
.hero::before {
  content: ""; position: absolute; inset: -10% -10% auto -10%; height: 720px; z-index: 0;
  background:
    radial-gradient(60% 60% at 50% 8%, rgba(121, 80, 242, 0.30), transparent 70%),
    radial-gradient(40% 40% at 78% 30%, rgba(190, 75, 219, 0.22), transparent 70%),
    radial-gradient(40% 40% at 22% 32%, rgba(34, 139, 230, 0.20), transparent 70%);
  pointer-events: none;
}
.hero .container { position: relative; z-index: 1; }
.eyebrow { display: inline-block; font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--fg2); padding: 6px 14px; border: 1px solid var(--line2); border-radius: 999px; background: rgba(255, 255, 255, 0.03); margin-bottom: 26px; }
.display { font-size: clamp(40px, 7vw, 82px); font-weight: 800; letter-spacing: -0.035em; }
.hero .display { margin: 0 auto; max-width: 14ch; }
.lead { color: var(--fg2); font-size: clamp(17px, 2vw, 21px); line-height: 1.5; max-width: 60ch; margin: 22px auto 0; }
.lead a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--line2); text-underline-offset: 3px; }
.lead a:hover { text-decoration-color: var(--violet3); }
.hero-cta { display: flex; gap: 12px; justify-content: center; margin-top: 30px; flex-wrap: wrap; }

/* install command pill */
.cmd { display: inline-flex; align-items: center; gap: 12px; margin-top: 30px; padding: 7px 7px 7px 18px; border: 1px solid var(--line2); border-radius: 999px; background: rgba(255, 255, 255, 0.03); font-family: var(--mono); font-size: 13.5px; color: var(--fg); max-width: 100%; }
.cmd code { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.copybtn { font-family: var(--sans); font-weight: 600; font-size: 13px; color: #0c0c0f; background: #ededf1; border: 0; border-radius: 999px; padding: 7px 14px; cursor: pointer; transition: 0.15s; }
.copybtn:hover { background: #fff; }
.copybtn.ok { background: var(--teal3); }

/* ---------- annotated hero exhibit ---------- */
.exhibit { position: relative; margin: 60px auto 0; max-width: 940px; }
.exhibit-wash { position: absolute; inset: -40px -40px -60px; z-index: 0; border-radius: 40px;
  background: radial-gradient(60% 80% at 50% 60%, rgba(121, 80, 242, 0.28), transparent 72%); filter: blur(6px); }
.winwrap { position: relative; width: max-content; max-width: 100%; margin: 0 auto; }
.win { position: relative; z-index: 1; border: 1px solid var(--line2); border-radius: 18px; overflow: hidden; background: #131318; box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.8); }
.win-bar { display: flex; align-items: center; gap: 14px; padding: 12px 16px; background: #1a1a20; border-bottom: 1px solid var(--line); }
.win-dots { display: inline-flex; gap: 7px; }
.win-dots i { width: 11px; height: 11px; border-radius: 50%; background: #3a3a44; }
.win-dots i:nth-child(1) { background: #ff5f57; } .win-dots i:nth-child(2) { background: #febc2e; } .win-dots i:nth-child(3) { background: #28c840; }
.win-title { font-family: var(--mono); font-size: 12.5px; color: var(--dim); }
.win-body { padding: 26px; text-align: left; }

/* callouts */
.cal { position: absolute; z-index: 3; font-family: var(--mono); font-size: 12px; color: var(--fg); white-space: nowrap; }
.cal span { border-bottom: 1px solid var(--violet3); padding-bottom: 2px; }
.cal::after { content: ""; position: absolute; width: 30px; height: 1px; background: linear-gradient(90deg, var(--violet3), transparent); }
.cal::before { content: ""; position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--violet3); box-shadow: 0 0 8px var(--violet3); }
.cal-l { right: 100%; padding-right: 38px; }
.cal-l::after { right: 2px; top: 50%; }
.cal-l::before { right: 0; top: calc(50% - 3px); }
.cal-r { left: 100%; padding-left: 38px; }
.cal-r::after { left: 2px; top: 50%; transform: scaleX(-1); }
.cal-r::before { left: 0; top: calc(50% - 3px); }

/* ---------- palette ribbon ---------- */
.ribbon { display: flex; gap: 6px; margin: 46px auto 0; max-width: 720px; }
.ribbon .swatch { flex: 1; height: 30px; border-radius: 7px; background: var(--c); display: flex; align-items: flex-end; justify-content: center; }
.ribbon--labelled .swatch { height: 42px; }
.ribbon .swatch em { font-family: var(--mono); font-style: normal; font-size: 8.5px; color: rgba(0, 0, 0, 0.55); padding-bottom: 3px; font-weight: 600; }
.ribbon-cap { font-family: var(--mono); font-size: 12px; color: var(--dim); text-align: center; margin-top: 14px; }

/* ---------- bands / sections ---------- */
.band { position: relative; padding: 86px 0; border-top: 1px solid var(--line); overflow: hidden; }
.band::before { content: ""; position: absolute; inset: 0; z-index: 0; opacity: 0.5;
  background: radial-gradient(50% 60% at 15% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%); pointer-events: none; }
.band .container { position: relative; z-index: 1; }
.band-blue { --accent: var(--blue); }
.band-violet { --accent: var(--violet); }
.band-grape { --accent: var(--grape); }
.band-teal { --accent: var(--teal); }
.band-pink { --accent: var(--pink); }

.band-head { max-width: 720px; margin-bottom: 44px; }
.band-head h2 { font-size: clamp(30px, 4.6vw, 50px); font-weight: 800; }
.band-head .gw { background: linear-gradient(100deg, var(--accent), color-mix(in srgb, var(--accent) 40%, var(--pink))); -webkit-background-clip: text; background-clip: text; color: transparent; }
.band-head p { color: var(--fg2); font-size: 18px; margin-top: 16px; }
.learn { display: inline-flex; align-items: center; gap: 7px; margin-top: 18px; font-family: var(--sans); font-weight: 600; color: var(--accent); }
.learn:hover { gap: 11px; }

/* feature cards */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 26px; transition: 0.18s; }
.feature:hover { border-color: var(--line2); transform: translateY(-3px); background: var(--card2); }
.feature .ic { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 11px; font-size: 19px; color: #fff; background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 50%, #000)); margin-bottom: 16px; }
.feature h3 { font-size: 18.5px; margin-bottom: 8px; }
.feature p { font-size: 14.6px; color: var(--fg2); line-height: 1.55; }
.feature code { background: rgba(255, 255, 255, 0.06); padding: 1px 6px; border-radius: 5px; font-size: 12.5px; color: var(--blue3); }

/* split (copy + code) */
.split { display: grid; grid-template-columns: 1fr 1.05fr; gap: 46px; align-items: center; }
.split.rev .split-copy { order: 2; }
.split-copy h2 { font-size: clamp(28px, 4vw, 46px); font-weight: 800; margin-bottom: 18px; }
.split-copy p { color: var(--fg2); font-size: 17px; }
.split-copy code { background: rgba(255, 255, 255, 0.06); padding: 1px 6px; border-radius: 5px; font-size: 13px; color: var(--blue3); }
.ticks { list-style: none; padding: 0; margin: 22px 0; display: grid; gap: 11px; }
.ticks li { position: relative; padding-left: 28px; color: var(--fg); font-size: 15px; }
.ticks li::before { content: ""; position: absolute; left: 0; top: 7px; width: 16px; height: 16px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 28%, transparent); border: 1px solid var(--accent); }
.ticks li::after { content: "✓"; position: absolute; left: 4px; top: 2px; font-size: 10px; color: var(--accent); }

/* code panel */
.codepanel { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #0f0f14; box-shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.9); }
.codepanel-bar { display: flex; align-items: center; gap: 8px; padding: 11px 15px; background: #15151b; border-bottom: 1px solid var(--line); }
.codepanel-bar i { width: 10px; height: 10px; border-radius: 50%; background: #3a3a44; }
.codepanel-bar i:nth-child(1) { background: #ff5f57; } .codepanel-bar i:nth-child(2) { background: #febc2e; } .codepanel-bar i:nth-child(3) { background: #28c840; }
.codepanel-bar span { font-family: var(--mono); font-size: 12px; color: var(--dim); margin-left: 6px; }
pre.code { margin: 0; padding: 20px; overflow-x: auto; font-size: 13px; line-height: 1.7; }
pre.code code { color: #c7c7d1; }
.t-c { color: #6b6b78; font-style: italic; }
.t-k { color: var(--pink4); }
.t-t { color: var(--blue3); }
.t-s { color: var(--green3); }

/* plate grid (gallery + teaser) */
.plate-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.plate { margin: 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); overflow: hidden; transition: 0.18s; }
.plate:hover { border-color: var(--line2); transform: translateY(-3px); }
.plate--wide { grid-column: span 2; }
.plate-stage { padding: 28px; min-height: 150px; display: flex; align-items: center; justify-content: center; background: radial-gradient(120% 120% at 50% 0%, rgba(255, 255, 255, 0.03), transparent 60%); }
.plate-cap { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 12px; }
.plate-idx { color: var(--accent, var(--violet)); font-weight: 600; }
.plate-name { color: var(--fg); font-weight: 600; }
.plate-note { color: var(--dim); }
.plate-link { margin-left: auto; color: var(--fg2); }
.plate-link:hover { color: var(--fg); }
.more-link { display: inline-block; margin-top: 28px; font-family: var(--sans); font-weight: 600; color: var(--fg); }
.more-link:hover { color: var(--violet3); }

/* systems list */
.syslist { display: grid; gap: 0; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.sysrow { display: grid; grid-template-columns: 56px 1fr 1.4fr 30px; align-items: center; gap: 14px; padding: 18px 22px; border-bottom: 1px solid var(--line); transition: 0.15s; }
.sysrow:last-child { border-bottom: 0; }
.sysrow:hover { background: var(--card); }
.sys-n { font-family: var(--mono); color: var(--dim); font-size: 13px; }
.sys-t { font-family: var(--sans); font-weight: 700; color: var(--fg); font-size: 17px; }
.sys-d { font-family: var(--mono); font-size: 12.5px; color: var(--fg2); }
.sys-x { color: var(--dim); text-align: right; }
.sysrow:hover .sys-x { color: var(--violet3); }

/* end cta cards */
.endgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 40px; }
.endcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 26px; transition: 0.18s; }
.endcard:hover { border-color: var(--line2); transform: translateY(-3px); }
.endcard h3 { font-size: 18px; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.endcard p { font-size: 14.5px; color: var(--fg2); }

/* ---------- footer ---------- */
.sitefooter { border-top: 1px solid var(--line); padding: 56px 0 30px; margin-top: 30px; }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; }
.foot-word { font-family: var(--sans); font-weight: 800; font-size: 20px; color: var(--fg); }
.foot-brand p { color: var(--fg2); font-size: 14px; margin: 10px 0; max-width: 30ch; }
.foot-meta { font-family: var(--mono); font-size: 12px; color: var(--dim); }
.foot-h { display: block; font-family: var(--sans); font-weight: 700; color: var(--fg); font-size: 13px; margin-bottom: 12px; }
.foot-col a { display: block; color: var(--fg2); font-size: 14px; padding: 4px 0; }
.foot-col a:hover { color: var(--fg); }
.foot-base { display: flex; justify-content: space-between; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 12px; color: var(--dim); }

/* =====================================================================
   guise mock components (.g-*) — dark theme, real Mantine palette
   ===================================================================== */
.g-app { width: 360px; }
.g-stack { display: flex; flex-direction: column; gap: 14px; }
.g-col { display: flex; flex-direction: column; gap: 12px; width: 100%; }
.g-col--gap { gap: 14px; }
.g-col--center { align-items: center; gap: 16px; }
.g-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.g-group { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.g-title { font-family: var(--sans); font-weight: 700; color: var(--fg); font-size: 16px; }
.g-dimmed { color: #8b8b97; font-size: 13.5px; }

.g-btn { font-family: var(--sans); font-weight: 600; font-size: 13.5px; padding: 8px 15px; border-radius: 8px; border: 1px solid transparent; cursor: pointer; transition: 0.15s; }
.g-btn--filled { background: var(--blue); color: #fff; }
.g-btn--filled:hover { background: #1c7ed6; }
.g-btn--filled.is-red { background: var(--red); }
.g-btn--light { background: rgba(34, 139, 230, 0.18); color: var(--blue3); }
.g-btn--outline { background: transparent; border-color: rgba(34, 139, 230, 0.5); color: var(--blue3); }
.g-btn--subtle { background: transparent; color: #b9b9c4; }
.g-btn--subtle:hover { background: rgba(255, 255, 255, 0.06); }

.g-aicon, .g-themeicon { width: 34px; height: 34px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; cursor: pointer; }
.g-aicon.is-blue { background: rgba(34, 139, 230, 0.16); color: var(--blue3); }
.g-aicon.is-grape { background: rgba(190, 75, 219, 0.16); color: var(--grape3); }
.g-aicon.is-red { background: rgba(250, 82, 82, 0.16); color: #ffa8a8; }
.g-aicon.is-teal { background: rgba(18, 184, 134, 0.16); color: var(--teal3); }
.g-themeicon.is-violet { background: var(--violet); color: #fff; }

.g-badge { font-family: var(--sans); font-weight: 700; font-size: 11px; letter-spacing: 0.02em; padding: 4px 9px; border-radius: 999px; text-transform: uppercase; }
.g-badge.is-blue { background: rgba(34, 139, 230, 0.2); color: var(--blue3); }
.g-badge.is-violet { background: rgba(121, 80, 242, 0.22); color: var(--violet3); }
.g-badge.is-teal { background: rgba(18, 184, 134, 0.2); color: var(--teal3); }
.g-badge.is-grape { background: rgba(190, 75, 219, 0.2); color: var(--grape3); }
.g-badge.is-orange { background: rgba(253, 126, 20, 0.2); color: var(--orange2); }
.g-badge.is-red { background: rgba(250, 82, 82, 0.2); color: #ffa8a8; }

.g-field { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.g-label { font-family: var(--sans); font-weight: 600; font-size: 12.5px; color: #c4c4ce; }
.g-input, .g-select { display: flex; align-items: center; gap: 4px; padding: 9px 12px; background: #1f1f26; border: 1px solid #32323b; border-radius: 8px; color: var(--fg); font-size: 13.5px; }
.g-input { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(34, 139, 230, 0.18); }
.g-select { justify-content: space-between; }
.g-caret { width: 1px; height: 15px; background: var(--blue3); margin-left: 1px; animation: blink 1.1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.g-chev { width: 7px; height: 7px; border-right: 1.5px solid #8b8b97; border-bottom: 1.5px solid #8b8b97; transform: rotate(45deg); }

.g-switch { width: 38px; height: 22px; border-radius: 999px; background: #3a3a44; position: relative; transition: 0.18s; cursor: pointer; flex: none; }
.g-switch i { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: 0.18s; }
.g-switch.is-on { background: var(--blue); }
.g-switch.is-on i { left: 19px; }
.g-switchrow, .g-checkrow, .g-radiorow { display: flex; align-items: center; gap: 11px; }
.g-check { width: 20px; height: 20px; border-radius: 6px; border: 1px solid #44444f; display: inline-flex; align-items: center; justify-content: center; color: transparent; font-size: 12px; flex: none; }
.g-check.is-on { background: var(--blue); border-color: var(--blue); color: #fff; }
.g-radio { width: 20px; height: 20px; border-radius: 50%; border: 1px solid #44444f; flex: none; position: relative; }
.g-radio.is-on { border-color: var(--blue); }
.g-radio.is-on::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--blue); }

.g-slider { position: relative; height: 6px; border-radius: 999px; background: #32323b; width: 100%; }
.g-slider-fill { position: absolute; left: 0; top: 0; height: 100%; border-radius: 999px; background: var(--blue); }
.g-slider-knob { position: absolute; top: 50%; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--blue); transform: translate(-50%, -50%); }

.g-segmented { display: inline-flex; background: #1f1f26; border: 1px solid #32323b; border-radius: 9px; padding: 3px; }
.g-segmented span { font-family: var(--sans); font-weight: 600; font-size: 12.5px; padding: 6px 14px; border-radius: 6px; color: #9a9aa6; }
.g-segmented span.is-on { background: #2f2f3a; color: var(--fg); }

.g-chip { font-family: var(--sans); font-weight: 600; font-size: 12.5px; padding: 6px 13px; border-radius: 999px; border: 1px solid #38383f; color: #b9b9c4; }
.g-chip.is-on { border-color: var(--blue); background: rgba(34, 139, 230, 0.14); color: var(--blue3); }

.g-alert { display: flex; gap: 12px; padding: 13px 15px; border-radius: 10px; background: #1a1a20; border: 1px solid var(--line); }
.g-alert-bar { width: 3px; border-radius: 3px; background: var(--blue); flex: none; }
.g-alert-bar.is-teal { background: var(--teal); }
.g-alert-bar.is-red { background: var(--red); }
.g-alert strong { display: block; color: var(--fg); font-size: 13.5px; font-family: var(--sans); }
.g-alert .g-dimmed { font-size: 12.5px; }

.g-progress { height: 8px; border-radius: 999px; background: #2a2a32; overflow: hidden; width: 100%; }
.g-progress span { display: block; height: 100%; border-radius: 999px; background: var(--blue); }
.g-progress span.is-teal { background: var(--teal); }

.g-ring { width: 40px; height: 40px; border-radius: 50%; background: conic-gradient(var(--blue) 0 68%, #2a2a32 68% 100%); position: relative; }
.g-ring::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--card); }
.g-ring.is-grape { background: conic-gradient(var(--grape) 0 45%, #2a2a32 45% 100%); }

.g-loader { width: 24px; height: 24px; border-radius: 50%; border: 3px solid #2a2a32; border-top-color: var(--blue); animation: spin 0.8s linear infinite; }
.g-loader.is-grape { border-top-color: var(--grape); }
.g-loader.is-teal { border-top-color: var(--teal); }
@keyframes spin { to { transform: rotate(360deg); } }

.g-skel { height: 12px; border-radius: 6px; background: linear-gradient(90deg, #22222a, #2e2e38, #22222a); background-size: 200% 100%; animation: shine 1.4s linear infinite; }
@keyframes shine { to { background-position: -200% 0; } }

.g-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); width: 100%; }
.g-tabs span { font-family: var(--sans); font-weight: 600; font-size: 13px; padding: 9px 13px; color: #9a9aa6; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.g-tabs span.is-on { color: var(--fg); border-bottom-color: var(--blue); }

.g-avatars { display: flex; }
.g-avatars i { width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-family: var(--sans); font-weight: 700; font-size: 12px; color: #fff; border: 2px solid var(--card); margin-left: -8px; font-style: normal; }
.g-avatars i:first-child { margin-left: 0; }
.g-avatars i.is-blue { background: var(--blue); } .g-avatars i.is-grape { background: var(--grape); } .g-avatars i.is-teal { background: var(--teal); }
.g-avatars i.more { background: #2f2f3a; color: #b9b9c4; }

.g-menu { width: 200px; background: #1a1a20; border: 1px solid var(--line2); border-radius: 11px; padding: 6px; display: flex; flex-direction: column; box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.9); }
.g-menu-h { font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--dim); padding: 6px 10px; }
.g-menu-i { font-size: 13.5px; color: #d4d4dd; padding: 8px 10px; border-radius: 7px; }
.g-menu-i.is-on { background: rgba(34, 139, 230, 0.16); color: var(--blue3); }
.g-menu-i.is-danger { color: #ffa8a8; }
.g-menu-i.is-danger:hover { background: rgba(250, 82, 82, 0.14); }

.g-table { width: 100%; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; font-size: 13px; }
.g-tr { display: grid; grid-template-columns: 1.4fr 1fr 0.9fr; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); color: #d4d4dd; }
.g-tr:last-child { border-bottom: 0; }
.g-th { background: #1a1a20; font-family: var(--sans); font-weight: 700; color: var(--fg2); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.03em; }

.g-timeline { display: flex; flex-direction: column; width: 100%; }
.g-tl-item { display: flex; gap: 13px; padding-bottom: 16px; position: relative; }
.g-tl-item > i { width: 13px; height: 13px; border-radius: 50%; background: var(--blue); border: 2px solid var(--card); flex: none; margin-top: 2px; z-index: 1; }
.g-tl-item::before { content: ""; position: absolute; left: 6px; top: 4px; bottom: -2px; width: 1px; background: #32323b; }
.g-tl-item.is-last::before { display: none; }
.g-tl-item strong { display: block; font-family: var(--sans); font-size: 13.5px; color: var(--fg); }
.g-tl-item .g-dimmed { font-size: 12px; }

.g-modalmock { width: 100%; border-radius: 12px; background: repeating-linear-gradient(45deg, #161619, #161619 10px, #18181c 10px, #18181c 20px); padding: 26px; display: flex; align-items: center; justify-content: center; }
.g-modal { width: 100%; max-width: 280px; background: #1b1b21; border: 1px solid var(--line2); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 24px 50px -20px rgba(0, 0, 0, 0.9); }
.g-modal .g-group { margin-top: 8px; justify-content: flex-end; }

.g-tooltip { position: relative; font-family: var(--sans); font-weight: 600; font-size: 12.5px; color: #0c0c0f; background: #ededf1; padding: 6px 11px; border-radius: 7px; }
.g-tooltip::after { content: ""; position: absolute; left: 50%; bottom: -5px; transform: translateX(-50%); border: 5px solid transparent; border-top-color: #ededf1; }

.g-stepper { display: flex; align-items: center; gap: 8px; width: 100%; justify-content: center; }
.g-step { display: flex; align-items: center; gap: 9px; }
.g-step i { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-family: var(--sans); font-weight: 700; font-size: 12px; background: #2a2a32; color: #9a9aa6; font-style: normal; }
.g-step span { font-family: var(--sans); font-weight: 600; font-size: 13px; color: #9a9aa6; }
.g-step.is-done i { background: var(--teal); color: #fff; } .g-step.is-done span { color: var(--fg); }
.g-step.is-on i { background: var(--blue); color: #fff; } .g-step.is-on span { color: var(--fg); }
.g-step:not(:last-child)::after { content: ""; width: 26px; height: 1px; background: #32323b; }

.g-pager { display: flex; gap: 6px; }
.g-pager span { min-width: 30px; height: 30px; padding: 0 6px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-family: var(--sans); font-weight: 600; font-size: 13px; color: #b9b9c4; border: 1px solid #2e2e36; }
.g-pager span.is-on { background: var(--blue); color: #fff; border-color: var(--blue); }

.g-crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.g-crumbs a { color: var(--blue3); } .g-crumbs i { color: var(--dim); font-style: normal; } .g-crumbs span { color: var(--fg2); }
.g-navlinks { display: flex; flex-direction: column; gap: 4px; width: 100%; }
.g-navlink { font-family: var(--sans); font-weight: 600; font-size: 13.5px; padding: 8px 12px; border-radius: 8px; color: #9a9aa6; }
.g-navlink.is-on { background: rgba(34, 139, 230, 0.14); color: var(--blue3); }

.g-cardmock { width: 100%; max-width: 280px; background: #1b1b21; border: 1px solid var(--line); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.g-cardmock .g-row { margin-top: 8px; }
.g-price { font-family: var(--sans); font-weight: 800; font-size: 26px; color: var(--fg); }
.g-price em { font-style: normal; font-size: 13px; color: var(--dim); font-weight: 500; }

.g-webview { width: 100%; border: 1px solid var(--line2); border-radius: 12px; overflow: hidden; }
.g-webbar { display: flex; align-items: center; gap: 8px; padding: 9px 13px; background: #1a1a20; border-bottom: 1px solid var(--line); }
.g-webbar i { width: 9px; height: 9px; border-radius: 50%; background: #3a3a44; }
.g-webbar span { font-family: var(--mono); font-size: 11.5px; color: var(--dim); margin-left: 6px; }
.g-webbody { padding: 28px; text-align: center; background: linear-gradient(135deg, rgba(76, 110, 245, 0.18), rgba(190, 75, 219, 0.18)); }
.g-webbody strong { display: block; font-family: var(--sans); font-size: 18px; color: var(--fg); margin-bottom: 4px; }
.g-webbody span { color: var(--fg2); font-size: 13px; }

/* =====================================================================
   docs
   ===================================================================== */
.docshell { max-width: 1240px; margin: 0 auto; padding: 38px 24px 60px; display: grid; grid-template-columns: 230px minmax(0, 1fr) 200px; gap: 40px; align-items: start; }
.sidebar { position: sticky; top: 78px; max-height: calc(100vh - 100px); overflow-y: auto; }
.navgroup { margin-bottom: 22px; }
.navgroup-title { display: block; font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--dim); margin-bottom: 9px; }
.navgroup ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.navgroup a { display: block; padding: 6px 12px; border-radius: 7px; color: var(--fg2); font-size: 14px; transition: 0.13s; }
.navgroup a:hover { color: var(--fg); background: var(--raise); }
.navgroup a.active { color: var(--fg); background: var(--card); box-shadow: inset 2px 0 0 var(--violet); }

.toc { position: sticky; top: 78px; }
.toc-title { display: block; font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--dim); margin-bottom: 10px; }
.toc ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; border-left: 1px solid var(--line); }
.toc a { display: block; padding: 3px 0 3px 14px; font-size: 13px; color: var(--fg2); margin-left: -1px; border-left: 1px solid transparent; }
.toc a:hover { color: var(--fg); border-left-color: var(--violet3); }
.toc .lvl3 a { padding-left: 26px; font-size: 12.5px; color: var(--dim); }

.doc { min-width: 0; font-size: 15.5px; line-height: 1.72; color: var(--fg2); }
.doc h1 { font-size: clamp(32px, 5vw, 44px); font-weight: 800; letter-spacing: -0.03em; margin-bottom: 18px; }
.doc h2 { font-size: 25px; font-weight: 700; margin: 44px 0 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.doc h3 { font-size: 19px; font-weight: 700; margin: 30px 0 10px; }
.doc h2 .anchor, .doc h3 .anchor { color: var(--dim); margin-left: -22px; padding-right: 8px; opacity: 0; font-weight: 400; }
.doc h2:hover .anchor, .doc h3:hover .anchor { opacity: 1; color: var(--violet3); }
.doc p { margin: 14px 0; }
.doc a { color: var(--blue3); text-decoration: underline; text-decoration-color: rgba(116, 192, 252, 0.3); text-underline-offset: 2px; }
.doc a:hover { text-decoration-color: var(--blue3); }
.doc ul, .doc ol { padding-left: 22px; margin: 14px 0; }
.doc li { margin: 6px 0; }
.doc strong { color: var(--fg); }
.doc code { background: rgba(255, 255, 255, 0.07); padding: 2px 6px; border-radius: 5px; font-size: 13px; color: var(--blue3); }
.doc pre { background: #0f0f14; border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; overflow-x: auto; margin: 18px 0; }
.doc pre code { background: none; padding: 0; color: #c7c7d1; font-size: 13px; line-height: 1.7; }
.doc blockquote { margin: 18px 0; padding: 12px 18px; border-left: 3px solid var(--violet); background: rgba(121, 80, 242, 0.08); border-radius: 0 8px 8px 0; color: var(--fg2); }
.doc blockquote p { margin: 0; }
.doc table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 14px; display: block; overflow-x: auto; }
.doc th, .doc td { text-align: left; padding: 9px 14px; border: 1px solid var(--line); }
.doc th { background: #16161b; color: var(--fg); font-family: var(--sans); font-weight: 700; }
.doc td code { font-size: 12.5px; }
.doc hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }

/* =====================================================================
   hljs token colors (dark)
   ===================================================================== */
.hljs-comment, .hljs-quote { color: #6b6b78; font-style: italic; }
.hljs-keyword, .hljs-selector-tag, .hljs-literal { color: var(--pink4); }
.hljs-type, .hljs-class .hljs-title, .hljs-title.class_ { color: var(--blue3); }
.hljs-title, .hljs-title.function_, .hljs-section { color: var(--violet3); }
.hljs-string, .hljs-meta-string { color: var(--green3); }
.hljs-number, .hljs-symbol { color: var(--orange2); }
.hljs-attr, .hljs-attribute, .hljs-property { color: #ffe066; }
.hljs-built_in, .hljs-name { color: var(--blue3); }
.hljs-meta, .hljs-comment.doc { color: #7a7a86; }
.hljs-punctuation, .hljs-operator { color: #9a9aa6; }

/* =====================================================================
   docs UX: search, previews, callouts, copy, paging, docs home
   ===================================================================== */

/* header search trigger */
.search-trigger { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; margin-right: 10px; padding: 7px 10px 7px 13px; border: 1px solid var(--line2); border-radius: 999px; background: rgba(255, 255, 255, 0.03); color: var(--fg2); font-family: var(--body); font-size: 13px; cursor: pointer; transition: 0.15s; }
.search-trigger:hover { color: var(--fg); background: var(--raise); }
.search-trigger kbd { font-family: var(--mono); font-size: 11px; color: var(--dim); border: 1px solid var(--line2); border-radius: 5px; padding: 1px 5px; }

/* search modal */
.search[hidden] { display: none; }
.search { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding-top: 11vh; }
.search-mask { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.62); backdrop-filter: blur(3px); }
.search-box { position: relative; width: min(620px, 92vw); background: #141418; border: 1px solid var(--line2); border-radius: 16px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.85); overflow: hidden; }
.search-top { display: flex; align-items: center; gap: 11px; padding: 15px 17px; border-bottom: 1px solid var(--line); color: var(--dim); }
.search-input { flex: 1; background: none; border: 0; outline: 0; color: var(--fg); font-size: 16px; font-family: var(--body); }
.search-top kbd, .search-foot kbd { font-family: var(--mono); font-size: 10.5px; color: var(--dim); border: 1px solid var(--line2); border-radius: 5px; padding: 1px 5px; }
.search-results { max-height: 52vh; overflow-y: auto; padding: 8px; }
.search-item { display: flex; flex-direction: column; gap: 2px; padding: 10px 13px; border-radius: 10px; }
.search-item .si-t { color: var(--fg2); font-weight: 600; font-size: 14.5px; }
.search-item .si-s { color: var(--dim); font-size: 11.5px; font-family: var(--mono); }
.search-item.sel { background: rgba(121, 80, 242, 0.18); }
.search-item.sel .si-t { color: #fff; }
.search-empty { padding: 28px; text-align: center; color: var(--dim); }
.search-foot { display: flex; gap: 16px; padding: 11px 17px; border-top: 1px solid var(--line); color: var(--dim); font-size: 12px; }
.search-foot span { display: inline-flex; align-items: center; gap: 5px; }
body.searching { overflow: hidden; }

/* live component preview */
.preview { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin: 0 0 30px; background: var(--card); }
.preview-bar { display: flex; align-items: center; justify-content: space-between; padding: 9px 15px; border-bottom: 1px solid var(--line); }
.preview-tag { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--violet3); }
.preview-note { font-family: var(--mono); font-size: 11px; color: var(--dim); }
.preview-stage { padding: 32px; display: flex; align-items: center; justify-content: center; background: radial-gradient(120% 120% at 50% 0%, rgba(121, 80, 242, 0.08), transparent 62%); }
.pv-wrap { display: flex; flex-direction: column; gap: 18px; align-items: center; }
.pv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; width: 100%; max-width: 620px; align-items: start; }
.pv-type { align-items: flex-start; width: 100%; max-width: 560px; }
.g-anchor { color: var(--blue3); text-decoration: underline; font-size: 14px; }
.g-codeinline { font-family: var(--mono); font-size: 12.5px; background: rgba(255, 255, 255, 0.07); color: var(--blue3); padding: 2px 7px; border-radius: 6px; }
.g-kbd { font-family: var(--mono); font-size: 12px; color: var(--fg); background: #222228; border: 1px solid #34343d; border-bottom-width: 2px; border-radius: 6px; padding: 2px 8px; }

/* doc head + breadcrumb + mobile toggle */
.doc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.crumbs { font-family: var(--mono); font-size: 12px; color: var(--dim); }
.crumbs a { color: var(--fg2); }
.crumbs a:hover { color: var(--fg); }
.crumbs span { margin: 0 3px; }
.docs-toggle { display: none; background: var(--raise); border: 1px solid var(--line2); color: var(--fg); border-radius: 8px; padding: 6px 12px; font-size: 13px; cursor: pointer; }

/* callouts */
.admon { display: flex; gap: 14px; margin: 20px 0; padding: 14px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); }
.admon-l { flex: none; font-family: var(--sans); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; padding: 3px 9px; border-radius: 999px; height: fit-content; }
.admon-b { min-width: 0; }
.admon-b p { margin: 0; }
.admon-b p + p { margin-top: 8px; }
.admon-note { border-color: rgba(34, 139, 230, 0.3); background: rgba(34, 139, 230, 0.07); }
.admon-note .admon-l { background: rgba(34, 139, 230, 0.2); color: var(--blue3); }
.admon-tip { border-color: rgba(18, 184, 134, 0.3); background: rgba(18, 184, 134, 0.07); }
.admon-tip .admon-l { background: rgba(18, 184, 134, 0.2); color: var(--teal3); }
.admon-warn { border-color: rgba(250, 82, 82, 0.3); background: rgba(250, 82, 82, 0.07); }
.admon-warn .admon-l { background: rgba(250, 82, 82, 0.2); color: #ffa8a8; }

/* code copy */
.doc .codeblock { position: relative; margin: 18px 0; }
.doc .codeblock pre { margin: 0; }
.codecopy { position: absolute; top: 10px; right: 10px; z-index: 2; font-family: var(--sans); font-weight: 600; font-size: 11.5px; color: var(--fg2); background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line2); border-radius: 7px; padding: 4px 10px; cursor: pointer; opacity: 0; transition: 0.15s; }
.codeblock:hover .codecopy { opacity: 1; }
.codecopy:hover { color: var(--fg); background: rgba(255, 255, 255, 0.12); }
.codecopy.ok { color: var(--teal3); opacity: 1; }

/* scroll-spy active state */
.toc li.active > a { color: var(--fg); border-left-color: var(--violet); }

/* prev / next paging */
.pagenav { display: flex; justify-content: space-between; gap: 16px; margin-top: 50px; padding-top: 26px; border-top: 1px solid var(--line); }
.pagenav-link { display: flex; flex-direction: column; gap: 5px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 12px; min-width: 210px; transition: 0.15s; }
.pagenav-link:hover { border-color: var(--line2); background: var(--card); }
.pagenav-link span { font-size: 12px; color: var(--dim); font-family: var(--mono); }
.pagenav-link b { color: var(--fg); font-family: var(--sans); font-weight: 700; }
.pagenav-link.next { text-align: right; margin-left: auto; }
.doc-foot { margin-top: 26px; }
.doc-foot a { color: var(--fg2); font-size: 13.5px; }
.doc-foot a:hover { color: var(--blue3); }

/* docs home */
.docindex { padding: 58px 0 30px; }
.docindex .eyebrow { margin-bottom: 20px; }
.docindex .display { font-size: clamp(36px, 5.5vw, 60px); }
.docindex .lead { margin: 20px 0 0; max-width: 62ch; }
.docindex .hero-cta { justify-content: flex-start; margin-top: 26px; }
.kbd-inline { font-family: var(--mono); font-size: 12px; color: var(--fg); background: #222228; border: 1px solid #34343d; border-radius: 5px; padding: 1px 6px; }
.docsec { margin-top: 50px; }
.docsec-h { font-family: var(--sans); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--dim); margin-bottom: 18px; padding-bottom: 11px; border-bottom: 1px solid var(--line); }
.doccards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.doccard { padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); transition: 0.16s; }
.doccard:hover { border-color: var(--line2); transform: translateY(-3px); background: var(--card2); }
.doccard h3 { font-size: 16.5px; display: flex; align-items: center; justify-content: space-between; }
.doccard .arr { color: var(--dim); transition: 0.15s; }
.doccard:hover .arr { color: var(--violet3); transform: translateX(3px); }
.doccard p { margin-top: 7px; font-size: 13.5px; color: var(--fg2); line-height: 1.5; }

/* =====================================================================
   responsive
   ===================================================================== */
@media (max-width: 920px) {
  .feature-grid, .plate-grid, .endgrid { grid-template-columns: 1fr 1fr; }
  .plate--wide { grid-column: span 2; }
  .split { grid-template-columns: 1fr; }
  .split.rev .split-copy { order: 0; }
  .docshell { grid-template-columns: 1fr; }
  .sidebar, .toc { position: static; max-height: none; display: none; }
  body.nav-open .sidebar { display: block; }
  .cal { display: none; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  .topnav { display: none; }
  body.nav-open .topnav { display: flex; position: absolute; top: 56px; right: 16px; flex-direction: column; background: var(--raise); border: 1px solid var(--line2); border-radius: 12px; padding: 8px; }
  .navtoggle { display: block; }
  .feature-grid, .plate-grid, .endgrid { grid-template-columns: 1fr; }
  .plate--wide { grid-column: span 1; }
  .foot-grid { grid-template-columns: 1fr; }
  .foot-base { flex-direction: column; gap: 8px; }
  .sysrow { grid-template-columns: 40px 1fr 24px; }
  .sys-d { display: none; }
}

/* docs UX responsive */
@media (max-width: 920px) {
  .docs-toggle { display: inline-block; }
  body.docs-open .sidebar { display: block; position: static; max-height: none; margin-bottom: 24px; }
  .pv-grid { grid-template-columns: 1fr; }
  .doccards { grid-template-columns: 1fr 1fr; }
  .pagenav { flex-direction: column; }
  .pagenav-link { min-width: 0; }
  .pagenav-link.next { text-align: left; margin-left: 0; }
  .search-trigger > span { display: none; }
}
@media (max-width: 680px) {
  .doccards { grid-template-columns: 1fr; }
  .search-trigger > kbd { display: none; }
  .search-trigger { margin-right: 6px; }
}
