/* ============================================================
   Base + Layout + Sections
   ============================================================ */

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

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-standard);
}

a:hover {
  color: var(--color-accent);
}

p {
  margin: 0 0 var(--space-4);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--color-ink);
  margin: 0 0 var(--space-4);
  line-height: var(--leading-tight);
}

h1 {
  font-size: var(--text-5xl);
  font-weight: 800;
}

h2 {
  font-size: var(--text-3xl);
  font-weight: 700;
}

h3 {
  font-size: var(--text-xl);
  font-weight: 700;
}

h4 {
  font-size: var(--text-lg);
  font-weight: 700;
}

time {
  color: inherit;
}

/* Focus visibility (WCAG) */
:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 200;
  background: var(--color-ink);
  color: #fff;
  padding: var(--space-3) var(--space-6);
  border-radius: 0 0 var(--radius-md) 0;
}

.skip-link:focus {
  left: 0;
}

/* Container */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

@media (min-width: 1024px) {
  .container {
    padding-inline: var(--grid-gutter);
  }
}

/* Section rhythm */
.section {
  padding-block: var(--section-gap-mobile);
}

@media (min-width: 768px) {
  .section {
    padding-block: var(--section-gap-desktop);
  }
}

.section--alt {
  background-color: var(--color-bg-alt);
}

/* Utility: visually hidden */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ============================================================
   Navbar
   ============================================================ */

.navbar {
  position: fixed;
  top: var(--space-4);
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.navbar__inner {
  width: calc(100% - var(--space-8));
  max-width: var(--container-max);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(18, 23, 43, 0.04);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: var(--space-2) var(--space-6);
  height: var(--navbar-height);
  pointer-events: auto;
}

.navbar__brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-lg);
  color: var(--color-ink);
  letter-spacing: -0.02em;
}

.navbar__brand img {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  object-fit: cover;
}

.navbar__links {
  display: none;
  align-items: center;
  gap: var(--space-1);
}

.navbar__link {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  border-radius: var(--radius-full);
}

.navbar__link:hover {
  color: var(--color-accent);
  background: var(--color-accent-soft);
}

.navbar__link[aria-current='page'] {
  color: var(--color-accent);
  font-weight: 700;
  background: var(--color-accent-soft);
}

@media (min-width: 1024px) {
  .navbar__links {
    display: flex;
  }

  .navbar__toggle {
    display: none;
  }
}

/* Mobile toggle */
.navbar__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  background: var(--color-accent-soft);
  color: var(--color-accent);
  border-radius: var(--radius-full);
  cursor: pointer;
}

.navbar__toggle svg {
  width: 22px;
  height: 22px;
}

/* Mobile menu panel */
.navbar__mobile {
  display: none;
  position: fixed;
  top: calc(var(--space-4) + var(--navbar-height) + var(--space-2));
  left: var(--space-4);
  right: var(--space-4);
  z-index: 99;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-4);
}

.navbar__mobile.is-open {
  display: block;
}

.navbar__mobile a {
  display: block;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-weight: 500;
}

.navbar__mobile a:hover,
.navbar__mobile a[aria-current='page'] {
  background: var(--color-accent-soft);
  color: var(--color-accent);
}

/* Spacer so fixed navbar doesn't overlap content */
.navbar-spacer {
  height: calc(var(--navbar-height) + var(--space-8));
}

/* ============================================================
   Hero
   ============================================================ */

.hero {
  position: relative;
  overflow: hidden;
  padding: var(--space-8) 0 var(--section-gap-mobile);
}

.hero__mesh {
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
}

.hero__mesh::before,
.hero__mesh::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
}

.hero__mesh::before {
  width: 560px;
  height: 560px;
  top: -12%;
  right: -8%;
  background: linear-gradient(135deg, rgba(201, 214, 255, 0.85), rgba(228, 201, 255, 0.85));
}

.hero__mesh::after {
  width: 480px;
  height: 480px;
  bottom: -18%;
  left: -10%;
  background: linear-gradient(135deg, rgba(255, 217, 236, 0.9), rgba(201, 214, 255, 0.7));
}

.hero__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-12);
  align-items: center;
}

@media (min-width: 1024px) {
  .hero__grid {
    grid-template-columns: 5fr 7fr;
    min-height: 72vh;
  }
}

/* Avatar blob */
.hero__visual {
  display: flex;
  justify-content: center;
}

@media (min-width: 1024px) {
  .hero__visual {
    justify-content: flex-start;
  }
}

.avatar-frame {
  position: relative;
  width: 288px;
  height: 288px;
}

@media (min-width: 768px) {
  .avatar-frame {
    width: 384px;
    height: 384px;
  }
}

.avatar-frame__blob {
  position: absolute;
  inset: 0;
  z-index: -1;
  transform: scale(1.18);
  background: linear-gradient(160deg, rgba(39, 174, 121, 0.22), rgba(39, 174, 121, 0.06));
  filter: blur(28px);
  animation: blob-morph 15s ease-in-out infinite;
}

.avatar-frame__ring {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.45;
  animation: spin-slow 24s linear infinite;
}

.avatar-frame__ring path {
  fill: var(--color-accent);
  fill-opacity: 0.14;
}

.avatar-frame__photo {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-full);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: #fff;
}

.avatar-frame__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.08);
  transition: transform var(--duration-slow) var(--ease-soft);
}

.avatar-frame:hover .avatar-frame__photo img {
  transform: scale(1.02);
}

/* Hero content */
.hero__content {
  text-align: center;
}

@media (min-width: 1024px) {
  .hero__content {
    text-align: left;
  }
}

.hero__kicker {
  display: inline-block;
  padding: var(--space-2) var(--space-4);
  background: rgba(230, 247, 239, 0.8);
  color: var(--color-accent);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-6);
}

.hero__title {
  margin-bottom: var(--space-6);
}

.hero__title .accent {
  color: var(--color-accent);
}

.hero__tagline {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 34rem;
  margin: 0 auto var(--space-8);
}

@media (min-width: 1024px) {
  .hero__tagline {
    margin-inline: 0;
  }
}

/* Tech icons row */
.hero__techs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-6);
  padding-top: var(--space-4);
  opacity: 0.7;
}

@media (min-width: 1024px) {
  .hero__techs {
    justify-content: flex-start;
  }
}

.hero__tech {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-ink);
  filter: grayscale(1);
  transition: filter var(--duration-base) var(--ease-standard);
}

.hero__tech:hover {
  filter: grayscale(0);
}

.hero__tech svg {
  width: 24px;
  height: 24px;
}

/* ============================================================
   Stats row
   ============================================================ */

.stats {
  background: var(--color-bg-alt);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-12) 0;
}

.stats__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
}

@media (min-width: 768px) {
  .stats__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.stat {
  text-align: center;
}

@media (min-width: 768px) {
  .stat {
    text-align: left;
  }
}

.stat__value {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 800;
  color: var(--color-accent);
  margin-bottom: var(--space-1);
}

.stat__label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

/* ============================================================
   Section headers
   ============================================================ */

.section-head {
  margin-bottom: var(--space-12);
}

.section-head__title {
  color: var(--color-accent);
  margin-bottom: var(--space-2);
}

.section-head__lede {
  color: var(--color-text-muted);
  max-width: 36rem;
}

.section-head__row {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  margin-bottom: var(--space-12);
}

@media (min-width: 768px) {
  .section-head__row {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }
}

.section-head__center {
  text-align: center;
}

.section-head__center .section-head__lede {
  margin-inline: auto;
}

.rule {
  width: 96px;
  height: 4px;
  background: var(--color-accent);
  border-radius: var(--radius-full);
  margin: var(--space-4) auto 0;
}

/* ============================================================
   Page header (inner pages)
   ============================================================ */

.page-header {
  position: relative;
  overflow: hidden;
  padding: var(--space-8) 0 var(--space-12);
}

.page-header__mesh {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 90% 10%, rgba(201, 214, 255, 0.5), transparent 45%),
    radial-gradient(circle at 8% 90%, rgba(255, 217, 236, 0.5), transparent 45%);
  filter: blur(40px);
}

.page-header__eyebrow {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-3);
}

.page-header h1 {
  margin-bottom: var(--space-4);
}

.page-header__lede {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 42rem;
}

/* ============================================================
   Footer
   ============================================================ */

.footer {
  background: var(--color-ink);
  color: rgba(255, 255, 255, 0.7);
  padding: var(--space-16) 0 var(--space-8);
}

.footer__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-12);
}

@media (min-width: 768px) {
  .footer__grid {
    grid-template-columns: 2fr 1fr 1fr;
  }
}

.footer__brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-lg);
  color: #fff;
  margin-bottom: var(--space-4);
}

.footer__brand img {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  object-fit: cover;
}

.footer__blurb {
  color: rgba(255, 255, 255, 0.55);
  max-width: 20rem;
  font-size: var(--text-sm);
}

.footer__heading {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-6);
}

.footer__links {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.footer__links a {
  color: rgba(255, 255, 255, 0.65);
  font-size: var(--text-sm);
}

.footer__links a:hover {
  color: #fff;
}

.footer__bottom {
  margin-top: var(--space-12);
  padding-top: var(--space-6);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.4);
}

/* ============================================================
   Keyframes
   ============================================================ */

@keyframes blob-morph {
  0%   { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
  50%  { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
  100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
}

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
