:root {
  --color-bg: #ffffff;
  --color-text: #1a1a2e;
  --color-text-muted: #555;
  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-border: #e5e7eb;
  --color-surface: #f9fafb;
  --color-nav-bg: rgba(255, 255, 255, 0.9);
  --max-width: 720px;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

[data-theme='dark'] {
  --color-bg: #0f172a;
  --color-text: #e2e8f0;
  --color-text-muted: #94a3b8;
  --color-primary: #60a5fa;
  --color-primary-hover: #93bbfd;
  --color-border: #1e293b;
  --color-surface: #1e293b;
  --color-nav-bg: rgba(15, 23, 42, 0.9);
}

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

html {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

footer {
  text-align: center;
  padding: 2rem 1.5rem;
  color: var(--color-text-muted);
  font-size: 0.875rem;
  border-top: 1px solid var(--color-border);
}

.footer-social {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  margin-bottom: 0.75rem;
}

.footer-social a {
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-social a:hover {
  color: var(--color-primary);
}

h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.2;
}

h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

p {
  margin-bottom: 1rem;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  color: var(--color-primary-hover);
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 0.9375rem;
}

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

th {
  font-weight: 600;
  white-space: nowrap;
}

td:first-child {
  white-space: nowrap;
}

thead th {
  border-bottom: 2px solid var(--color-border);
}

ul, ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

li {
  margin-bottom: 0.25rem;
}

.metrika-fallback {
  position: absolute;
  left: -9999px;
}

nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--color-nav-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
}

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

.nav-logo {
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--color-text);
  text-decoration: none;
}

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

.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-links a {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--color-primary);
  text-decoration: none;
}

.lang-switch {
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.lang-switch:hover {
  border-color: var(--color-primary);
}

.blog-feed {
  margin-top: 0.5rem;
}

.load-trigger {
  height: 1px;
}

.empty {
  color: var(--color-text-muted);
  text-align: center;
  padding: 3rem 0;
}

.blog-card {
  border-bottom: 1px solid var(--color-border);
  padding: 1.75rem 0;
}

.blog-card:first-child {
  padding-top: 0;
}

.blog-card:last-child {
  border-bottom: none;
}

.blog-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.blog-card-link:hover {
  text-decoration: none;
}

.blog-card-link:hover h2 {
  color: var(--color-primary);
}

.blog-card time {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.blog-card h2 {
  font-size: 1.375rem;
  font-weight: 600;
  margin: 0.35rem 0 0.5rem;
  line-height: 1.3;
  transition: color 0.2s;
}

.blog-card .description {
  color: var(--color-text-muted);
  font-size: 0.9375rem;
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.blog-card .tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.blog-card .tag {
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 3px;
  color: var(--color-text-muted);
}

.blog-card .read-more {
  font-size: 0.875rem;
  color: var(--color-primary);
  font-weight: 500;
}

.blog-card-link:hover .read-more {
  text-decoration: underline;
}

.blog-post-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
}

.blog-post-date {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.blog-post-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.blog-post-tag {
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 3px;
  color: var(--color-text-muted);
}

.post-social {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  font-size: 0.875rem;
}

.post-social-label {
  color: var(--color-text-muted);
}

.post-social a {
  color: var(--color-primary);
  text-decoration: none;
}

.post-social a:hover {
  text-decoration: underline;
}

.blog-post .content h3 {
  margin-bottom: 1.5rem;
}

.blog-post .content code {
  font-size: 1.15em;
}

.blog-post .content pre {
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}

.blog-post-footer {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
  text-align: left;
  font-size: 0.9375rem;
}

/* Photo gallery */
.gallery-hero {
  margin-bottom: 0.75rem;
}

.gallery-hero img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
}

.gallery-satellites {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.gallery-satellites img {
  flex: 1 1 calc(33.333% - 0.35rem);
  min-width: 120px;
  max-width: calc(33.333% - 0.35rem);
  aspect-ratio: 3 / 2;
  object-fit: cover;
  object-position: top;
  border-radius: 6px;
}
