/* ==========================================================================
   sellergren.net — Design System
   Dark, sophisticated single-page personal site
   ========================================================================== */

/* --- Reset & Base -------------------------------------------------------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Colors */
  --bg-primary: #0f1117;
  --bg-secondary: #161821;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --bg-glass: rgba(255, 255, 255, 0.06);
  --border-glass: rgba(255, 255, 255, 0.1);
  --border-glass-hover: rgba(255, 255, 255, 0.18);

  --text-primary: #e8e6e3;
  --text-secondary: #9b9a97;
  --text-muted: #6b6a67;

  --accent-warm: #d4a373;
  --accent-warm-dim: rgba(212, 163, 115, 0.15);
  --accent-blue: #7eb8da;
  --accent-blue-dim: rgba(126, 184, 218, 0.12);
  --accent-green: #8fbc8f;
  --accent-green-dim: rgba(143, 188, 143, 0.12);
  --accent-red: #cd6a6a;
  --accent-red-dim: rgba(205, 106, 106, 0.12);

  /* Typography */
  --font-heading: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Spacing */
  --section-padding: clamp(60px, 9vh, 110px);
  --container-width: 1100px;
  --container-padding: clamp(20px, 5vw, 48px);

  /* Animation */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-base: 0.3s var(--ease-out-expo);
  --transition-slow: 0.6s var(--ease-out-expo);
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  font-size: 16px;
  overflow-x: hidden;
}

a {
  color: var(--accent-warm);
  text-decoration: none;
  transition: color var(--transition-base);
}

a:hover {
  color: var(--text-primary);
}

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

/* --- Navigation ---------------------------------------------------------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 0 var(--container-padding);
  transition: background var(--transition-base), box-shadow var(--transition-base);
}

.nav.scrolled {
  background: rgba(15, 17, 23, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 var(--border-glass);
}

.nav-inner {
  max-width: var(--container-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.nav-logo {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  transition: color var(--transition-base);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent-warm);
  transition: width var(--transition-base);
}

.nav-links a:hover {
  color: var(--text-primary);
}

.nav-links a:hover::after {
  width: 100%;
}

/* Mobile menu toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-secondary);
  transition: transform var(--transition-base), opacity var(--transition-base);
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* --- Hero Section -------------------------------------------------------- */
.hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  overflow: hidden;
}

.hero-image {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(15, 17, 23, 0.15) 0%,
    rgba(15, 17, 23, 0.3) 40%,
    rgba(15, 17, 23, 0.85) 80%,
    rgba(15, 17, 23, 1) 100%
  );
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 0 var(--container-padding) 80px;
  max-width: var(--container-width);
  width: 100%;
  margin: 0 auto;
}

.hero-name {
  font-family: var(--font-heading);
  font-size: clamp(3.5rem, 9vw, 7rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.0;
  margin-bottom: 20px;
  color: #fff;
}

.hero-tagline {
  font-size: clamp(0.8rem, 1.4vw, 1rem);
  color: rgba(255,255,255,0.55);
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero-tagline .separator {
  margin: 0 14px;
  color: rgba(255,255,255,0.25);
}

.scroll-indicator {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0.5;
  animation: float 2.5s ease-in-out infinite;
}

.scroll-indicator-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--text-muted), transparent);
}

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

/* --- Sections (shared) --------------------------------------------------- */
.section {
  padding: var(--section-padding) var(--container-padding);
}

.section-inner {
  max-width: var(--container-width);
  margin: 0 auto;
}

.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-warm);
  margin-bottom: 12px;
}

.section-heading {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 24px;
  color: var(--text-primary);
}

.section-body {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.8;
  max-width: 680px;
}

.section-body p + p {
  margin-top: 16px;
}

.section-divider {
  width: 32px;
  height: 1px;
  background: var(--accent-warm);
  margin-bottom: 40px;
  opacity: 0.8;
}

/* Alternating section backgrounds */
.section--alt {
  background: var(--bg-secondary);
}

/* --- Scroll reveal animations -------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* --- About Section ------------------------------------------------------- */
.about-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 32px;
}

.about-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition-base);
}

.about-link:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glass-hover);
  color: var(--text-primary);
  transform: translateY(-2px);
}

.about-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* --- Research Section ---------------------------------------------------- */
.research-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 40px;
}

.research-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: transparent;
  border: none;
  border-left: 2px solid var(--border-glass);
  border-radius: 0;
  padding: 20px 28px;
  transition: all var(--transition-base);
  position: relative;
}

.research-card:hover {
  border-left-color: var(--accent-warm);
  background: transparent;
  transform: translateX(4px);
}

.research-card-icon {
  display: none;
}

.research-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-primary);
  transition: color var(--transition-base);
}

.research-card:hover h3 {
  color: var(--accent-warm);
}

.research-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* keep icon classes so HTML doesn't break, just hidden */
.research-card-icon--blue,
.research-card-icon--green,
.research-card-icon--warm,
.research-card-icon--red { display: none; }

/* --- Triathlon Section --------------------------------------------------- */
.tri-stats {
  display: flex;
  gap: 48px;
  margin: 40px 0;
  flex-wrap: wrap;
}

.tri-stat {
  text-align: left;
  padding: 0;
  background: transparent;
  border: none;
  border-top: 1px solid var(--border-glass);
  padding-top: 16px;
  min-width: 100px;
}

.tri-stat-number {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.tri-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 4px;
}

.tri-photos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 48px;
}

.tri-photo {
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 3/4;
  position: relative;
}

.tri-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform 0.6s var(--ease-out-expo);
}

.tri-photo:hover img {
  transform: scale(1.05);
}

.tri-photo-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 24px 16px 12px;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
  font-size: 0.78rem;
  color: rgba(255,255,255,0.8);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.tri-photo:hover .tri-photo-caption {
  opacity: 1;
}

/* First photo spans full width */
.tri-photo--hero {
  grid-column: 1 / -1;
  aspect-ratio: 21/9;
}

/* --- Poker Section ------------------------------------------------------- */
.poker-photo {
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 40px;
}

.poker-photo img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.6s var(--ease-out-expo);
}

.poker-photo:hover img {
  transform: scale(1.03);
}

.poker-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.poker-result {
  background: transparent;
  border: none;
  border-left: 2px solid var(--accent-warm);
  padding: 0 0 0 28px;
  position: relative;
}

.poker-event-name {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-warm);
  margin-bottom: 10px;
}

.poker-event-title {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 24px;
  line-height: 1.5;
}

.poker-stats-row {
  display: flex;
  gap: 40px;
}

.poker-stat {
  text-align: left;
}

.poker-stat-value {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.poker-stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 4px;
}

/* --- Footer -------------------------------------------------------------- */
.footer {
  padding: 48px var(--container-padding);
  border-top: 1px solid var(--border-glass);
}

.footer-inner {
  max-width: var(--container-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-left {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: color var(--transition-base);
}

.footer-links a:hover {
  color: var(--text-secondary);
}

/* --- Responsive ---------------------------------------------------------- */
@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: rgba(15, 17, 23, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 100px 40px 40px;
    gap: 24px;
    transition: right var(--transition-slow);
    border-left: 1px solid var(--border-glass);
  }

  .nav-links.open {
    right: 0;
  }

  .nav-toggle {
    display: flex;
  }

  .hero-content {
    padding-bottom: 60px;
  }

  .hero-tagline .separator {
    display: none;
  }

  .hero-tagline {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .research-grid {
    grid-template-columns: 1fr;
  }

  .tri-photos {
    grid-template-columns: 1fr;
  }

  .tri-photo--hero {
    aspect-ratio: 16/9;
  }

  .tri-photo {
    aspect-ratio: 16/10;
  }

  .poker-content {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

  .scroll-indicator {
    display: none;
  }
}

@media (max-width: 480px) {
  .tri-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .poker-stats-row {
    gap: 20px;
  }
}
