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

:root {
  --bg: #f6f5ef;
  --surface: #fffdf7;
  --ink: #1f2428;
  --muted: #4a5259;
  --border: #d8d1c2;
  --brand: #007f8c;
  --brand-hover: #00616b;
  --accent: #e05a2b;
  --focus: #7ec4ff;
  --elevation: 0 14px 34px rgba(22, 29, 37, 0.12);
  --radius: 14px;
  --radius-sm: 10px;
  --max-width: 1100px;
  --space-1: 0.5rem;
  --space-2: 0.875rem;
  --space-3: 1.25rem;
  --space-4: 2rem;
  --space-5: 3rem;
  --space-6: 4rem;
}

html {
  scroll-behavior: smooth;
}

body {
  color: var(--ink);
  line-height: 1.65;
  font-family: "Work Sans", "Segoe UI", sans-serif;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 16% 14%, rgba(0, 127, 140, 0.08), transparent 28%),
    radial-gradient(circle at 86% 88%, rgba(224, 90, 43, 0.08), transparent 30%),
    linear-gradient(rgba(31, 36, 40, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 36, 40, 0.035) 1px, transparent 1px);
  background-size: auto, auto, 22px 22px, 22px 22px;
  background-attachment: fixed;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(246, 245, 239, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  gap: var(--space-3);
}

.site-title {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: 1.2rem;
  color: var(--ink);
  text-decoration: none;
}

.nav-links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0;
}

.nav-links a {
  text-decoration: none;
  color: var(--ink);
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.nav-links a:hover {
  border-color: var(--border);
  background-color: var(--surface);
  text-decoration: none;
}

.site-content {
  padding: var(--space-4) 0 var(--space-6);
}

.hero {
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  background: linear-gradient(140deg, #fffdf7, #fbfaf4);
  box-shadow: var(--elevation);
  margin-bottom: var(--space-5);
  text-align: center;
}

.hero-image {
  width: min(100%, 460px);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin: 0 auto var(--space-4);
  display: block;
}

.hero h1 {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2rem, 5vw, 3.1rem);
  line-height: 1.12;
  margin-bottom: var(--space-2);
  letter-spacing: -0.02em;
}

.hero .lead {
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  color: var(--muted);
  margin-bottom: var(--space-2);
}

.hero-note {
  max-width: 66ch;
  margin: 0 auto;
}

h2 {
  margin-top: var(--space-5);
  margin-bottom: var(--space-3);
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.6rem, 3vw, 2.15rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h2::after {
  content: "";
  display: block;
  width: 90px;
  height: 5px;
  border-radius: 999px;
  margin-top: 0.45rem;
  background: linear-gradient(90deg, var(--brand), var(--accent));
}

h3 {
  margin-top: var(--space-4);
  margin-bottom: var(--space-2);
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.2rem, 2.3vw, 1.55rem);
}

p,
li {
  color: var(--ink);
}

p {
  margin-bottom: var(--space-2);
}

ul,
ol {
  margin-left: 1.2rem;
  margin-bottom: var(--space-3);
}

li {
  margin-bottom: 0.45rem;
}

a {
  color: var(--brand);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--brand-hover);
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin: var(--space-2) 0 var(--space-3);
}

.button {
  display: inline-block;
  text-decoration: none;
  border-radius: 999px;
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #ffffff;
  font-weight: 600;
  font-family: "Space Grotesk", sans-serif;
  padding: 0.72rem 1.1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.button:hover {
  text-decoration: none;
  background: var(--brand-hover);
  color: #ffffff;
  transform: translateY(-1px);
}

.button-secondary {
  background: transparent;
  color: var(--brand);
}

.button-secondary:hover {
  background: rgba(0, 127, 140, 0.1);
  color: var(--brand-hover);
}

.section-grid {
  margin-top: var(--space-3);
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.section-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-3);
  box-shadow: 0 8px 18px rgba(20, 25, 31, 0.06);
}

.section-card h3 {
  margin-top: 0;
}

.section-card a {
  font-weight: 600;
}

.section-card > .button {
  margin-top: auto;
  align-self: flex-start;
}

.repo-grid {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: var(--space-3);
}

.repo-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-3);
  box-shadow: 0 8px 18px rgba(20, 25, 31, 0.06);
}

.repo-card h3 {
  margin: 0;
}

.repo-card h3 a {
  text-decoration: none;
  color: var(--ink);
}

.repo-card h3 a:hover {
  color: var(--brand);
}

.repo-card p {
  margin: 0;
  color: var(--muted);
}

.repo-card > .button {
  margin-top: auto;
  align-self: flex-start;
}

.media-gallery {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(280px, 78vw);
  gap: var(--space-3);
  overflow-x: auto;
  padding: var(--space-2) 0 var(--space-3);
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}

.gallery-item {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 18px rgba(20, 25, 31, 0.06);
  overflow: hidden;
  scroll-snap-align: start;
}

.gallery-item figcaption {
  padding: 0 var(--space-3) var(--space-3);
  font-weight: 600;
  color: var(--muted);
}

.gallery-video-frame {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #111417;
}

.gallery-video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.gallery-image-button {
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: zoom-in;
}

.gallery-image-button img {
  display: block;
  width: 100%;
  height: 320px;
  object-fit: cover;
  margin: 0;
  border: 0;
  border-radius: 0;
}

.gallery-lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  background: rgba(17, 20, 23, 0.82);
  z-index: 200;
}

.gallery-lightbox.is-open {
  display: flex;
}

.gallery-lightbox-dialog {
  position: relative;
  max-width: min(1100px, 100%);
  max-height: 100%;
}

.gallery-lightbox-image {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 7rem);
  width: auto;
  height: auto;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  box-shadow: 0 16px 46px rgba(0, 0, 0, 0.34);
}

.gallery-lightbox-close {
  position: absolute;
  top: -0.85rem;
  right: -0.85rem;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
}

.gallery-lightbox-close:hover {
  transform: translateY(-1px);
}

.gallery-lightbox-caption {
  margin-top: var(--space-2);
  text-align: center;
  color: #f4f4ef;
  font-weight: 500;
}

.site-footer {
  background: #1f2428;
  color: #f8f7f1;
  margin-top: var(--space-6);
  padding: var(--space-4) 0;
}

.site-footer p {
  color: #f8f7f1;
  margin-bottom: var(--space-1);
}

.site-footer a {
  color: #86d9e1;
}

@media (max-width: 900px) {
  .container {
    padding: 0 var(--space-3);
  }

  .hero {
    padding: var(--space-4);
  }

  .section-grid {
    grid-template-columns: 1fr;
  }

  .repo-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .site-nav {
    flex-direction: column;
    align-items: flex-start;
    padding: var(--space-2) 0;
  }

  .nav-links {
    width: 100%;
  }

  .hero {
    padding: var(--space-3);
  }

  .button {
    text-align: center;
  }

  .media-gallery {
    grid-auto-columns: minmax(240px, 88vw);
  }

  .gallery-image-button img {
    height: 240px;
  }
}
