/* ===========================
   Design tokens
   =========================== */
:root {
  --nav-height: 56px;

  --color-bg: #fcf8ee;        /* warm cream */
  --color-ink: #1f1b16;       /* warm near-black */
  --color-ink-soft: #2a2620;  /* body text */
  --color-muted: #7a7068;     /* secondary text */
  --color-rule: #ede5d5;      /* cream-toned border */
  --color-accent: #e63946;    /* crimson */
  --color-accent-soft: rgba(230, 57, 70, 0.4);

  --font-serif: "Fraunces", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html {
  font-size: 17px;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  line-height: 1.7;
  color: var(--color-ink-soft);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===========================
   Background — recolored gradient blobs
   on the cream palette + the existing noise overlay
   =========================== */
.background {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-color: var(--color-bg);
  overflow: hidden;
}

.circle {
  position: absolute;
  width: 80vmin;
  height: 80vmin;
  border-radius: 50%;
  filter: blur(20vmin);
  opacity: 0.55;
  will-change: transform;
}

/* Warm peach into crimson — pulls the accent into the bg */
.circle-1 {
  background: radial-gradient(circle at 70% 30%, #f4a88c, #e63946);
  top: 20%;
  left: 25%;
  animation: drift-1 64s ease-in-out infinite;
}

/* Soft amber into terracotta — keeps things cream-adjacent */
.circle-2 {
  background: radial-gradient(circle at 0% 100%, #f5c99b, #c97a66);
  top: 55%;
  left: -5%;
  animation: drift-2 82s ease-in-out infinite;
}

/* Two long, mismatched drift loops. Different durations and
   distinct waypoints keep the blobs from ever syncing up, so
   the motion never feels mechanical. ease-in-out at each keyframe
   softens direction changes — think breathing, not panning. */
@keyframes drift-1 {
  0%   { transform: translate(0vw, 0vh) scale(1); }
  20%  { transform: translate(-12vw, 8vh) scale(1.05); }
  45%  { transform: translate(10vw, 16vh) scale(0.97); }
  70%  { transform: translate(18vw, -6vh) scale(1.03); }
  100% { transform: translate(0vw, 0vh) scale(1); }
}

@keyframes drift-2 {
  0%   { transform: translate(0vw, 0vh) scale(1); }
  25%  { transform: translate(18vw, -10vh) scale(1.04); }
  50%  { transform: translate(8vw, 14vh) scale(0.96); }
  75%  { transform: translate(-10vw, 6vh) scale(1.06); }
  100% { transform: translate(0vw, 0vh) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .circle-1,
  .circle-2 {
    animation: none;
  }
}

.noise {
  position: absolute;
  inset: 0;
  background-image: url("img/noise.png");
  background-repeat: repeat;
  opacity: 0.25;
  mix-blend-mode: overlay;
}

/* ===========================
   Site nav
   Layout: left link group | centered title (fades in on scroll)
   | right link group. The center title is hidden until the
   hero scrolls out of view.
   =========================== */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background-color: rgba(252, 248, 238, 0.85);
  backdrop-filter: saturate(160%) blur(8px);
  -webkit-backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
  z-index: 100;
  padding: 0 32px;
}

.site-nav--scrolled {
  border-bottom-color: var(--color-rule);
}

.site-nav__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  height: 100%;
}

.site-nav__group {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.site-nav__group--left {
  grid-column: 1;
  justify-self: start;
}

.site-nav__group--right {
  grid-column: 3;
  justify-self: end;
}

.site-nav__group a {
  color: var(--color-ink);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  border-bottom: none;
  transition: color 0.15s ease;
}

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

/* Center brand title — flies in once the hero scrolls past.
   Springy ease keeps the entrance from feeling robotic. */
.site-nav__title {
  grid-column: 2;
  justify-self: center;
  font-family: var(--font-serif);
  font-style: normal;
  font-variation-settings: "opsz" 144;
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: -0.015em;
  color: var(--color-ink);
  text-decoration: none;
  border-bottom: none;
  opacity: 0;
  transform: translateY(-8px);
  transition:
    opacity 250ms cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 250ms cubic-bezier(0.2, 0.8, 0.2, 1),
    color 0.15s ease;
  pointer-events: none;
}

.site-nav--title-visible .site-nav__title {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.site-nav__title:hover {
  color: var(--color-accent);
}

/* ===========================
   Hero
   Fills the visible area below the nav so the brand mark has
   full-screen presence on first paint. Scrolling past it hands
   off to the small nav title.
   =========================== */
header.hero {
  padding: 6rem 20px 1.5rem;
  text-align: center;
}

/* Wrap the name + tagline in an inline-block so they share a
   positioning context. The tagline tucks into the empty space
   next to the descender of the "y" in Bryan — small typographic
   move that makes the composition feel intentional. */
.hero__name {
  display: inline-block;
  position: relative;
  text-align: left;
}

.hero__name h1 {
  font-family: var(--font-serif);
  font-style: normal;
  font-variation-settings: "opsz" 144;
  font-weight: 600;
  font-size: 8rem;
  line-height: 0.9;
  letter-spacing: -0.04em;
  color: var(--color-ink);
  margin: 0;
}

.hero__name .tagline {
  position: absolute;
  /* Vertical: nudge the tagline below the h1 baseline so it sits
     inside the descender zone rather than colliding with the
     bottoms of the upright letterforms. */
  top: 100%;
  margin-top: -.4em;
  /* Horizontal: just to the right of the y's descender curl —
     the y in "Bryan" lands ~28% across the wordmark, so 30%
     parks the tagline in the empty space immediately after it. */
  left: 35%;
  margin-left: 0;
  margin-right: 0;
  margin-bottom: 0;
  font-family: var(--font-sans);
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--color-muted);
  white-space: nowrap;
}

/* ===========================
   Page hero (sub-pages)
   Smaller than the homepage hero so the "Bryan Rea" wordmark stays
   reserved for the brand. Using a different selector (.page-hero)
   means the IntersectionObserver in main.js doesn't latch onto it,
   so the small nav title appears immediately on subpages.
   =========================== */
header.page-hero {
  padding: 7rem 20px 1rem;
  text-align: center;
}

header.page-hero h1 {
  font-family: var(--font-serif);
  font-style: normal;
  font-variation-settings: "opsz" 144;
  font-weight: 600;
  font-size: 5rem;
  line-height: 0.95;
  letter-spacing: -0.035em;
  color: var(--color-ink);
  margin: 0;
}

/* ===========================
   Content
   =========================== */
main.content {
  max-width: 36rem;
  margin: 0 auto;
  padding: 2.5rem 20px 6rem;
  text-align: center;
}

h2 {
  font-family: var(--font-serif);
  font-style: normal;
  font-variation-settings: "opsz" 144;
  font-weight: 600;
  font-size: 2.5rem;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--color-accent);
  margin: 0 0 1rem;
  text-wrap: balance;
}

p {
  font-size: 1.1rem;
  margin: 0 0 1.25rem;
  color: var(--color-ink-soft);
}

.section + .section {
  margin-top: 3rem;
}

.section p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  border-bottom: 1px solid var(--color-accent-soft);
  transition: border-color 0.15s ease, color 0.15s ease;
}

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

em,
i {
  font-style: italic;
}

/* ===========================
   Responsive
   =========================== */
@media (max-width: 768px) {
  html {
    font-size: 16px;
  }

  .site-nav {
    padding: 0 16px;
  }

  .site-nav__group {
    gap: 1rem;
  }

  .site-nav__group a {
    font-size: 0.72rem;
    letter-spacing: 0.1em;
  }

  .site-nav__title {
    display: none;
  }

  header.hero {
    padding: 5.5rem 20px 2rem;
  }

  header.hero h1 {
    font-size: 5rem;
    letter-spacing: -0.035em;
  }

  .hero__name .tagline {
    font-size: 0.88rem;
  }

  header.page-hero {
    padding: 5rem 20px 1rem;
  }

  header.page-hero h1 {
    font-size: 4rem;
    letter-spacing: -0.03em;
  }

  h2 {
    font-size: 2rem;
    letter-spacing: -0.02em;
  }
}
