:root {
  --bg: #0c0d10;
  --bg-soft: #14161b;
  --card: #14161b;
  --card-hover: #1a1d24;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --fg: #f4f2ed;
  --muted: #9a958b;
  --muted-2: #6f6a61;
  --blue: #3d6bff;
  --blue-deep: #1b4de0;
  --accent: #ff5a3c;
  --radius: 18px;
  --maxw: 980px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
  --mono: "SF Mono", Consolas, "Roboto Mono", monospace;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 38px; height: 38px; border-radius: 10px; display: block; }
.brand b { font-size: 19px; letter-spacing: 0.5px; font-weight: 700; }
.brand .dot { color: var(--accent); }

/* Smart language toggle: a single button that always points at the other
   language version of the page the visitor is currently on. */
.lang-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  padding: 7px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.lang-toggle:hover { background: var(--fg); color: #111; border-color: var(--fg); }

/* ---------- hero ---------- */
.hero { padding: 84px 0 56px; }
.hero .eyebrow {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 22px;
}
.hero h1 {
  font-size: clamp(2rem, 5.5vw, 3.4rem);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.02em;
  max-width: 18ch;
}
.hero p.lead {
  margin-top: 22px;
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  color: var(--muted);
  max-width: 46ch;
}

/* ---------- projects ---------- */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 56px 0 24px;
  border-top: 1px solid var(--line);
  padding-top: 40px;
}
.section-head h2 { font-size: 1.05rem; font-weight: 600; letter-spacing: 0.5px; }
.section-head span { font-family: var(--mono); font-size: 12px; color: var(--muted-2); letter-spacing: 2px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
  padding-bottom: 40px;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}
.card:hover { background: var(--card-hover); border-color: var(--line-strong); transform: translateY(-3px); }

.card .icon {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  display: block;
  margin-bottom: 20px;
}
.card .row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.card h3 { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.01em; }
.card p { color: var(--muted); font-size: 0.96rem; flex: 1; }

.badge {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  white-space: nowrap;
}
.badge.live { color: #5fd38a; border-color: rgba(95, 211, 138, 0.4); }
.badge.soon { color: var(--accent); border-color: rgba(255, 90, 60, 0.4); }

.card .more {
  margin-top: 18px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--blue);
}
.card:hover .more { color: #6f93ff; }

/* ---------- about + footer ---------- */
.about {
  border-top: 1px solid var(--line);
  padding: 40px 0 0;
  color: var(--muted);
  max-width: 60ch;
  font-size: 1.02rem;
}

footer {
  margin-top: 64px;
  border-top: 1px solid var(--line);
  padding: 28px 0 48px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  color: var(--muted-2);
  font-size: 13px;
}
footer a { color: var(--muted); }
footer a:hover { color: var(--fg); }

/* ---------- generic content page (project pages, 404) ---------- */
.page { min-height: 100vh; }
.article { padding: 56px 0 0; max-width: 720px; }
.article .icon { width: 88px; height: 88px; border-radius: 20px; margin-bottom: 26px; }
.article h1 { font-size: clamp(2rem, 5vw, 2.8rem); letter-spacing: -0.02em; margin-bottom: 8px; }
.article .sub { color: var(--muted); font-size: 1.15rem; margin-bottom: 28px; }
.article h2 { font-size: 1.25rem; margin: 36px 0 12px; }
.article p { color: #cfcbc2; margin-bottom: 16px; }
.article ul { color: #cfcbc2; margin: 0 0 16px 22px; }
.article li { margin-bottom: 8px; }

.btn {
  display: inline-block;
  background: var(--blue);
  color: #fff;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: 12px;
  margin-top: 8px;
  transition: background 0.2s ease;
}
.btn:hover { background: var(--blue-deep); }
.btn.ghost { background: transparent; border: 1px solid var(--line-strong); color: var(--fg); }
.btn.ghost:hover { background: var(--bg-soft); }

.backlink {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
  margin-top: 48px;
}
.backlink:hover { color: var(--fg); }

.notfound { padding: 140px 0; text-align: center; }
.notfound h1 { font-size: 5rem; letter-spacing: -2px; }
.notfound p { color: var(--muted); margin: 8px 0 24px; }

@media (max-width: 560px) {
  .hero { padding: 56px 0 36px; }
  .card { padding: 22px; }
}
