/* Y-10 v7 — Daylight Editorial Precision · Always-On 60fps Desktop Motion + Robot Companion */
:root {
  --bg: #FFFFFF;
  --ink: #111111;
  --cobalt: #2F63FF;
  --cobalt-hover: #1F4FE0;
  --slate: #5D6270;
  --slate-muted: #6B6F78;
  --wash: #EEF2FF;
  --line: #D9DBE0;
  --dark-card: #12151E;
  --font-display: 'Tajawal', system-ui, sans-serif;
  --font-body: 'IBM Plex Sans Arabic', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  background: var(--bg);
  color: var(--ink);
  overflow-x: clip;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  animation: pageEnter 0.65s var(--ease-out) both;
}

@keyframes pageEnter {
  from { opacity: 0; }
  to { opacity: 1; }
}
html, body {
  transform: none !important;
  filter: none !important;
  perspective: none !important;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
.mono { font-family: var(--font-mono); }

:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 3px; border-radius: 6px; }

/* ---------- Ambient 60fps motion layers ---------- */
#y10BgCanvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
}

.kinetic-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.k-num {
  position: absolute;
  top: 0;
  inset-inline-start: var(--x, 10%);
  direction: ltr;
  white-space: nowrap;
  user-select: none;
  line-height: 1;
  will-change: transform;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.04em;
}

.k-xl {
  font-size: clamp(7rem, 17vw, 15.5rem);
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(47, 99, 255, 0.22);
}

.k-lg {
  font-size: clamp(3.6rem, 8.5vw, 7.5rem);
  color: rgba(47, 99, 255, 0.075);
}

.k-sm {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: clamp(0.72rem, 0.88vw, 0.85rem);
  letter-spacing: 0.08em;
  color: rgba(47, 99, 255, 0.56);
}

main, header, footer {
  position: relative;
  z-index: 2;
}

.container {
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: clamp(18px, 4.5vw, 52px);
}

/* ---------- Topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: color-mix(in srgb, var(--bg) 93%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  gap: 14px;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  user-select: none;
  transition: transform 0.45s var(--ease-out);
}

.brand-lockup:hover { transform: translate3d(0, -2px, 0) scale(1.02); }
.brand-logo-svg { transition: filter 0.35s var(--ease-out); }
.brand-lockup:hover .brand-logo-svg { filter: drop-shadow(0 6px 14px rgba(47, 99, 255, 0.32)); }

.brand-tag {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--slate);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.main-nav a {
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.89rem;
  font-weight: 600;
  color: var(--slate);
  transition: color 0.3s var(--ease-out), background-color 0.3s var(--ease-out), transform 0.3s var(--ease-out);
}

.main-nav a:hover { color: var(--ink); background: var(--wash); transform: translate3d(0, -1px, 0); }
.main-nav a.active { color: #FFFFFF; background: var(--cobalt); box-shadow: 0 6px 18px -6px rgba(47, 99, 255, 0.55); }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.discord-top-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--cobalt);
  color: #FFFFFF;
  font-size: 0.84rem;
  font-weight: 600;
  transition: background-color 0.3s var(--ease-out), transform 0.4s var(--ease-out), box-shadow 0.35s var(--ease-out);
}

.discord-top-btn:hover {
  background: var(--cobalt-hover);
  transform: translate3d(0, -2px, 0);
  box-shadow: 0 10px 22px -8px rgba(47, 99, 255, 0.55);
}

.menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font-size: 1.2rem;
}

.mobile-drawer {
  display: grid;
  grid-template-rows: 0fr;
  background: var(--bg);
  transition: grid-template-rows 0.45s var(--ease-out);
}

.mobile-drawer > .drawer-inner {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-inline: clamp(18px, 4.5vw, 52px);
}

.mobile-drawer.open { grid-template-rows: 1fr; border-bottom: 1px solid var(--line); }
.mobile-drawer.open > .drawer-inner { padding-block: 14px 20px; }

.mobile-drawer a {
  padding: 11px 14px;
  border-radius: 10px;
  font-weight: 600;
  color: var(--ink);
  border: 1px solid transparent;
}

.mobile-drawer a.active { background: var(--wash); border-color: var(--cobalt); color: var(--cobalt); }

/* ---------- Buttons (Enhanced Desktop Hover Physics & Glow) ---------- */
.pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding-inline: 24px;
  border-radius: 999px;
  font-size: 0.93rem;
  font-weight: 600;
  border: 1.5px solid transparent;
  transition:
    background-color 0.3s var(--ease-out),
    color 0.3s var(--ease-out),
    border-color 0.3s var(--ease-out),
    box-shadow 0.35s var(--ease-out),
    transform 0.35s var(--ease-out);
  will-change: transform;
}

.pill-btn:hover { transform: translate3d(0, -3px, 0); }
.pill-btn:active { transform: translate3d(0, 0, 0) scale(0.97); }

.pill-filled { background: var(--cobalt); color: #FFFFFF; border-color: var(--cobalt); }
.pill-filled:hover {
  background: var(--cobalt-hover);
  border-color: var(--cobalt-hover);
  box-shadow: 0 14px 30px -10px rgba(47, 99, 255, 0.58);
}

.pill-outline { background: var(--bg); color: var(--cobalt); border-color: var(--cobalt); }
.pill-outline:hover {
  background: var(--wash);
  box-shadow: 0 10px 24px -10px rgba(47, 99, 255, 0.32);
}

.pill-dark { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pill-dark:hover {
  background: var(--cobalt);
  border-color: var(--cobalt);
  color: #FFFFFF;
  box-shadow: 0 14px 30px -10px rgba(47, 99, 255, 0.5);
}

/* ---------- Cards: Silky-Smooth Elevation + Spotlight + Top Cobalt Sweep ---------- */
.spotlight-card {
  --mx: 50%;
  --my: 50%;
  position: relative;
  display: block;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 26px 24px;
  overflow: hidden;
  transition: transform 0.65s var(--ease-out), border-color 0.45s var(--ease-out), box-shadow 0.65s var(--ease-out);
}

.spotlight-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(400px circle at var(--mx) var(--my), rgba(47, 99, 255, 0.12), transparent 65%);
  opacity: 0;
  transition: opacity 0.45s var(--ease-out);
  pointer-events: none;
  z-index: 0;
}

.spotlight-card::after {
  content: '';
  position: absolute;
  top: 0;
  inset-inline: 0;
  height: 2.5px;
  background: linear-gradient(90deg, var(--cobalt), #60A5FA);
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform 0.65s var(--ease-out);
  pointer-events: none;
  z-index: 1;
}

.spotlight-card > * { position: relative; z-index: 1; }

.spotlight-card:hover,
.js .spotlight-card.reveal.visible:hover {
  transform: translate3d(0, -7px, 0);
  border-color: rgba(47, 99, 255, 0.6);
  box-shadow: 0 24px 48px -18px rgba(47, 99, 255, 0.26);
}

.spotlight-card:hover::before { opacity: 1; }
.spotlight-card:hover::after { transform: scaleX(1); }

/* ---------- Typography & Sections ---------- */
.overline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--cobalt);
  margin-bottom: 16px;
}

.overline::before { content: ''; width: 22px; height: 1.5px; background: var(--cobalt); }

.display-h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.1rem, 4.8vw, 3.85rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.display-h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.65rem, 3.1vw, 2.45rem);
  line-height: 1.16;
  color: var(--ink);
}

.hl-cobalt { color: var(--cobalt); }
.lead-copy { color: var(--slate); font-size: clamp(0.98rem, 1.35vw, 1.1rem); max-width: 58ch; }

.section {
  padding-block: clamp(54px, 7.5vw, 96px);
  border-bottom: 1px solid var(--line);
}

.section-wash { background: color-mix(in srgb, var(--wash) 44%, transparent); }

/* Headline entrance */
.glitch-line {
  display: block;
  animation: lineIn 0.95s var(--ease-out) both;
  animation-delay: var(--d, 0ms);
}

@keyframes lineIn {
  from { opacity: 0; transform: translate3d(0, 0.42em, 0); clip-path: inset(0 0 100% 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); clip-path: inset(0 0 0 0); }
}

/* Tags */
.tag-row { display: flex; flex-wrap: wrap; gap: 7px; }
.tag {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  padding: 3px 10px;
  border-radius: 6px;
  background: var(--wash);
  color: var(--cobalt);
  font-weight: 500;
}
.tag-ink { background: color-mix(in srgb, var(--ink) 7%, var(--bg)); color: var(--ink); }

/* ---------- Staggered Scroll Reveals ---------- */
.js .reveal {
  opacity: 0;
  transform: translate3d(0, 28px, 0) scale(0.985);
  transition:
    opacity 0.8s var(--ease-out) var(--delay, 0ms),
    transform 0.95s var(--ease-out) var(--delay, 0ms),
    border-color 0.45s var(--ease-out),
    box-shadow 0.65s var(--ease-out);
}

.js .reveal.visible { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }

/* ---------- Y-10 Interactive Flying & Card-Perching Robot Companion (v8) ---------- */
#y10RobotCompanion.y10-robot-dock,
.y10-robot-dock {
  position: fixed !important;
  top: 0px !important;
  left: 0px !important;
  right: auto !important;
  bottom: auto !important;
  inset-inline-start: auto !important;
  inset-inline-end: auto !important;
  margin: 0 !important;
  z-index: 9999 !important;
  direction: ltr !important;
  pointer-events: auto !important;
  width: 76px;
  height: 94px;
  padding: 0;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  will-change: transform;
  transform-origin: 50% 85%;
  filter: drop-shadow(0 12px 24px rgba(17, 17, 17, 0.16));
  transition: filter 0.3s var(--ease-out);
}

.y10-robot-dock:hover {
  filter: drop-shadow(0 16px 32px rgba(47, 99, 255, 0.42));
}

.y10-robot-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

#robotHead, #robotPupils, #robotBody {
  transition: transform 0.11s ease-out;
  transform-origin: 50px 34px;
}

#robotArmL { transform-origin: 15.5px 58px; transition: transform 0.32s var(--ease-out); }
#robotArmR { transform-origin: 84.5px 58px; transition: transform 0.32s var(--ease-out); }
#robotLegs { transform-origin: 50px 92px; transition: transform 0.32s var(--ease-out), opacity 0.25s ease; }
#robotFlame { transform-origin: 50px 95px; transition: transform 0.18s ease-out, opacity 0.22s ease; }

/* Blinking Eyelids */
#robotEyesNormal {
  transform-origin: 50px 33.5px;
  transition: transform 0.08s ease-in-out, opacity 0.18s ease;
}
.y10-robot-dock.is-blinking #robotEyesNormal {
  transform: scaleY(0.08);
}

/* Flight State vs Perched State */
.y10-robot-dock.is-flying #robotFlame {
  opacity: 1;
}
.y10-robot-dock.is-flying #robotLegs {
  transform: translate3d(0, -6px, 0) scaleY(0.76);
}
.y10-robot-dock.is-flying #robotArmL { transform: rotate(22deg); }
.y10-robot-dock.is-flying #robotArmR { transform: rotate(-22deg); }
.y10-robot-dock.is-flying #robotShadow {
  opacity: 0.12;
  transform: scaleX(0.65);
  transform-origin: 50px 113px;
}

.y10-robot-dock.is-perched #robotFlame {
  opacity: 0.18;
  transform: scaleY(0.45);
}
.y10-robot-dock.is-perched #robotLegs {
  transform: translate3d(0, 0, 0) scaleY(1);
}
.y10-robot-dock.is-perched #robotShadow {
  opacity: 0.85;
  transform: scaleX(1);
  transform-origin: 50px 113px;
}

/* Curious / Antenna Signal Pulse */
.y10-robot-dock.is-curious .robot-antenna-ring {
  animation: robotAntennaPulse 0.85s var(--ease-out) forwards;
}

@keyframes robotAntennaPulse {
  0% { opacity: 0.95; transform: scale(0.9); transform-origin: 50px 7px; }
  100% { opacity: 0; transform: scale(2.8); transform-origin: 50px 7px; }
}

.robot-eyes-happy { opacity: 0; transition: opacity 0.2s ease; }
.robot-eyes-normal { opacity: 1; }

/* Alert State (Hovering Buttons / Cards) */
.y10-robot-dock.is-alert #robotAntenna {
  fill: #60A5FA;
  filter: drop-shadow(0 0 8px #2F63FF);
}
.y10-robot-dock.is-alert #robotCoreInner {
  fill: #60A5FA;
  transform: scale(1.18);
  transform-origin: 50px 71px;
}
.y10-robot-dock.is-perched.is-alert #robotArmL { transform: rotate(14deg); }
.y10-robot-dock.is-perched.is-alert #robotArmR { transform: rotate(-14deg); }

/* Waving / Diagnostic Pulse State (Clicked / Tapped) */
.robot-pulse-ring {
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 2px solid var(--cobalt);
  opacity: 0;
  pointer-events: none;
}

.y10-robot-dock.is-waving .robot-pulse-ring {
  animation: robotPulseWave 0.95s var(--ease-out) forwards;
}

.y10-robot-dock.is-waving .robot-eyes-normal { opacity: 0; }
.y10-robot-dock.is-waving .robot-eyes-happy { opacity: 1; }

.y10-robot-dock.is-waving #robotArmR {
  animation: robotArmWave 0.9s ease-in-out;
}

@keyframes robotPulseWave {
  0% { opacity: 0.9; transform: scale(0.75); }
  100% { opacity: 0; transform: scale(1.75); }
}

@keyframes robotArmWave {
  0% { transform: rotate(0deg); }
  22% { transform: rotate(-125deg); }
  45% { transform: rotate(-85deg); }
  70% { transform: rotate(-130deg); }
  100% { transform: rotate(0deg); }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--bg); padding-block: 36px; }

.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.88rem;
  color: var(--slate-muted);
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  font-weight: 600;
}

.footer-links { display: flex; flex-wrap: wrap; gap: 18px; font-weight: 600; color: var(--ink); }
.footer-links a { transition: color 0.3s var(--ease-out); }
.footer-links a:hover { color: var(--cobalt); }

@media (max-width: 900px) {
  .main-nav, .discord-top-btn { display: none; }
  .menu-btn { display: inline-flex; }
}

@media (max-width: 720px) {
  .k-hide-sm { display: none; }
  .y10-robot-dock { width: 60px; height: 74px; }
}
