:root {
  --bg: #000;
  --surface: #050505;
  --surface-hover: #111;
  --line: #333;
  --text: #fff;
  --muted: rgba(255, 255, 255, 0.68);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    var(--bg);
  background-size: 48px 48px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

.shell {
  width: min(1400px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 34px 0 48px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.topbar h1 {
  margin: 0;
  font-size: clamp(1.65rem, 2.2vw, 2.35rem);
  line-height: 1;
  font-weight: 300;
}

.topbar__meta {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar p {
  margin: 0;
  color: var(--muted);
  font-family: Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.92rem;
}

.lang-switch {
  display: flex;
  gap: 6px;
}

.lang-switch button {
  min-width: 42px;
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  font-family: Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  cursor: pointer;
}

.lang-switch button[aria-pressed="true"],
.lang-switch button:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
  padding-top: 24px;
}

.project-card {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.project-card:hover {
  transform: translateY(-2px);
  border-color: #fff;
  background: var(--surface-hover);
}

.project-card:focus-visible {
  outline: 1px solid #fff;
  outline-offset: 3px;
}

.project-card__thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #050506;
}

.project-card__body {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.project-card__title {
  overflow-wrap: anywhere;
  font-size: 1rem;
  line-height: 1.25;
  font-weight: 650;
}

.project-card__summary {
  color: var(--muted);
  overflow-wrap: anywhere;
  font-size: 0.88rem;
  line-height: 1.35;
}

.empty {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 28px, 1400px);
    padding-top: 22px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .topbar__meta {
    width: 100%;
    justify-content: space-between;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }
}
