/* Vlad G — minimal homepage
   Monochrome, Apple-inspired. Intentionally separate from styles.css
   (which is shared by blog/, links/, admin/ and imposter-app/ pages). */

:root {
  --bg: #fbfbfd;
  --ink: #1d1d1f;
  --ink-soft: #424245;
  --muted: #6e6e73;
  --muted-2: #86868b;
  --line: #d2d2d7;
  --line-soft: #e6e6ea;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --nav-h: 52px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

.container {
  width: min(1080px, 90vw);
  margin-inline: auto;
}

main,
.site-footer {
  position: relative;
  z-index: 2;
}

/* ── Ambient cursor glow ─────────────────────────── */
.glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 42vmax;
  height: 42vmax;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transform: translate3d(-50%, -50%, 0);
  background: radial-gradient(
    circle at center,
    rgba(20, 20, 40, 0.05),
    transparent 62%
  );
  transition: opacity 0.7s ease;
  will-change: transform;
}

.glow.is-visible {
  opacity: 1;
}
/* Neural-network background — drifts slowly, disperses around the pointer */
.neural-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
/* ── Header ──────────────────────────────────────── */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 30;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background-color 0.4s var(--ease), border-color 0.4s var(--ease),
    backdrop-filter 0.4s var(--ease);
}

.site-header.is-scrolled {
  background: rgba(251, 251, 253, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom-color: var(--line-soft);
}

.nav {
  width: min(1080px, 90vw);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}

.nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.25s ease;
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--ink);
}

/* ── Hero ────────────────────────────────────────── */
.hero {
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--nav-h) + 6vh) 0 12vh;
}

.hero h1 {
  margin: 0;
  font-size: clamp(3rem, 9vw, 6.4rem);
  line-height: 1.02;
  font-weight: 600;
  letter-spacing: -0.035em;
  color: var(--ink);
}

.hero-subhead {
  margin: clamp(14px, 2vw, 22px) 0 0;
  font-size: clamp(1.5rem, 4.2vw, 2.9rem);
  line-height: 1.1;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--muted);
}

.type-word {
  color: var(--ink);
  font-weight: 600;
}

.caret {
  display: inline-block;
  width: 2px;
  height: 0.92em;
  margin-left: 2px;
  vertical-align: -0.08em;
  border-radius: 2px;
  background: var(--ink);
  animation: caret 1.05s steps(1) infinite;
}

@keyframes caret {
  0%,
  45% {
    opacity: 1;
  }
  46%,
  100% {
    opacity: 0;
  }
}

.hero-support {
  margin: clamp(22px, 3vw, 30px) auto 0;
  max-width: 42ch;
  font-size: clamp(1.05rem, 1.5vw, 1.24rem);
  line-height: 1.5;
  color: var(--muted-2);
}

.hero-cta {
  margin-top: clamp(26px, 3vw, 34px);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 1.02rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
}

.hero-cta .u {
  padding-bottom: 2px;
  background-image: linear-gradient(var(--ink), var(--ink));
  background-size: 0% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size 0.4s var(--ease);
}

.hero-cta:hover .u,
.hero-cta:focus-visible .u {
  background-size: 100% 1px;
}

.hero-cta svg {
  transition: transform 0.3s var(--ease);
}

.hero-cta:hover svg,
.hero-cta:focus-visible svg {
  transform: translateX(4px);
}

/* ── Trusted by ──────────────────────────────────── */
.trusted {
  text-align: center;
  padding: clamp(72px, 12vh, 132px) 0 clamp(72px, 12vh, 120px);
}

.eyebrow {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.trusted h2 {
  margin: 14px 0 0;
  font-size: clamp(1.8rem, 4vw, 2.9rem);
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.logos {
  margin: clamp(40px, 6vw, 64px) auto 0;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 2.4vw, 40px);
  max-width: 100%;
}

.logos img {
  height: 28px;
  width: auto;
  object-fit: contain;
  filter: grayscale(1);
  opacity: 0.4;
  transition: opacity 0.55s var(--ease), filter 0.55s var(--ease);
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

/* Lit state — logo cycles into full brand colour, one at a time.
   Every logo (including National Grid, whose PNG is already brand blue) just
   fades grayscale -> natural colour, so there is no hue-rotate sweep. */
.logos img.is-lit {
  filter: grayscale(0);
  opacity: 1;
}

/* Per-logo sizing for optical balance */
.logos img[alt="Microsoft"] { height: 26px; }
.logos img[alt="SSE"] { height: 22px; }
.logos img[alt="National Grid"] { height: 22px; }
.logos img[alt="Aviva"] { height: 25px; }
.logos img[alt="UK Power Networks"] { height: 32px; }
.logos img[alt="Cadent"] { height: 22px; }
.logos img[alt="Standard Life"] { height: 20px; }

/* ── Footer ──────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--line-soft);
  padding: 26px 0 40px;
}

.footer-inner {
  width: min(1080px, 90vw);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted-2);
  font-size: 0.85rem;
}

.footer-inner a {
  display: inline-flex;
  color: var(--muted-2);
  transition: color 0.25s ease;
}

.footer-inner a:hover,
.footer-inner a:focus-visible {
  color: var(--ink);
}

/* ── Entrance animation (hero) ───────────────────── */
@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.anim {
  opacity: 0;
  animation: riseIn 1s var(--ease) forwards;
}

.anim-1 { animation-delay: 0.05s; }
.anim-2 { animation-delay: 0.18s; }
.anim-3 { animation-delay: 0.34s; }
.anim-4 { animation-delay: 0.5s; }

/* ── Scroll reveal (trusted section) ─────────────── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.95s var(--ease), transform 0.95s var(--ease);
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

.trusted h2.reveal {
  transition-delay: 90ms;
}

.logos.reveal {
  transition-delay: 180ms;
}

/* ── Responsive ──────────────────────────────────── */
/* Below desktop, let the logo row wrap instead of overflowing */
@media (max-width: 880px) {
  .logos {
    flex-wrap: wrap;
    gap: 22px 30px;
  }
}

@media (max-width: 600px) {
  .hero {
    min-height: 86vh;
  }

  .hero-support {
    max-width: 34ch;
  }

  .logos {
    gap: 24px 34px;
  }

  .glow {
    display: none;
  }
}

/* ── Reduced motion ──────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .anim {
    opacity: 1;
    animation: none;
  }

  .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .caret {
    animation: none;
  }

  .glow {
    display: none;
  }
}
