:root {
  --bg: #eaf2fb;
  --bg-strong: #dce8f8;
  --surface: rgba(248, 251, 255, 0.88);
  --surface-strong: #fdfefe;
  --ink: #182332;
  --muted: #5a6c84;
  --accent: #2f6fda;
  --accent-deep: #1f4ea6;
  --line: rgba(24, 35, 50, 0.12);
  --shadow: 0 24px 60px rgba(36, 74, 132, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(47, 111, 218, 0.14), transparent 26%),
    radial-gradient(circle at right 20%, rgba(96, 153, 230, 0.14), transparent 22%),
    linear-gradient(180deg, #f4f8fd 0%, var(--bg) 48%, #e4eefb 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(31, 29, 26, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 29, 26, 0.02) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.25), transparent 80%);
}

.page-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 64px;
}

.hero,
.section {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  padding: 24px;
  min-height: 34vh;
}

.topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand,
.eyebrow,
.section-tag,
.panel-label,
.metric-label,
.section-note {
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand {
  margin: 0;
  font-weight: 800;
  font-size: 0.95rem;
}

.topbar-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.topbar a,
.contact-card a {
  color: var(--ink);
  text-decoration: none;
}

.topbar a:hover,
.topbar a:focus-visible,
.contact-card a:hover,
.contact-card a:focus-visible {
  color: var(--accent-deep);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0;
  animation: rise 700ms ease-out both;
}

.eyebrow,
.section-tag,
.panel-label,
.section-note {
  margin: 0 0 12px;
  font-size: 0.76rem;
  color: var(--muted);
}

h1,
h2 {
  margin: 0;
  font-family: "DM Serif Display", serif;
  font-weight: 400;
  line-height: 0.95;
}

h1 {
  max-width: none;
  font-size: clamp(2.2rem, 4vw, 3.6rem);
  line-height: 1;
}

h2 {
  font-size: clamp(2rem, 4vw, 3.4rem);
}

h3 {
  margin: 0 0 10px;
  font-size: 1.15rem;
}

.lede,
.intro-card p,
.contact-card p,
.project-card p,
.project-meta li {
  color: var(--muted);
  line-height: 1.7;
}

.lede {
  max-width: 70ch;
  margin: 12px 0 0;
  font-size: 0.98rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 22px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 700;
  text-decoration: none;
  transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-2px);
}

.button-primary {
  color: #fff9f3;
  background: var(--accent);
}

.button-primary:hover,
.button-primary:focus-visible {
  background: var(--accent-deep);
}

.button-secondary {
  color: var(--ink);
  background: transparent;
  border-color: var(--line);
}

.hero-panel,
.metric-card,
.intro-card,
.project-card,
.contact-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface-strong);
}

.hero-panel {
  align-self: end;
  padding: 24px;
  animation: rise 900ms ease-out both;
}

.hero-panel ul,
.contact-card ul,
.project-meta {
  margin: 0;
  padding-left: 18px;
}

.hero-panel li,
.contact-card li,
.project-meta li {
  margin-bottom: 10px;
}

.section {
  margin-top: 24px;
  padding: 32px;
}

.intro-grid {
  display: grid;
  grid-template-columns: 1.6fr 0.8fr;
  gap: 18px;
  align-items: stretch;
}

.intro-card,
.metric-card {
  padding: 24px;
}

.metric-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.metric-value {
  margin: 0 0 24px;
  font-family: "DM Serif Display", serif;
  font-size: clamp(2rem, 4vw, 3.4rem);
}

.metric-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.projects-section,
.contact-section {
  display: grid;
  gap: 28px;
}

.projects-grid {
  display: grid;
  gap: 18px;
}

.project-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.project-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-chip,
.project-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-strong);
  color: var(--accent-deep);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.filter-chip {
  min-height: 38px;
  padding: 0 14px;
  cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.filter-chip:hover,
.filter-chip:focus-visible,
.project-badge:hover,
.project-badge:focus-visible {
  transform: translateY(-1px);
}

.filter-chip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff9f3;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.section-note {
  max-width: 28ch;
  text-align: right;
}

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

.project-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px;
  opacity: 0;
  transform: translateY(18px);
  animation: rise 700ms ease-out forwards;
}

.project-badge {
  align-self: flex-start;
  padding: 8px 12px;
  cursor: pointer;
}

.project-card h3 {
  font-size: 1.35rem;
}

.project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.project-link {
  width: fit-content;
  color: var(--accent-deep);
  font-weight: 700;
  text-decoration: none;
}

.project-link-muted {
  color: var(--muted);
  cursor: default;
}

.project-link:hover,
.project-link:focus-visible {
  text-decoration: underline;
}

.project-link-muted:hover,
.project-link-muted:focus-visible {
  text-decoration: none;
}

.project-preview-button,
.preview-close {
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.project-preview-button {
  min-height: 38px;
  padding: 0 14px;
}

.preview-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
}

.preview-modal[hidden] {
  display: none;
}

.preview-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(31, 29, 26, 0.7);
}

.preview-modal-panel {
  position: relative;
  z-index: 1;
  width: min(1320px, calc(100vw - 20px));
  max-height: calc(100vh - 20px);
  overflow: hidden;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.preview-close {
  min-height: 38px;
  margin-left: auto;
  padding: 0 14px;
}

.preview-gallery {
  position: relative;
}

.preview-gallery.is-video {
  display: block;
}

.preview-stage {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-width: 0;
  width: 100%;
  max-height: calc(100vh - 140px);
  overflow: auto;
  padding: 0 64px;
}

.preview-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 1.2rem;
  font-weight: 800;
}

.preview-nav-left {
  left: 4px;
}

.preview-nav-right {
  right: 4px;
}

.preview-image {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
}

.preview-video {
  display: block;
  width: min(100%, 860px);
  max-height: min(70vh, 620px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #000;
  object-fit: contain;
}

.preview-image[hidden] {
  display: none;
}

.preview-video[hidden] {
  display: none;
}

.preview-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
}

.preview-dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(31, 29, 26, 0.2);
  cursor: pointer;
}

.preview-dot.is-active {
  background: var(--accent);
}

.contact-section {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.95fr);
  align-items: start;
}

.contact-card {
  padding: 24px;
}

code {
  font-family: inherit;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(31, 29, 26, 0.06);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .hero,
  .intro-grid,
  .projects-grid,
  .contact-section {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }

  .section-note {
    max-width: none;
    text-align: left;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100vw - 18px, 1180px);
    padding-top: 10px;
    padding-bottom: 24px;
  }

  .hero,
  .section {
    border-radius: 22px;
    padding: 20px;
  }

  .topbar {
    align-items: start;
    flex-direction: column;
  }

  h1 {
    max-width: none;
    font-size: clamp(2.6rem, 14vw, 4rem);
  }

  .hero-actions,
  .topbar-links {
    width: 100%;
  }

  .topbar-links {
    gap: 12px 16px;
  }

  .button {
    width: 100%;
  }

  .preview-gallery {
    display: block;
  }

  .preview-nav {
    width: 42px;
    height: 42px;
  }

  .preview-stage {
    padding: 0 48px;
  }
}
