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

:root {
  --bg: #0b1220;
  --text: #e6e9ef;
  --muted: #a5adba;
  --link: #52f5d2;
  --max-width: 620px;
}

body {
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  padding: 56px 28px 72px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration: none;
}

.layout {
  max-width: 860px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 32px;
}

.sidebar {
  align-self: start;
  width: 160px;
  font-size: 13px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.site-title {
  display: block;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}

.site-title:hover {
  color: var(--text);
  text-decoration: none;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar nav a {
  color: var(--muted);
  text-decoration: none;
}

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

.content {
  max-width: var(--max-width);
}

.content-header {
  margin-bottom: 20px;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

main {
  max-width: var(--max-width);
}

main h1 {
  font-size: 28px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin-bottom: 20px;
}

main p {
  margin-bottom: 1.6em;
}

footer {
  max-width: var(--max-width);
  margin: 52px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.footer-meta {
  color: var(--muted);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
}

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

/* ── About page ──────────────────────────────── */

.about-hero {
  margin-bottom: 48px;
}

.about-text {
  color: var(--muted);
  margin-bottom: 1.4em;
}

.about-text:last-child {
  margin-bottom: 0;
}

/* ── Running page ─────────────────────────────── */

.running {
  --tag-trail: #52f5d2;
  --tag-road: #5b9bf5;
  --tag-ultra: #f5a623;
  --tag-marathon: #e56070;
  --tag-night: #b48efa;
  --tag-vertical: #ff8a65;
}

/* Hero */

.r-hero {
  margin-bottom: 48px;
}

.r-intro {
  color: var(--muted);
  margin-bottom: 28px;
}

.r-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 20px 0;
}

.r-stat-value {
  display: block;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.r-stat-label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-top: 2px;
}

/* Progression chart */

.r-progression {
  margin-bottom: 52px;
}

.r-section-title {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 400;
  margin-bottom: 16px;
}

.r-chart {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.r-chart-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.r-chart-year {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  width: 36px;
  flex-shrink: 0;
}

.r-chart-track {
  flex: 1;
  height: 22px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 3px;
  overflow: hidden;
}

.r-chart-bar {
  height: 100%;
  background: var(--link);
  opacity: 0.35;
  border-radius: 3px;
  min-width: 8px;
}

.r-chart-value {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  min-width: 140px;
  text-align: right;
}

.r-chart-elev {
  color: var(--muted);
}

/* Year sections */

.r-year {
  margin-bottom: 48px;
}

.r-year-header {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.r-year-header h2 {
  font-size: 22px;
  letter-spacing: -0.01em;
}

.r-year-meta {
  font-size: 14px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Race cards */

.r-races {
  display: flex;
  flex-direction: column;
}

.r-race {
  padding: 16px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.r-race:last-child {
  border-bottom: none;
}

.r-race--featured {
  padding: 20px 0;
}

/* Tags */

.r-race-tags {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
}

.r-tag {
  display: inline-block;
  font-size: 11px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 3px;
  font-weight: 600;
  line-height: 1.6;
}

.r-tag--trail {
  background: rgba(82, 245, 210, 0.1);
  color: var(--tag-trail);
}

.r-tag--road {
  background: rgba(91, 155, 245, 0.1);
  color: var(--tag-road);
}

.r-tag--ultra {
  background: rgba(245, 166, 35, 0.1);
  color: var(--tag-ultra);
}

.r-tag--marathon {
  background: rgba(229, 96, 112, 0.1);
  color: var(--tag-marathon);
}

.r-tag--half {
  background: rgba(240, 140, 150, 0.1);
  color: #f08c96;
}

.r-tag--night {
  background: rgba(180, 142, 250, 0.1);
  color: var(--tag-night);
}

.r-tag--vertical {
  background: rgba(255, 138, 101, 0.1);
  color: var(--tag-vertical);
}

.r-tag--cross {
  background: rgba(160, 200, 120, 0.1);
  color: #a0c878;
}

.r-tag--10k {
  background: rgba(91, 155, 245, 0.1);
  color: var(--tag-road);
}

.r-tag--pb {
  background: rgba(212, 168, 85, 0.1);
  color: #d4a855;
}

.r-tag--dnf {
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

/* Race info */

.r-race-name {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 2px;
}

.r-race-date {
  display: block;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 8px;
}

.r-race-metrics {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  margin-bottom: 10px;
}

.r-sep {
  color: rgba(255, 255, 255, 0.15);
}

/* Distance bar */

.r-bar {
  height: 3px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 2px;
  overflow: hidden;
}

.r-bar-fill {
  height: 100%;
  background: var(--tag-road);
  opacity: 0.4;
  border-radius: 2px;
  min-width: 4%;
}

.r-bar-fill--trail {
  background: var(--tag-trail);
}

/* Compact photo layout */

.r-race--compact {
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 16px;
  align-items: start;
}

.r-race-photo--compact {
  margin-bottom: 0;
}

.r-race-photo--compact .r-race-img {
  width: 140px;
  height: 100px;
  object-fit: cover;
  border-radius: 4px;
}

/* Photo placeholder */

.r-race-photo {
  margin-bottom: 12px;
}

.r-race-img {
  width: 100%;
  border-radius: 6px;
  display: block;
}

.r-photo-placeholder {
  aspect-ratio: 21 / 9;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.15);
  font-size: 12px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(255, 255, 255, 0.015);
}

/* ── Resume page ─────────────────────────────── */

.cv {
  --tag-executive: #d4a855;
  --tag-cto: #5b9bf5;
  --tag-engineer: #52f5d2;
  --tag-founder: #b48efa;
  --tag-architect: #4ecdc4;
}

/* Hero */

.cv-hero {
  margin-bottom: 48px;
}

.cv-subtitle {
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 16px;
}

.cv-intro {
  color: var(--muted);
  margin-bottom: 28px;
}

.cv-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 20px 0;
}

.cv-stat-value {
  display: block;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.cv-stat-label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-top: 2px;
}

/* Sections */

.cv-section {
  margin-bottom: 48px;
}

.cv-section-title {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 400;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* Role cards */

.cv-roles {
  display: flex;
  flex-direction: column;
}

.cv-role {
  padding: 16px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.cv-role:last-child {
  border-bottom: none;
}

.cv-role-tags {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
}

.cv-tag {
  display: inline-block;
  font-size: 11px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 3px;
  font-weight: 600;
  line-height: 1.6;
}

.cv-tag--executive {
  background: rgba(212, 168, 85, 0.1);
  color: var(--tag-executive);
}

.cv-tag--cto {
  background: rgba(91, 155, 245, 0.1);
  color: var(--tag-cto);
}

.cv-tag--engineer {
  background: rgba(82, 245, 210, 0.1);
  color: var(--tag-engineer);
}

.cv-tag--founder {
  background: rgba(180, 142, 250, 0.1);
  color: var(--tag-founder);
}

.cv-tag--architect {
  background: rgba(78, 205, 196, 0.1);
  color: var(--tag-architect);
}

.cv-role-name {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 2px;
}

.cv-role-name a {
  color: var(--text);
  text-decoration: none;
}

.cv-role-name a:hover {
  color: var(--link);
}

.cv-role-meta {
  display: block;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 8px;
}

.cv-role-desc {
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 8px;
}

.cv-subrole {
  margin-top: 14px;
}

.cv-subrole-name {
  margin-bottom: 4px;
  font-size: 15px;
  font-weight: 600;
}

.cv-subrole-date {
  margin-left: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
}

.cv-subrole + .cv-bar {
  margin-top: 14px;
}

.cv-role-items {
  list-style: none;
  margin-bottom: 10px;
}

.cv-role-items li {
  position: relative;
  padding-left: 16px;
  font-size: 15px;
  color: var(--muted);
  line-height: 1.6;
}

.cv-role-items li::before {
  content: "·";
  position: absolute;
  left: 0;
  color: rgba(255, 255, 255, 0.25);
  font-weight: 700;
}

/* Duration bar */

.cv-bar {
  height: 3px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 2px;
  overflow: hidden;
}

.cv-bar-fill {
  height: 100%;
  opacity: 0.4;
  border-radius: 2px;
  min-width: 4%;
}

.cv-bar-fill--executive { background: var(--tag-executive); }
.cv-bar-fill--cto { background: var(--tag-cto); }
.cv-bar-fill--engineer { background: var(--tag-engineer); }
.cv-bar-fill--founder { background: var(--tag-founder); }
.cv-bar-fill--architect { background: var(--tag-architect); }

/* Skills */

.cv-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cv-skill {
  display: inline-block;
  font-size: 10px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 3px;
  font-weight: 600;
  line-height: 1.6;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

/* Languages */

.cv-langs {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cv-lang-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}

.cv-lang-name {
  font-size: 15px;
  font-weight: 600;
}

.cv-lang-level {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.cv-lang-bar {
  height: 3px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 2px;
  overflow: hidden;
}

.cv-lang-bar-fill {
  height: 100%;
  background: var(--link);
  opacity: 0.4;
  border-radius: 2px;
}

/* ── Responsive ──────────────────────────────── */

@media (max-width: 720px) {
  body {
    padding: 40px 20px 56px;
  }

  .layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .sidebar {
    position: static;
    width: auto;
  }

  main h1 {
    font-size: 36px;
  }

  footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .r-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .r-year-header {
    flex-direction: column;
    gap: 4px;
  }

  .r-chart-value {
    min-width: auto;
    font-size: 12px;
  }

  .r-chart-elev {
    display: none;
  }

  .cv-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }
}

/* Projects */
.project {
  margin-bottom: 56px;
}

.project-shot {
  display: block;
  margin-bottom: 16px;
}

.project-shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
}

.project-name {
  margin-bottom: 4px;
  font-size: 20px;
  font-weight: 500;
}

.project-name a {
  color: inherit;
  text-decoration: none;
}

.project-name a:hover {
  text-decoration: underline;
}

.project-desc {
  color: var(--muted);
}
