:root {
  --bg: #f7f7fb;
  --surface: #ffffff;
  --text: #1f2430;
  --muted: #687082;
  --line: #dfe3ea;
  --accent: #2d5bff;
  --accent-soft: #eef3ff;
  --max-width: 960px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}

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

a:hover { text-decoration: underline; }

.container {
  width: min(var(--max-width), calc(100% - 2rem));
  margin: 0 auto;
}

.site-header {
  background: linear-gradient(180deg, #ffffff 0%, #f3f6ff 100%);
  border-bottom: 1px solid var(--line);
  padding: 3.5rem 0 2rem;
}

.eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1, h2, h3 {
  line-height: 1.25;
  margin-top: 0;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin-bottom: 0.75rem;
}

h2 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.subtitle {
  max-width: 900px;
  font-size: 1.05rem;
  color: var(--muted);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.nav a {
  padding: 0.5rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.section {
  padding: 3rem 0 0;
}

.card-list,
.skill-grid,
.project-grid {
  display: grid;
  gap: 1rem;
}

.project-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.skill-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.25rem;
}

.meta {
  margin: 0 0 0.7rem;
  color: var(--muted);
  font-size: 0.95rem;
}

ul {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
}

.site-footer {
  margin-top: 4rem;
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--line);
}

.back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
}

.project-header {
  padding: 3rem 0 1rem;
}

.project-main {
  padding-bottom: 3rem;
}

.project-section {
  margin-top: 1.5rem;
}

.project-section .card + .card {
  margin-top: 1rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-left: 0;
  list-style: none;
}

.tag-list li {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
}

.image-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}

.project-image {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 12px;
}

@media (max-width: 700px) {
  .image-row {
    grid-template-columns: 1fr;
  }
}

.project-card.featured h3::before {
  content: "★ ";
  color: #f4c542;
  font-size: 0.95em;
}

.project-card.featured {
  border: 1px solid #f4c542;
  box-shadow: 0 6px 18px rgba(244, 197, 66, 0.12);
}

.header-top-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 1.5rem;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem;
  border: 1px solid rgba(31, 36, 48, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 24px rgba(31, 36, 48, 0.08);
}

.lang-switch a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  height: 40px;
  padding: 0 1rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.lang-switch a:hover {
  text-decoration: none;
  background: #eef3ff;
  color: var(--accent);
}

.lang-switch a.is-active {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(45, 91, 255, 0.28);
}

.project-header .header-top-row {
  margin-bottom: 1.25rem;
}

@media (max-width: 700px) {
  .header-top-row {
    margin-bottom: 1rem;
  }

  .lang-switch {
    padding: 0.28rem;
    gap: 0.3rem;
  }

  .lang-switch a {
    min-width: 52px;
    height: 36px;
    padding: 0 0.85rem;
    font-size: 0.88rem;
  }
}
