:root {
  --bg: #06101f;
  --bg-soft: #0d1d35;
  --card: #122641;
  --text: #eef4ff;
  --muted: #b8c7df;
  --line: #28466f;
  --accent: #ff8c00;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

body {
  font-family: "Sora", sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 500px at 80% -100px, #233f66 0%, transparent 60%),
    radial-gradient(900px 400px at -10% 10%, #1b3152 0%, transparent 55%),
    var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
}

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

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

.container {
  width: min(1120px, 92vw);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(6, 16, 31, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-wrap {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
  flex: 1;
  max-width: calc(100vw - 120px);
}

.brand-logo {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.brand span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.98rem;
}

.brand-short {
  display: none;
}

.desktop-nav {
  display: none;
  align-items: center;
  gap: 1.2rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.desktop-nav a:not(.btn):hover {
  color: var(--accent);
}

.menu-btn {
  border: 1px solid var(--line);
  color: var(--text);
  background: transparent;
  border-radius: 0.55rem;
  padding: 0.45rem 0.75rem;
  font: inherit;
}

.mobile-menu {
  display: none;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.mobile-menu.open {
  display: block;
}

.mobile-menu a {
  display: block;
  width: min(1120px, 92vw);
  margin: 0 auto;
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-weight: 600;
}

.hero {
  padding: 4rem 0 2rem;
}

.hero-grid {
  display: grid;
  gap: 1.5rem;
}

.eyebrow {
  margin: 0 0 0.8rem;
  color: var(--accent);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: clamp(1.8rem, 7.5vw, 3.4rem);
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.hero-text {
  max-width: 55ch;
  color: var(--muted);
  margin: 1rem 0 1.5rem;
}

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

.hero-card {
  background: linear-gradient(145deg, #122a47, #0d1f36);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1.25rem;
}

.hero-card img {
  width: 64px;
  height: 64px;
  border-radius: 0.65rem;
  object-fit: cover;
  margin-bottom: 0.75rem;
}

.hero-card h2 {
  margin: 0;
  font-size: 1.05rem;
}

.hero-card p {
  color: var(--muted);
  margin: 0.5rem 0 0;
}

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border-radius: 0.7rem;
  padding: 0.68rem 1rem;
  background: var(--accent);
  color: #111;
  border: 1px solid var(--accent);
  font-weight: 700;
}

.btn-sm {
  padding: 0.5rem 0.8rem;
}

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

.section {
  padding: 2.8rem 0;
}

.section-dark {
  background: rgba(8, 19, 35, 0.8);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.section-title {
  margin: 0 0 1.1rem;
  font-size: clamp(1.3rem, 5vw, 2rem);
  overflow-wrap: anywhere;
}

.projects-toolbar {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.projects-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.projects-filter-btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border-radius: 999px;
  padding: 0.38rem 0.72rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.projects-filter-btn.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #0d1018;
}

.projects-filter-btn.is-disabled,
.projects-filter-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.projects-grid {
  display: grid;
  gap: 0.8rem;
}

.projects-tile {
  position: relative;
  min-height: 210px;
  overflow: hidden;
  border-radius: 0.9rem;
  border: 1px solid var(--line);
  background: #11253f;
}

.projects-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.projects-tile:hover img {
  transform: scale(1.04);
}

.projects-tile.fallback {
  background:
    linear-gradient(160deg, #173558, #0d1c31),
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.04) 0 10px, rgba(255, 255, 255, 0.015) 10px 20px);
}

.projects-meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.7rem;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.82) 82%);
}

.projects-meta h3 {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.35;
}

.cards,
.projects,
.steps {
  display: grid;
  gap: 0.9rem;
}

.card,
.project,
.step {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  padding: 1rem;
}

.card h3,
.project h3,
.step h3 {
  margin: 0 0 0.45rem;
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}

.card p,
.project p,
.step p {
  margin: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.tag {
  display: inline-block;
  margin-bottom: 0.45rem;
  background: rgba(255, 140, 0, 0.17);
  color: #ffbf73;
  border: 1px solid rgba(255, 140, 0, 0.35);
  border-radius: 999px;
  padding: 0.2rem 0.58rem;
  font-size: 0.75rem;
  font-weight: 700;
}

.step span {
  color: var(--accent);
  font-weight: 800;
  font-size: 1.2rem;
}

.cta {
  padding-top: 2.4rem;
}

.cta-wrap {
  background: linear-gradient(130deg, #132d4d, #0d1f35);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1.2rem;
  display: grid;
  gap: 1rem;
}

.cta-wrap h2 {
  margin: 0;
  font-size: clamp(1.3rem, 4.5vw, 2rem);
  overflow-wrap: anywhere;
}

.cta-wrap p {
  margin: 0.45rem 0 0;
  color: var(--muted);
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.site-footer {
  padding: 1.2rem 0 2rem;
}

.footer-wrap {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.88rem;
}

@media (max-width: 859px) {
  .mobile-menu a {
    width: 100%;
    margin: 0;
    padding-left: 4vw;
    padding-right: 4vw;
  }

  .container {
    width: min(1120px, 94vw);
  }

  .nav-wrap {
    min-height: 64px;
    gap: 0.65rem;
  }

  .brand {
    max-width: calc(100vw - 116px);
  }

  .brand-logo {
    width: 36px;
    height: 36px;
  }

  .brand-full {
    display: none;
  }

  .brand-short {
    display: inline;
    font-size: 0.95rem;
  }

  .menu-btn {
    padding: 0.4rem 0.62rem;
    font-size: 0.88rem;
    line-height: 1;
    flex-shrink: 0;
  }

  .hero {
    padding: 2.4rem 0 1.6rem;
  }

  h1 {
    font-size: clamp(1.7rem, 8.6vw, 2.35rem);
    line-height: 1.14;
  }

  .hero-text {
    margin: 0.85rem 0 1.15rem;
    font-size: 0.97rem;
  }

  .hero-actions {
    gap: 0.58rem;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .btn {
    padding: 0.58rem 0.8rem;
    border-radius: 0.6rem;
    font-size: 0.86rem;
  }

  .btn-sm {
    padding: 0.46rem 0.68rem;
    font-size: 0.8rem;
  }

  .section {
    padding: 1.7rem 0;
  }

  .cta-actions {
    flex-direction: column;
  }

  .cta-actions .btn {
    width: 100%;
  }

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

  .portfolio-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.62rem;
  }

  .portfolio-content {
    padding: 0.72rem;
  }

  .portfolio-content h3 {
    font-size: 0.94rem;
    margin: 0.25rem 0 0.5rem;
    line-height: 1.25;
  }

  .portfolio-location {
    font-size: 0.7rem;
    letter-spacing: 0.05em;
  }

  .chips-row {
    margin-bottom: 0.55rem;
    gap: 0.28rem;
  }

  .chip {
    font-size: 0.66rem;
    padding: 0.12rem 0.4rem;
  }

  .stats-grid > div {
    padding: 0.4rem 0.45rem;
  }

  .stats-grid strong {
    font-size: 0.78rem;
  }

  .portfolio-actions {
    gap: 0.42rem;
    margin-top: 0.68rem;
  }

  .projects-filter-btn {
    font-size: 0.72rem;
    padding: 0.3rem 0.56rem;
  }

  .footer-wrap {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
  }
}

@media (max-width: 420px) {
  .eyebrow {
    letter-spacing: 0.08em;
    font-size: 0.72rem;
  }

  .section-title {
    margin-bottom: 0.8rem;
  }

  .card,
  .project,
  .step,
  .cta-wrap {
    padding: 0.88rem;
  }

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

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

  .portfolio-cover {
    min-height: 140px;
  }

  .portfolio-content {
    padding: 0.64rem;
  }

  .portfolio-content h3 {
    font-size: 0.9rem;
  }

  .btn {
    font-size: 0.82rem;
    padding: 0.52rem 0.68rem;
  }
}

@media (min-width: 860px) {
  .menu-btn,
  .mobile-menu {
    display: none;
  }

  .desktop-nav {
    display: flex;
  }

  .hero {
    padding-top: 5.3rem;
  }

  .hero-grid {
    grid-template-columns: 1.25fr 0.75fr;
    align-items: center;
    gap: 2rem;
  }

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

  .projects-toolbar {
    grid-template-columns: auto 1fr;
    align-items: end;
  }

  .projects-filters {
    justify-content: flex-end;
  }

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

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

  .cta-wrap {
    grid-template-columns: 1fr auto;
    align-items: center;
  }
}

.portfolio-hero {
  padding-bottom: 2.5rem;
}

.portfolio-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.portfolio-card {
  display: grid;
  background: linear-gradient(160deg, #10253e, #0b1c31);
  border: 1px solid var(--line);
  border-radius: 1rem;
  overflow: hidden;
}

.portfolio-cover {
  min-height: 190px;
  background: #0e1c30;
}

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

.portfolio-content {
  padding: 1rem;
}

.portfolio-location {
  margin: 0;
  color: #ffd19a;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 700;
}

.portfolio-content h3 {
  margin: 0.35rem 0 0.8rem;
  font-size: 1.1rem;
}

.chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.chip {
  font-size: 0.73rem;
  border: 1px solid rgba(255, 140, 0, 0.45);
  color: #ffcb8e;
  background: rgba(255, 140, 0, 0.12);
  border-radius: 999px;
  padding: 0.16rem 0.52rem;
  font-weight: 700;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}

.stats-grid > div {
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 0.7rem;
  padding: 0.48rem 0.56rem;
  background: rgba(255, 255, 255, 0.02);
}

.stats-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
}

.stats-grid strong {
  font-size: 0.88rem;
}

.portfolio-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.95rem;
}

#case-study {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-12px);
  transition: max-height 0.55s ease, opacity 0.35s ease, transform 0.35s ease;
  padding-top: 0;
  padding-bottom: 0;
}

#case-study.is-open {
  max-height: 3600px;
  opacity: 1;
  transform: translateY(0);
  padding-top: 1.2rem;
  padding-bottom: 2.8rem;
}

.portfolio-empty {
  border: 1px dashed var(--line);
  border-radius: 0.9rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.02);
}

.portfolio-empty h3,
.portfolio-empty p {
  margin: 0;
}

.portfolio-empty p {
  color: var(--muted);
  margin-top: 0.25rem;
}

.case-study-card {
  border-radius: 1rem;
  border: 1px solid var(--line);
  background: linear-gradient(165deg, #122744, #0a192c);
  padding: 1.1rem;
}

.case-study-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.case-study-head h2 {
  margin: 0;
  font-size: clamp(1.25rem, 4.5vw, 2rem);
}

.case-loc {
  margin: 0.3rem 0 0;
  color: var(--muted);
}

.case-study-body {
  display: grid;
  gap: 1rem;
}

.case-study-body section {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.9rem;
  padding: 0.9rem;
  background: rgba(255, 255, 255, 0.02);
}

.case-study-body h3 {
  margin: 0 0 0.52rem;
}

.case-study-body p {
  margin: 0 0 0.8rem;
  color: var(--muted);
}

.case-list {
  margin: 0;
  padding-left: 1rem;
  color: var(--muted);
}

.case-list li + li {
  margin-top: 0.22rem;
}

.bda-wrap {
  display: grid;
  gap: 0.6rem;
}

.bda-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.bda-panels {
  display: block;
}

.bda-tab {
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 999px;
  padding: 0.42rem 0.65rem;
  cursor: pointer;
}

.bda-tab.is-active {
  background: var(--accent);
  color: #10141c;
  border-color: var(--accent);
}

.bda-panel {
  display: none;
}

.bda-panel.is-active {
  display: block;
}

.bda-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.bda-grid img {
  width: 100%;
  aspect-ratio: 4 / 3;
  height: auto;
  object-fit: cover;
  border-radius: 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

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

  .bda-grid img {
    aspect-ratio: 4 / 3;
  }
}

.project-map {
  width: 100%;
  min-height: 260px;
  border: 0;
  border-radius: 0.8rem;
}

.stats-grid-large strong {
  font-size: 0.95rem;
}

.stat-services {
  grid-column: 1 / -1;
}

@media (min-width: 860px) {
  .portfolio-card {
    grid-template-rows: 220px auto;
  }

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

  .case-study-body section:first-child {
    grid-column: span 2;
  }

  .case-study-body section:last-child {
    grid-column: span 2;
  }

  .case-study-body section:nth-child(2) {
    grid-column: span 2;
  }
}

/* Final mobile override for portfolio cards */
@media (max-width: 859px) {
  .projects-grid.portfolio-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .projects-grid.portfolio-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
