:root {
  --bg: #ffffff;
  --bg-alt: #f4f3f1;
  --border: #e4e2dd;
  --text: #16161a;
  --text-muted: #6b6a72;
  --dark: #111114;
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1 {
  font-family: 'Fraunces', Georgia, serif;
  letter-spacing: -0.01em;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.wrap { max-width: 900px; margin: 0 auto; padding: 0 24px; }

.top-nav {
  border-bottom: 1px solid var(--border);
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  max-width: 900px;
  margin: 0 auto;
}

.back-link {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.back-link::before {
  content: '';
  display: inline-block;
  width: 13px;
  height: 13px;
  background-color: currentColor;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='19' y1='12' x2='5' y2='12'/%3E%3Cpolyline points='12 19 5 12 12 5'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='19' y1='12' x2='5' y2='12'/%3E%3Cpolyline points='12 19 5 12 12 5'/%3E%3C/svg%3E");
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  transition: transform 0.2s ease;
}

.back-link:hover::before { transform: translateX(-3px); }

[data-lang]:not(.active) { display: none !important; }

.lang-switcher {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
}

.lang-switcher button {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0;
}

.lang-switcher button.active { color: var(--text); font-weight: 700; }
.lang-switcher span.sep { color: var(--border); }

.back-link:hover { color: var(--text); }

.case-hero { padding: 56px 24px 40px; }

.case-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.case-label .dates {
  display: block;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 400;
  margin-top: 4px;
  opacity: 0.7;
}

.case-hero h1 {
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 700;
  line-height: 1.15;
  max-width: 640px;
  margin-bottom: 20px;
}

.case-desc {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 560px;
  margin-bottom: 24px;
}

.case-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 28px; }

.case-tags > span {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 6px 14px;
}

.tool-icons { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 24px; }

.tool-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-right: 4px;
}

.tool-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
}

.tool-icon img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  filter: brightness(0);
  opacity: 0.6;
}

.case-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--dark);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 12px 24px;
}

.case-cta::after {
  content: '';
  display: inline-block;
  width: 13px;
  height: 13px;
  background-color: currentColor;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='7' y1='17' x2='17' y2='7'/%3E%3Cpolyline points='7 7 17 7 17 17'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='7' y1='17' x2='17' y2='7'/%3E%3Cpolyline points='7 7 17 7 17 17'/%3E%3C/svg%3E");
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  transition: transform 0.25s ease;
}

.case-cta:hover::after { transform: translate(2px, -2px); }

.case-cta:hover { opacity: 0.85; }

.case-gallery { padding: 16px 24px 80px; }

.gallery-grid {
  columns: 3;
  column-gap: 12px;
}

@media (max-width: 720px) {
  .gallery-grid { columns: 2; }
}

@media (max-width: 480px) {
  .gallery-grid { columns: 1; }
}

.gallery-grid img {
  width: 100%;
  display: block;
  margin-bottom: 12px;
  break-inside: avoid;
  cursor: zoom-in;
  transition: transform 0.3s ease;
}

.gallery-grid img:hover {
  transform: scale(1.06);
  position: relative;
  z-index: 2;
}

.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease;
  z-index: 1000;
  cursor: zoom-out;
}

.lightbox-overlay.active { opacity: 1; visibility: visible; }

.lightbox-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  width: auto;
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  margin-bottom: 0;
}

.gallery-grid .wide {
  column-span: all;
}

footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  color: var(--text-muted);
}

footer a {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

footer a:hover { border-color: var(--text); }

footer a img {
  width: 18px;
  height: 18px;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

footer a:hover img { opacity: 1; }

/* Mini project grid, used on experience pages */
.mini-section { padding: 8px 24px 80px; }

.mini-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (max-width: 640px) {
  .mini-grid { grid-template-columns: 1fr; }
}

.mini-card {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  display: block;
  background: var(--bg-alt);
}

.mini-card--solid {
  background: var(--dark);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
}

.mini-card--solid .mini-card-overlay {
  position: static;
  background: none;
  padding: 0;
  align-items: center;
}

.mini-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.mini-card:hover img { transform: scale(1.05); }

.mini-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(17,17,20,0.85), rgba(17,17,20,0.05) 55%);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px;
}

.mini-card-overlay strong { font-size: 0.95rem; font-weight: 700; }
.mini-card-overlay span { font-size: 0.78rem; color: #d8d7dc; text-transform: capitalize; }

.mini-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--dark);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 8px;
}
