/* RSH AI — landing v2. Warm paper, editorial type, true glass. */
:root {
  --paper: #7d9ed5; /* sky base */
  --ink: #0c1322;
  --ink-60: rgba(12, 19, 34, 0.68);
  --ink-40: rgba(12, 19, 34, 0.46);
  --hairline: rgba(12, 19, 34, 0.16);
  --blue: #1c3dc2;
  --blue-soft: rgba(28, 61, 194, 0.2);
  --grotesk: "Space Grotesk", system-ui, sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--grotesk);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100svh;
}
a { color: inherit; text-decoration: none; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: 0.005em; }
::selection { background: var(--blue-soft); }

/* ---------- sky behind the glass ---------- */
.field {
  position: fixed; inset: 0; z-index: -2; overflow: hidden;
  background: linear-gradient(180deg, #a3bce7 0%, #7d9ed5 46%, #5e7fb8 100%);
}
.field .blob { position: absolute; border-radius: 50%; filter: blur(70px); will-change: transform; }
.field .b1 {
  width: 48vw; height: 48vw; left: 6vw; top: -16vw;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.7), transparent 65%);
  animation: float-a 21s ease-in-out infinite alternate;
}
.field .b2 {
  width: 40vw; height: 40vw; right: -10vw; top: 16vh;
  background: radial-gradient(circle, rgba(34, 60, 150, 0.5), transparent 65%);
  animation: float-b 27s ease-in-out infinite alternate;
}
.field .b3 {
  width: 42vw; height: 42vw; left: 28vw; bottom: -20vw;
  background: radial-gradient(circle, rgba(255, 200, 168, 0.45), transparent 65%);
  animation: float-a 33s ease-in-out infinite alternate-reverse;
}
@keyframes float-a { to { transform: translate3d(9vw, 7vh, 0) scale(1.12); } }
@keyframes float-b { to { transform: translate3d(-8vw, -6vh, 0) scale(0.94); } }
.field::after {
  content: "";
  position: absolute; inset: -50%;
  background: linear-gradient(180deg, rgba(255,255,255,.10), transparent 42%, rgba(12,19,34,.08));
  opacity: .55;
}

/* ---------- clean Nexa background layer ---------- */
.floats { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.floats::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 78% 24%, rgba(255,255,255,.18), transparent 25rem),
    radial-gradient(circle at 42% 68%, rgba(255,255,255,.11), transparent 34rem);
  mask-image: radial-gradient(circle at 62% 38%, #000, transparent 76%);
}
.code-wall {
  position: absolute; top: clamp(84px, 12vh, 150px); right: clamp(18px, 5vw, 86px); width: min(45vw, 560px);
  display: grid; gap: clamp(10px, 1.5vw, 18px); opacity: .46; filter: blur(.18px); mix-blend-mode: multiply;
}
.code-wall span {
  width: 0; max-width: max-content; overflow: hidden; white-space: nowrap;
  color: rgba(12,19,34,.5); font: 600 clamp(11px, 1.05vw, 15px)/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: -.035em; animation: code-type 15s steps(54) infinite both;
}
.code-wall span:nth-child(1) { animation-delay: -.2s; opacity: .46; }
.code-wall span:nth-child(2) { animation-delay: -.9s; opacity: .38; transform: translateX(5vw); }
.code-wall span:nth-child(3) { animation-delay: -1.55s; opacity: .34; transform: translateX(2vw); }
.code-wall span:nth-child(4) { animation-delay: -2.25s; opacity: .4; transform: translateX(5vw); }
.code-wall span:nth-child(5) { animation-delay: -2.9s; opacity: .32; }
.code-wall span:nth-child(6) { animation-delay: -3.55s; opacity: .38; transform: translateX(5vw); }
.code-wall span:nth-child(7) { animation-delay: -4.2s; opacity: .31; transform: translateX(2vw); }
.code-wall span:nth-child(8) { animation-delay: -4.85s; opacity: .44; transform: translateX(5vw); }
.flogo {
  position: absolute; width: 34px; height: 34px; object-fit: contain; opacity: .2;
  filter: grayscale(1) brightness(.48) drop-shadow(0 12px 26px rgba(16,28,70,.18));
  animation: logo-drift var(--dur, 20s) ease-in-out infinite alternate;
}
.flogo.l1 { left: clamp(22px, 5vw, 76px); top: 24%; --dx: 10px; --dy: -18px; --rot: -4deg; --dur: 19s; }
.flogo.l2 { left: clamp(22px, 5vw, 76px); top: 34%; --dx: -8px; --dy: 16px; --rot: 4deg; --dur: 23s; width: 30px; }
.flogo.l3 { left: clamp(22px, 5vw, 76px); top: 44%; --dx: 12px; --dy: -14px; --rot: 5deg; --dur: 21s; }
.flogo.l4 { left: clamp(22px, 5vw, 76px); top: 54%; --dx: -10px; --dy: 18px; --rot: -5deg; --dur: 24s; }
.flogo.l5 { left: clamp(22px, 5vw, 76px); top: 64%; --dx: 9px; --dy: -16px; --rot: 4deg; --dur: 26s; }
.flogo.l6 { left: clamp(22px, 5vw, 76px); top: 74%; --dx: -8px; --dy: 14px; --rot: -4deg; --dur: 22s; width: 31px; }
@keyframes code-type { 0%, 8% { width: 0; } 28%, 86% { width: 64ch; } 100% { width: 0; } }
@keyframes logo-drift { to { transform: translate3d(var(--dx), var(--dy), 0) rotate(var(--rot)) scale(1.06); } }
@media (prefers-reduced-motion: reduce) { .code-wall span, .flogo { animation: none; width: auto; } }
@media (max-width: 820px) { .flogo.l2, .flogo.l5, .flogo.l6 { display: none; } .code-wall { inset: 12% auto auto 5vw; width: 90vw; opacity: .22; } }

/* ---------- glass ---------- */
.glass {
  position: relative;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.48), rgba(255, 255, 255, 0.22));
  -webkit-backdrop-filter: blur(30px) saturate(185%);
  backdrop-filter: blur(30px) saturate(185%);
  border: 1px solid rgba(255, 255, 255, 0.64);
  box-shadow:
    0 1px 1px rgba(255, 255, 255, 0.95) inset,
    0 -1px 1px rgba(255, 255, 255, 0.18) inset,
    0 24px 70px rgba(28, 32, 68, 0.13),
    0 4px 16px rgba(28, 32, 68, 0.06);
  border-radius: 20px;
}

/* ---------- shared chrome ---------- */
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px clamp(22px, 4.5vw, 56px);
}
.wordmark {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 600; font-size: 13px; letter-spacing: 0.18em;
}
.brand-core { width: 24px; height: 24px; display: block; flex: none; }
.brand-core.mini { width: 16px; height: 16px; opacity: .9; }
.foot-brand { display: inline-flex; align-items: center; gap: 8px; }
.bar-links { display: flex; align-items: center; gap: 22px; }
.bar-links a { font-size: 13px; color: var(--ink-60); letter-spacing: 0.04em; transition: color 0.25s ease; }
.bar-links a:hover { color: var(--ink); }
.bar-links .pill {
  color: #f4f7fd;
  background: var(--ink);
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(12, 19, 34, 0.25);
  transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.3), box-shadow 0.3s ease;
}
.bar-links .pill:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 12px 30px rgba(12, 19, 34, 0.32); }

.foot {
  display: flex; align-items: center; gap: 24px;
  padding: 30px clamp(22px, 4.5vw, 56px) 38px;
  font-size: 12.5px; color: var(--ink-40); letter-spacing: 0.03em;
  border-top: 1px solid var(--hairline);
}
.foot a:hover { color: var(--ink); }
.foot .spacer { flex: 1; }

/* ---------- caret ---------- */
.caret {
  display: inline-block;
  width: 3px; height: 0.92em;
  background: var(--blue);
  vertical-align: -0.12em;
  margin-left: 2px;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---------- front door (rshai.dev) ---------- */
.home { min-height: 100svh; display: flex; flex-direction: column; }
.home-main {
  flex: 1;
  display: flex; flex-direction: column;
  justify-content: center;
  gap: clamp(40px, 7vh, 72px);
  padding: 0 clamp(22px, 4.5vw, 56px);
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}
.statement {
  font-weight: 500;
  font-size: clamp(44px, 7.4vw, 104px);
  line-height: 1.02;
  letter-spacing: -0.035em;
}
.statement em { color: var(--blue); letter-spacing: -0.01em; }
.statement .ln { display: block; overflow: hidden; padding-bottom: 0.13em; margin-bottom: -0.13em; }
.statement .ln > span {
  display: inline-block;
  transform: translateY(130%);
  animation: rise 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: var(--d, 0s);
}
@keyframes rise { to { transform: none; } }

.door-row { perspective: 1100px; }
.door {
  display: flex; align-items: center; gap: 20px;
  width: min(560px, 100%);
  padding: 22px 26px;
  transform-style: preserve-3d;
  opacity: 0;
  animation: door-in 1.1s cubic-bezier(0.16, 1, 0.3, 1) 0.55s forwards;
  transition: box-shadow 0.4s ease;
  will-change: transform;
}
@keyframes door-in { from { opacity: 0; transform: translateY(36px); } to { opacity: 1; transform: none; } }
.door:hover {
  box-shadow:
    0 1px 1px rgba(255, 255, 255, 0.95) inset,
    0 -1px 1px rgba(16, 16, 19, 0.04) inset,
    0 26px 60px rgba(28, 32, 68, 0.16),
    0 4px 10px rgba(28, 32, 68, 0.06);
}
.door .glare {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(320px circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, 0.55), transparent 60%);
  opacity: 0;
  transition: opacity 0.35s ease;
}
.door:hover .glare { opacity: 1; }
.door .mark {
  flex: none;
  width: 74px; height: 74px;
  display: grid; place-items: center;
  border-radius: 18px;
  background: transparent;
  transform: translateZ(28px);
  overflow: hidden;
}
.door .mark img { width: 74px; height: 74px; display: block; }
.door .body { flex: 1; min-width: 0; transform: translateZ(18px); }
.door .name {
  display: flex; align-items: baseline; gap: 10px;
  font-weight: 600; font-size: 21px; letter-spacing: -0.01em;
}
.door .name .beta {
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.14em;
  color: var(--blue); text-transform: uppercase;
}
.door .desc { margin-top: 3px; font-size: 14px; color: var(--ink-60); }
.door .arrow {
  flex: none;
  font-size: 22px; color: var(--ink-40);
  transform: translateZ(24px);
  transition: transform 0.4s cubic-bezier(0.2, 0.9, 0.25, 1.4), color 0.3s ease;
}
.door:hover .arrow { transform: translateZ(24px) translateX(7px); color: var(--blue); }

/* ---------- reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.16, 1, 0.3, 1); transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal, .door, .statement .ln > span { opacity: 1; transform: none; }
}
@media (max-width: 600px) {
  .door { flex-wrap: wrap; }
}
