/* =========================================================
   SportUp.sk — design system
   Based on ClubUp Design Manual v1.0 (adapted)
   Navy · Blue · White · Sans-serif
   ========================================================= */

:root {
  /* Primary brand colors */
  --navy: #1A2D47;
  --navy-dark: #12203A;
  --navy-light: #22385A;
  --blue: #388FC3;
  --blue-dark: #2A7AAA;
  --blue-light: #E8F4FD;
  --white: #FFFFFF;

  /* Neutrals */
  --bg: #FFFFFF;
  --bg-alt: #F4F6F8;
  --bg-soft: #FAFBFC;
  --border: #E3E7EC;
  --border-strong: #C9D1DA;
  --text: #1A2D47;
  --text-muted: #5E6B7D;
  --text-soft: #8E8E92;

  /* Semantic */
  --success: #2E7D5B;
  --success-soft: #E6F2EC;
  --warning: #B8860B;
  --warning-soft: #FAF3E0;
  --danger: #C8453C;
  --danger-soft: #FBEAE8;

  /* Code */
  --code-bg: #12203A;
  --code-text: #E8F4FD;
  --code-string: #9BD3F0;
  --code-key: #B8D8E8;
  --code-number: #F0B97E;
  --code-comment: #6B7D99;

  /* Type */
  --font-sans: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;

  /* Layout */
  --container: 1200px;
  --container-narrow: 840px;
  --nav-height: 76px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4 {
  font-family: var(--font-sans);
  font-weight: 700;
  line-height: 1.2;
  color: var(--navy);
  letter-spacing: -0.015em;
}

h1 { font-size: clamp(2.2rem, 4.5vw, 3.5rem); font-weight: 800; letter-spacing: -0.025em; }
h2 { font-size: clamp(1.6rem, 2.8vw, 2.1rem); margin-top: 3.5rem; margin-bottom: 1rem; }
h3 { font-size: clamp(1.15rem, 1.8vw, 1.35rem); margin-top: 2rem; margin-bottom: 0.75rem; font-weight: 700; }
h4 { font-size: 1rem; margin-top: 1.5rem; margin-bottom: 0.5rem; font-weight: 700; }

p { margin-bottom: 1rem; max-width: 70ch; }
p.lead { font-size: 1.2rem; line-height: 1.55; font-weight: 400; max-width: 62ch; margin-bottom: 1.5rem; }

a { color: var(--blue); text-decoration: none; font-weight: 500; transition: color 0.15s ease; }
a:hover { color: var(--blue-dark); text-decoration: underline; text-underline-offset: 3px; }

em { font-style: italic; color: var(--blue); }
strong { font-weight: 700; color: var(--navy); }

::selection { background: var(--blue); color: var(--white); }

/* Layout */
.container { max-width: var(--container); margin: 0 auto; padding: 0 1.5rem; }
.container.narrow { max-width: var(--container-narrow); }
main { padding: 3rem 0 6rem; }
section { margin-bottom: 2.5rem; }

/* Navigation */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--navy);
  height: var(--nav-height);
  display: flex; align-items: center;
  border-bottom: 3px solid var(--blue);
}

.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  border: none;
  color: var(--white);
}

.logo:hover { text-decoration: none; color: var(--white); }

.logo-mark svg {
  width: 38px;
  height: 28px;
  display: block;
}

.logo-text {
  display: inline-flex;
  align-items: baseline;
  background: var(--white);
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-style: italic;
}

.logo-text .sport {
  color: var(--navy);
  font-size: 1rem;
}

.logo-text .up {
  color: var(--blue);
  font-size: 1.25rem;
  margin-left: 0.1rem;
  font-weight: 800;
}

.logo-tld {
  font-family: var(--font-mono);
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.78rem;
  font-weight: 500;
  font-style: normal;
}

.nav-links {
  display: flex;
  gap: 1.4rem;
  list-style: none;
  align-items: center;
}

.nav-links a {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.4rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  text-decoration: none;
}

.nav-links a:hover { color: var(--white); text-decoration: none; }
.nav-links a.active { color: var(--white); border-bottom-color: var(--blue); }

.nav-github {
  display: inline-flex;
  align-items: center;
  border-bottom: 2px solid transparent !important;
  padding: 0.4rem 0.35rem !important;
}
.nav-github svg { display: block; opacity: 0.72; transition: opacity 0.15s; }
.nav-github:hover svg { opacity: 1; }

.nav-toggle {
  display: none;
  background: none; border: none;
  cursor: pointer; padding: 0.5rem;
  color: var(--white);
}

.nav-toggle svg { width: 24px; height: 24px; }

@media (max-width: 900px) {
  .nav-links {
    display: none;
    position: absolute;
    top: calc(var(--nav-height) + 3px);
    left: 0; right: 0;
    background: var(--navy-dark);
    flex-direction: column;
    padding: 1rem 1.5rem 2rem;
    gap: 0.25rem;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 0.7rem 0; width: 100%; }
  .nav-toggle { display: block; }
}

/* Hero */
.hero {
  background: var(--navy);
  color: var(--white);
  padding: 4rem 0 3.5rem;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 45%;
  height: 100%;
  background: linear-gradient(135deg, transparent 0%, rgba(56, 143, 195, 0.1) 100%);
  pointer-events: none;
}

.hero .container { position: relative; z-index: 1; }

.hero h1 { color: var(--white); max-width: 20ch; margin-bottom: 1.5rem; }
.hero h1 em { color: var(--blue); font-style: italic; }

.hero-eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 1.25rem;
  padding: 0.3rem 0.85rem;
  border: 1px solid var(--blue);
  border-radius: 99px;
  background: rgba(56, 143, 195, 0.08);
}

.hero .lead { color: rgba(255, 255, 255, 0.82); max-width: 62ch; }
.hero .lead strong { color: var(--white); }

.hero-meta {
  display: flex;
  gap: 2.5rem;
  flex-wrap: wrap;
  margin-top: 2.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.55);
}

.hero-meta span {
  font-weight: 700;
  color: var(--white);
  display: block;
  margin-top: 0.2rem;
  font-size: 0.95rem;
}

/* Sections */
.section-number {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--blue);
  letter-spacing: 0.12em;
  display: block;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  font-weight: 500;
}

.section-header {
  border-top: 1px solid var(--border);
  padding-top: 2.5rem;
  margin-top: 4rem;
  margin-bottom: 1.5rem;
}

.section-header h2 { margin-top: 0; }

/* Grid */
.grid { display: grid; gap: 1.25rem; margin: 2rem 0; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 800px) {
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
}

/* Cards */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.card h3 { margin-top: 0; margin-bottom: 0.5rem; font-size: 1.1rem; }
.card h4 { margin-top: 0; margin-bottom: 0.4rem; }
.card p { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 0.5rem; }
.card p:last-child { margin-bottom: 0; }

.card .card-number {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--blue);
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
  display: block;
  font-weight: 500;
}

.card-link {
  display: block;
  border: 1px solid var(--border);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  background: var(--white);
  color: var(--navy);
  text-decoration: none;
  transition: all 0.2s;
}

.card-link:hover {
  border-color: var(--blue);
  color: var(--navy);
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(26, 45, 71, 0.08);
}

.card-link h3 { color: var(--navy); margin-bottom: 0.4rem; }
.card-link p { color: var(--text-muted); font-size: 0.92rem; }
.card-link .arrow {
  color: var(--blue);
  font-weight: 700;
  margin-top: 0.75rem;
  display: inline-block;
  font-size: 1.1rem;
}

/* Callout */
.callout {
  background: var(--blue-light);
  border-left: 3px solid var(--blue);
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.callout h4 {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue-dark);
  margin-bottom: 0.5rem;
  margin-top: 0;
  font-weight: 600;
}

.callout p { margin-bottom: 0.5rem; color: var(--navy); font-size: 0.94rem; }
.callout p:last-child { margin-bottom: 0; }

.callout.success { border-left-color: var(--success); background: var(--success-soft); }
.callout.success h4 { color: var(--success); }

.callout.warning { border-left-color: var(--warning); background: var(--warning-soft); }
.callout.warning h4 { color: var(--warning); }

/* Tables */
.table-wrap {
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--white);
}

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }

th, td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  font-weight: 700;
  color: var(--navy);
  background: var(--bg-alt);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

td { color: var(--text); }

td code {
  font-size: 0.85em;
  background: var(--blue-light);
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
  color: var(--navy);
  font-weight: 500;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-soft); }

/* Code */
pre {
  background: var(--code-bg);
  color: var(--code-text);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.65;
  padding: 1.5rem;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: 1.5rem 0;
}

code { font-family: var(--font-mono); font-size: 0.88em; }

p code, li code {
  background: var(--blue-light);
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
  color: var(--navy);
  font-size: 0.88em;
  font-weight: 500;
}

pre code { background: transparent; padding: 0; color: var(--code-text); font-size: inherit; font-weight: 400; }

.code-string { color: var(--code-string); }
.code-key { color: var(--code-key); }
.code-number { color: var(--code-number); }
.code-comment { color: var(--code-comment); font-style: italic; }
.code-punct { color: #9BA8B8; }
.code-bool { color: var(--code-number); }

.code-header {
  background: var(--navy-dark);
  color: var(--blue-light);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.7rem 1.5rem;
  margin: 1.5rem 0 -1.5rem;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}

.code-header + pre { border-radius: 0 0 var(--radius-md) var(--radius-md); margin-top: 0; }

/* Lists */
ul, ol { max-width: 70ch; margin-bottom: 1rem; padding-left: 1.5rem; }
ul li, ol li { margin-bottom: 0.5rem; line-height: 1.65; }
ul li::marker { color: var(--blue); }

/* Pills */
.pill {
  display: inline-block;
  padding: 0.18rem 0.65rem;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 99px;
  background: var(--bg-alt);
  color: var(--text-muted);
  margin-right: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pill.accent { background: var(--blue-light); color: var(--blue-dark); }
.pill.success { background: var(--success-soft); color: var(--success); }
.pill.warning { background: var(--warning-soft); color: var(--warning); }

/* Figure */
figure {
  margin: 2rem 0;
  padding: 1.75rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow-x: auto;
}

figcaption {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 1rem;
  text-align: center;
}

/* TOC */
.toc {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem 1.75rem;
  margin-bottom: 2.5rem;
}

.toc h4 {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.toc ol { padding-left: 0; list-style: none; margin-bottom: 0; counter-reset: toc; }

.toc li {
  counter-increment: toc;
  margin-bottom: 0.4rem;
  padding-left: 2rem;
  position: relative;
  font-size: 0.9rem;
}

.toc li::before {
  content: counter(toc, decimal-leading-zero);
  position: absolute;
  left: 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--blue);
  font-weight: 500;
}

.toc a { color: var(--navy); font-weight: 500; text-decoration: none; }
.toc a:hover { color: var(--blue); text-decoration: none; }

/* Scenario */
.scenario {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin: 2.5rem 0;
  overflow: hidden;
  background: var(--white);
}

.scenario-header {
  padding: 1.25rem 1.75rem;
  background: var(--navy);
  color: var(--white);
  border-bottom: 3px solid var(--blue);
}

.scenario-header .label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--blue);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
  display: block;
  font-weight: 500;
}

.scenario-header h3 { margin: 0; font-size: 1.25rem; color: var(--white); }

.scenario-body { padding: 1.75rem; }
.scenario-body > *:first-child { margin-top: 0; }
.scenario-body > *:last-child { margin-bottom: 0; }

.scenario-step {
  padding: 1rem 0 1rem 2.75rem;
  border-bottom: 1px dashed var(--border);
  position: relative;
}

.scenario-step:last-child { border-bottom: none; padding-bottom: 0; }
.scenario-step:first-child { padding-top: 0; }

.scenario-step .step-num {
  position: absolute;
  left: 0;
  top: 1rem;
  width: 1.85rem;
  height: 1.85rem;
  background: var(--blue);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
}

.scenario-step:first-child .step-num { top: 0; }

.scenario-step h4 { margin-top: 0; margin-bottom: 0.35rem; font-size: 1rem; }
.scenario-step p { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 0.75rem; }
.scenario-step pre { margin: 0.75rem 0 0; }

/* Footer */
footer {
  background: var(--navy);
  color: rgba(255, 255, 255, 0.7);
  padding: 3rem 0 2rem;
  margin-top: 6rem;
  border-top: 3px solid var(--blue);
}

.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2rem;
  font-size: 0.85rem;
}

.footer-inner a { color: var(--blue); }
.footer-inner a:hover { color: var(--blue-light); text-decoration: none; }

.footer-brand {
  color: var(--white);
  font-weight: 800;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  letter-spacing: -0.015em;
  font-style: italic;
}

.footer-brand em { color: var(--blue); font-style: italic; }

.footer-tagline {
  font-style: italic;
  color: var(--blue);
  font-size: 0.82rem;
  margin-top: 0.35rem;
}

/* Utilities */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-4 { margin-top: 2rem; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 1rem; }

hr { border: none; border-top: 1px solid var(--border); margin: 3rem 0; }

.divider-ornament {
  text-align: center;
  margin: 4rem 0;
  color: var(--blue);
  font-size: 0.85rem;
  letter-spacing: 0.4rem;
  font-weight: 600;
  text-transform: uppercase;
}

@media print {
  .nav, footer, .nav-toggle { display: none; }
  body { background: white; color: black; }
  pre { background: #f5f5f5; color: black; border: 1px solid #ddd; }
  .hero { background: white; color: black; border-bottom: 2px solid black; }
  .hero h1, .hero .lead { color: black; }
}
