:root {
  --bg: #EEF3F1;
  --ink: #14302B;
  --muted: #4D6660;
  --line: #C5D3CE;
  --accent: #1F6F5C;
  --panel: #E1EBE7;
}
:root[data-theme="dark"] {
  --bg: #0F1C19;
  --ink: #E4EFEB;
  --muted: #9DB5AE;
  --line: #2A403A;
  --accent: #6FD1B4;
  --panel: #162723;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
}
a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.wrap { max-width: 900px; margin: 0 auto; padding: 0 24px; }

/* Soft light that follows the mouse */
.glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(500px circle at var(--x, 50%) var(--y, 30%), var(--accent), transparent 70%);
  opacity: 0.12;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.logo { font-weight: 800; text-decoration: none; font-size: 1.2rem; }
.links { display: flex; align-items: center; gap: 20px; font-size: 16px; }
.links a { text-decoration: none; color: var(--muted); }
.links a:hover { color: var(--accent); }
#theme {
  font: inherit;
  font-size: 15px;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 16px;
  cursor: pointer;
}

/* Hero: every letter of the name reacts to the mouse */
.hero { padding-top: 90px; padding-bottom: 80px; position: relative; }
h1 {
  font-size: clamp(3.2rem, 14vw, 8.5rem);
  line-height: 1;
  letter-spacing: -0.04em;
  margin: 0;
  font-weight: 300;
}
h1 .ch {
  display: inline-block;
  font-variation-settings: "wght" 300;
  transition: font-variation-settings 0.12s linear, transform 0.12s linear, color 0.12s linear;
  white-space: pre;
}
.hero p { font-size: 1.5rem; color: var(--muted); margin: 28px 0 0; }
#role { color: var(--accent); font-weight: 600; }
.cursor { color: var(--accent); animation: blink 1s steps(1) infinite; }
.hero .hint { font-size: 1rem; margin-top: 12px; }
@keyframes blink { 50% { opacity: 0; } }

section { padding: 64px 0; border-top: 1px solid var(--line); }
h2 { font-size: 1.7rem; margin: 0 0 20px; letter-spacing: -0.01em; }
section p { max-width: 60ch; margin: 0 0 16px; }

.cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.card {
  background: var(--panel);
  padding: 22px;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: transform 0.2s, border-color 0.2s;
}
.card:hover { transform: translateY(-4px); border-color: var(--accent); }
.card strong { display: block; margin-bottom: 4px; }
.card span { color: var(--muted); font-size: 16px; }

.btn {
  display: inline-block;
  background: var(--accent);
  color: var(--bg);
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
}
.btn:hover { filter: brightness(1.1); }

footer { padding-top: 32px; padding-bottom: 48px; border-top: 1px solid var(--line); color: var(--muted); font-size: 15px; }

/* Sections fade in as you scroll */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s, transform 0.6s; }
.reveal.show { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .cursor { animation: none; }
}
.insta-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1.2rem;
  border-radius: 999px;
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  background: linear-gradient(45deg, #f09433, #dc2743 50%, #bc1888);
  background-size: 140% 140%;
  background-position: 0% 50%;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-position 0.4s ease;
}

.insta-link:hover {
  transform: translateY(-3px);
  background-position: 100% 50%;
  box-shadow: 0 8px 20px rgba(220, 39, 67, 0.35);
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch; /* makes both buttons exactly the same height */
  gap: 0.75rem;
}

.insta-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0 1.5rem;
  border: 2px solid #386e5e;   /* same green as the email button */
  border-radius: 8px;          /* same corners as the email button */
  color: #386e5e;
  background: transparent;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.insta-link:hover {
  background: #386e5e;
  color: #fff;
  transform: translateY(-2px);
}

.insta-link:focus-visible {
  outline: 3px solid #386e5e;
  outline-offset: 3px;
}
/* ================================================================
   Contact buttons
   ================================================================ */
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.75rem;
}

/* both buttons: outlined green, fill green on hover */
.contact-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  background: transparent;
  color: var(--accent, #386e5e);
  box-shadow: inset 0 0 0 2px currentColor;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.contact-actions .btn:hover,
.contact-actions .btn:focus-visible {
  background: var(--accent, #386e5e);
  color: #fff;
  transform: translateY(-2px);
}

/* ================================================================
   Running card (button)
   ================================================================ */
.run-card {
  position: relative;
  display: block;
  width: 100%;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* green fill that sweeps up on hover */
.run-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(135deg, #386e5e, #4f9a7f);
  transform: translateY(101%);
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* light "track" line that draws along the bottom */
.run-card::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 4px;
  width: 0;
  background: #bff0d8;
  transition: width 0.7s ease;
}

.run-card .run-cta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.8rem;
  font-style: normal;
  font-weight: 600;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s ease 0.1s, transform 0.3s ease 0.1s;
}

.run-card .arrow {
  display: inline-block;
  font-style: normal;
  transition: transform 0.3s ease;
}

.run-card:hover,
.run-card:focus-visible {
  transform: translateY(-6px);
  box-shadow: 0 14px 30px rgba(56, 110, 94, 0.35);
}

.run-card:hover::before,
.run-card:focus-visible::before { transform: translateY(0); }

.run-card:hover::after,
.run-card:focus-visible::after { width: 100%; }

.run-card:hover strong,
.run-card:hover span,
.run-card:focus-visible strong,
.run-card:focus-visible span,
.run-card:hover .run-cta,
.run-card:focus-visible .run-cta { color: #fff; }

.run-card:hover .run-cta,
.run-card:focus-visible .run-cta {
  opacity: 1;
  transform: translateY(0);
}

.run-card:hover .arrow,
.run-card:focus-visible .arrow { transform: translateX(6px); }

.run-card:focus-visible { outline: 3px solid #bff0d8; outline-offset: 3px; }

/* phones/tablets have no hover, so always show the prompt */
@media (hover: none) {
  .run-card .run-cta {
    opacity: 1;
    transform: none;
    color: var(--accent, #386e5e);
  }
}

/* ================================================================
   Training log popup
   ================================================================ */
body:has(dialog[open]) { overflow: hidden; }

.run-modal {
  width: min(560px, calc(100% - 2rem));
  max-height: calc(100% - 2rem);
  margin: auto;
  padding: 0;
  border: 1px solid rgba(127, 209, 168, 0.35);
  border-radius: 20px;
  background: radial-gradient(120% 120% at 0% 0%, #1d4a3c 0%, #12352b 60%);
  color: #eaf6f0;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  overflow: auto;
}

.run-modal[open] { animation: runPop 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2); }

.run-modal::backdrop {
  background: rgba(10, 30, 24, 0.55);
  backdrop-filter: blur(6px);
}

@keyframes runPop {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to   { opacity: 1; transform: none; }
}

.run-modal-inner { padding: 1.75rem; }

.run-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.run-modal-title-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.run-modal h3 { margin: 0; font-size: 1.5rem; color: #eaf6f0; }

.run-device-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.2rem 0.65rem 0.2rem 0.45rem;
  border-radius: 999px;
  background: rgba(127, 209, 168, 0.14);
  border: 1px solid rgba(127, 209, 168, 0.3);
  color: #bff0d8;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.coros-watch-icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.run-close {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(127, 209, 168, 0.5);
  background: transparent;
  color: #eaf6f0;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.3s ease, background 0.2s ease, color 0.2s ease;
}

.run-close:hover {
  transform: rotate(90deg);
  background: #bff0d8;
  color: #12352b;
}

.rm-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.rm-stat {
  padding: 0.9rem;
  border-radius: 14px;
  background: rgba(127, 209, 168, 0.12);
  border: 1px solid rgba(127, 209, 168, 0.25);
}

.rm-stat strong { display: block; font-size: 1.3rem; color: #bff0d8; }
.rm-stat span { font-size: 0.85rem; opacity: 0.8; }

.run-modal .run-goal-label { margin: 1.25rem 0 0.5rem; }

.run-modal .run-bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  overflow: hidden;
}

#run-modal #run-bar-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #4f9a7f, #bff0d8);
  transition: width 0.9s ease 0.2s;
}

.run-modal .run-list { list-style: none; padding: 0; margin: 1.25rem 0 0; }

.run-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.run-item:last-child {
  border-bottom: none;
}

.run-item-main {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

.run-item-name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.run-item-icon {
  font-size: 1.05rem;
  line-height: 1;
}

.run-item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: rgba(234, 246, 240, 0.72);
}

.run-item-meta .dot {
  opacity: 0.35;
}

.run-item-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.1rem 0.45rem;
  border-radius: 6px;
  background: rgba(127, 209, 168, 0.14);
  border: 1px solid rgba(127, 209, 168, 0.25);
  color: #bff0d8;
  font-size: 0.76rem;
  font-weight: 500;
}

.run-item-dist {
  text-align: right;
  flex-shrink: 0;
}

.run-item-dist strong {
  display: block;
  font-size: 1.28rem;
  font-weight: 700;
  color: #bff0d8;
  line-height: 1;
}

.run-item-dist span {
  font-size: 0.72rem;
  opacity: 0.75;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.run-modal .run-list li:not(.run-item) {
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.95rem;
}

.run-modal .run-list li:last-child { border-bottom: none; }

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

/* ================================================================
   Animated role icons
   ================================================================ */
#role-icon {
  display: inline-block;
  width: 1.15em;
  height: 1.15em;
  margin-left: 0.45em;
  vertical-align: -0.18em;
  color: var(--accent, #386e5e);
}

#role-icon svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  animation: icPop 0.4s ease;
}

@keyframes icPop {
  from { opacity: 0; transform: scale(0.6); }
  to   { opacity: 1; transform: none; }
}

/* student: cap bobs, tassel sways */
.ic-cap { animation: icBob 1.6s ease-in-out infinite; }
.ic-tassel { transform-origin: 30px 13px; animation: icSway 1.2s ease-in-out infinite alternate; }
@keyframes icBob  { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
@keyframes icSway { from { transform: rotate(-14deg); } to { transform: rotate(14deg); } }

/* learner: bulb glows, rays blink */
.ic-glow { animation: icGlow 1.4s ease-in-out infinite alternate; }
.ic-rays { animation: icRays 1.4s ease-in-out infinite alternate; }
@keyframes icGlow { from { opacity: 0.08; } to { opacity: 0.55; } }
@keyframes icRays { from { opacity: 0.2; } to { opacity: 1; } }

/* builder: hammer swings */
.ic-hammer { transform-origin: 16px 28px; animation: icHit 0.9s ease-in-out infinite; }
@keyframes icHit {
  0%   { transform: rotate(-38deg); }
  45%  { transform: rotate(16deg); }
  55%  { transform: rotate(16deg); }
  100% { transform: rotate(-38deg); }
}

/* runner: arms and legs swing, speed lines streak */
.ic-leg { transform-origin: 15px 18px; animation: icSwing 0.5s ease-in-out infinite alternate; }
.ic-arm { transform-origin: 18px 11px; animation: icSwingArm 0.5s ease-in-out infinite alternate; }
.ic-leg.b, .ic-arm.b { animation-direction: alternate-reverse; }
.ic-speed { animation: icSpeed 0.6s linear infinite; }
@keyframes icSwing    { from { transform: rotate(-28deg); } to { transform: rotate(28deg); } }
@keyframes icSwingArm { from { transform: rotate(-20deg); } to { transform: rotate(20deg); } }
@keyframes icSpeed {
  0%   { transform: translateX(3px);  opacity: 0; }
  50%  { opacity: 1; }
  100% { transform: translateX(-3px); opacity: 0; }
}

/* data: bars grow and shrink */
.ic-bar {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: icBar 1.1s ease-in-out infinite alternate;
}
@keyframes icBar { from { transform: scaleY(0.35); } to { transform: scaleY(1); } }

/* football fan: bouncing, spinning ball with a shadow */
.ic-ball { animation: icBounce 0.9s infinite; }
.ic-spin { transform-origin: 16px 11px; animation: icSpinBall 1.8s linear infinite; }
.ic-shadow {
  transform-box: fill-box;
  transform-origin: 50% 50%;
  animation: icShadow 0.9s ease-in-out infinite;
}
@keyframes icBounce {
  0%   { transform: translateY(-3px); animation-timing-function: ease-in; }
  50%  { transform: translateY(8px);  animation-timing-function: ease-out; }
  100% { transform: translateY(-3px); }
}
@keyframes icSpinBall { to { transform: rotate(360deg); } }
@keyframes icShadow {
  0%, 100% { transform: scale(0.55); opacity: 0.25; }
  50%      { transform: scale(1);    opacity: 0.6; }
}

/* respect "reduce motion" settings */
@media (prefers-reduced-motion: reduce) {
  #role-icon svg, #role-icon svg * { animation: none !important; }
}