:root {
  --bg: #060708;
  --bg-soft: #0c0f14;
  --panel-top: rgba(255, 255, 255, 0.045);
  --panel-bottom: rgba(255, 255, 255, 0.025);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #f4f5f7;
  --muted: #a0a8b6;
  --muted-2: #7f8896;
  --accent: #79d8ff;
  --accent-2: #5b7cff;
  --accent-3: #c7f3ff;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.34);
  --radius-xl: 38px;
  --radius-lg: 28px;
  --radius-md: 20px;
  --container: 1720px;
}

html {
  scroll-behavior: smooth;
}

body {
  color: var(--text);
  background:
    radial-gradient(circle at 14% 0%, rgba(84, 126, 255, 0.12), transparent 24%),
    radial-gradient(circle at 88% 8%, rgba(108, 218, 255, 0.09), transparent 16%),
    linear-gradient(180deg, #060708 0%, #090b0f 100%);
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.page {
  max-width: var(--container);
  margin: 0 auto;
  padding: 18px;
}

.frame {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 16px;
  align-items: start;
}

.main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.frame,
.main,
.cases,
.sections,
.stats,
.projects,
.archive-grid,
.gallery-sections {
  gap: 18px;
}

.gallery-section,
.case-gallery,
.archive-gallery,
.story-team,
.pill-row,
.project-actions,
.panel-footer {
  gap: 14px;
}

.main > * {
  min-width: 0;
}

.archive-thumb,
.gallery-card,
.gallery-tile {
  max-width: 100%;
}

.archive-thumb img,
.gallery-card img,
.gallery-tile img {
  max-width: 100%;
}

.panel-footer,
.project-actions,
.pill-row {
  margin-top: 22px;
}

.case-tags + .pill-row,
.case-tags + .project-actions,
.case-tags + .panel-footer {
  margin-top: 24px;
}

.section-card p + .panel-footer,
.section-card p + .pill-row,
.story p + .pill-row,
.story p + .panel-footer,
.cta p + .pill-row,
.cta p + .panel-footer,
.cta p + .project-actions {
  margin-top: 24px;
}

.glass {
  background: linear-gradient(180deg, var(--panel-top), var(--panel-bottom));
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.brandbar,
.hero-surface,
.feature,
.story,
.sidebar,
.section-card,
.stat-card,
.project-card,
.cta-card,
.overview,
.case-study,
.case-card,
.cta {
  border-radius: var(--radius-xl);
}

.meta-box,
.detail,
.side-nav a,
.side-subnav a {
  border-radius: var(--radius-md);
}

.brand-subtitle,
.brand-meta,
.eyebrow,
.section-label,
.stat-label,
.case-kicker,
.side-title,
.side-foot {
  color: var(--muted);
}

.side-nav a,
.side-subnav a {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.side-nav a:hover,
.side-nav a.active,
.side-subnav a:hover,
.side-subnav a.active {
  transform: translateX(2px);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.06);
}

.pill {
  min-width: 126px;
  height: 52px;
  padding: 0 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-weight: 600;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sidebar-close {
  display: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  cursor: pointer;
}

.sidebar-close::before,
.sidebar-close::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.sidebar-close {
  position: relative;
}

.sidebar-close::before {
  transform: rotate(45deg);
}

.sidebar-close::after {
  transform: rotate(-45deg);
}

.menu-toggle {
  display: none;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  flex: 0 0 auto;
}

.menu-toggle span {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.menu-open .menu-toggle span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.menu-open .menu-toggle span:nth-child(2) {
  opacity: 0;
}

.menu-open .menu-toggle span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

@media (max-width: 1100px) {
  .frame {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }
}

@media (max-width: 780px) {
  body.menu-open {
    overflow: hidden;
  }

  body.menu-open::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(5, 8, 12, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 40;
  }

  .page {
    padding:
      max(14px, env(safe-area-inset-top))
      14px
      max(16px, env(safe-area-inset-bottom))
      14px;
  }

  .frame,
  .main {
    gap: 14px;
  }

  .cases,
  .sections,
  .stats,
  .projects,
  .archive-grid,
  .gallery-sections {
    gap: 16px !important;
  }

  .gallery-section,
  .case-gallery,
  .archive-gallery,
  .story-team,
  .pill-row,
  .project-actions,
  .panel-footer {
    gap: 14px !important;
  }

  .brandbar,
  .cta {
    flex-direction: column;
    align-items: flex-start;
  }

  .brandbar,
  .sidebar,
  .cta,
  .project-card,
  .archive-card,
  .section-card,
  .case-study,
  .case-card,
  .gallery-section,
  .overview,
  .story,
  .feature,
  .hero-surface,
  .stat-card {
    border-radius: 24px;
  }

  .brandbar {
    min-height: auto;
    padding: 16px 18px;
    gap: 10px;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .brand {
    width: auto;
    flex: 1;
    min-width: 0;
  }

  .brand-mark {
    width: 124px;
  }

  .brand-subtitle,
  .brand-meta {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
    z-index: 60;
  }

  .sidebar {
    position: fixed;
    top: 12px;
    right: 12px;
    bottom: 12px;
    width: min(320px, calc(100vw - 24px));
    padding: 18px;
    z-index: 50;
    transform: translateX(calc(100% + 18px));
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.25s ease;
    overflow: auto;
  }

  .sidebar-close {
    display: inline-flex;
  }

  .menu-open .sidebar {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
  }

  .side-nav,
  .side-subnav {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .side-nav a,
  .side-subnav a {
    min-height: 48px;
    padding: 12px 14px;
  }

  .pill-row,
  .project-actions,
  .panel-footer,
  .case-tags,
  .archive-gallery,
  .case-gallery,
  .story-team {
    gap: 12px;
  }

  .panel-footer,
  .project-actions,
  .pill-row {
    margin-top: 20px;
  }

  .section-card p + .panel-footer,
  .section-card p + .pill-row,
  .story p + .pill-row,
  .story p + .panel-footer,
  .cta p + .pill-row,
  .cta p + .panel-footer,
  .cta p + .project-actions {
    margin-top: 22px;
  }

  .pill,
  .hero-action,
  .video-link {
    min-height: 48px;
  }

  .archive-grid,
  .archive-gallery,
  .case-gallery {
    grid-template-columns: 1fr !important;
  }

  .archive-thumb,
  .gallery-card {
    min-height: 0 !important;
    aspect-ratio: auto !important;
  }

  .archive-thumb img,
  .gallery-card img {
    width: 100%;
    height: auto !important;
    max-height: none !important;
    object-fit: contain !important;
    object-position: center center !important;
  }

  .gallery-tile img {
    width: 100%;
    height: auto !important;
    object-fit: contain !important;
  }
}

@media (max-width: 520px) {
  .page {
    padding:
      max(16px, env(safe-area-inset-top))
      12px
      max(22px, env(safe-area-inset-bottom))
      12px;
  }

  .frame,
  .main {
    gap: 14px;
  }

  .cases,
  .sections,
  .stats,
  .projects,
  .archive-grid,
  .gallery-sections {
    gap: 16px !important;
  }

  .gallery-section,
  .case-gallery,
  .archive-gallery,
  .story-team,
  .pill-row,
  .project-actions,
  .panel-footer {
    gap: 12px !important;
  }

  .brandbar {
    padding: 14px 16px;
  }

  .brand {
    gap: 14px;
  }

  .brand-mark {
    width: 112px;
  }

  .sidebar {
    top: max(12px, env(safe-area-inset-top));
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    width: min(320px, calc(100vw - 24px));
    padding: 16px;
  }

  .pill {
    min-width: 0;
    width: 100%;
  }

  .hero-action,
  .video-link {
    width: 100%;
    justify-content: center;
  }

  .archive-thumb,
  .gallery-card,
  .gallery-tile {
    border-radius: 18px;
  }

  .archive-thumb img,
  .gallery-card img,
  .gallery-tile img {
    clip-path: inset(0 round 18px) !important;
  }

  .panel-footer,
  .project-actions,
  .pill-row {
    margin-top: 18px;
  }

  .side-nav a,
  .side-subnav a {
    min-height: 46px;
    padding: 11px 13px;
  }
}
