:root {
  --bg: #0c1117;
  --bg-alt: #121a24;
  --surface: #182230;
  --surface-hover: #1f2d40;
  --border: rgba(148, 163, 184, 0.14);
  --text: #e8eef5;
  --text-muted: #94a3b8;
  --accent: #3dd6c6;
  --accent-dim: rgba(61, 214, 198, 0.14);
  --warm: #f0a56e;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --radius: 14px;
  --radius-sm: 10px;
  --font-sans: "DM Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --container: min(1120px, calc(100% - 2.5rem));
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(61, 214, 198, 0.12), transparent),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(240, 165, 110, 0.08), transparent),
    var(--bg);
  min-height: 100vh;
}

img {
  max-width: 100%;
  display: block;
}

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

a:hover {
  text-decoration: underline;
}

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--surface);
  padding: 0.15em 0.45em;
  border-radius: 6px;
}

.container {
  width: var(--container);
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 1rem;
  z-index: 1000;
  background: var(--accent);
  color: var(--bg);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
}

.skip-link:focus {
  left: 1rem;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: rgba(12, 17, 23, 0.82);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 1rem;
}

.header-inner--nav-only {
  justify-content: flex-end;
  gap: 1.5rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

.logo-home {
  margin-right: auto;
}

.logo-home .logo-mark {
  font-size: 1.25rem;
  transition: color 0.2s, transform 0.2s;
}

.logo-home:hover {
  text-decoration: none;
}

.logo-home:hover .logo-mark {
  color: #5ce3d5;
  transform: scale(1.08);
}

.logo-mark {
  color: var(--accent);
  font-size: 1.1rem;
}

.site-nav {
  display: flex;
  gap: 1.5rem;
}

.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
}

.site-nav a:hover {
  color: var(--text);
  text-decoration: none;
}

/* Hero */

.hero {
  padding-block: clamp(3rem, 8vw, 5.5rem) clamp(3rem, 6vw, 4rem);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.eyebrow {
  margin: 0 0 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.lead {
  margin: 0 0 1.75rem;
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 36ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.25rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  color: #06201d;
}

.btn-primary:hover {
  background: #5ce3d5;
}

.btn-ghost {
  border-color: var(--border);
  color: var(--text);
  background: transparent;
}

.btn-ghost:hover {
  background: var(--surface);
}

.hero-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 0;
}

.hero-stats dt {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.hero-stats dd {
  margin: 0;
  font-size: 0.95rem;
}

.hero-map-wrap {
  position: relative;
}

#hero-map,
#project-map {
  height: clamp(280px, 42vw, 420px);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.map-caption {
  margin: 0.65rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.project-figure {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.project-figure img {
  display: block;
  width: 100%;
  height: auto;
}

.project-figure figcaption.map-caption {
  margin: 0;
  padding: 0.65rem 0.9rem;
  background: var(--bg-alt);
}

.project-embed {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.project-embed iframe {
  display: block;
  width: 100%;
  height: clamp(480px, 78vh, 820px);
  border: 0;
}

.project-embed figcaption.map-caption {
  margin: 0;
  padding: 0.65rem 0.9rem;
  background: var(--bg-alt);
}

.map-title {
  margin: 0 0 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.9;
}

/* Sections */

.section {
  padding-block: clamp(3rem, 6vw, 5rem);
}

.section-alt {
  background: var(--bg-alt);
  border-block: 1px solid var(--border);
}

.section-head {
  max-width: 52ch;
  margin-bottom: 2rem;
}

.section-head h2,
.about-heading,
.contact-block h2 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  letter-spacing: -0.02em;
}

.section-head p {
  margin: 0;
  color: var(--text-muted);
}

/* Filters */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
}

.filter-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.filter-btn:hover,
.filter-btn.is-active {
  background: var(--accent-dim);
  border-color: rgba(61, 214, 198, 0.35);
  color: var(--accent);
}

/* Project grid */

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.project-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, border-color 0.2s, background 0.2s;
}

.project-card:hover {
  transform: translateY(-3px);
  border-color: rgba(61, 214, 198, 0.3);
  background: var(--surface-hover);
  text-decoration: none;
}

.project-thumb {
  aspect-ratio: 16 / 10;
  background:
    linear-gradient(135deg, rgba(61, 214, 198, 0.15), rgba(240, 165, 110, 0.12)),
    var(--bg-alt);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-body {
  padding: 1.15rem 1.25rem 1.35rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.65rem;
}

.chip {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--accent-dim);
  color: var(--accent);
}

.chip-warm {
  background: rgba(240, 165, 110, 0.14);
  color: var(--warm);
}

.project-body h3 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
}

.project-body p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  flex: 1;
}

.project-link-hint {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 500;
}

/* About */

.about-section {
  position: relative;
  overflow: hidden;
  border-block: 1px solid var(--border);
}

.about-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.about-bg-photo {
  position: absolute;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  filter: saturate(0.9) contrast(1.05);
  opacity: 0.55;
}

.about-bg-photo-1 {
  width: min(52vw, 680px);
  height: min(42vw, 360px);
  top: 8%;
  right: -4%;
  transform: rotate(2deg);
}

.about-bg-photo-2 {
  width: min(36vw, 420px);
  height: min(28vw, 260px);
  bottom: 10%;
  left: -3%;
  transform: rotate(-3deg);
  opacity: 0.4;
}

.about-bg-photo-3 {
  width: min(28vw, 320px);
  height: min(22vw, 220px);
  top: 42%;
  left: 38%;
  transform: rotate(4deg);
  opacity: 0.48;
  border-radius: 50%;
}

.about-bg-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(105deg, rgba(12, 17, 23, 0.7) 0%, rgba(12, 17, 23, 0.55) 42%, rgba(12, 17, 23, 0.4) 100%),
    radial-gradient(ellipse 70% 60% at 15% 50%, rgba(61, 214, 198, 0.08), transparent),
    radial-gradient(ellipse 50% 40% at 85% 20%, rgba(240, 165, 110, 0.06), transparent);
}

.about-section-inner {
  position: relative;
  z-index: 1;
}

.about-intro {
  margin-bottom: clamp(2rem, 5vw, 3rem);
  max-width: none;
}

.about-eyebrow {
  margin: 0 0 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.about-name {
  margin: 0;
  font-size: clamp(3rem, 10vw, 5.5rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
  font-weight: 700;
  -webkit-background-clip: text;
  background-clip: text;
  color: var(--text);
}

.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 2rem;
  align-items: start;
}

.about-copy p,
.about-grid p {
  color: var(--text-muted);
}

.about-heading {
  margin-top: 0;
}

.skills-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

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

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

.tag-list li {
  font-size: 0.875rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

/* Contact */

.contact-block {
  text-align: center;
  max-width: 40rem;
}

.contact-block p {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem;
  font-weight: 500;
}

/* Footer */

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

.site-footer p {
  margin: 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Project detail page */

.project-page {
  padding-block: 2.5rem 4rem;
}

.back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

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

.project-header {
  margin-bottom: 2rem;
}

.project-header h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2rem, 4vw, 2.75rem);
  letter-spacing: -0.03em;
}

.project-header .summary {
  margin: 0;
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 60ch;
}

.project-content {
  display: grid;
  gap: 2rem;
}

.project-content section h2 {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
}

.project-content section p,
.project-content section li {
  color: var(--text-muted);
}

.project-content ul {
  padding-left: 1.2rem;
}

.project-content .data-list {
  list-style: none;
  padding-left: 0;
  display: grid;
  gap: 0.4rem;
}

.project-content .data-list li {
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.project-content .data-list a {
  color: var(--accent, #3dd6c6);
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
}

.project-pdf {
  margin-top: 2rem;
  display: grid;
  gap: 1rem;
  justify-items: start;
}

.project-pdf h2 {
  margin: 0;
  font-size: 1.15rem;
}

.project-pdf .pdf-embed {
  width: 100%;
  height: clamp(420px, 70vh, 780px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-alt);
}

.loading,
.not-found {
  color: var(--text-muted);
}

/* Leaflet overrides */

.leaflet-container {
  background: #0a0f14;
  font-family: var(--font-sans);
}

.leaflet-control-attribution {
  font-size: 10px;
  background: rgba(12, 17, 23, 0.85) !important;
  color: var(--text-muted) !important;
}

.leaflet-control-attribution a {
  color: var(--text-muted) !important;
}

.leaflet-interactive {
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.75))
          drop-shadow(0 0 12px rgba(61, 214, 198, 0.25));
}

/* Responsive */

@media (max-width: 860px) {
  .hero-grid,
  .about-grid {
    grid-template-columns: 1fr;
  }

  .about-bg-photo-1 {
    width: 70vw;
    height: 42vw;
    top: 2%;
    right: -18%;
    opacity: 0.35;
  }

  .about-bg-photo-2 {
    width: 50vw;
    height: 34vw;
    bottom: 4%;
    left: -12%;
    opacity: 0.28;
  }

  .about-bg-photo-3 {
    display: none;
  }

  .about-intro {
    max-width: none;
  }

  .hero-copy {
    order: 1;
  }

  .hero-map-wrap {
    order: 2;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }

  .site-nav {
    gap: 1rem;
  }
}

@media (max-width: 520px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
}
