:root {
  --bg: #f7f7f4;
  --bg-soft: #ececea;
  --card: #ffffff;
  --card-strong: #111111;
  --line: #d7d7d2;
  --line-strong: #151515;
  --text: #111111;
  --muted: #5f5f59;
  --accent: #111111;
  --accent-2: #3b3b36;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Sora", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    linear-gradient(90deg, rgb(17 17 17 / 4%) 1px, transparent 1px),
    linear-gradient(180deg, rgb(17 17 17 / 4%) 1px, transparent 1px),
    var(--bg);
  background-size: 42px 42px;
  min-height: 100vh;
}

.no-scroll {
  overflow: hidden;
}

main {
  width: min(1120px, 100% - 2rem);
  margin: 0 auto;
  padding-bottom: 4rem;
}

.hero {
  padding: clamp(2rem, 7vh, 5rem) 0 3rem;
}

.eyebrow {
  margin: 0;
  color: var(--accent-2);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0.8rem 0 0;
  font-size: clamp(2rem, 6vw, 4rem);
  line-height: 1.06;
  letter-spacing: 0;
}

.hero-subtitle {
  margin: 0.7rem 0 0;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  font-weight: 700;
  line-height: 1.25;
}

.lead {
  margin: 1.2rem 0 0;
  max-width: 70ch;
  color: var(--muted);
  line-height: 1.75;
}

.hero-actions {
  margin-top: 1.7rem;
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.78rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
}

.btn-primary {
  color: #ffffff;
  background: var(--accent);
  border: 1px solid var(--accent);
}

.btn-secondary {
  color: var(--text);
  border: 1px solid var(--line);
}

.section {
  margin-top: 3.2rem;
  padding-top: 0.2rem;
}

h2 {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 2rem);
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--line-strong);
}

.skill-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem;
}

.skill-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  background: var(--card);
}

.skill-card h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
}

.skill-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.project-list {
  margin-top: 1rem;
  display: grid;
  gap: 1.1rem;
}

.project-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  background: var(--card);
}

.project-card[data-project-url] {
  cursor: pointer;
}

.project-card[data-project-url]:hover {
  border-color: var(--line-strong);
  box-shadow: 6px 6px 0 var(--line-strong);
  transform: translate(-2px, -2px);
}

.project-kicker {
  margin: 0;
  color: var(--accent-2);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.project-card h3 {
  margin: 0.45rem 0 0;
}

.project-card p {
  margin: 0.7rem 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.project-open-link {
  display: inline-flex;
  margin-top: 0.85rem;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  border-bottom: 1px solid currentColor;
}

.project-open-link:hover {
  text-decoration: none;
  color: var(--muted);
}

.project-text {
  border-style: dashed;
}

.project-preview {
  display: grid;
  grid-template-columns: minmax(180px, 280px) 1fr;
  gap: 1rem;
  align-items: stretch;
}

.project-preview-media {
  min-width: 0;
}

.project-preview-img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 170px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  filter: grayscale(100%);
  transition: filter 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.project-preview-img-contain {
  object-fit: contain;
  padding: 0.2rem;
}

.project-preview-body {
  min-width: 0;
  align-self: center;
}

.project-card:hover .project-preview-img {
  filter: grayscale(0%);
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.gallery {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.7rem;
  width: 100%;
}

.gallery-group {
  margin-top: 1.6rem;
}

.gallery-group h3 {
  margin: 0;
  color: var(--text);
  font-size: 1rem;
  font-family: "IBM Plex Mono", monospace;
  font-weight: 500;
  text-transform: uppercase;
}

.gallery img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 220px;
  height: auto;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  cursor: zoom-in;
  transition: transform 0.25s ease, border-color 0.25s ease;
  filter: grayscale(100%);
}

.gallery img.gallery-img-contain {
  object-fit: contain;
  background: var(--bg-soft);
}

.gallery img:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  filter: grayscale(0%);
}

.project-video-wrap {
  margin-top: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-soft);
  padding: 0.7rem;
}

.project-video {
  display: block;
  width: 100%;
  max-height: 520px;
  border-radius: 6px;
  background: #000;
}

.project-video-embed {
  aspect-ratio: 16 / 9;
  min-height: 220px;
  height: auto;
  max-height: none;
  border: 0;
}

.video-note {
  margin: 0.7rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.video-note a {
  color: var(--accent);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  touch-action: none;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-rows: auto 1fr auto;
  align-items: center;
  gap: 0.8rem;
  padding: clamp(0.8rem, 3vw, 2rem);
  background: rgb(0 0 0 / 92%);
  backdrop-filter: blur(5px);
}

.lightbox[hidden] {
  display: none;
}

.lightbox-close {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--line);
  background: #ffffff;
  color: #111111;
  border-radius: 8px;
  cursor: pointer;
}

.lightbox-nav {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: #111111;
  font-size: 1.25rem;
  cursor: pointer;
}

.lightbox-prev {
  grid-column: 1;
  grid-row: 2;
}

.lightbox-next {
  grid-column: 3;
  grid-row: 2;
}

.lightbox-figure {
  grid-column: 2;
  grid-row: 2;
  position: relative;
  touch-action: none;
  margin: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: 1fr;
  gap: 0;
  overflow: hidden;
}

.lightbox-figure img {
  width: 100%;
  height: 100%;
  max-height: calc(100vh - 11rem);
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid rgb(255 255 255 / 35%);
  background: rgb(0 0 0 / 30%);
  cursor: zoom-in;
  touch-action: none;
  transform-origin: center;
  transition: transform 0.18s ease;
  user-select: none;
  will-change: transform;
}

.lightbox.is-zoomed .lightbox-figure img {
  cursor: grab;
}

.lightbox.is-zoomed .lightbox-figure img:active {
  cursor: grabbing;
}

.lightbox-loader {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.9rem;
  color: #f3f7ff;
  background: rgb(0 0 0 / 78%);
  border-radius: 8px;
  z-index: 1;
}

.lightbox.is-loading .lightbox-loader {
  display: inline-flex;
}

.lightbox-spinner {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  border: 2px solid rgb(255 255 255 / 35%);
  border-top-color: #ffffff;
  animation: lightboxSpin 0.8s linear infinite;
}

@keyframes lightboxSpin {
  to {
    transform: rotate(360deg);
  }
}

.lightbox-figure figcaption {
  display: none;
}

.lightbox-counter {
  display: none;
}

.site-footer {
  padding: 2.6rem 1rem 3rem;
  color: var(--muted);
  text-align: center;
  border-top: 1px solid var(--line-strong);
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.75s ease, transform 0.75s ease;
}

.reveal-visible {
  opacity: 1;
  transform: translateY(0);
}

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

  .project-preview-img {
    height: auto;
    min-height: 0;
  }

  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lightbox {
    grid-template-columns: 1fr auto 1fr;
    grid-template-rows: auto 1fr auto auto;
    gap: 0.6rem;
  }

  .lightbox-close {
    grid-column: 3;
    grid-row: 1;
  }

  .lightbox-figure {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .lightbox-prev {
    grid-column: 1;
    grid-row: 3;
    justify-self: start;
  }

  .lightbox-next {
    grid-column: 3;
    grid-row: 3;
    justify-self: end;
  }

  .lightbox-counter {
    display: none;
  }
}
