/* === Design tokens === */
:root {
  /* Navy & Coral palette — light (oklch) */
  --bg: oklch(0.97 0.01 245);         /* faint blue-tinted white */
  --bg-alt: oklch(0.94 0.015 245);    /* slightly deeper blue-gray */
  --surface: oklch(0.99 0.005 245);   /* near-white with blue hint */
  --border: oklch(0.88 0.02 245);     /* cool blue-gray border */
  --text: oklch(0.20 0.02 245);       /* very dark navy */
  --text-muted: oklch(0.50 0.03 245); /* mid navy-gray */
  --accent: oklch(0.60 0.19 25);      /* coral / warm orange */
  --accent-hover: oklch(0.53 0.21 25);/* deeper coral on hover */
  --tag-bg: oklch(0.94 0.015 245);    /* light blue-tinted tag */
  --tag-text: oklch(0.33 0.03 245);   /* dark navy tag text */
  --shadow: 0 1px 3px oklch(0.20 0.02 245 / 0.08);
  --shadow-lg: 0 4px 16px oklch(0.20 0.02 245 / 0.10);
  --glass: oklch(0.97 0.01 245 / 0.8);
}

[data-theme="dark"] {
  --bg: oklch(0.20 0.04 245);         /* deep cold navy */
  --bg-alt: oklch(0.24 0.04 245);     /* slightly lighter navy */
  --surface: oklch(0.27 0.04 245);    /* card surface navy */
  --border: oklch(0.35 0.04 245);     /* visible blue-gray border */
  --text: oklch(0.93 0.01 245);       /* cool off-white */
  --text-muted: oklch(0.68 0.02 245); /* muted blue-gray */
  --accent: oklch(0.72 0.17 30);      /* bright coral / orange */
  --accent-hover: oklch(0.78 0.14 30);/* lighter coral on hover */
  --tag-bg: oklch(0.27 0.04 245);     /* navy tag bg */
  --tag-text: oklch(0.87 0.01 245);   /* light blue-white tag text */
  --shadow: 0 1px 3px oklch(0.10 0.03 245 / 0.30);
  --shadow-lg: 0 4px 16px oklch(0.10 0.03 245 / 0.40);
  --glass: oklch(0.20 0.04 245 / 0.8);
}

/* === Reset & base === */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

/* Block transitions until page is ready */
html:not(.loaded) * {
  transition: none !important;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  transition: background 0.3s, color 0.3s;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--accent-hover);
}

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

/* === Focus === */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* === Layout === */
.container {
  max-width: 42rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* === Header === */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s, border-color 0.3s;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3.5rem;
  gap: 1.5rem;
}

.header-logo {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.header-logo:hover {
  color: var(--text);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-right: auto;
}

.header-nav a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

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

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: inherit;
}

.icon-btn:hover {
  background: var(--bg-alt);
  color: var(--text);
}

.icon-btn svg {
  width: 1.125rem;
  height: 1.125rem;
}

/* === Sections === */
section {
  padding: 4rem 0;
}

.section-title {
  font-size: clamp(1.125rem, 1rem + 0.5vw, 1.25rem);
  font-weight: 600;
  margin-bottom: 1.5rem;
  letter-spacing: -0.01em;
}

.subsection-title {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 2rem;
  margin-bottom: 1rem;
}

/* === Hero === */
.hero {
  padding: 6rem 0 4rem;
}

.hero h1 {
  font-size: clamp(2rem, 1.6rem + 2vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.hero .subtitle {
  font-size: clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
  color: var(--text-muted);
  line-height: 1.5;
}

/* === About === */
.about p {
  color: var(--text-muted);
  max-width: 38rem;
}

/* === Tech Stack === */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  background: var(--tag-bg);
  color: var(--tag-text);
  border-radius: 6px;
  font-size: 0.8125rem;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: background 0.2s, transform 0.2s;
  border: 1px solid var(--border);
}

.tag:hover {
  background: var(--border);
  transform: translateY(-1px);
}

/* === Projects === */
.projects-grid {
  display: grid;
  gap: 1.25rem;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: box-shadow 0.2s, transform 0.2s, background 0.3s, border-color 0.3s;
}

.project-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.project-card h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.project-card p {
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.project-card .tags {
  margin-bottom: 1rem;
}

.project-card .tag {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
}

.project-links {
  display: flex;
  gap: 1rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.project-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.project-links svg {
  width: 1rem;
  height: 1rem;
}

/* === Contact === */
.contact p {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  font-size: 1.0625rem;
}

/* === Footer === */
.footer {
  padding: 3rem 0;
  border-top: 1px solid var(--border);
  transition: border-color 0.3s;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-links {
  display: flex;
  gap: 0.75rem;
}

.footer-links a {
  display: inline-flex;
  color: var(--text-muted);
  transition: color 0.2s;
}

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

.footer-links svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* === Language toggle === */
[data-lang="cs"] [data-i18n="en"] {
  display: none;
}

[data-lang="en"] [data-i18n="cs"] {
  display: none;
}

/* === Scroll animations === */
.fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .fade-in {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* === Responsive === */
@media (max-width: 640px) {
  .header-nav {
    display: none;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 4rem 0 3rem;
  }

  section {
    padding: 3rem 0;
  }

  .project-card {
    padding: 1.25rem;
  }
}
