/* Lesti Software — minimalist, typography-driven, no build, no fonts loaded over network. */

:root {
  --bg: #f6f8fa;
  --fg: #1a1a1a;
  --fg-muted: #57606a;
  --rule: #e1e4e8;
  --accent: #003580;
  --accent-hover: #00256a;
  --max: 44rem;             /* ~720px */
  --max-wide: 56rem;        /* ~896px for service/case grids */
  --pad: clamp(1rem, 4vw, 2rem);
  --gap: clamp(2.5rem, 8vw, 5rem);
  --serif: "Iowan Old Style", "Charter", "Georgia", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --fg: #e6edf3;
    --fg-muted: #8b949e;
    --rule: #21262d;
    --accent: #5a8fcc;
    --accent-hover: #7faddb;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Skip-to-content for keyboard users */
.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--fg);
  color: var(--bg);
  padding: 0.5rem 1rem;
}
.skip:focus { left: 1rem; top: 1rem; z-index: 10; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--rule);
}
.header-inner {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 0.85rem var(--pad);
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.95rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  color: var(--fg);
  text-decoration: none;
  line-height: 1;
}
.brand:hover { color: var(--fg); }
.brand img { height: 28px; width: auto; display: block; }
.nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.nav a { color: var(--fg-muted); text-decoration: none; }
.nav a:hover { color: var(--fg); }
.nav a[aria-current="page"] { color: var(--fg); }
.lang {
  margin-left: auto;
  display: flex;
  gap: 0.6rem;
  font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
}
.lang a { color: var(--fg-muted); text-decoration: none; }
.lang a[aria-current] { color: var(--fg); }

/* Layout */
main { max-width: var(--max); margin: 0 auto; padding: var(--gap) var(--pad); }
main.wide { max-width: var(--max-wide); }
section + section { margin-top: var(--gap); }

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.015em; font-weight: 600; }
h1 { font-family: var(--serif); font-size: clamp(2rem, 5vw, 2.75rem); margin: 0 0 0.5rem; }
h2 { font-size: clamp(1.35rem, 3vw, 1.6rem); margin: 0 0 0.75rem; }
h3 { font-size: 1.1rem; margin: 0 0 0.5rem; }

.lead { font-size: 1.15rem; color: var(--fg-muted); margin: 0 0 1.5rem; max-width: 38rem; }

p { margin: 0 0 1rem; }
ul { padding-left: 1.25rem; margin: 0 0 1rem; }
li { margin: 0.25rem 0; }

hr.rule { border: 0; border-top: 1px solid var(--rule); margin: var(--gap) 0; }

.muted { color: var(--fg-muted); }
.small { font-size: 0.92rem; }

/* Language-switching paragraph (used in About → Languages) */
.lang-es,
.lang-fi { font-style: italic; color: var(--fg-muted); margin: 0.5rem 0 0; }
.lang-es a,
.lang-fi a { color: inherit; }

/* CTAs (text links styled prominent) */
.cta-row { display: flex; flex-wrap: wrap; gap: 1.5rem; margin-top: 1.25rem; }
.cta { font-weight: 500; }
.cta::after { content: " →"; }

/* Proof tiles on the home page */
.proof {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  margin: 2rem 0;
}
.proof h3 { margin: 0 0 0.25rem; }
.proof p { margin: 0; color: var(--fg-muted); }

/* Service / case-study cards */
.cards { display: flex; flex-direction: column; gap: var(--gap); }
.card { padding-top: 1rem; border-top: 1px solid var(--rule); }
.card:first-child { padding-top: 0; border-top: 0; }
.card .meta { color: var(--fg-muted); font-size: 0.92rem; margin: 0 0 0.5rem; font-variant-numeric: tabular-nums; }
.card h2 { margin-bottom: 0.5rem; }
.card .stack { font-family: var(--mono); font-size: 0.88rem; color: var(--fg-muted); margin-top: 0.5rem; }

/* Experience timeline */
.timeline { border-left: 1px solid var(--rule); padding-left: 1.5rem; }
.entry { position: relative; padding-bottom: 1.75rem; }
.entry::before {
  content: "";
  position: absolute;
  left: -1.55rem;
  top: 0.55rem;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent);
}
.entry h3 { margin-bottom: 0.1rem; }
.entry .meta { color: var(--fg-muted); font-size: 0.92rem; font-variant-numeric: tabular-nums; }
.entry ul { margin-top: 0.5rem; }

/* About — hero photo + sports grid */
.hero-photo { margin: 0 auto 1.5rem; max-width: 22rem; }
.hero-photo img { border-radius: 4px; }

/* Side-by-side hero: photo on the left, H1 + intro on the right */
.about-hero {
  display: grid;
  grid-template-columns: minmax(240px, 18rem) 1fr;
  gap: 2rem;
  align-items: start;
  margin: 0 0 1.5rem;
}
.about-hero img { border-radius: 4px; width: 100%; height: auto; display: block; }
.about-hero .copy h1 { margin-top: 0; }
.about-hero .copy > :last-child { margin-bottom: 0; }
@media (max-width: 40rem) {
  .about-hero { grid-template-columns: 1fr; gap: 1rem; }
  .about-hero figure { max-width: 22rem; margin: 0 auto; }
}
.sport-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin: 1.25rem 0;
}
.sport-grid img { border-radius: 3px; aspect-ratio: 1/1; object-fit: cover; width: 100%; }
.sport-caption { color: var(--fg-muted); font-size: 0.9rem; margin: 0.25rem 0 0; }

/* Stats inline */
.stats { font-variant-numeric: tabular-nums; }
.stats strong { font-weight: 600; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--rule);
  margin-top: var(--gap);
  padding: 1.5rem var(--pad);
  font-size: 0.9rem;
  color: var(--fg-muted);
}
.footer-inner {
  max-width: var(--max-wide);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: space-between;
}
.footer-inner a { color: var(--fg-muted); }
.footer-inner a:hover { color: var(--fg); }

@media (max-width: 30rem) {
  .sport-grid { grid-template-columns: repeat(2, 1fr); }
  .header-inner { flex-wrap: wrap; }
  .lang { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
