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

html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

a {
  color: var(--accent);
  text-underline-offset: 0.15em;
}

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

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--header-h);
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  max-width: var(--max);
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.site-header__brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.site-header__nav {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.site-header__link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
}

.site-header__link:hover {
  color: var(--ink);
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0.25rem;
  font-size: 0.875rem;
}

.lang-switch__sep {
  color: var(--muted);
  opacity: 0.55;
  user-select: none;
}

.lang-switch__link {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
}

.lang-switch__link:hover {
  color: var(--ink);
}

.lang-switch__link.is-current {
  color: var(--ink);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--panel);
  margin-top: 0;
}

.site-footer__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: var(--space-7) var(--space-5);
  display: grid;
  gap: var(--space-4);
}

.site-footer__brand {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.site-footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.site-footer__nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9375rem;
}

.site-footer__nav a:hover {
  color: var(--ink);
}

.site-footer__meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.site-footer__meta a {
  color: inherit;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.7rem 1.25rem;
  border-radius: 0;
  font-weight: 600;
  font-size: 0.975rem;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn--primary {
  background: var(--accent);
  color: var(--white);
}

.btn--primary:hover {
  background: var(--accent-strong);
  color: var(--white);
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-soft);
}

.btn--ghost:hover {
  border-color: var(--ink);
  color: var(--ink);
  background: var(--surface-2);
}

@media (max-width: 640px) {
  .site-header__inner {
    padding: 0 var(--space-4);
    gap: var(--space-3);
  }

  .site-header__brand {
    font-size: 1.05rem;
    flex-shrink: 0;
  }

  .site-header__nav {
    gap: 0.65rem;
    flex-wrap: nowrap;
    min-width: 0;
  }

  .site-header__link {
    font-size: 0.8125rem;
    white-space: nowrap;
  }

  .site-footer__inner {
    padding: var(--space-6) var(--space-4);
  }

  .site-footer__nav {
    gap: var(--space-3);
  }
}
