:root {
  --bg: #0c100f;
  --bg-soft: #121715;
  --panel: #161d1a;
  --line: #23302a;
  --text: #e6efe9;
  --muted: #8fa39a;
  --accent: #4ce0a6;
  --display: "Bahnschrift", "DIN Alternate", "Century Gothic", system-ui, sans-serif;
  --sans: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { color-scheme: dark; }

body {
  background:
    radial-gradient(1100px 480px at 50% -120px, rgba(76, 224, 166, 0.08), transparent 62%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

::selection { background: rgba(76, 224, 166, 0.35); }

/* ---------- Header ---------- */

.site-header { text-align: center; padding: 76px 12px 6px; }

.name {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  letter-spacing: 0.05em;
}

.name::after {
  content: "";
  display: block;
  width: 52px;
  height: 2px;
  background: var(--accent);
  margin: 12px auto 0;
}

.subtitle {
  margin-top: 10px;
  color: var(--muted);
  font-size: clamp(0.95rem, 2.5vw, 1.05rem);
  letter-spacing: 0.04em;
}

.location {
  margin-top: 8px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.contact-line {
  margin-top: 16px;
  color: #5c6270;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
}

.contact-line a { color: inherit; transition: color 0.18s; }

.contact-line a:hover { color: var(--accent); }

/* ---------- Filters ---------- */

.filters {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 12px 6px;
}

.tag-btn {
  appearance: none;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  padding: 8px 20px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s, background 0.18s, transform 0.18s;
}

.tag-btn:hover { color: var(--text); border-color: var(--accent); }

.tag-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #0a1611;
  font-weight: 600;
  transform: translateY(-1px);
}

/* ---------- Index grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(295px, 100%), 1fr));
  gap: 22px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 30px 12px 60px;
}

.card {
  display: block;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.22s, border-color 0.22s, box-shadow 0.22s;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(76, 224, 166, 0.5);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.45);
}

.card.hidden { display: none; }

.thumb {
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--bg-soft);
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.card:hover .thumb img { transform: scale(1.06); }

.no-image {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
}

.meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
}

.card-title { font-size: 0.92rem; font-weight: 600; line-height: 1.35; }

.card-tag {
  flex: none;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  color: var(--accent);
  border: 1px solid rgba(76, 224, 166, 0.35);
  padding: 3px 9px;
  border-radius: 999px;
}

/* ---------- Project page ---------- */

.project-header { max-width: 1280px; margin: 0 auto; padding: 42px 12px 0; }

.back {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.18s;
}

.back:hover { color: var(--accent); }

.back-float {
  position: fixed;
  top: 42px;
  left: 12px;
  z-index: 50;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  background: rgba(22, 29, 26, 0.85);
  backdrop-filter: blur(6px);
  padding: 10px 18px;
  border-radius: 999px;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease, color 0.18s, border-color 0.18s;
}

.back-float.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-float:hover { color: var(--accent); border-color: var(--accent); }

.project-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.project-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  letter-spacing: 0.03em;
}

.gallery-section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 36px 12px 0;
}

.gallery-head {
  margin-bottom: 16px;
}

.section-label {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}

.gallery-wrap {
  position: relative;
  max-height: 420px;
  overflow: hidden;
  padding-top: 4px;
  transition: max-height 0.45s ease;
}

.gallery {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
}

.gallery-fade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 90px;
  background: linear-gradient(to top, var(--bg), rgba(12, 16, 15, 0));
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.gallery-wrap.expanded .gallery-fade { opacity: 0; }

.gallery-more {
  display: block;
  margin: 18px auto 0;
  appearance: none;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  padding: 10px 26px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s, background 0.18s;
}

.gallery-more:hover { color: var(--accent); border-color: var(--accent); }

.gallery-more.active {
  color: var(--accent);
  border-color: var(--accent);
  background: transparent;
}

.gallery-item {
  display: block;
  flex: 0 1 auto;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  transition: border-color 0.2s, transform 0.2s;
}

.gallery-item:hover { border-color: var(--accent); transform: translateY(-2px); }

.gallery-item img {
  width: 100%;
  display: block;
  transition: transform 0.3s ease;
}

.gallery-item:hover img { transform: scale(1.04); }

.about {
  max-width: 1280px;
  margin: 0 auto;
  padding: 44px 12px 60px;
  color: var(--muted);
  font-size: 0.95rem;
}

.about .section-label { margin-bottom: 14px; }

.about p { margin-bottom: 12px; }

.bullets { margin: 0 0 12px 20px; }

.bullets li { margin-bottom: 6px; }

/* ---------- Lightbox ---------- */

#lightbox {
  position: fixed;
  inset: 0;
  background: rgba(8, 9, 11, 0.94);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 26px;
  cursor: zoom-out;
}

#lightbox.open { display: flex; }

#lightbox img {
  max-width: 100%;
  max-height: 86vh;
  border-radius: 6px;
  box-shadow: 0 22px 64px rgba(0, 0, 0, 0.65);
  cursor: default;
}

.lb-caption {
  position: absolute;
  bottom: 22px;
  left: 0;
  right: 0;
  text-align: center;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
}

.lb-close {
  position: absolute;
  top: 16px;
  right: 22px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 1.9rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.18s, transform 0.18s;
}

.lb-close:hover { color: var(--accent); transform: rotate(90deg); }

.lb-prev,
.lb-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(22, 29, 26, 0.8);
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s, background 0.18s;
}

.lb-prev { left: 18px; }

.lb-next { right: 18px; }

.lb-prev:hover,
.lb-next:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- 404 ---------- */

.err-page { text-align: center; padding: 130px 20px 40px; }

.err-code {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(4rem, 12vw, 7rem);
  letter-spacing: 0.06em;
  color: var(--accent);
  line-height: 1;
}

.err-page .err-note { margin-top: 18px; color: var(--muted); }

.err-page .err-back {
  display: inline-block;
  margin-top: 26px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(76, 224, 166, 0.4);
  padding-bottom: 4px;
  transition: color 0.18s, border-color 0.18s;
}

.err-page .err-back:hover { color: var(--text); border-color: var(--text); }

/* ---------- Footer ---------- */

.site-footer {
  text-align: center;
  padding: 24px 20px 44px;
  color: #5c6270;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
}

.site-footer a { color: inherit; transition: color 0.18s; }

.site-footer a:hover { color: var(--accent); }
