/* Design tokens and the landing page (overrides/home.html).
   The tokens match docs/assets/src/brand.css, which the README graphics use. */

:root {
  --ink: #0a0f1e;
  --ink-2: #111831;
  --ink-3: #1c2647;
  --well: #070b17;
  --amber: #f5b83d;
  --amber-2: #ffd27a;
  --amber-3: #c98f1c;
  --cream: #f4f1e8;
  --mist: #a7b0c8;
  --dim: #6b7594;
  --sky: #6cc4f0;
  --pass: #5fd38d;
  --block: #ff7a6b;
  --amber-a04: rgba(245, 184, 61, 0.04);
  --amber-a08: rgba(245, 184, 61, 0.08);
  --amber-a16: rgba(245, 184, 61, 0.16);
  --amber-a30: rgba(245, 184, 61, 0.3);
  --gr-radius: 0.8rem;
  --gr-radius-sm: 0.55rem;
  --gr-shadow: 0 30px 70px rgba(0, 0, 0, 0.5);
}

/* Material's dark scheme in the brand colors. */
[data-md-color-scheme="slate"] {
  --md-hue: 228;
  --md-default-bg-color: var(--ink);
  --md-default-fg-color: var(--cream);
  --md-default-fg-color--light: var(--mist);
  --md-primary-fg-color: var(--ink);
  --md-primary-fg-color--light: var(--ink-2);
  --md-primary-fg-color--dark: var(--ink-3);
  --md-primary-bg-color: var(--cream);
  --md-primary-bg-color--light: var(--mist);
  --md-accent-fg-color: var(--amber);
  --md-accent-fg-color--transparent: var(--amber-a08);
  --md-typeset-a-color: var(--amber);
  --md-footer-bg-color: var(--well);
  --md-footer-bg-color--dark: #05080f;
}

.md-header {
  background: rgba(10, 15, 30, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--amber-a08);
}
.md-header__title { font-weight: 700; letter-spacing: -0.02em; }
.md-header__button.md-logo img { height: 1.6rem; }

/* The landing page is all custom sections; Material's empty article goes.
   .md-main stays: on small screens it holds the menu drawer. */
.md-container:has(.gr) .md-content,
.md-container:has(.gr) .md-sidebar--secondary { display: none; }
.md-container:has(.gr) .md-main__inner { margin: 0; height: 0; }
.md-container:has(.gr) { min-height: 100vh; }

.gr {
  color: var(--mist);
  font-size: 0.85rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
.gr *, .gr *::before, .gr *::after { box-sizing: border-box; }
.gr a { color: var(--amber); }
.gr code {
  font-family: var(--md-code-font-family);
  font-variant-ligatures: none;
  font-size: 0.9em;
  color: var(--amber-2);
  background: var(--amber-a08);
  padding: 0.08em 0.38em;
  border-radius: 0.3em;
}
.gr svg { width: 1.1em; height: 1.1em; fill: currentColor; vertical-align: -0.18em; }

.gr-wrap { max-width: 62rem; margin: 0 auto; padding: 0 1rem; position: relative; }

.gr-grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(245, 184, 61, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 184, 61, 0.055) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse 80% 70% at 30% 40%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 30% 40%, #000 20%, transparent 75%);
}

/* Hero */
.gr-hero {
  position: relative;
  padding: 4.5rem 0 2.5rem;
  background:
    radial-gradient(900px 480px at 10% 25%, rgba(245, 184, 61, 0.16), transparent 70%),
    radial-gradient(700px 420px at 95% 90%, rgba(108, 196, 240, 0.10), transparent 70%);
}
.gr-hero__inner > *, .gr-split > * { min-width: 0; }
.gr-hero__inner { display: grid; grid-template-columns: 1fr 1.05fr; gap: 2.5rem; align-items: center; }
.gr-hero__logo {
  width: 3.9rem; height: 4.6rem;
  filter: drop-shadow(0 14px 24px rgba(0, 0, 0, 0.45));
  animation: gr-float 6s ease-in-out infinite;
}
.gr-title {
  margin: 0.6rem 0 0;
  font-size: clamp(2.8rem, 8vw, 4.4rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 0.95;
  color: var(--cream);
}
.gr-title span, .gr h2 span { color: var(--amber); }
.gr-tagline { margin: 1rem 0 0; font-size: 1.15rem; line-height: 1.45; }
.gr-tagline b { color: var(--cream); font-weight: 600; }

.gr-install {
  margin-top: 1.6rem;
  display: flex; align-items: center; gap: 0.6rem;
  max-width: 100%;
  padding: 0.55rem 0.55rem 0.55rem 0.9rem;
  background: var(--well);
  border: 1px solid var(--ink-3);
  border-radius: var(--gr-radius-sm);
  font-family: var(--md-code-font-family);
  font-size: 0.72rem;
}
.gr-install code {
  background: none; padding: 0; color: var(--cream);
  white-space: nowrap; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0;
}
.gr-install__prompt { color: var(--amber); }
.gr-install + .gr-install { margin-top: 0.5rem; }

.gr-copy {
  flex: none; cursor: pointer;
  display: inline-grid; place-items: center;
  width: 1.8rem; height: 1.8rem;
  color: var(--dim);
  background: var(--ink-2);
  border: 1px solid var(--ink-3);
  border-radius: 0.4rem;
  transition: color 0.15s, border-color 0.15s;
}
.gr-copy:hover, .gr-copy:focus-visible { color: var(--amber); border-color: var(--amber-3); }
.gr-copy.is-copied { color: var(--pass); border-color: var(--pass); }

.gr-cta { margin-top: 1.4rem; display: flex; flex-wrap: wrap; gap: 0.7rem; }
.gr-cta--center { justify-content: center; }
.gr-btn {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.6rem 1.1rem;
  font-weight: 600; font-size: 0.8rem;
  color: var(--cream) !important;
  background: var(--ink-2);
  border: 1px solid var(--ink-3);
  border-radius: var(--gr-radius-sm);
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.gr-btn:hover { transform: translateY(-1px); border-color: var(--amber-3); }
.gr-btn--primary {
  color: var(--ink) !important;
  background: linear-gradient(180deg, var(--amber-2), var(--amber));
  border-color: transparent;
  box-shadow: 0 8px 24px rgba(245, 184, 61, 0.22);
}
.gr-btn--primary:hover { box-shadow: 0 10px 30px rgba(245, 184, 61, 0.35); }

/* Terminal */
.gr-term {
  border-radius: var(--gr-radius);
  background: var(--well);
  border: 1px solid var(--ink-3);
  box-shadow: var(--gr-shadow), 0 0 0 1px var(--amber-a04);
  overflow: hidden;
  min-width: 0;
}
.gr-term__bar {
  height: 1.9rem; display: flex; align-items: center; gap: 0.4rem;
  padding: 0 0.75rem; background: var(--ink-2);
}
.gr-term__bar i { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: #2a3560; display: block; }
.gr-term__bar span {
  margin-left: auto; margin-right: auto; padding-right: 2.2rem;
  font-size: 0.65rem; color: var(--dim); font-family: var(--md-code-font-family);
}
.gr-term__body {
  padding: 1rem 1.1rem 1.2rem;
  font-family: var(--md-code-font-family);
  font-variant-ligatures: none;
  font-size: 0.72rem; line-height: 1.8;
  overflow-x: auto;
  min-height: 17rem;
}
.gr-term__body > div { white-space: pre; }
.gr .p { color: var(--amber); }
.gr .c { color: var(--cream); }
.gr .d { color: var(--dim); }
.gr .s { color: var(--sky); }
.gr .ok { color: var(--pass); }
.gr .bad { color: var(--block); }
.gr .a2 { color: var(--amber-2); }
.gr-caret {
  display: inline-block; width: 0.5em; height: 1.1em; margin-left: 2px;
  vertical-align: -0.2em; background: var(--amber);
  animation: gr-blink 1.1s steps(1) infinite;
}
.gr-term__body.is-typing > div { visibility: hidden; }
.gr-term__body.is-typing > div.is-shown { visibility: visible; }

/* Stats */
.gr-stats {
  list-style: none; margin: 3.5rem max(1rem, calc((100% - 60rem) / 2)) 0 !important;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  padding: 0 !important;
  background: var(--ink-3);
  border: 1px solid var(--ink-3);
  border-radius: var(--gr-radius);
  overflow: hidden;
  max-width: 60rem;
}
.gr-stats li { margin: 0 !important; padding: 1.1rem 1rem; background: rgba(10, 15, 30, 0.92); text-align: center; }
.gr-stats b { display: block; font-size: 1.5rem; font-weight: 800; color: var(--cream); letter-spacing: -0.03em; }
.gr-stats b em { font-style: normal; color: var(--amber); }
.gr-stats span { font-size: 0.72rem; color: var(--dim); }

/* Sections */
.gr-section { padding: 5rem 0; position: relative; }
.gr-section--alt {
  background: linear-gradient(180deg, rgba(17, 24, 49, 0.6), rgba(17, 24, 49, 0.25));
  border-top: 1px solid var(--amber-a08);
  border-bottom: 1px solid var(--amber-a08);
}
.gr-eyebrow {
  margin: 0 0 0.6rem; text-align: center;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--amber);
}
.gr h2 {
  margin: 0; text-align: center;
  font-size: clamp(1.6rem, 4vw, 2.3rem); font-weight: 800; letter-spacing: -0.035em; line-height: 1.12;
  color: var(--cream);
}
.gr h2 code { font-size: 0.85em; }
.gr-lede { margin: 1rem 0 1.4rem; font-size: 0.92rem; }
.gr-lede--center { text-align: center; max-width: 38rem; margin-left: auto; margin-right: auto; }
.gr-center { text-align: center; margin-top: 2rem; }
.gr-link { font-weight: 600; display: inline-flex; align-items: center; gap: 0.35rem; }
.gr-link svg { transition: transform 0.15s; }
.gr-link:hover svg { transform: translateX(3px); }

/* The loop */
.gr-loop {
  list-style: none; margin: 2.8rem 0 0 !important; padding: 0 !important;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; counter-reset: loop;
}
.gr-loop li {
  position: relative; margin: 0 !important;
  padding: 1.3rem 1.2rem 1.2rem;
  background: var(--well);
  border: 1px solid var(--ink-3);
  border-radius: var(--gr-radius);
}
.gr-loop li:not(:last-child)::after {
  content: ""; position: absolute; top: 2.25rem; right: -0.85rem;
  width: 0.7rem; height: 1px; background: var(--amber-3);
}
.gr-loop__event {
  font-family: var(--md-code-font-family); font-size: 0.64rem; font-weight: 700;
  letter-spacing: 0.04em; color: var(--dim);
}
.gr-loop h3 {
  margin: 0.45rem 0 0.35rem; display: flex; align-items: center; gap: 0.45rem;
  font-size: 1rem; font-weight: 700; color: var(--cream);
}
.gr-loop h3 svg { color: var(--amber); }
.gr-loop p { margin: 0; font-size: 0.78rem; }
.gr-loop__badge {
  display: inline-block; margin-top: 0.8rem;
  font-family: var(--md-code-font-family); font-size: 0.64rem; font-weight: 700;
  padding: 0.12rem 0.5rem; border-radius: 999px;
  color: var(--amber-2); background: var(--amber-a08); border: 1px solid var(--amber-a16);
}
.gr-loop li.is-gate { border-color: var(--amber-a30); background: linear-gradient(180deg, rgba(245, 184, 61, 0.07), var(--well)); }

/* Verdicts */
.gr-verdicts { list-style: none; margin: 1.2rem 0 1.4rem !important; padding: 0 !important; }
.gr-verdicts li { margin: 0 0 0.55rem !important; display: flex; gap: 0.7rem; align-items: center; font-size: 0.82rem; color: var(--cream); }
.gr-chip {
  flex: none; min-width: 3.6rem; text-align: center;
  font-family: var(--md-code-font-family); font-size: 0.66rem; font-weight: 700;
  padding: 0.14rem 0.5rem; border-radius: 0.35rem; border: 1px solid;
}
.gr-chip--block { color: var(--block); border-color: rgba(255, 122, 107, 0.35); background: rgba(255, 122, 107, 0.08); }
.gr-chip--deny { color: var(--amber); border-color: var(--amber-a30); background: var(--amber-a08); }
.gr-chip--ask { color: var(--sky); border-color: rgba(108, 196, 240, 0.35); background: rgba(108, 196, 240, 0.08); }
.gr-chip--pass { color: var(--pass); border-color: rgba(95, 211, 141, 0.35); background: rgba(95, 211, 141, 0.08); }

.gr-report {
  margin: 0; padding: 1.1rem 1.2rem;
  font-family: var(--md-code-font-family); font-variant-ligatures: none;
  font-size: 0.7rem; line-height: 1.75; color: var(--mist);
  white-space: pre; overflow-x: auto;
}

/* Feature cards */
.gr-features { margin-top: 2.8rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.gr-card {
  display: block;
  padding: 1.4rem;
  color: var(--mist) !important;
  background: linear-gradient(180deg, var(--ink-2), rgba(17, 24, 49, 0.4));
  border: 1px solid var(--ink-3);
  border-radius: var(--gr-radius);
  transition: transform 0.2s, border-color 0.2s;
}
.gr-card:hover { transform: translateY(-3px); border-color: var(--amber-a30); }
.gr-card__icon {
  width: 2.3rem; height: 2.3rem; display: grid; place-items: center;
  border-radius: var(--gr-radius-sm);
  color: var(--amber);
  background: var(--amber-a08);
  border: 1px solid var(--amber-a16);
}
.gr-card__icon svg { width: 1.25rem; height: 1.25rem; vertical-align: 0; }
.gr-card h3 { margin: 1rem 0 0.4rem; font-size: 0.95rem; font-weight: 700; color: var(--cream); letter-spacing: -0.01em; }
.gr-card p { margin: 0; font-size: 0.8rem; }

/* Quick start */
.gr-split { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 3rem; align-items: start; }
.gr-split--center { align-items: center; }
.gr-split h2, .gr-split .gr-eyebrow { text-align: left; }
.gr-steps { list-style: none; counter-reset: step; margin: 0 !important; padding: 0 !important; }
.gr-steps li { counter-increment: step; position: relative; margin: 0 0 1.4rem !important; padding-left: 2.6rem; }
.gr-steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: -0.1rem;
  width: 1.7rem; height: 1.7rem; display: grid; place-items: center;
  font-size: 0.75rem; font-weight: 800; color: var(--ink);
  background: var(--amber); border-radius: 50%;
  box-shadow: 0 0 0 4px var(--amber-a16);
}
.gr-steps li:not(:last-child)::after {
  content: ""; position: absolute; left: 0.83rem; top: 1.9rem; bottom: -1.2rem;
  width: 1px; background: var(--ink-3);
}
.gr-steps h4 { margin: 0 0 0.4rem; font-size: 0.9rem; color: var(--cream); font-weight: 700; }
.gr-steps p { margin: 0 0 0.5rem; font-size: 0.8rem; }
.gr-code {
  position: relative; margin: 0;
  padding: 0.75rem 3rem 0.75rem 0.9rem;
  background: var(--well); border: 1px solid var(--ink-3); border-radius: var(--gr-radius-sm);
  overflow-x: auto;
}
.gr-code code { background: none; padding: 0; color: var(--cream); font-size: 0.72rem; line-height: 1.7; white-space: pre; }
.gr-code .gr-copy { position: absolute; top: 0.45rem; right: 0.45rem; }

/* Languages */
.gr-langs { margin-top: 2.4rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8rem; }
.gr-lang {
  display: block; padding: 1rem 1rem 0.9rem;
  background: var(--ink-2); border: 1px solid var(--ink-3); border-radius: var(--gr-radius);
  transition: transform 0.15s, border-color 0.15s;
}
.gr-lang:hover { transform: translateY(-2px); border-color: var(--amber-3); }
.gr-lang b { display: block; color: var(--cream); font-size: 0.95rem; font-weight: 700; }
.gr-lang span { display: block; margin-top: 0.35rem; font-family: var(--md-code-font-family); font-size: 0.66rem; line-height: 1.55; color: var(--dim); }

/* Commands */
.gr-cmds { margin-top: 2.4rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.gr-cmdgroup { padding: 1.3rem 1.3rem 0.9rem; background: var(--well); border: 1px solid var(--ink-3); border-radius: var(--gr-radius); }
.gr-cmdgroup h3 {
  margin: 0 0 0.8rem; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim);
}
.gr-cmdgroup dl { margin: 0; }
.gr-cmdgroup dt { font-family: var(--md-code-font-family); font-size: 0.76rem; color: var(--amber-2); font-weight: 500; }
.gr-cmdgroup dt::before { content: "guardrails "; color: var(--dim); }
.gr-cmdgroup dd { margin: 0.05rem 0 0.7rem !important; font-size: 0.76rem; }

/* Docs */
.gr-docs { margin-top: 2.4rem; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.8rem; }
.gr-doc {
  position: relative; display: block;
  padding: 1rem 2.2rem 1rem 1.1rem;
  background: var(--ink-2); border: 1px solid var(--ink-3); border-radius: 0.7rem;
  transition: border-color 0.15s, transform 0.15s;
}
.gr-doc:hover { border-color: var(--amber-3); transform: translateY(-2px); }
.gr-doc b { display: block; color: var(--cream); font-size: 0.85rem; }
.gr-doc span { display: block; margin-top: 0.15rem; color: var(--dim); font-size: 0.74rem; line-height: 1.45; }
.gr-doc svg { position: absolute; right: 0.9rem; top: 1.05rem; color: var(--dim); transition: color 0.15s, transform 0.15s; }
.gr-doc:hover svg { color: var(--amber); transform: translateX(3px); }

/* Closing */
.gr-final {
  position: relative; text-align: center;
  padding: 5.5rem 0 6rem;
  background: radial-gradient(700px 360px at 50% 40%, rgba(245, 184, 61, 0.15), transparent 70%);
  border-top: 1px solid var(--amber-a08);
}
.gr-final .gr-grid {
  mask-image: radial-gradient(ellipse 60% 70% at 50% 45%, #000 15%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 60% 70% at 50% 45%, #000 15%, transparent 70%);
}
.gr-final__logo { width: 3.4rem; height: 4rem; margin-bottom: 1rem; animation: gr-float 6s ease-in-out infinite; }

@keyframes gr-float { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-6px) rotate(-4deg); } }
@keyframes gr-blink { 50% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .gr-hero__logo, .gr-final__logo, .gr-caret { animation: none; }
  .gr-card, .gr-btn, .gr-doc, .gr-lang { transition: none; }
}

/* Narrow screens */
@media (max-width: 60em) {
  .gr-hero__inner, .gr-split { grid-template-columns: 1fr; }
  .gr-features, .gr-cmds, .gr-docs, .gr-loop { grid-template-columns: 1fr 1fr; }
  .gr-loop li::after { display: none; }
  .gr-langs { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 40em) {
  .gr-hero { padding-top: 2.5rem; }
  .gr-features, .gr-cmds, .gr-docs, .gr-loop { grid-template-columns: 1fr; }
  .gr-stats { grid-template-columns: 1fr 1fr; }
  .gr-langs { grid-template-columns: 1fr; }
  .gr-section { padding: 3.5rem 0; }
  .gr-term__body { font-size: 0.64rem; }
}
