/* =========================================================
   TEUKU RIZQY RAMADHAN — RUNNING PORTFOLIO
   Minimal / Editorial / Modern
   ========================================================= */

/* =========================================================
   RESET
   ========================================================= */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

:root {
  --bg: #0b0d0f;
  --surface: #111417;
  --surface-soft: #15191c;
  --surface-hover: #191d21;

  --text: #f2f3f3;
  --muted: #858b91;
  --muted-light: #aeb3b7;

  --accent: #b8ff3d;

  --border: #252a2e;
  --border-light: #30353a;

  --card: #111417;
  --card-hover: #191d21;

  --max-width: 1200px;
}

body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial,
    Helvetica, sans-serif;

  background: var(--bg);
  color: var(--text);

  line-height: 1.6;

  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;

  overflow-x: hidden;
}

img,
video {
  max-width: 100%;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

/* =========================================================
     GLOBAL
     ========================================================= */

section {
  width: 100%;
}

.eyebrow {
  margin-bottom: 14px;

  color: var(--accent);

  font-size: 10px;
  font-weight: 700;

  letter-spacing: 1.8px;
  text-transform: uppercase;
}

.section-header h2,
.stats-header h2,
.about-section h2 {
  font-size: clamp(38px, 5vw, 58px);
  line-height: 1;
  letter-spacing: -2.5px;
}

/* =========================================================
     NAVBAR
     ========================================================= */

header {
  position: sticky;
  top: 0;
  z-index: 1000;

  background: rgba(11, 13, 15, 0.94);

  border-bottom: 1px solid var(--border);

  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.navbar {
  width: 100%;
  max-width: var(--max-width);

  min-height: 72px;

  margin: 0 auto;
  padding: 0 24px;

  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar a {
  text-decoration: none;
}

.logo {
  color: var(--text);

  font-size: 18px;
  font-weight: 800;

  letter-spacing: -0.8px;
}

.logo span {
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links a {
  color: var(--muted);

  font-size: 13px;
  font-weight: 500;

  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--text);
}

/* =========================================================
     HERO
     ========================================================= */

.hero {
  width: 100%;
  max-width: var(--max-width);

  min-height: 680px;

  margin: 0 auto;
  padding: 100px 24px;

  display: flex;
  align-items: center;
}

.hero-content {
  max-width: 850px;
}

.hero h1 {
  margin-bottom: 30px;

  font-size: clamp(52px, 8vw, 94px);

  line-height: 0.92;
  letter-spacing: -5px;

  font-weight: 800;
}

.hero h1 span {
  color: var(--muted);
}

.hero-description {
  max-width: 500px;

  margin-bottom: 32px;

  color: var(--muted);

  font-size: 15px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 12px 18px;

  background: var(--accent);
  color: var(--bg);

  border-radius: 5px;

  font-size: 13px;
  font-weight: 700;

  text-decoration: none;

  transition: transform 0.2s ease, opacity 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

.text-link {
  color: var(--muted);

  font-size: 13px;
  font-weight: 600;

  text-decoration: none;

  transition: color 0.2s ease;
}

.text-link:hover {
  color: var(--accent);
}

/* =========================================================
     RUNNING STATS
     ========================================================= */

.stats-section {
  width: 100%;
  max-width: var(--max-width);

  margin: 0 auto;
  padding: 100px 24px;
}

.stats-header {
  margin-bottom: 40px;
}

.stats-grid {
  display: grid;

  grid-template-columns: repeat(3, minmax(0, 1fr));

  gap: 12px;
}

.stat-card {
  min-height: 150px;

  padding: 28px;

  display: flex;
  flex-direction: column;
  justify-content: space-between;

  background: var(--surface);

  border: 1px solid var(--border);
  border-radius: 6px;

  transition: background 0.2s ease, border-color 0.2s ease;
}

.stat-card:hover {
  background: var(--surface-soft);
  border-color: var(--border-light);
}

.stat-card span {
  color: var(--muted);

  font-size: 10px;
  font-weight: 600;

  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.stat-card strong {
  font-size: 36px;
  font-weight: 700;

  letter-spacing: -2px;
}

.stat-card small {
  margin-top: 5px;

  color: var(--muted);

  font-size: 11px;
}

/* =========================================================
     PERFORMANCE
     ========================================================= */

.progress-section {
  width: 100%;
  max-width: var(--max-width);

  margin: 0 auto;
  padding: 100px 24px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;

  gap: 40px;

  margin-bottom: 45px;
}

.progress-header h2 {
  max-width: 680px;

  margin-top: 8px;

  font-size: clamp(38px, 5vw, 64px);

  line-height: 0.98;
  letter-spacing: -3px;
}

.progress-description {
  max-width: 300px;

  color: var(--muted);

  font-size: 14px;
  line-height: 1.7;
}

.progress-grid {
  display: grid;

  grid-template-columns: repeat(2, minmax(0, 1fr));

  gap: 14px;
}

.progress-card {
  min-width: 0;

  padding: 28px;

  background: var(--surface);

  border: 1px solid var(--border);
  border-radius: 6px;

  overflow: hidden;
}

.progress-card-wide {
  grid-column: span 2;
}

.progress-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;

  gap: 20px;

  margin-bottom: 28px;
}

.progress-distance {
  color: var(--muted);

  font-size: 10px;
  font-weight: 700;

  letter-spacing: 1.5px;
}

.progress-card h3 {
  margin-top: 6px;

  font-size: 18px;
  font-weight: 500;

  letter-spacing: -0.3px;
}

.progress-best {
  flex-shrink: 0;

  font-size: 23px;
  font-weight: 700;

  line-height: 1;
  letter-spacing: -1px;
}

.progress-chart {
  position: relative;

  width: 100%;
  min-height: 220px;

  overflow: hidden;
}

.progress-svg {
  display: block;

  width: 100%;
  height: 220px;

  overflow: visible;
}

.progress-grid-line {
  stroke: var(--border);
  stroke-width: 1;
}

.progress-line {
  fill: none;

  stroke: var(--accent);

  stroke-width: 2.5;

  stroke-linecap: round;
  stroke-linejoin: round;
}

.progress-point {
  fill: var(--surface);

  stroke: var(--accent);

  stroke-width: 2.5;
}

.progress-label {
  fill: var(--muted);

  font-size: 11px;
  font-family: inherit;
}

.progress-time-label {
  fill: var(--text);

  font-size: 11px;
  font-weight: 600;

  font-family: inherit;
}

.progress-empty {
  min-height: 220px;

  display: flex;
  align-items: center;
  justify-content: center;

  color: var(--muted);

  font-size: 13px;
}

/* =========================================================
     RUNNING JOURNEY
     ========================================================= */

.journey-section {
  width: 100%;
  max-width: var(--max-width);

  margin: 0 auto;
  padding: 100px 24px;
}

.journey-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;

  gap: 40px;

  margin-bottom: 65px;
}

.journey-header h2 {
  max-width: 650px;

  font-size: clamp(40px, 5vw, 56px);

  line-height: 0.98;
  letter-spacing: -3px;
}

.journey-description {
  max-width: 300px;

  color: var(--muted);

  font-size: 14px;
  line-height: 1.7;
}

.journey-timeline {
  position: relative;

  margin-left: 25px;
  padding-left: 45px;

  border-left: 1px solid var(--border);
}

.journey-year {
  position: relative;

  margin-bottom: 65px;
}

.journey-year:last-child {
  margin-bottom: 0;
}

.journey-year::before {
  content: "";

  position: absolute;

  width: 9px;
  height: 9px;

  left: -50px;
  top: 7px;

  background: var(--bg);

  border: 2px solid var(--accent);
  border-radius: 50%;
}

.journey-year-title {
  margin-bottom: 22px;

  font-size: 38px;

  line-height: 1;
  letter-spacing: -2px;
}

.journey-year-stats {
  display: flex;

  gap: 18px;

  margin-bottom: 24px;

  color: var(--muted);

  font-size: 10px;

  letter-spacing: 1px;

  text-transform: uppercase;
}

.journey-year-stats span + span {
  padding-left: 18px;

  border-left: 1px solid var(--border);
}

.journey-races {
  display: grid;

  gap: 8px;
}

.journey-race {
  display: grid;

  grid-template-columns: 95px minmax(0, 1fr) 130px;

  align-items: center;

  gap: 20px;

  padding: 15px 18px;

  background: var(--surface);

  border: 1px solid var(--border);
  border-radius: 6px;

  color: var(--text);

  text-decoration: none;

  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.journey-race:hover {
  transform: translateX(4px);

  background: var(--surface-hover);

  border-color: var(--border-light);
}

.journey-race:has(.pb-badge) {
  border-color: var(--accent);
}

.journey-date {
  color: var(--muted);

  font-size: 11px;

  text-transform: uppercase;
}

.journey-race-main {
  min-width: 0;

  display: flex;
  align-items: center;

  gap: 13px;
}

.journey-race-image {
  width: 48px;
  height: 48px;

  flex-shrink: 0;

  overflow: hidden;

  background: var(--border);

  border-radius: 5px;
}

.journey-race-image img {
  width: 100%;
  height: 100%;

  object-fit: cover;

  display: block;
}

.journey-race-name {
  display: flex;
  align-items: center;

  gap: 8px;

  margin-bottom: 4px;

  font-size: 16px;
  font-weight: 600;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.journey-race-meta {
  color: var(--muted);

  font-size: 11px;
}

.journey-time {
  text-align: right;

  font-size: 17px;
  font-weight: 600;
}

.pb-badge {
  display: inline-flex;
  align-items: center;

  padding: 3px 6px;

  color: var(--accent);

  border: 1px solid var(--accent);
  border-radius: 3px;

  font-size: 8px;
  font-weight: 800;

  letter-spacing: 0.8px;
  line-height: 1;
}

/* =========================================================
     RACE ARCHIVE
     ========================================================= */

.races-section {
  width: 100%;
  max-width: var(--max-width);

  margin: 0 auto;
  padding: 100px 24px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;

  gap: 40px;
}

.section-description {
  max-width: 300px;

  color: var(--muted);

  font-size: 14px;
  line-height: 1.7;
}

.filters {
  display: grid;

  grid-template-columns: 2fr 1fr 1fr 1fr;

  gap: 8px;

  margin: 40px 0 28px;
}

.filters input,
.filters select {
  width: 100%;

  padding: 12px 14px;

  background: var(--surface);

  color: var(--text);

  border: 1px solid var(--border);
  border-radius: 5px;

  outline: none;

  font-size: 13px;

  transition: border-color 0.2s ease;
}

.filters input::placeholder {
  color: var(--muted);
}

.filters input:focus,
.filters select:focus {
  border-color: var(--accent);
}

/* =========================================================
     RACE GRID
     ========================================================= */

.race-grid {
  display: grid;

  grid-template-columns: repeat(3, minmax(0, 1fr));

  gap: 16px;
}

.race-card {
  overflow: hidden;

  background: var(--surface);

  border: 1px solid var(--border);
  border-radius: 6px;

  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.race-card:hover {
  transform: translateY(-3px);

  background: var(--surface-hover);

  border-color: var(--border-light);
}

.race-card-link {
  display: block;

  color: inherit;

  text-decoration: none;
}

.race-image {
  width: 100%;
  height: 210px;

  display: block;

  object-fit: cover;

  background: var(--border);
}

.race-content {
  padding: 20px;
}

.race-category-row {
  display: flex;
  align-items: center;

  gap: 10px;

  margin-bottom: 12px;
}

.race-category-row .eyebrow {
  margin-bottom: 0;
}

.race-category {
  color: var(--accent);

  font-size: 10px;
  font-weight: 700;

  letter-spacing: 1.2px;
}

.race-pb-badge {
  display: inline-flex;
  align-items: center;

  padding: 4px 7px;

  color: var(--accent);

  border: 1px solid var(--accent);
  border-radius: 3px;

  font-size: 8px;
  font-weight: 800;

  letter-spacing: 0.8px;
}

.race-content h3 {
  margin-bottom: 3px;

  font-size: 19px;

  line-height: 1.2;
  letter-spacing: -0.4px;
}

.race-date {
  color: var(--muted);

  font-size: 11px;
}

.race-info {
  display: flex;
  justify-content: space-between;

  margin-top: 18px;

  color: var(--muted);

  font-size: 12px;
}

.race-time {
  color: var(--text);

  font-weight: 700;
}

.race-result {
  display: flex;
  justify-content: space-between;
  align-items: center;

  margin-top: 18px;
  padding-top: 14px;

  border-top: 1px solid var(--border);
}

.race-result span {
  color: var(--muted);

  font-size: 9px;

  letter-spacing: 1px;
}

.race-result strong {
  font-size: 22px;

  letter-spacing: -1px;
}

.race-link {
  display: block;

  margin-top: 16px;

  color: var(--muted);

  font-size: 12px;
  font-weight: 600;

  text-decoration: none;

  transition: color 0.2s ease;
}

.race-link:hover,
.race-card:hover .race-link {
  color: var(--accent);
}

/* =========================================================
     EMPTY STATE
     ========================================================= */

.empty-state {
  grid-column: 1 / -1;

  padding: 70px 20px;

  text-align: center;

  background: var(--surface);

  border: 1px solid var(--border);
  border-radius: 6px;
}

.empty-state h3 {
  margin-bottom: 5px;
}

.empty-state p {
  color: var(--muted);

  font-size: 13px;
}

/* =========================================================
     ABOUT
     IMPORTANT:
     ABOUT NOW FULL WIDTH
     ========================================================= */

.about-section {
  width: 100%;
  max-width: var(--max-width);

  margin: 0 auto;

  padding: 100px 24px;
}

.about-content {
  max-width: 700px;
}

.about-content h2 {
  margin-bottom: 25px;
}

.about-content p {
  max-width: 680px;

  color: var(--muted-light);

  font-size: 16px;
  line-height: 1.8;

  margin-bottom: 18px;
}

.about-content p:last-child {
  margin-top: 20px;

  color: var(--muted);

  font-size: 16px;

  line-height: 1.8;
}

/* =========================================================
     PUBLIC RUNNING MEMORIES
     THIS IS THE MAIN FIX
     ========================================================= */

.public-gallery-section {
  width: 100%;

  margin-top: 110px;

  padding-top: 80px;

  border-top: 1px solid var(--border);
}

.gallery-section-header {
  display: grid;

  grid-template-columns:
    minmax(0, 1fr)
    minmax(280px, 0.6fr);

  gap: 60px;

  align-items: end;

  margin-bottom: 45px;
}

.gallery-section-header h2 {
  margin: 0;

  font-size: clamp(38px, 5vw, 64px);

  line-height: 0.98;

  letter-spacing: -3px;
}

.gallery-section-header > p {
  max-width: 320px;

  margin: 0;

  color: var(--muted);

  font-size: 14px;

  line-height: 1.7;
}

/* =========================================================
     PUBLIC GALLERY GRID
     ========================================================= */

.public-gallery-grid {
  width: 100%;

  display: grid;

  grid-template-columns: repeat(3, minmax(0, 1fr));

  gap: 16px;
}

/* =========================================================
     PUBLIC GALLERY CARD
     ========================================================= */

.public-gallery-item {
  min-width: 0;

  overflow: hidden;

  background: var(--surface);

  border: 1px solid var(--border);

  border-radius: 10px;

  transition: transform 0.25s ease, border-color 0.25s ease,
    background 0.25s ease;
}

.public-gallery-item:hover {
  transform: translateY(-5px);

  background: var(--surface-hover);

  border-color: var(--border-light);
}

/* =========================================================
     PUBLIC GALLERY MEDIA
     ========================================================= */

.public-gallery-item .gallery-media {
  position: relative;

  width: 100%;

  aspect-ratio: 4 / 3;

  overflow: hidden;

  background: #080a0c;
}

.public-gallery-item .gallery-media img,
.public-gallery-item .gallery-media video {
  display: block;

  width: 100%;
  height: 100%;

  object-fit: cover;

  transition: transform 0.4s ease;
}

.public-gallery-item:hover .gallery-media img,
.public-gallery-item:hover .gallery-media video {
  transform: scale(1.04);
}

/* =========================================================
     GALLERY VIDEO OVERLAY
     ========================================================= */

.gallery-video-overlay {
  position: absolute;

  inset: 0;

  display: flex;

  align-items: center;
  justify-content: center;

  pointer-events: none;
}

.gallery-video-overlay span {
  width: 56px;
  height: 56px;

  display: flex;

  align-items: center;
  justify-content: center;

  padding-left: 3px;

  border-radius: 50%;

  background: rgba(0, 0, 0, 0.7);

  color: white;

  font-size: 20px;

  backdrop-filter: blur(5px);
}

/* =========================================================
     PUBLIC GALLERY CONTENT
     ========================================================= */

.public-gallery-item .gallery-card-content {
  padding: 20px;
}

.public-gallery-item .gallery-card-meta {
  display: flex;
  align-items: center;

  gap: 10px;

  margin-bottom: 10px;
}

.public-gallery-item .gallery-category {
  color: var(--accent);

  font-size: 10px;
  font-weight: 800;

  letter-spacing: 1.2px;

  text-transform: uppercase;
}

.public-gallery-item .gallery-date {
  color: var(--muted);

  font-size: 11px;

  padding-left: 10px;

  border-left: 1px solid var(--border);
}

.public-gallery-item .gallery-card-content h3 {
  margin: 0 0 8px;

  font-size: 19px;

  line-height: 1.2;

  letter-spacing: -0.4px;
}

.public-gallery-item .gallery-card-content p {
  margin: 0;

  color: var(--muted);

  font-size: 13px;

  line-height: 1.6;
}

/* =========================================================
     GALLERY LOADING / EMPTY
     ========================================================= */

.gallery-loading,
.gallery-empty {
  grid-column: 1 / -1;

  padding: 70px 20px;

  text-align: center;

  background: var(--surface);

  border: 1px solid var(--border);

  border-radius: 8px;
}

.gallery-loading p,
.gallery-empty p {
  color: var(--muted);
}

.gallery-empty h3 {
  margin-bottom: 5px;
}

/* =========================================================
     GALLERY CLICKABLE
     ========================================================= */

.gallery-clickable {
  cursor: pointer;
}

.gallery-clickable:hover .gallery-media img,
.gallery-clickable:hover .gallery-media video {
  transform: scale(1.04);
}

/* =========================================================
     FOOTER
     ========================================================= */

footer {
  padding: 30px 24px;

  border-top: 1px solid var(--border);

  color: var(--muted);

  text-align: center;

  font-size: 12px;
}

footer strong {
  color: var(--text);
}

/* =========================================================
     RACE DETAIL
     ========================================================= */

.race-detail-container {
  width: 100%;
  max-width: var(--max-width);

  margin: 0 auto;

  padding: 60px 24px 100px;
}

.back-link {
  display: inline-block;

  margin-bottom: 55px;

  color: var(--muted);

  font-size: 13px;

  text-decoration: none;

  transition: color 0.2s ease;
}

.back-link:hover {
  color: var(--accent);
}

.race-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;

  margin-bottom: 40px;
}

.race-detail-header h1 {
  max-width: 900px;

  font-size: clamp(48px, 7vw, 90px);

  line-height: 0.92;

  letter-spacing: -5px;
}

.detail-meta {
  display: flex;

  gap: 25px;

  margin-top: 24px;

  color: var(--muted);

  font-size: 13px;
}

.race-detail-image {
  width: 100%;
  height: 600px;

  overflow: hidden;

  background: var(--surface);

  border-radius: 6px;
}

.race-detail-image img {
  width: 100%;
  height: 100%;

  display: block;

  object-fit: cover;
}

/* =========================================================
     RESULT
     ========================================================= */

.result-section {
  width: 100%;
  max-width: var(--max-width);
}

.result-grid {
  display: grid;

  grid-template-columns: repeat(4, minmax(0, 1fr));

  gap: 10px;

  margin-top: 35px;
}

.result-box {
  padding: 24px;

  background: var(--surface);

  border: 1px solid var(--border);

  border-radius: 6px;
}

.result-box span {
  display: block;

  color: var(--muted);

  font-size: 9px;

  letter-spacing: 1.5px;
}

.result-box strong {
  display: block;

  margin-top: 9px;

  font-size: 27px;

  letter-spacing: -1px;
}

/* =========================================================
     PERSONAL BEST
     ========================================================= */

.personal-best-section {
  margin-top: 25px;

  overflow: hidden;

  background: rgba(184, 255, 61, 0.04);

  border: 1px solid var(--accent);

  border-radius: 6px;
}

.personal-best-inner {
  display: flex;
  align-items: center;

  gap: 20px;

  padding: 24px 26px;
}

.personal-best-icon {
  width: 50px;
  height: 50px;

  flex-shrink: 0;

  display: flex;

  align-items: center;
  justify-content: center;

  background: var(--accent);

  color: var(--bg);

  border-radius: 50%;

  font-size: 22px;
  font-weight: 800;
}

.personal-best-inner .eyebrow {
  margin-bottom: 4px;
}

.personal-best-inner h2 {
  margin-bottom: 4px;

  font-size: 25px;

  letter-spacing: -1px;
}

.personal-best-inner p:not(.eyebrow) {
  color: var(--muted);

  font-size: 13px;
}

/* =========================================================
     DETAIL SECTION
     ========================================================= */

.detail-section {
  width: 100%;
  max-width: 800px;

  padding-top: 90px;
}

.detail-section h2 {
  margin-bottom: 15px;

  font-size: 40px;

  letter-spacing: -2px;
}

.detail-section p:not(.eyebrow) {
  margin-bottom: 25px;

  color: var(--muted);
}

.race-result-section {
  margin-top: 20px;
}

.certificate-section {
  margin-top: 70px;
  padding-top: 60px;

  border-top: 1px solid var(--border);
}

/* =========================================================
     RACE NAVIGATION
     ========================================================= */

.race-navigation {
  display: grid;

  grid-template-columns: repeat(2, minmax(0, 1fr));

  gap: 12px;

  margin-top: 90px;
}

.race-nav-card {
  min-height: 120px;

  padding: 24px;

  display: flex;
  flex-direction: column;
  justify-content: center;

  gap: 8px;

  background: var(--surface);

  border: 1px solid var(--border);

  border-radius: 6px;

  color: var(--text);

  text-decoration: none;

  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.race-nav-card:hover {
  transform: translateY(-2px);

  background: var(--surface-hover);

  border-color: var(--accent);
}

.race-nav-card span {
  color: var(--muted);

  font-size: 9px;
  font-weight: 700;

  letter-spacing: 1.5px;
}

.race-nav-card strong {
  font-size: 18px;

  line-height: 1.3;
}

.race-nav-card.disabled {
  opacity: 0.3;

  pointer-events: none;
}

/* =========================================================
     LOGIN
     ========================================================= */

.login-page {
  min-height: 100vh;

  padding: 30px;

  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  width: 100%;
  max-width: 420px;

  padding: 38px;

  background: var(--surface);

  border: 1px solid var(--border);

  border-radius: 6px;
}

.login-card .logo {
  display: inline-block;

  margin-bottom: 45px;
}

.login-card h1 {
  margin-bottom: 8px;

  font-size: 40px;

  letter-spacing: -2px;
}

.login-description {
  margin-bottom: 32px;

  color: var(--muted);

  font-size: 14px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;

  margin-bottom: 7px;

  color: var(--muted);

  font-size: 12px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;

  padding: 12px 14px;

  background: var(--bg);

  color: var(--text);

  border: 1px solid var(--border);

  border-radius: 5px;

  outline: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--accent);
}

.form-group small {
  display: block;

  margin-top: 6px;

  color: var(--muted);

  font-size: 10px;
}

.form-group textarea {
  resize: vertical;
}

.login-button {
  width: 100%;

  border: none;

  cursor: pointer;
}

.login-message {
  margin-top: 18px;

  color: #ff7070;

  font-size: 12px;
}

/* =========================================================
     ADMIN
     ========================================================= */

.admin-container {
  width: 100%;
  max-width: var(--max-width);

  margin: 0 auto;

  padding: 70px 24px 100px;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;

  margin-bottom: 45px;
}

.admin-header h1 {
  font-size: 52px;

  letter-spacing: -3px;
}

.nav-button {
  background: transparent;

  border: none;

  color: var(--muted);

  cursor: pointer;

  font-size: 13px;
}

.nav-button:hover {
  color: var(--text);
}

.admin-message {
  min-height: 20px;

  margin-bottom: 15px;

  color: var(--accent);

  font-size: 13px;
}

.admin-race-list {
  display: grid;

  gap: 8px;
}

.admin-race-item {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 20px;

  padding: 18px;

  background: var(--surface);

  border: 1px solid var(--border);

  border-radius: 6px;
}

.admin-race-info h3 {
  margin-bottom: 4px;

  font-size: 16px;
}

.admin-race-info p {
  color: var(--muted);

  font-size: 12px;
}

.admin-race-actions {
  display: flex;

  gap: 7px;

  flex-shrink: 0;
}

.edit-race,
.delete-race {
  font-family: inherit;
}

.delete-button {
  padding: 10px 15px;

  background: transparent;

  color: #ff7070;

  border: 1px solid var(--border);

  border-radius: 5px;

  cursor: pointer;

  font-size: 12px;
}

.delete-button:hover {
  border-color: #ff7070;
}

.admin-form-section {
  width: 100%;
  max-width: 900px;

  margin-top: 65px;

  padding-top: 55px;

  border-top: 1px solid var(--border);
}

.form-grid {
  display: grid;

  grid-template-columns: repeat(2, minmax(0, 1fr));

  gap: 18px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;

  gap: 8px;

  margin-top: 25px;
}

.secondary-button {
  padding: 12px 18px;

  background: transparent;

  color: var(--text);

  border: 1px solid var(--border);

  border-radius: 5px;

  cursor: pointer;
}

.secondary-button:hover {
  border-color: var(--text);
}

/* =========================================================
     ADMIN DASHBOARD
     ========================================================= */

.admin-dashboard-header {
  width: 100%;
  max-width: var(--max-width);

  margin: 0 auto 70px;

  padding: 70px 24px 0;

  display: flex;

  justify-content: space-between;

  align-items: flex-end;

  gap: 40px;
}

.admin-heading {
  max-width: 700px;
}

.admin-heading h1 {
  margin: 8px 0 18px;

  font-size: clamp(52px, 7vw, 82px);

  line-height: 0.95;

  letter-spacing: -4px;
}

.admin-intro {
  max-width: 520px;

  color: var(--muted);

  font-size: 15px;

  line-height: 1.7;
}

.admin-header-actions {
  display: flex;

  align-items: center;

  gap: 10px;

  flex-shrink: 0;
}

/* =========================================================
     ADMIN PANEL
     ========================================================= */

.admin-panel {
  width: 100%;
  max-width: var(--max-width);

  margin: 0 auto 40px;

  padding: 0 24px 80px;
}

.admin-panel + .admin-panel {
  padding-top: 80px;

  border-top: 1px solid var(--border);
}

.admin-panel-header {
  display: flex;

  justify-content: space-between;

  align-items: flex-end;

  gap: 40px;

  margin-bottom: 35px;
}

.admin-panel-header h2 {
  margin: 8px 0;

  font-size: clamp(36px, 5vw, 52px);

  line-height: 1;

  letter-spacing: -2.5px;
}

.admin-panel-header p:not(.eyebrow) {
  max-width: 520px;

  color: var(--muted);

  font-size: 14px;
}

.admin-panel-action {
  flex-shrink: 0;
}

/* =========================================================
     ADMIN FORM
     ========================================================= */

.admin-form-section {
  width: 100%;
  max-width: none;

  margin-top: 40px;

  padding: 40px;

  background: var(--card);

  border: 1px solid var(--border);

  border-radius: 12px;
}

.form-section-header {
  display: flex;

  justify-content: space-between;

  align-items: flex-end;

  gap: 20px;

  margin-bottom: 35px;

  padding-bottom: 25px;

  border-bottom: 1px solid var(--border);
}

.form-section-header h2,
.form-section-header h3 {
  margin: 7px 0 0;

  font-size: 30px;

  letter-spacing: -1.5px;
}

.form-hint {
  color: var(--muted);

  font-size: 12px;
}

/* =========================================================
     INPUT SUFFIX
     ========================================================= */

.input-with-suffix {
  position: relative;
}

.input-with-suffix input {
  padding-right: 55px;
}

.input-with-suffix span {
  position: absolute;

  right: 15px;
  top: 50%;

  transform: translateY(-50%);

  color: var(--muted);

  font-size: 11px;
  font-weight: 700;

  letter-spacing: 1px;
}

/* =========================================================
     ADMIN STATS
     ========================================================= */

.admin-stats {
  display: grid;

  grid-template-columns: repeat(3, minmax(0, 1fr));

  gap: 16px;

  margin-bottom: 32px;
}

.admin-stat-card {
  padding: 24px;

  border: 1px solid rgba(255, 255, 255, 0.08);

  background: rgba(255, 255, 255, 0.025);

  border-radius: 14px;
}

.admin-stat-label {
  display: block;

  font-size: 11px;

  letter-spacing: 0.12em;

  opacity: 0.55;

  margin-bottom: 10px;
}

.admin-stat-card strong {
  display: block;

  font-size: 36px;

  line-height: 1;

  font-weight: 600;
}

/* =========================================================
     ADMIN GALLERY
     ========================================================= */

.gallery-admin-section {
  margin-top: 100px;
}

.gallery-form {
  width: 100%;
  max-width: 100%;

  margin-top: 40px;
}

.gallery-admin-list-section {
  margin-top: 80px;
}

.gallery-admin-list-section h3 {
  font-size: 32px;

  letter-spacing: -1px;

  margin-top: 8px;
}

.gallery-list-header {
  display: flex;

  justify-content: space-between;

  align-items: flex-end;

  margin-top: 70px;

  margin-bottom: 25px;

  padding-top: 40px;

  border-top: 1px solid var(--border);
}

.gallery-list-header h3 {
  margin-top: 5px;

  font-size: 24px;

  letter-spacing: -1px;
}

.admin-gallery-grid {
  display: grid;

  grid-template-columns: repeat(3, minmax(0, 1fr));

  gap: 16px;

  margin-top: 30px;
}

.admin-gallery-card {
  overflow: hidden;

  background: var(--card);

  border: 1px solid var(--border);

  border-radius: 10px;

  transition: transform 0.2s ease, border-color 0.2s ease;
}

.admin-gallery-card:hover {
  transform: translateY(-3px);

  border-color: var(--border-light);
}

.admin-gallery-item {
  overflow: hidden;

  background: var(--card);

  border: 1px solid var(--border);

  border-radius: 8px;
}

.admin-gallery-media {
  position: relative;

  width: 100%;

  aspect-ratio: 16 / 10;

  overflow: hidden;

  background: #080a0c;
}

.admin-gallery-media img,
.admin-gallery-media video {
  display: block;

  width: 100%;
  height: 100%;

  object-fit: cover;
}

.admin-gallery-content {
  padding: 18px;
}

.admin-gallery-content h3,
.admin-gallery-content h4 {
  margin-bottom: 6px;

  font-size: 17px;

  letter-spacing: -0.3px;
}

.admin-gallery-category {
  display: inline-block;

  margin-bottom: 8px;

  color: var(--accent);

  font-size: 9px;
  font-weight: 800;

  letter-spacing: 1.5px;

  text-transform: uppercase;
}

.admin-gallery-meta {
  color: var(--muted);

  font-size: 11px;

  letter-spacing: 0.8px;

  margin-bottom: 12px;
}

.admin-gallery-content p,
.admin-gallery-description {
  color: var(--muted);

  font-size: 12px;

  line-height: 1.6;
}

.admin-gallery-date {
  display: block;

  margin-top: 10px;

  color: var(--muted);

  font-size: 10px;
}

.admin-gallery-actions {
  display: flex;

  gap: 8px;

  margin-top: 16px;

  padding-top: 14px;

  border-top: 1px solid var(--border);
}

.admin-gallery-actions button {
  flex: 1;
}

.gallery-delete-button {
  padding: 9px 13px;

  background: transparent;

  color: #ff7070;

  border: 1px solid var(--border);

  border-radius: 6px;

  cursor: pointer;

  font-family: inherit;

  font-size: 12px;
}

.gallery-delete-button:hover {
  border-color: #ff7070;
}

.gallery-video-badge {
  position: absolute;

  top: 10px;
  left: 10px;

  padding: 5px 7px;

  background: rgba(11, 13, 15, 0.85);

  border: 1px solid rgba(255, 255, 255, 0.1);

  border-radius: 4px;

  color: var(--text);

  font-size: 9px;
  font-weight: 700;

  letter-spacing: 1px;
}

/* =========================================================
     GALLERY UPLOAD
     ========================================================= */

.gallery-form-section {
  padding: 40px;

  background: var(--card);

  border: 1px solid var(--border);

  border-radius: 12px;
}

.gallery-upload-area {
  position: relative;

  display: flex;

  align-items: center;

  gap: 20px;

  min-height: 110px;

  margin-top: 10px;

  padding: 25px;

  border: 1px dashed var(--border);

  border-radius: 10px;

  background: var(--bg);

  overflow: hidden;

  transition: border-color 0.2s ease, background 0.2s ease;
}

.gallery-upload-area:hover {
  border-color: var(--accent);

  background: var(--card-hover);
}

.gallery-upload-empty {
  width: 100%;

  min-height: 180px;

  display: flex;

  flex-direction: column;

  align-items: center;

  justify-content: center;

  text-align: center;

  padding: 35px 20px;

  cursor: pointer;
}

.gallery-upload-icon {
  width: 48px;
  height: 48px;

  flex-shrink: 0;

  display: flex;

  align-items: center;
  justify-content: center;

  border: 1px solid var(--border);

  border-radius: 50%;

  color: var(--accent);

  font-size: 24px;

  margin-bottom: 15px;
}

.gallery-upload-content {
  min-width: 0;
}

.gallery-upload-content label {
  display: block;

  margin-bottom: 5px;

  color: var(--text);

  font-size: 14px;
  font-weight: 700;

  cursor: pointer;
}

.gallery-upload-content p {
  margin: 0;

  color: var(--muted);

  font-size: 12px;
}

.gallery-upload-area > input[type="file"] {
  position: absolute;

  width: 1px;
  height: 1px;

  opacity: 0;

  pointer-events: none;
}

.gallery-upload-preview {
  width: 100%;

  padding: 15px;
}

.gallery-preview-media {
  width: 100%;

  max-height: 420px;

  overflow: hidden;

  border-radius: 8px;

  background: var(--bg);

  display: flex;

  align-items: center;
  justify-content: center;
}

.gallery-preview-media img,
.gallery-preview-media video {
  display: block;

  width: 100%;

  max-height: 420px;

  object-fit: contain;

  background: #000;
}

.gallery-preview-info {
  display: flex;

  align-items: center;

  justify-content: space-between;

  gap: 20px;

  margin-top: 15px;

  padding: 5px 3px;
}

.gallery-preview-info > div {
  min-width: 0;

  display: flex;

  flex-direction: column;

  gap: 4px;
}

.gallery-preview-info strong {
  font-size: 14px;

  white-space: nowrap;

  overflow: hidden;

  text-overflow: ellipsis;

  max-width: 500px;
}

.gallery-preview-info span {
  color: var(--muted);

  font-size: 11px;
}

/* =========================================================
     PUBLISH TOGGLE
     ========================================================= */

.publish-toggle {
  display: flex;

  align-items: center;

  gap: 12px;

  margin-top: 25px;

  padding: 15px;

  border: 1px solid var(--border);

  border-radius: 8px;

  cursor: pointer;
}

.publish-toggle input {
  width: 16px;
  height: 16px;

  accent-color: var(--accent);

  flex-shrink: 0;
}

.publish-toggle span {
  display: flex;

  flex-direction: column;

  gap: 2px;
}

.publish-toggle strong {
  font-size: 13px;
}

.publish-toggle small {
  color: var(--muted);

  font-size: 11px;
}

/* =========================================================
     LIGHTBOX
     ========================================================= */

.gallery-lightbox {
  position: fixed;

  inset: 0;

  z-index: 9999;

  display: flex;

  align-items: center;
  justify-content: center;

  padding: 40px;

  background: rgba(0, 0, 0, 0.92);

  opacity: 0;

  visibility: hidden;

  pointer-events: none;

  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.gallery-lightbox.active {
  opacity: 1;

  visibility: visible;

  pointer-events: auto;
}

.gallery-lightbox-content {
  max-width: min(1100px, 85vw);

  max-height: 80vh;

  display: flex;

  align-items: center;
  justify-content: center;
}

.gallery-lightbox-content img,
.gallery-lightbox-content video {
  display: block;

  max-width: 100%;

  max-height: 80vh;

  width: auto;
  height: auto;

  object-fit: contain;

  border-radius: 8px;
}

.gallery-lightbox-close {
  position: absolute;

  top: 20px;
  right: 25px;

  width: 48px;
  height: 48px;

  border: none;

  border-radius: 50%;

  background: rgba(255, 255, 255, 0.12);

  color: white;

  font-size: 32px;

  line-height: 1;

  cursor: pointer;

  z-index: 2;

  transition: background 0.2s ease;
}

.gallery-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.25);
}

.gallery-lightbox-nav {
  position: absolute;

  top: 50%;

  transform: translateY(-50%);

  width: 52px;
  height: 52px;

  border: none;

  border-radius: 50%;

  background: rgba(255, 255, 255, 0.12);

  color: white;

  font-size: 40px;

  line-height: 1;

  cursor: pointer;

  z-index: 2;

  transition: background 0.2s ease;
}

.gallery-lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.25);
}

.gallery-lightbox-prev {
  left: 25px;
}

.gallery-lightbox-next {
  right: 25px;
}

.gallery-lightbox-caption {
  position: absolute;

  left: 50%;
  bottom: 25px;

  transform: translateX(-50%);

  width: min(700px, 80vw);

  text-align: center;

  color: white;
}

.gallery-lightbox-caption strong {
  display: block;

  margin-bottom: 5px;

  font-size: 18px;
}

.gallery-lightbox-caption span {
  display: block;

  font-size: 13px;

  opacity: 0.65;
}

/* =========================================================
     RESPONSIVE — TABLET
     ========================================================= */

@media (max-width: 1000px) {
  .race-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .public-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gallery-section-header {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* =========================================================
     RESPONSIVE — 900px
     ========================================================= */

@media (max-width: 900px) {
  .progress-header,
  .journey-header,
  .section-header {
    display: block;
  }

  .progress-description,
  .journey-description,
  .section-description {
    margin-top: 20px;
  }

  .admin-dashboard-header {
    display: block;

    padding-top: 50px;
  }

  .admin-header-actions {
    margin-top: 25px;
  }
}

/* =========================================================
     MOBILE — 768px
     ========================================================= */

@media (max-width: 768px) {
  .navbar {
    min-height: 64px;

    padding: 0 18px;
  }

  .nav-links {
    display: none;
  }

  /* HERO */

  .hero {
    min-height: 560px;

    padding: 80px 24px;
  }

  .hero h1 {
    font-size: 54px;

    letter-spacing: -3px;
  }

  .hero-actions {
    flex-wrap: wrap;
  }

  /* SECTIONS */

  .stats-section,
  .progress-section,
  .journey-section,
  .races-section,
  .about-section {
    padding-top: 75px;
    padding-bottom: 75px;
  }

  /* STATS */

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 8px;
  }

  .stat-card {
    min-height: 130px;

    padding: 20px;
  }

  .stat-card strong {
    font-size: 28px;
  }

  /* PROGRESS */

  .progress-grid {
    grid-template-columns: 1fr;
  }

  .progress-card-wide {
    grid-column: span 1;
  }

  .progress-card {
    padding: 20px;
  }

  .progress-best {
    font-size: 20px;
  }

  .progress-chart,
  .progress-empty {
    min-height: 190px;
  }

  .progress-svg {
    height: 190px;
  }

  /* JOURNEY */

  .journey-header {
    margin-bottom: 50px;
  }

  .journey-timeline {
    margin-left: 12px;

    padding-left: 28px;
  }

  .journey-year::before {
    left: -34px;
  }

  .journey-year-title {
    font-size: 32px;
  }

  .journey-year-stats {
    gap: 12px;
  }

  .journey-year-stats span + span {
    padding-left: 12px;
  }

  .journey-race {
    grid-template-columns: 1fr;

    gap: 9px;

    padding: 14px;
  }

  .journey-time {
    text-align: left;

    font-size: 16px;
  }

  /* RACES */

  .filters {
    grid-template-columns: 1fr;

    margin-top: 30px;
  }

  .race-grid {
    grid-template-columns: 1fr;

    gap: 10px;
  }

  .race-image {
    height: 220px;
  }

  /* ABOUT */

  .about-section {
    width: 100%;

    margin: 0;

    padding-left: 24px;
    padding-right: 24px;
  }

  /* RUNNING MEMORIES */

  .public-gallery-section {
    margin-top: 75px;

    padding-top: 60px;
  }

  .gallery-section-header {
    display: block;

    margin-bottom: 35px;
  }

  .gallery-section-header > p {
    margin-top: 20px;
  }

  .public-gallery-grid {
    grid-template-columns: 1fr;

    gap: 12px;
  }

  /* DETAIL */

  .race-detail-container {
    padding-top: 40px;
  }

  .race-detail-header {
    display: block;
  }

  .race-detail-header h1 {
    font-size: 50px;

    letter-spacing: -3px;
  }

  .detail-meta {
    flex-direction: column;

    gap: 4px;
  }

  .race-detail-image {
    height: 350px;
  }

  .result-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-box {
    padding: 20px;
  }

  .result-box strong {
    font-size: 22px;
  }

  .detail-section {
    padding-top: 65px;
  }

  .detail-section h2 {
    font-size: 34px;
  }

  /* PERSONAL BEST */

  .personal-best-inner {
    align-items: flex-start;

    gap: 15px;

    padding: 20px;
  }

  .personal-best-icon {
    width: 43px;
    height: 43px;

    font-size: 18px;
  }

  .personal-best-inner h2 {
    font-size: 21px;
  }

  /* NAVIGATION */

  .race-navigation {
    grid-template-columns: 1fr;

    margin-top: 65px;
  }

  /* LOGIN */

  .login-page {
    padding: 20px;
  }

  .login-card {
    padding: 28px 22px;
  }

  /* ADMIN */

  .admin-header {
    align-items: flex-start;

    gap: 20px;
  }

  .admin-header h1 {
    font-size: 42px;
  }

  .admin-race-item {
    align-items: flex-start;

    flex-direction: column;
  }

  .admin-race-actions {
    width: 100%;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-actions {
    justify-content: stretch;

    flex-direction: column;
  }

  .form-actions button {
    width: 100%;
  }

  /* ADMIN GALLERY */

  .admin-gallery-grid {
    grid-template-columns: 1fr;
  }

  .admin-form-section,
  .gallery-form-section {
    padding: 22px;
  }

  .form-section-header {
    display: block;
  }

  .gallery-panel-count {
    margin-top: 20px;

    width: fit-content;

    text-align: left;
  }

  .gallery-upload-area {
    align-items: flex-start;
  }

  .gallery-upload-empty {
    min-height: 150px;

    padding: 25px 15px;
  }

  .gallery-preview-info {
    align-items: flex-start;

    flex-direction: column;

    gap: 12px;
  }

  .gallery-preview-info strong {
    max-width: 100%;
  }

  .gallery-preview-info .secondary-button {
    width: 100%;
  }

  .admin-header-actions {
    width: 100%;

    display: grid;

    grid-template-columns: 1fr 1fr;
  }

  .admin-header-actions a,
  .admin-header-actions button {
    width: 100%;

    text-align: center;
  }

  .admin-panel {
    padding-left: 20px;
    padding-right: 20px;
  }

  .admin-panel-header {
    display: block;
  }

  .admin-panel-action {
    margin-top: 20px;
  }

  .admin-dashboard-header {
    padding-left: 20px;
    padding-right: 20px;
  }

  .admin-heading h1 {
    font-size: 52px;

    letter-spacing: -3px;
  }

  .admin-stats {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
     SMALL MOBILE — 480px
     ========================================================= */

@media (max-width: 480px) {
  .hero h1 {
    font-size: 46px;

    letter-spacing: -2.5px;
  }

  .section-header h2,
  .stats-header h2 {
    font-size: 38px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stat-card {
    min-height: 115px;
  }

  .journey-header h2 {
    font-size: 38px;
  }

  .race-detail-header h1 {
    font-size: 43px;
  }

  .result-grid {
    gap: 7px;
  }

  .result-box {
    padding: 16px;
  }

  .gallery-section-header h2 {
    font-size: 38px;
  }

  .public-gallery-item .gallery-card-content {
    padding: 18px;
  }

  .gallery-lightbox {
    padding: 20px;
  }

  .gallery-lightbox-content {
    max-width: 92vw;

    max-height: 75vh;
  }

  .gallery-lightbox-nav {
    width: 42px;
    height: 42px;

    font-size: 30px;
  }

  .gallery-lightbox-prev {
    left: 10px;
  }

  .gallery-lightbox-next {
    right: 10px;
  }

  .gallery-lightbox-close {
    top: 10px;
    right: 10px;
  }

  .gallery-lightbox-caption {
    bottom: 15px;
  }

  .admin-header-actions {
    grid-template-columns: 1fr;
  }
}
