/* ==========================================================================
   UK Robot Lab — local site
   Palette sampled from the brand logo + "Animated background example".
   ========================================================================== */

@font-face {
  font-family: "Montserrat";
  src: url("../assets/fonts/montserrat-latin.woff2") format("woff2");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --navy-900: #0b1d33;
  --navy-800: #0f2a47;
  --navy-700: #14365a;
  --navy-600: #1e4a73;
  --blue-500: #2a6d9a;
  --cyan-400: #6ec3ff;
  --cyan-300: #9fd8ff;
  --ice-100:  #e6f6ff;
  --text:     #f2f8fd;
  --muted:    #b3c9dc;
  --line:     rgba(159, 216, 255, 0.18);
  --glass:    rgba(14, 38, 66, 0.55);
  --glass-hi: rgba(28, 70, 112, 0.45);
  --radius:   18px;
  --maxw:     1160px;
  --gutter:   clamp(16px, 4vw, 40px);
  --ease:     cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  /* Same diagonal blue fall-off as the reference background */
  background:
    radial-gradient(120% 80% at 70% 0%, #2f78a8 0%, transparent 55%),
    linear-gradient(170deg, var(--blue-500) 0%, var(--navy-600) 35%, var(--navy-700) 65%, var(--navy-900) 100%);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
::selection { background: rgba(110, 195, 255, .35); }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  padding: 10px 16px; border-radius: 10px;
  background: var(--ice-100); color: var(--navy-800); font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; }

:focus-visible { outline: 2px solid var(--cyan-300); outline-offset: 3px; border-radius: 6px; }

/* ---------- Background layers ---------- */
#neural-field {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}
.aurora {
  position: fixed; inset: 0; overflow: hidden;
  z-index: 0; pointer-events: none;
}
.aurora::before {
  content: ""; position: absolute; inset: -20%;
  background:
    radial-gradient(35% 30% at 25% 30%, rgba(110, 195, 255, .12), transparent 70%),
    radial-gradient(30% 35% at 80% 70%, rgba(64, 140, 220, .12), transparent 70%);
  filter: blur(20px);
  animation: aurora 26s ease-in-out infinite alternate;
}
@keyframes aurora {
  0%   { transform: translate3d(0, 0, 0) rotate(0deg); }
  100% { transform: translate3d(4%, -3%, 0) rotate(8deg); }
}
.vignette {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(5, 14, 28, .55) 100%);
}

header, main, footer { position: relative; z-index: 1; }
/* rotating decorations must never widen the page on mobile */
main { overflow-x: clip; }

.container { width: min(var(--maxw), 100% - 2 * var(--gutter)); margin-inline: auto; }

/* ---------- Header / nav ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  transition: background .4s var(--ease), backdrop-filter .4s, border-color .4s;
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: rgba(11, 29, 51, .6);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--line);
}
.nav {
  width: min(var(--maxw), 100% - 2 * var(--gutter)); margin-inline: auto;
  height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { width: 36px; height: auto; filter: drop-shadow(0 0 10px rgba(110, 195, 255, .35)); }
.brand-word { font-size: 15px; letter-spacing: .16em; font-weight: 400; white-space: nowrap; }
.brand-word b { font-weight: 800; letter-spacing: .06em; margin-right: .1em; }

.nav-links { list-style: none; display: flex; align-items: center; gap: 6px; margin: 0; padding: 0; }
.nav-links a {
  display: inline-block; padding: 8px 14px; border-radius: 999px;
  font-size: 14px; font-weight: 500; letter-spacing: .04em; text-decoration: none; color: var(--muted);
  transition: color .25s, background .25s;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); background: rgba(159, 216, 255, .08); }
.nav-links a.nav-cta { color: var(--navy-800); background: var(--ice-100); font-weight: 600; margin-left: 6px; }
.nav-links a.nav-cta:hover { background: #fff; }
/* Member Login (memberapps.ukrobotlab.org): outlined, like .btn-ghost; the
   1px border comes out of the padding so it lines up with Contact */
.nav-links a.nav-login { color: var(--text); border: 1px solid rgba(230, 246, 255, .35); padding: 7px 13px; margin-left: 4px; }
.nav-links a.nav-login:hover { border-color: rgba(230, 246, 255, .7); }

.nav-toggle {
  display: none; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 12px;
  background: rgba(14, 38, 66, .5); cursor: pointer; position: relative;
}
.nav-toggle span {
  position: absolute; left: 12px; right: 12px; height: 2px; background: var(--text); border-radius: 2px;
  transition: transform .3s var(--ease), top .3s var(--ease);
}
.nav-toggle span:first-child { top: 17px; }
.nav-toggle span:last-child { top: 25px; }
.nav-toggle[aria-expanded="true"] span:first-child { top: 21px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { top: 21px; transform: rotate(-45deg); }

/* 860px: below this the five links no longer fit beside the logo (they need 774px) */
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: fixed; top: 72px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 4px;
    padding: 12px var(--gutter) 20px;
    background: rgba(11, 29, 51, .94);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity .25s, transform .25s var(--ease), visibility .25s;
  }
  .nav-links.open { transform: none; opacity: 1; visibility: visible; }
  .nav-links a { display: block; padding: 12px 14px; font-size: 16px; }
  .nav-links a.nav-cta { margin: 6px 0 0; text-align: center; }
  .nav-links a.nav-login { padding: 11px 13px; margin: 6px 0 0; text-align: center; }
}

/* ---------- Shared type ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  margin: 0 0 18px; font-size: 12.5px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase;
  color: var(--cyan-300);
}
h1, h2, h3 { margin: 0; line-height: 1.12; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: clamp(30px, 4.4vw, 52px); margin-bottom: 24px; max-width: 18ch; }
h3 { font-size: 21px; margin-bottom: 10px; }
p { margin: 0 0 16px; color: var(--muted); }
.lead { font-size: clamp(18px, 1.8vw, 21px); color: var(--text); }
strong { color: var(--text); font-weight: 600; }

.pulse-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--cyan-400);
  box-shadow: 0 0 0 0 rgba(110, 195, 255, .6); animation: pulse 2.2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(110, 195, 255, .6); }
  80%, 100% { box-shadow: 0 0 0 12px rgba(110, 195, 255, 0); }
}

/* ---------- Buttons ---------- */
.btn {
  --bx: 50%; --by: 50%;
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  min-height: 50px; padding: 0 26px; border-radius: 999px;
  font: inherit; font-size: 15px; font-weight: 600; letter-spacing: .03em; text-decoration: none;
  transition: transform .25s var(--ease), box-shadow .25s, background .25s, border-color .25s;
  overflow: hidden; isolation: isolate;
}
.btn::after {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .3s;
  background: radial-gradient(120px circle at var(--bx) var(--by), rgba(255, 255, 255, .35), transparent 60%);
}
.btn:hover::after { opacity: 1; }
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  color: var(--navy-800); background: linear-gradient(135deg, #ffffff, var(--cyan-300));
  box-shadow: 0 10px 30px -10px rgba(110, 195, 255, .7);
}
.btn-primary:hover { box-shadow: 0 16px 40px -12px rgba(110, 195, 255, .9); }
.btn-ghost {
  color: var(--text); border: 1px solid rgba(230, 246, 255, .35); background: rgba(14, 38, 66, .35);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.btn-ghost:hover { border-color: rgba(230, 246, 255, .7); }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center;
  padding: 110px 0 90px;
}
.hero-inner {
  width: min(var(--maxw), 100% - 2 * var(--gutter)); margin-inline: auto;
}
.hero-title {
  font-size: clamp(46px, 8.6vw, 116px);
  font-weight: 400; letter-spacing: .02em; line-height: .98;
  text-shadow: 0 4px 40px rgba(6, 20, 40, .55);
  max-width: 8.6ch;
}
.hero-title .uk { font-weight: 800; letter-spacing: 0; margin-right: .04em; }
.hero-sub {
  margin: 22px 0 0; font-size: clamp(15px, 1.9vw, 22px); font-weight: 500;
  letter-spacing: .32em; text-transform: uppercase; color: var(--ice-100);
}
.hero-typed {
  margin: 28px 0 0; min-height: 1.6em;
  font-size: clamp(17px, 1.7vw, 20px); color: var(--cyan-300); font-weight: 400;
}
.caret {
  display: inline-block; width: 2px; height: 1.1em; margin-left: 3px; vertical-align: -0.18em;
  background: var(--cyan-300); animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 38px; }

.hero-hint {
  position: absolute; left: 50%; bottom: 84px; transform: translateX(-50%);
  margin: 0; font-size: 11.5px; letter-spacing: .24em; text-transform: uppercase; color: rgba(179, 201, 220, .6);
  white-space: nowrap;
}
.scroll-cue {
  position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%);
  width: 26px; height: 42px; border: 1.5px solid rgba(230, 246, 255, .45); border-radius: 14px;
}
.scroll-cue span {
  position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px;
  background: var(--ice-100); animation: scrollcue 1.8s var(--ease) infinite;
}
@keyframes scrollcue {
  0% { opacity: 0; transform: translateY(0); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: translateY(14px); }
}
@media (hover: none) { .hero-hint { display: none; } }
@media (max-width: 900px) {
  /* leave the top of the hero for the network sphere */
  .hero { align-items: flex-end; padding-bottom: 96px; }
}

/* ---------- Sections ---------- */
.section { padding: clamp(90px, 13vw, 170px) 0; }

.about-grid {
  display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(32px, 6vw, 90px); align-items: center;
}
@media (max-width: 900px) { .about-grid { grid-template-columns: 1fr; } }

.chips { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-wrap: wrap; gap: 10px; }
.chips li {
  padding: 8px 16px; border-radius: 999px; font-size: 13.5px; font-weight: 500; letter-spacing: .04em;
  border: 1px solid var(--line); background: rgba(14, 38, 66, .45); color: var(--ice-100);
}

.about-visual { position: relative; margin: 0; justify-self: center; width: min(100%, 480px); aspect-ratio: 1; }
.about-visual img {
  position: relative; z-index: 1;
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 58%, transparent 71%);
  mask-image: radial-gradient(circle at 50% 50%, #000 58%, transparent 71%);
}
.about-visual::before {
  content: ""; position: absolute; inset: 6%; border-radius: 50%;
  background: radial-gradient(circle, rgba(110, 195, 255, .28), transparent 65%);
  filter: blur(20px);
}
.orbit, .orbit span { position: absolute; inset: 0; border-radius: 50%; }
.orbit span { border: 1px solid var(--line); }
.orbit span:nth-child(1) { inset: -2%; animation: spin 40s linear infinite; }
.orbit span:nth-child(2) { inset: -8%; border-style: dashed; opacity: .6; animation: spin 70s linear infinite reverse; }
.orbit span:nth-child(3) { inset: 4%; animation: spin 55s linear infinite; }
.orbit span::after {
  content: ""; position: absolute; top: 50%; left: -4px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--cyan-300); box-shadow: 0 0 14px 3px rgba(110, 195, 255, .7);
}
.orbit span:nth-child(2)::after { top: 12%; left: 82%; }
.orbit span:nth-child(3)::after { top: auto; bottom: 8%; left: 20%; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 48px; }
@media (max-width: 900px) { .cards { grid-template-columns: 1fr; } }
.card {
  --mx: 50%; --my: 0%;
  position: relative; padding: 34px 30px 30px; border-radius: var(--radius);
  background: linear-gradient(160deg, var(--glass-hi), var(--glass));
  border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transform-style: preserve-3d;
  transition: transform .35s var(--ease), border-color .35s, box-shadow .35s;
  overflow: hidden;
}
.card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .35s;
  background: radial-gradient(260px circle at var(--mx) var(--my), rgba(110, 195, 255, .18), transparent 60%);
}
.card:hover { border-color: rgba(159, 216, 255, .4); box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .6); }
.card:hover::before { opacity: 1; }
.card-num {
  position: absolute; top: 24px; right: 26px;
  font-size: 13px; font-weight: 600; letter-spacing: .14em; color: rgba(159, 216, 255, .55);
}
.card-icon {
  width: 46px; height: 46px; margin-bottom: 26px;
  fill: none; stroke: var(--cyan-300); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 0 8px rgba(110, 195, 255, .45));
}
.card p { margin: 0; }

/* Statement */
.statement { padding-block: clamp(60px, 10vw, 130px); }
.statement-text {
  margin: 0; text-align: center; color: var(--text);
  font-size: clamp(32px, 6.2vw, 80px); font-weight: 300; line-height: 1.1; letter-spacing: -.02em;
}
.grad {
  font-weight: 700;
  background: linear-gradient(90deg, #ffffff, var(--cyan-300) 45%, var(--cyan-400) 70%, #ffffff);
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: sheen 6s linear infinite;
}
@keyframes sheen { to { background-position: -200% 0; } }

/* Membership */
.membership-panel {
  display: flex; align-items: center; justify-content: space-between; gap: 40px;
  padding: clamp(32px, 5vw, 64px); border-radius: calc(var(--radius) + 8px);
  background:
    radial-gradient(80% 140% at 100% 0%, rgba(110, 195, 255, .18), transparent 60%),
    linear-gradient(160deg, var(--glass-hi), var(--glass));
  border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.membership-panel h2 { margin-bottom: 18px; }
.membership-panel p { max-width: 56ch; margin: 0; }
.membership-panel .btn { flex-shrink: 0; }
@media (max-width: 820px) { .membership-panel { flex-direction: column; align-items: flex-start; } }

/* Contact */
.contact-inner { display: flex; flex-direction: column; align-items: center; text-align: center; }
.contact-logo { width: min(260px, 64vw); margin-bottom: 44px; filter: drop-shadow(0 0 24px rgba(110, 195, 255, .25)); }
.contact h2 { max-width: none; margin-bottom: 14px; }
.email-link {
  margin-top: 12px; font-size: clamp(22px, 3.6vw, 40px); font-weight: 600; letter-spacing: -.01em;
  text-decoration: none; color: var(--ice-100);
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat;
  transition: background-size .45s var(--ease), color .3s;
  padding-bottom: 4px; overflow-wrap: anywhere;
}
.email-link:hover { background-size: 100% 2px; color: #fff; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: rgba(8, 20, 38, .55); }
.footer-inner {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding: 28px 0;
  font-size: 13.5px;
}
.footer-inner p { margin: 0; }
.footer-inner a { color: var(--muted); text-decoration: none; }
.footer-inner a:hover { color: var(--text); }

/* ---------- Reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
.js .hero .reveal { transition-duration: 1.1s; }
.js .card.reveal.in { transition: opacity .9s var(--ease), transform .35s var(--ease), border-color .35s, box-shadow .35s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}
