/* ResearchGuru colophon — the public footer's closing scene.

   The footer is always night-dark, in both site themes. Near the end of a
   page the page itself behaves like a lifted sheet: the footer stays put and
   the sheet slides away over it (`.is-under`, compositor-driven through a
   scroll timeline where supported, colophon.js otherwise). Under the sheet:
   a slow ink-in-water sky (WebGL, CSS gradient fallback) and the giant
   ResearchGuru.AI lockup at the head of the footer, where the name plays a
   series-opening title (variant cuts, a letter scramble, a lock) before it
   settles as the logo.

   Native text is the first paint and the no-JavaScript, reduced-motion,
   forced-colours and failure state. Owner: colophon.js. */

.rgc {
  --rgc-bg: #050713;
  --rgc-ink: #f2f4ff;
  --rgc-soft: #aeb6da;
  --rgc-faint: #858eb3;
  --rgc-line: rgba(214, 222, 255, .12);
  --rgc-violet: #b7abff;
  --rgc-gold: #e9bb5c;
  --rgc-gutter: clamp(20px, 4.4vw, 64px);
  --rgc-radius: clamp(22px, 2.8vw, 44px);
  --rgc-width: 1312px;
  position: relative;
  display: block;
  overflow: clip;
  isolation: isolate;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--rgc-bg);
  color: var(--rgc-ink);
  color-scheme: dark;
  font: 400 15px/1.55 var(--font, "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
  text-align: left;
}
.rgc *, .rgc *::before, .rgc *::after { box-sizing: border-box; }

/* The bottom of the page sheet: same colour as the page above it, rounded
   corners over the footer, a soft shadow cast onto the sky. */
.rgc-edge {
  position: absolute; z-index: 5; left: 0; right: 0; top: 0;
  height: var(--rgc-radius);
  background: var(--rgc-sheet, var(--bg, #fff));
  border-radius: 0 0 var(--rgc-radius) var(--rgc-radius);
  box-shadow: 0 22px 44px -16px rgba(0, 0, 0, .7), 0 1px 0 rgba(255, 255, 255, .05);
  pointer-events: none;
}

[data-theme="dark"] .rgc-edge {
  box-shadow: 0 22px 44px -16px rgba(0, 0, 0, .85), 0 1px 0 rgba(183, 171, 255, .24);
}

.rgc-under {
  position: relative; z-index: 1;
  padding: calc(var(--rgc-radius) + clamp(40px, 8.5vh, 92px)) var(--rgc-gutter) 0;
}
.rgc.is-under .rgc-under { will-change: transform; }

/* ── sky ── */
.rgc-sky {
  position: absolute; z-index: -1; inset: 0; overflow: hidden; pointer-events: none;
  background:
    radial-gradient(60% 55% at 78% 30%, rgba(99, 91, 255, .30), transparent 70%),
    radial-gradient(45% 50% at 18% 62%, rgba(196, 57, 154, .16), transparent 72%),
    radial-gradient(40% 45% at 50% 105%, rgba(68, 92, 230, .30), transparent 70%),
    radial-gradient(30% 35% at 92% 88%, rgba(245, 146, 30, .10), transparent 70%),
    var(--rgc-bg);
}
.rgc-sky canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
  opacity: 0; transition: opacity 1.1s ease;
}
.rgc-sky.is-live canvas { opacity: 1; }
.rgc-grain {
  position: absolute; inset: 0; opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

/* ── letter + directory ── */
.rgc-inner {
  max-width: var(--rgc-width); margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(36px, 6vw, 104px); align-items: start;
}
.rgc-kicker {
  display: flex; align-items: center; gap: 10px; margin: 0;
  font: 600 11px/1.4 var(--font, "Inter", sans-serif); letter-spacing: .16em; text-transform: uppercase;
  color: var(--rgc-violet);
}
.rgc-kicker::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, #f5921e, #c4399a 55%, #635bff);
  box-shadow: 0 0 0 4px rgba(99, 91, 255, .18);
}
.rgc-title {
  margin: 16px 0 12px; max-width: 15ch;
  font: 650 clamp(30px, 3vw, 44px)/1.06 var(--font, "Inter", sans-serif); letter-spacing: -.045em;
  color: var(--rgc-ink);
}
.rgc-title em {
  font-style: normal;
  background: linear-gradient(95deg, #f6a554 0%, #e2589f 46%, #a597ff 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-text-fill-color: transparent;
}
.rgc-sub { margin: 0 0 22px; max-width: 40ch; color: var(--rgc-soft); font-size: 15px; }

.rgc .rgc-nl { display: block; margin: 0; padding: 0; max-width: 470px; border: 0; border-radius: 0; background: none; }
.rgc .rgc-nl .rg-nl-row {
  display: flex; flex-wrap: nowrap; gap: 6px; padding: 5px;
  border: 1px solid rgba(214, 222, 255, .16); border-radius: 14px;
  background: rgba(255, 255, 255, .055);
  transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
}
.rgc .rgc-nl .rg-nl-row:focus-within {
  border-color: rgba(183, 171, 255, .7); background: rgba(255, 255, 255, .08);
  box-shadow: 0 0 0 4px rgba(99, 91, 255, .22);
}
.rgc .rgc-nl input[type=email] {
  flex: 1 1 auto; min-width: 0; margin: 0; padding: 10px 12px;
  border: 0; border-radius: 10px; outline: none; background: transparent;
  color: var(--rgc-ink); font: 500 15px/1.3 var(--font, "Inter", sans-serif);
}
.rgc .rgc-nl input[type=email]::placeholder { color: #8890b6; opacity: 1; }
.rgc .rgc-nl input[type=email]:focus-visible { outline: none; }
.rgc .rgc-nl button {
  flex: none; min-height: 42px; margin: 0; padding: 0 18px;
  border: 0; border-radius: 10px; cursor: pointer;
  background: #635bff; color: #fff; font: 600 14px/1 var(--font, "Inter", sans-serif);
  transition: background-color .2s ease, transform .2s ease;
}
.rgc .rgc-nl button:hover { background: #7770ff; }
.rgc .rgc-nl button:active { transform: translateY(1px); }
.rgc .rgc-nl button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.rgc .rgc-nl button:disabled, .rgc .rgc-nl input:disabled { cursor: default; opacity: .7; }
.rgc .rgc-nl .rg-nl-msg { margin: 8px 2px 0; font-size: 13px; color: var(--rgc-soft); }
.rgc .rgc-nl .rg-nl-msg:empty { display: none; }
.rgc .rgc-nl.done .rg-nl-msg { color: #8be8c0; }
.rgc .rgc-nl.err .rg-nl-msg { color: #ffa3b1; }
.rgc-fine { margin: 10px 2px 0; font-size: 12.5px; color: var(--rgc-faint); }
.rgc-fine a { color: var(--rgc-soft); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(174, 182, 218, .4); }
.rgc-fine a:hover { color: var(--rgc-ink); }

.rgc-cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(18px, 2.4vw, 40px); }
.rgc-cols h3 {
  margin: 2px 0 14px; color: var(--rgc-ink);
  font: 600 12px/1.4 var(--font, "Inter", sans-serif); letter-spacing: .02em;
}
.rgc-cols a {
  position: relative; display: block; width: fit-content; max-width: 100%; padding: 5px 0;
  color: var(--rgc-soft); font-size: 14px; line-height: 1.45; text-decoration: none;
  transition: color .2s ease;
}
.rgc-cols a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 3px; height: 1px;
  background: linear-gradient(90deg, #f5921e, #c4399a 50%, #a597ff);
  transform: scaleX(0); transform-origin: left center;
  transition: transform .35s cubic-bezier(.2, .8, .2, 1);
}
.rgc-cols a:hover, .rgc-cols a:focus-visible { color: var(--rgc-ink); }
.rgc-cols a:hover::after, .rgc-cols a:focus-visible::after { transform: scaleX(1); }
.rgc-cols a:focus-visible, .rgc-base a:focus-visible { outline: 2px solid var(--rgc-violet); outline-offset: 3px; border-radius: 3px; }
.rgc-cols .rgc-cta { color: var(--rgc-violet); }
.rgc-note { margin: 12px 0 0; max-width: 21ch; color: var(--rgc-faint); font-size: 12px; line-height: 1.5; }

.rgc-base {
  text-shadow: 0 1px 14px rgba(5, 7, 19, .85), 0 0 2px rgba(5, 7, 19, .6);
  max-width: var(--rgc-width); margin: clamp(26px, 4vh, 40px) auto 0; padding: 16px 0 clamp(18px, 3vh, 28px);
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 28px;
  border-top: 1px solid var(--rgc-line);
  color: var(--rgc-soft); font-size: 12.5px;
}
.rgc-badges { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.rgc-badges span { display: inline-flex; align-items: center; gap: 8px; }
.rgc-badges span::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--rgc-violet); opacity: .85; }
.rgc-up {
  margin-left: auto; display: inline-flex; align-items: center; gap: 8px;
  color: var(--rgc-soft); text-decoration: none; transition: color .2s ease;
}
.rgc-up svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .3s ease; }
.rgc-up:hover { color: var(--rgc-ink); }
.rgc-up:hover svg { transform: translateY(-2px); }

/* ── the brand: the lockup, where the title plays ── */
.rgc-brand { display: flex; flex-direction: column; align-items: flex-start; }
.rgc-mark {
  position: relative; display: inline-flex; align-items: center; gap: .3em;
  color: inherit; text-decoration: none; border-radius: 8px;
  font: 700 clamp(28px, 2.5vw, 38px)/1 Georgia, "Times New Roman", serif;
  -webkit-text-size-adjust: none; text-size-adjust: none;
}
.rgc-mark:focus-visible { outline: 2px solid var(--rgc-violet); outline-offset: 6px; }
.rgc-mark-icon {
  flex: none; width: 1.32em; height: 1.26em;
  background: url('/assets/logo-mark-dark.png') center / contain no-repeat;
}
.rgc-name { position: relative; display: inline-block; }
.rgc-word {
  display: inline-block; white-space: nowrap; user-select: none;
  font: inherit; line-height: 1.12; letter-spacing: -.05em;
}
.rgc-word > span {
  /* room for the ink that the tight tracking pushes past each word's box,
     so its last letter is painted whole */
  padding: 0 .09em; margin: 0 -.09em;
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
}
.rgc-word .w1 { background-image: linear-gradient(180deg, #ffffff 8%, #e3e7fb 52%, #aab4e2 100%); }
.rgc-word .w2 { background-image: linear-gradient(180deg, #ddd5ff 8%, #ab9bff 52%, #7867f0 100%); }
.rgc-word .w3 { background-image: linear-gradient(180deg, #ffe4a6 8%, #ecbb59 52%, #b9822a 100%); }
.rgc-about { margin: 22px 0 20px; max-width: 38ch; color: var(--rgc-soft); font-size: 15px; line-height: 1.75; }
.rgc-brand .rgc-badges { gap: 8px; }
.rgc-brand .rgc-badges span {
  padding: 6px 12px; border: 1px solid rgba(214, 222, 255, .16); border-radius: 999px;
  background: rgba(255, 255, 255, .035); color: var(--rgc-soft); font-size: 12px; font-weight: 600;
}
.rgc-brand .rgc-badges span::before { display: none; }

/* ── the research letter: a strip under the directory ── */
.rgc-letter {
  max-width: var(--rgc-width); margin: clamp(36px, 6vh, 60px) auto 0;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px 48px; align-items: center;
  padding: clamp(22px, 2.6vw, 30px) clamp(22px, 3vw, 36px);
  border: 1px solid rgba(214, 222, 255, .12); border-radius: 18px;
  background: linear-gradient(120deg, rgba(255, 255, 255, .065), rgba(255, 255, 255, .02));
}
.rgc-letter .rgc-title { margin: 10px 0 6px; max-width: none; font-size: clamp(22px, 2vw, 28px); }
.rgc-letter .rgc-sub { margin: 0; }
.rgc-letter .rgc-nl { max-width: none; }

/* The ignition (colophon.js): while it plays, the name is drawn on a canvas
   from the same glyph positions and the text waits underneath, invisible;
   the last frame matches it exactly and hands back to it. */
.rgc.is-seq .rgc-word { opacity: 0; }
.rgc.is-seq.is-done .rgc-word { opacity: 1; transition: opacity .45s ease; }
/* max-width: the site's global canvas cap would cut it to the name's width,
   and the last letters (the I of .AI) would only appear at the hand-back. */
.rgc-fire { position: absolute; left: 0; display: block; max-width: none; max-height: none; pointer-events: none; z-index: 2; }

/* ── the lifted sheet: scroll-linked, on the compositor where supported ── */
@keyframes rgc-under { from { transform: translate3d(0, -100%, 0); } to { transform: translate3d(0, 0, 0); } }
@supports (animation-timeline: view()) {
  .rgc.is-under.is-timeline { view-timeline: --rgc-reveal block; }
  .rgc.is-under.is-timeline .rgc-under {
    animation: rgc-under linear both;
    animation-timeline: --rgc-reveal;
    animation-range: entry 0% entry 100%;
  }
}

/* ── responsive ── */
@media (max-width: 1100px) {
  .rgc-inner { grid-template-columns: 1fr; gap: 44px; }
  .rgc-letter { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .rgc-under { padding-top: calc(var(--rgc-radius) + 44px); }
  .rgc-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px 20px; }
  .rgc-title { font-size: 30px; }
  .rgc-sub { font-size: 14px; }
  .rgc-base { gap: 10px 18px; font-size: 12px; }
  .rgc-badges { order: 3; width: 100%; }
  .rgc-up { margin-left: 0; }
  /* the floating theme and assistant buttons sit in this strip, not on the text */
  .rgc-base { padding-bottom: 96px; }
}
@media (max-width: 380px) {
  .rgc .rgc-nl .rg-nl-row { flex-wrap: wrap; }
  .rgc .rgc-nl input[type=email] { flex-basis: 100%; }
  .rgc .rgc-nl button { flex: 1 1 auto; }
}

/* ── static modes ── */
@media (prefers-reduced-motion: reduce) {
  .rgc-sky canvas { transition: none; }
  .rgc-up svg, .rgc-cols a::after { transition: none; }
}
@media (forced-colors: active) {
  .rgc-sky, .rgc-edge, .rgc-fire { display: none; }
  .rgc-word > span { color: CanvasText; -webkit-text-fill-color: CanvasText; background: none; }
  .rgc.is-seq .rgc-word { opacity: 1; }
}
@media print {
  .rgc-sky, .rgc-edge, .rgc-fire { display: none; }
  .rgc.is-seq .rgc-word { opacity: 1; }
  .rgc { background: #fff; color: #000; }
}
