/* ==========================================================
   rychenjones.com — style.css (universal stylesheet)
   Link this one file from every page.

   1. Tokens        5. Header / nav       9. Home: intro + list
   2. Reset/base    6. Layout helpers    10. Projects page
   3. Page + glows  7. Buttons           11. Footer
   4. Animation     8. Home: hero        12. Responsive + motion
   ========================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  /* colour */
  --bg: #04060c;
  --ink: #e8eef7;
  --muted: #9fb1cc;
  --faint: #6f829e;
  --accent: #85b7eb;
  --on-accent: #04162b;
  --line: rgba(255, 255, 255, 0.12);
  --hover: rgba(255, 255, 255, 0.06);
  --accent-soft: rgba(133, 183, 235, 0.1);
  --accent-line: rgba(133, 183, 235, 0.25);

  /* type */
  --font:
    "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* shape + layout */
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --maxw: 1040px;
  --gutter: clamp(20px, 5vw, 56px);
  --ease: 0.2s ease;
}

/* ---------- 2. Reset / base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.5;
  background-color: var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

h1,
h2,
h3,
p,
ul {
  margin: 0;
}
ul {
  padding: 0;
  list-style: none;
}

/* ---------- 3. Page + gradient background ---------- */
.page {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: 24px var(--gutter) 48px;
}

/* Fixed to the viewport (not the page), so the gradient and glows sit in
   the same place on every page, whatever its height, and don't scroll. */
.blobs {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background: linear-gradient(160deg, #04060c 0%, #08101f 50%, #0c1b38 100%);
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  will-change: transform;
}
.b1 {
  width: 48vmax;
  height: 48vmax;
  top: -20vmax;
  right: -14vmax;
  background: rgba(24, 95, 165, 0.42);
  animation: float-1 36s linear infinite;
  /* Negative delay = start part-way through the loop. Longer than the loop
     is fine: infinite animations just wrap around. */
  animation-delay: calc(var(--bg-elapsed, 0) * -1s);
}
.b2 {
  width: 44vmax;
  height: 44vmax;
  bottom: -20vmax;
  left: -14vmax;
  background: rgba(12, 68, 124, 0.34);
  animation: float-2 40s linear infinite;
  animation-delay: calc(var(--bg-elapsed, 0) * -1s);
}

/* ---------- 4. Glow animation ----------
   Glows keep to opposite sides so their edges graze instead of merging.
   Keyframe times are proportional to segment length (constant speed). */
@keyframes float-1 {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  28% {
    transform: translate3d(-28vmax, 8vmax, 0) scale(1.15);
  }
  40% {
    transform: translate3d(-38vmax, -1vmax, 0) scale(0.95);
  }
  75% {
    transform: translate3d(-12vmax, 24vmax, 0) scale(1.1);
  }
}
@keyframes float-2 {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  29% {
    transform: translate3d(32vmax, -10.5vmax, 0) scale(1.1);
  }
  44% {
    transform: translate3d(42vmax, 3.5vmax, 0) scale(0.92);
  }
  75% {
    transform: translate3d(18vmax, -22.5vmax, 0) scale(1.08);
  }
}

/* ---------- 5. Header / nav ---------- */
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--maxw);
  width: 100%;
  margin: 0 auto;
}

.brand {
  font-weight: 600;
}

.nav nav {
  display: flex;
  gap: 24px;
  font-size: 0.9rem;
  color: var(--muted);
}
.nav nav a {
  transition: color var(--ease);
}
.nav nav a:hover,
.nav nav a[aria-current="page"] {
  color: var(--ink);
}

/* ---------- 6. Layout helpers ---------- */
.container {
  flex: 1;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding-top: 64px;
}

.page-head h1 {
  margin-bottom: 14px;
}
.page-head p {
  max-width: 46ch;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

/* ---------- 7. Buttons + type ---------- */
h1 {
  font-size: clamp(2.5rem, 6vw, 3.6rem);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-block;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  font-size: 0.95rem;
  transition: filter var(--ease);
}
.btn:hover {
  filter: brightness(1.1);
}
.btn-secondary {
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
}

/* Shared icon tile styling */
.tile {
  flex: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 0.5px solid var(--accent-line);
}
.tile svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Footer ---------- */
.footer {
  max-width: var(--maxw);
  width: 100%;
  margin: 64px auto 0;
  padding-top: 20px;
  border-top: 0.5px solid var(--line);
  font-size: 0.8rem;
  color: var(--faint);
}

/* ---------- Responsive + reduced motion ---------- */
@media (max-width: 760px) {
  .container {
    padding-top: 40px;
  }
}

/* Glows only animate on screens wider than 800px; static below that
   (saves battery, avoids jank on phones and small tablets) */
@media (max-width: 800px) {
  .blob {
    animation: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .blob {
    animation: none !important;
  }
  * {
    transition: none !important;
  }
}