/* ==========================================================================
   Stellar — custom landing page styles
   Deep-space background with layered starfields and a subtle scroll parallax.
   This page does NOT use the jekyll-text-theme layout; it is self-contained.
   ========================================================================== */

/* Display face for the hero title only (Quick Argani, from 1001fonts). */
@font-face {
  font-family: "Quick Argani";
  src: url("../fonts/quick-argani.otf") format("opentype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;       /* show fallback immediately, swap when loaded */
}

:root {
  --space-bg-top: #060914;
  --space-bg-bottom: #0b1224;
  --nebula-a: rgba(88, 101, 242, 0.18);
  --nebula-b: rgba(168, 85, 247, 0.14);
  --text: #e7ecf6;
  --text-dim: #9aa6c2;
  --accent: #7c9cff;
  --accent-strong: #a78bfa;
  /* RGB of --accent, for the many accent-tinted glows/borders below. */
  --accent-rgb: 124, 156, 255;
  --card-bg: rgba(20, 28, 52, 0.45);
  --card-border: rgba(var(--accent-rgb), 0.18);
  --max-width: 1080px;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  --font-head: "Space Grotesk", var(--font-body);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.65;
  background: linear-gradient(
    180deg,
    var(--space-bg-top) 0%,
    var(--space-bg-bottom) 100%
  );
  /* Keep the gradient stationary so the starfield parallax reads cleanly. */
  background-attachment: fixed;
  overflow-x: hidden;
}

/* --------------------------------------------------------------------------
   Starfield: three fixed, full-viewport layers at different densities/sizes.
   Each layer is a tileable pattern of radial-gradient "stars". Parallax is
   applied by the inline script, which shifts each layer's background-position
   at a different rate on scroll. A soft nebula glow sits behind them all.
   -------------------------------------------------------------------------- */
.sky {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}

.sky__nebula {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(40% 35% at 20% 25%, var(--nebula-a), transparent 70%),
    radial-gradient(45% 40% at 80% 70%, var(--nebula-b), transparent 70%),
    radial-gradient(30% 30% at 60% 15%, rgba(56, 189, 248, 0.1), transparent 70%);
  filter: blur(8px);
  will-change: transform;
}

.stars {
  position: absolute;
  inset: -10% 0;
  width: 100%;
  background-repeat: repeat;
  will-change: background-position;
}

/* Far layer — tiny, faint, dense. */
.stars--far {
  background-image:
    radial-gradient(1px 1px at 25px 35px, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(1px 1px at 90px 120px, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1px 1px at 160px 60px, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(1px 1px at 200px 180px, rgba(255, 255, 255, 0.45), transparent),
    radial-gradient(1px 1px at 60px 210px, rgba(255, 255, 255, 0.55), transparent),
    radial-gradient(1px 1px at 130px 250px, rgba(255, 255, 255, 0.5), transparent);
  background-size: 260px 280px;
  opacity: 0.7;
}

/* Mid layer — small, brighter, medium density. */
.stars--mid {
  background-image:
    radial-gradient(1.4px 1.4px at 50px 70px, rgba(255, 255, 255, 0.9), transparent),
    radial-gradient(1.4px 1.4px at 180px 30px, rgba(200, 220, 255, 0.85), transparent),
    radial-gradient(1.4px 1.4px at 110px 200px, rgba(255, 255, 255, 0.8), transparent),
    radial-gradient(1.4px 1.4px at 280px 150px, rgba(220, 230, 255, 0.85), transparent),
    radial-gradient(1.4px 1.4px at 330px 260px, rgba(255, 255, 255, 0.75), transparent);
  background-size: 380px 320px;
  opacity: 0.85;
}

/* Near layer — larger, brightest, sparse; carries the strongest parallax. */
.stars--near {
  background-image:
    radial-gradient(2px 2px at 80px 90px, #ffffff, transparent),
    radial-gradient(2.2px 2.2px at 300px 200px, #dbe6ff, transparent),
    radial-gradient(1.8px 1.8px at 460px 60px, #ffffff, transparent),
    radial-gradient(2px 2px at 200px 340px, #cfe0ff, transparent);
  background-size: 520px 460px;
  opacity: 0.95;
}

/* A handful of twinkling accent stars. */
.stars--twinkle {
  background-image:
    radial-gradient(2px 2px at 140px 120px, #fff, transparent),
    radial-gradient(2px 2px at 420px 280px, #fff, transparent),
    radial-gradient(1.6px 1.6px at 620px 160px, #fff, transparent);
  background-size: 760px 520px;
  animation: twinkle 4.5s ease-in-out infinite;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 0.9; }
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.5rem;
  backdrop-filter: blur(8px);
  background: rgba(6, 9, 20, 0.35);
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.08);
}

.site-nav__brand {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.04em;
  color: var(--text);
  text-decoration: none;
}

.site-nav__links a {
  color: var(--text-dim);
  text-decoration: none;
  margin-left: 1.5rem;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.site-nav__links a:hover {
  color: var(--text);
}

/* Hero ---------------------------------------------------------------------- */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 88vh;
  padding: 6rem 1.5rem 4rem;
}

.hero__title {
  font-family: "Quick Argani", var(--font-head);
  font-weight: 700;
  font-size: clamp(3rem, 9vw, 6rem);
  /* Quick Argani's glyphs rise above the normal ascent, so give the line box
     extra height and a little top padding to stop the tops being clipped. */
  line-height: 1.25;
  padding-top: 0.15em;
  margin: 0 0 1.25rem;
  background: linear-gradient(120deg, #ffffff 0%, var(--accent) 55%, var(--accent-strong) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 40px rgba(var(--accent-rgb), 0.25);
}

.hero__subtitle {
  max-width: 640px;
  font-size: clamp(1.05rem, 2.4vw, 1.35rem);
  color: var(--text-dim);
  margin: 0 0 2.5rem;
}

.hero__excerpt {
  max-width: 680px;
  color: var(--text-dim);
  margin: 0 auto 2.5rem;
}

/* Buttons ------------------------------------------------------------------- */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.btn {
  display: inline-block;
  padding: 0.85rem 1.8rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn--primary {
  color: #0a0f1f;
  background: linear-gradient(120deg, var(--accent) 0%, var(--accent-strong) 100%);
  box-shadow: 0 8px 30px rgba(var(--accent-rgb), 0.35);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(var(--accent-rgb), 0.5);
}

.btn--ghost {
  color: var(--text);
  border: 1px solid var(--card-border);
  background: rgba(var(--accent-rgb), 0.06);
}

.btn--ghost:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

/* Sections ------------------------------------------------------------------ */
.section {
  padding: 5rem 0;
}

.section__title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  text-align: center;
  margin: 0 0 3rem;
}

.features {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.card {
  padding: 2rem;
  border-radius: 18px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(10px);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(var(--accent-rgb), 0.45);
  box-shadow: 0 16px 50px rgba(5, 8, 20, 0.6);
}

.card__title {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.3rem;
  margin: 0 0 0.75rem;
  color: var(--text);
}

.card__body {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.98rem;
}

/* CTA ----------------------------------------------------------------------- */
.cta {
  text-align: center;
  padding: 6rem 0 7rem;
}

.cta__title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 3rem);
  margin: 0 0 1rem;
}

.cta__body {
  max-width: 620px;
  margin: 0 auto 2.5rem;
  color: var(--text-dim);
}

/* Footer -------------------------------------------------------------------- */
.site-footer {
  text-align: center;
  padding: 2.5rem 1.5rem 3.5rem;
  color: var(--text-dim);
  font-size: 0.9rem;
  border-top: 1px solid rgba(var(--accent-rgb), 0.08);
}

.site-footer a {
  color: var(--accent);
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   Reduced motion: disable parallax-driven animation and twinkle.
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .stars--twinkle { animation: none; opacity: 0.6; }
}

/* --------------------------------------------------------------------------
   Tabs (CSS-only, radio-button driven). Hidden radios hold the "which tab is
   active" state; labels are the clickable buttons; one panel shows per radio.
   No URL fragment is involved, so clicking a tab never scrolls the page.
   Styling reuses the page's design tokens: the tabs are rounded-top buttons
   that seat onto a .card surface, and the active tab merges into the panel.
   -------------------------------------------------------------------------- */
div.tabs {
    max-width: 760px;
    margin: 0 auto;
}

/* The radios carry the state but are visually hidden (still focusable). */
div.tabs > input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Labels are the tab buttons — rounded tops that seat onto the panel. The
   -1px bottom margin makes each tab overlap the panel's top border. */
div.tabs > label {
    display: inline-block;
    position: relative;
    vertical-align: bottom;
    margin: 0 0.25rem -1px 0;
    padding: 0.55rem 1.4rem;
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-dim);
    background: rgba(var(--accent-rgb), 0.06);
    border: 1px solid var(--card-border);
    border-radius: 12px 12px 0 0;	/* round only the top corners */
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
}

div.tabs > label:hover {
    color: var(--text);
}

/* The active tab adopts the panel surface and erases the seam between the
   two, so the tab and its content read as one connected shape. */
div.tabs > input:checked + label {
    z-index: 1;
    color: var(--text);
    background: var(--card-bg);
    border-bottom-color: var(--card-bg);
}

/* Keyboard focus ring on the active label (radios are visually hidden). */
div.tabs > input:focus-visible + label {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Panels: only the one matching the checked radio is shown — the .card
   surface, rounded except at the top-left where the tab strip seats. */
div.tabs > .tab__panel {
    display: none;
    position: relative;
    padding: 1rem;
    color: var(--text-dim);
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 0 18px 18px 18px;
    backdrop-filter: blur(10px);
}
#tab1:checked ~ #panel1,
#tab2:checked ~ #panel2,
#tab3:checked ~ #panel3,
#tab4:checked ~ #panel4 {
    display: block;
}

/* --------------------------------------------------------------------------
   Code blocks inside the tabs. The token COLOURS come from code-highlight.css
   (the theme's own highlight skin, compiled standalone and linked in <head>),
   so they always match the docs. These rules only add the layout the docs get
   from the theme's main.css: the JetBrains Mono font and the accent "halo".
   Jekyll's {% highlight %} tag emits <figure class="highlight"><pre><code>.
   -------------------------------------------------------------------------- */
.tab__panel .highlight {
    margin: 0;
    border-radius: 10px;
    box-shadow:
        0 0 0 1px rgba(var(--accent-rgb), 0.18),       /* crisp edge ring */
        0 0 18px 4px rgba(var(--accent-rgb), 0.22),    /* soft accent halo */
        0 14px 32px -4px rgba(0, 0, 0, 0.65);          /* drop shadow */
    overflow: hidden;                                  /* clip pre to the radius */
}
.tab__panel .highlight pre {
    margin: 0;
    padding: 1rem 1.15rem;
    font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo,
        Consolas, monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    text-align: left;
    overflow-x: auto;
}
.tab__panel .highlight code {
    font-family: inherit;
}
