/* ============================================================
   berg. — Sterk in vastgoed
   ============================================================ */

:root {
  --green: #a3e635;
  --green-dark: #84c41d;
  --bg: #0c0c0c;
  --bg-2: #111111;
  --bg-3: #161616;
  --card: #141414;
  --line: rgba(255, 255, 255, 0.08);
  --line-green: rgba(163, 230, 53, 0.35);
  --text: #f5f5f4;
  --text-dim: #a8a8a3;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* clip, not hidden: never becomes a scroll container */
@supports (overflow-x: clip) {
  html, body { overflow-x: clip; }
}

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

.container {
  width: min(1180px, 92%);
  margin-inline: auto;
}

/* ============ Typography ============ */

.eyebrow {
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 0.9rem;
}

.section-title {
  font-size: clamp(1.9rem, 4vw, 2.9rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.12;
  margin-bottom: 1.4rem;
}

.body-text {
  color: var(--text-dim);
  font-size: 0.98rem;
  max-width: 46ch;
  margin-bottom: 2rem;
}

.body-text strong { color: var(--text); }

/* ============ Buttons ============ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.6rem;
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 4px;
  cursor: pointer;
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out),
              background 0.35s, color 0.35s, border-color 0.35s;
}

.btn .arrow { transition: transform 0.35s var(--ease-out); }
.btn:hover .arrow { transform: translateX(5px); }

.btn-green {
  background: var(--green);
  color: #0c0c0c;
}
.btn-green:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(163, 230, 53, 0.25);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.25);
}
.btn-outline:hover {
  border-color: var(--green);
  color: var(--green);
  transform: translateY(-3px);
}

.btn-outline-green {
  background: transparent;
  color: var(--green);
  border: 1px solid var(--line-green);
}
.btn-outline-green:hover {
  background: var(--green);
  color: #0c0c0c;
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(163, 230, 53, 0.2);
}

.link-more {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  /* reset for the <button> variant used to open service modals */
  background: none;
  border: 0;
  padding: 0;
  font-family: inherit;
  cursor: pointer;
}
.link-more .arrow { transition: transform 0.3s var(--ease-out); }
.link-more:hover .arrow { transform: translateX(5px); }

/* ============ Header ============ */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  padding: 1.1rem 0;
  transition: padding 0.4s, box-shadow 0.4s;
}

/* Blur/background lives on a pseudo-element: backdrop-filter on the header
   itself would become the containing block for the fixed mobile menu. */
.site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(12, 12, 12, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}

.site-header.scrolled {
  padding: 0.7rem 0;
  box-shadow: 0 1px 0 var(--line);
}

.site-header.scrolled::before { opacity: 1; }

.header-inner {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.logo {
  text-decoration: none;
  line-height: 1;
  margin-right: auto;
}

.logo-text {
  display: block;
  font-size: 1.9rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--green);
}

.logo-dot { color: var(--text); }

.logo-sub {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.52rem;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.main-nav {
  display: flex;
  gap: 1.8rem;
}

.nav-link {
  position: relative;
  color: var(--text);
  text-decoration: none;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.3rem 0;
  transition: color 0.3s;
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--green);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s var(--ease-out);
}

.nav-link:hover { color: var(--green); }
.nav-link.active { color: var(--green); }
.nav-link.active::after,
.nav-link:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.btn-header { padding: 0.65rem 1.3rem; border-radius: 999px; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  width: 24px; height: 2px;
  background: var(--text);
  transition: transform 0.3s, opacity 0.3s;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============ Hero ============ */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 70% 40%;
  transform: scale(1.18);
  filter: brightness(0.9) saturate(0.85);
  animation: heroZoom 7s var(--ease-expo) 0.2s forwards;
}

@keyframes heroZoom {
  to { transform: scale(1.02); }
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(8, 8, 8, 0.95) 0%, rgba(8, 8, 8, 0.72) 38%, rgba(8, 8, 8, 0.25) 70%, rgba(8, 8, 8, 0.45) 100%),
    linear-gradient(180deg, rgba(8, 8, 8, 0.55) 0%, transparent 30%, rgba(12, 12, 12, 1) 98%);
}

/* curtain wipe on load */
.hero-curtain {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: var(--bg);
  transform-origin: top;
  animation: curtainUp 1.1s var(--ease-expo) 0.15s forwards;
  pointer-events: none;
}

@keyframes curtainUp {
  to { transform: scaleY(0); }
}

.hero-content {
  position: relative;
  z-index: 6;
  padding-top: 4rem;
}

.hero-title {
  font-size: clamp(4.5rem, 13vw, 9.5rem);
  font-weight: 900;
  letter-spacing: -0.045em;
  line-height: 0.95;
  overflow: hidden;
  display: flex;
}

.hero-letter {
  display: inline-block;
  transform: translateY(110%) rotate(4deg);
  animation: letterUp 0.9s var(--ease-expo) forwards;
}

.hero-letter:nth-child(1) { animation-delay: 0.55s; }
.hero-letter:nth-child(2) { animation-delay: 0.63s; }
.hero-letter:nth-child(3) { animation-delay: 0.71s; }
.hero-letter:nth-child(4) { animation-delay: 0.79s; }
.hero-letter:nth-child(5) { animation-delay: 0.92s; }

.hero-letter-dot { color: var(--green); }

@keyframes letterUp {
  to { transform: translateY(0) rotate(0); }
}

.hero-tagline {
  margin-top: 0.8rem;
  overflow: hidden;
}

.hero-tagline span {
  display: inline-block;
  color: var(--green);
  font-size: clamp(0.85rem, 1.6vw, 1.05rem);
  font-weight: 700;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  transform: translateY(120%);
  animation: letterUp 0.8s var(--ease-expo) 1.05s forwards;
}

.hero-line {
  width: 64px;
  height: 3px;
  background: var(--green);
  margin: 2rem 0;
  transform: scaleX(0);
  transform-origin: left;
  animation: lineGrow 0.8s var(--ease-expo) 1.25s forwards;
}

@keyframes lineGrow {
  to { transform: scaleX(1); }
}

.hero-sub {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text);
  font-weight: 400;
}

.hero-sub-mask {
  display: block;
  overflow: hidden;
}

.hero-sub-mask span {
  display: inline-block;
  transform: translateY(110%);
  animation: letterUp 0.75s var(--ease-expo) forwards;
}

.hero-sub-mask:nth-child(1) span { animation-delay: 1.35s; }
.hero-sub-mask:nth-child(2) span { animation-delay: 1.45s; }

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2.4rem;
  opacity: 0;
  transform: translateY(24px);
  animation: fadeUp 0.9s var(--ease-expo) 1.65s forwards;
}

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

.hero-scroll-hint {
  position: absolute;
  bottom: 2.2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  width: 26px;
  height: 42px;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  border-radius: 14px;
  opacity: 0;
  animation: fadeUp 1s ease 2.3s forwards;
}

.scroll-dot {
  position: absolute;
  top: 7px;
  left: 50%;
  width: 4px;
  height: 8px;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--green);
  animation: scrollDot 1.8s ease-in-out infinite;
}

@keyframes scrollDot {
  0% { transform: translateY(0); opacity: 1; }
  70% { transform: translateY(14px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}

/* ============ Scroll reveal system ============ */

[data-reveal] {
  opacity: 0;
  transition:
    opacity 0.9s var(--ease-expo),
    transform 0.9s var(--ease-expo),
    clip-path 1.1s var(--ease-expo);
  will-change: opacity, transform;
}

[data-reveal="fade-up"]    { transform: translateY(44px); }
[data-reveal="fade-left"]  { transform: translateX(54px); }
[data-reveal="fade-right"] { transform: translateX(-54px); }
[data-reveal="scale-in"]   { transform: scale(0.9); }

[data-reveal="clip-right"] {
  clip-path: inset(0 100% 0 0);
  transform: none;
  opacity: 1;
}

[data-reveal="grow-line"] {
  opacity: 1;
  transform: scaleX(0);
  transform-origin: left;
}

[data-reveal].revealed {
  opacity: 1;
  transform: none;
  clip-path: inset(0 0 0 0);
}

[data-reveal="grow-line"].revealed { transform: scaleX(1); }

/* stagger children inside grouped containers */
[data-reveal-group] > [data-reveal]:nth-child(1) { transition-delay: 0s; }
[data-reveal-group] > [data-reveal]:nth-child(2) { transition-delay: 0.13s; }
[data-reveal-group] > [data-reveal]:nth-child(3) { transition-delay: 0.26s; }
[data-reveal-group] > [data-reveal]:nth-child(4) { transition-delay: 0.39s; }

[data-stagger] > * {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease-expo), transform 0.7s var(--ease-expo);
}

[data-stagger].revealed > *:nth-child(1) { transition-delay: 0.05s; }
[data-stagger].revealed > *:nth-child(2) { transition-delay: 0.18s; }
[data-stagger].revealed > *:nth-child(3) { transition-delay: 0.31s; }

[data-stagger].revealed > * {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-delay: 0s !important;
    transition-duration: 0.001s !important;
    transition-delay: 0s !important;
  }
  [data-reveal], [data-stagger] > * { opacity: 1; transform: none; clip-path: none; }
}

/* ============ Sections ============ */

.section {
  padding: 6.5rem 0;
  overflow-x: clip; /* pre-reveal transforms must never widen the page */
}

/* ---- About ---- */

.about { background: var(--bg-2); }

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 4rem;
  align-items: center;
}

.about-img-wrap {
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.about-img-wrap img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  transition: transform 0.8s var(--ease-out);
}

.about-img-wrap:hover img { transform: scale(1.04); }

.about-badges {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.6rem;
}

.badge-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
}

.badge-item svg {
  width: 22px;
  height: 22px;
  color: var(--green);
  flex-shrink: 0;
}

/* ---- Services ---- */

.services { background: var(--bg); }

.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.2rem;
  margin-top: 2.5rem;
}

.service-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 2rem 1.5rem;
  transition: transform 0.45s var(--ease-out), border-color 0.45s, box-shadow 0.45s;
}

.service-card:hover {
  transform: translateY(-8px);
  border-color: var(--line-green);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45);
}

.service-icon {
  width: 64px;
  height: 64px;
  margin-bottom: 1.5rem;
  color: var(--green);
  transition: transform 0.45s var(--ease-out);
}

.service-card:hover .service-icon { transform: translateY(-4px) scale(1.06); }

.service-icon svg { width: 100%; height: 100%; }

.service-card h3 {
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.service-num { color: var(--green); }

.service-card p {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-bottom: 1.4rem;
  flex: 1;
}

/* pin the link to the card bottom so all four align */
.service-card .link-more { margin-top: auto; }

/* ---- Projects ---- */

.projects { background: var(--bg-2); }

.projects-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.projects-head .section-title { margin-bottom: 0; }

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
}

.project-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.5s var(--ease-out), border-color 0.5s, box-shadow 0.5s;
}

.project-card:hover {
  transform: translateY(-8px);
  border-color: var(--line-green);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.5);
}

.project-img {
  overflow: hidden;
  aspect-ratio: 16 / 11;
}

.project-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease-out), filter 0.8s;
}

.project-card:hover .project-img img {
  transform: scale(1.07);
  filter: brightness(1.08);
}

.project-info { padding: 1.5rem 1.5rem 1.7rem; }

.project-info h3 {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 0.3rem;
}

.project-info p {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-bottom: 1.1rem;
}

.arrow-long { font-size: 1.1em; }

/* ---- Why ---- */

.why { background: var(--bg); }

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

.title-line {
  width: 64px;
  height: 3px;
  background: var(--green);
  margin-top: 0.6rem;
}

.why-features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.2rem;
}

.why-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.7rem 1.5rem;
  transition: transform 0.45s var(--ease-out), border-color 0.45s;
}

.why-item:hover {
  transform: translateY(-4px);
  border-color: var(--line-green);
}

.why-item svg {
  width: 34px;
  height: 34px;
  color: var(--green);
  margin-bottom: 0.9rem;
}

.why-item h3 {
  font-size: 0.95rem;
  font-weight: 800;
  margin-bottom: 0.3rem;
}

.why-item p {
  color: var(--text-dim);
  font-size: 0.85rem;
}

/* ---- Contact ---- */

.contact {
  background: var(--bg-3);
  border-top: 1px solid var(--line);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 4rem;
  align-items: start;
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  margin-bottom: 2.2rem;
}

.contact-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.contact-item svg {
  width: 22px;
  height: 22px;
  color: var(--green);
  flex-shrink: 0;
  margin-top: 0.2rem;
}

.contact-item span {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.15rem;
}

.contact-item a, .contact-item p {
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  transition: color 0.3s;
}

.contact-item a:hover { color: var(--green); }

.contact-map {
  background: #101010;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.map-svg { display: block; width: 100%; height: 190px; }

/* ---- Contact form ---- */

.contact-form-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 2.2rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem 1rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.form-field-full { grid-column: 1 / -1; }

.form-field label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  background: #0f0f0f;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95rem;
  padding: 0.8rem 0.95rem;
  transition: border-color 0.3s, box-shadow 0.3s;
  color-scheme: dark;
}

.form-field input::placeholder,
.form-field textarea::placeholder { color: #565650; }

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--line-green);
  box-shadow: 0 0 0 3px rgba(163, 230, 53, 0.08);
}

.form-field textarea { resize: vertical; min-height: 120px; }

.btn-submit {
  width: 100%;
  justify-content: center;
  margin-top: 1.4rem;
  border: 0;
}

.hp-field {
  position: absolute;
  left: -5000px;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.form-status {
  display: none;
  margin-top: 1rem;
  padding: 0.8rem 1rem;
  border-radius: 5px;
  font-size: 0.9rem;
}

.form-status.show { display: block; }

.form-status.success {
  background: rgba(163, 230, 53, 0.1);
  border: 1px solid rgba(163, 230, 53, 0.35);
  color: var(--green);
}

.form-status.error {
  background: rgba(255, 107, 107, 0.08);
  border: 1px solid rgba(255, 107, 107, 0.3);
  color: #ff8a8a;
}

.form-note {
  margin-top: 0.9rem;
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* ============ Footer ============ */

.site-footer {
  background: var(--bg);
  border-top: 1px solid var(--line);
  padding: 2.2rem 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.footer-inner .logo { margin-right: auto; }
.footer-inner .logo-text { font-size: 1.4rem; }

.footer-copy {
  color: var(--text-dim);
  font-size: 0.78rem;
}

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

.footer-nav a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color 0.3s;
}

.footer-nav a:hover { color: var(--green); }

.footer-social {
  color: var(--text-dim);
  transition: color 0.3s, transform 0.3s;
}

.footer-social svg { width: 20px; height: 20px; }
.footer-social:hover { color: var(--green); transform: translateY(-2px); }

/* ============ Service modal ============ */

.service-modal {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(560px, 90vw);
  max-height: min(680px, 86vh);
  padding: 3.2rem 3rem 2.8rem;
  border: 1px solid var(--line-green);
  border-radius: 18px;
  background:
    radial-gradient(120% 160% at 0% 0%, rgba(163, 230, 53, 0.08), transparent 55%),
    var(--card);
  color: var(--text);
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(163, 230, 53, 0.05);
  overflow: hidden auto;

  /* closed state: JS toggles .is-visible for the entrance/exit transition,
     then calls dialog.close() once the transition has finished */
  opacity: 0;
  transform: translateY(28px) scale(0.96);
  transition: opacity 0.4s var(--ease-expo), transform 0.4s var(--ease-expo);
}

.service-modal.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.service-modal::backdrop {
  background: rgba(5, 5, 5, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.service-modal.is-visible::backdrop { opacity: 1; }

.modal-glow {
  position: absolute;
  top: -120px;
  right: -120px;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(163, 230, 53, 0.16), transparent 70%);
  pointer-events: none;
}

.modal-close {
  position: absolute;
  top: 1.3rem;
  right: 1.3rem;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text-dim);
  cursor: pointer;
  transition: border-color 0.3s, color 0.3s, transform 0.3s var(--ease-out);
}

.modal-close:hover {
  color: var(--green);
  border-color: var(--line-green);
  transform: rotate(90deg);
}

.modal-close svg { width: 16px; height: 16px; }

.modal-icon {
  width: 56px;
  height: 56px;
  margin-bottom: 1.4rem;
  color: var(--green);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s var(--ease-out) 0.1s, transform 0.5s var(--ease-out) 0.1s;
}

.service-modal.is-visible .modal-icon { opacity: 1; transform: translateY(0); }

.modal-icon svg { width: 100%; height: 100%; }

.modal-eyebrow { margin-bottom: 0.6rem; }

.modal-title {
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 0.9rem;
}

.modal-lead {
  color: var(--text-dim);
  font-size: 0.95rem;
  max-width: 44ch;
  margin-bottom: 1.6rem;
}

.modal-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-bottom: 2.2rem;
}

.modal-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  font-size: 0.88rem;
  color: var(--text);
}

.modal-list li::before {
  content: '';
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  margin-top: 0.45em;
  border-radius: 50%;
  background: var(--green);
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

/* ============ Projects modal ============ */

.projects-modal {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(960px, 94vw);
  max-height: min(760px, 88vh);
  padding: 2.6rem 2.6rem 2.2rem;
  border: 1px solid var(--line-green);
  border-radius: 18px;
  background:
    radial-gradient(120% 160% at 0% 0%, rgba(163, 230, 53, 0.08), transparent 55%),
    var(--card);
  color: var(--text);
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(163, 230, 53, 0.05);
  display: flex;
  flex-direction: column;
  overflow: hidden;

  opacity: 0;
  transform: translateY(28px) scale(0.96);
  transition: opacity 0.4s var(--ease-expo), transform 0.4s var(--ease-expo);
}

.projects-modal.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.projects-modal::backdrop {
  background: rgba(5, 5, 5, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.projects-modal-head {
  padding-right: 2.5rem;
  margin-bottom: 1.6rem;
  flex-shrink: 0;
}

.projects-modal-head .modal-title { margin-bottom: 0.5rem; }
.projects-modal-head .modal-lead { margin-bottom: 0; max-width: 56ch; }

.projects-modal-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  align-items: center;
  margin-bottom: 1rem;
  flex-shrink: 0;
}

.project-search {
  position: relative;
  flex: 1 1 240px;
  min-width: 200px;
}

.project-search svg {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: var(--text-dim);
  pointer-events: none;
}

.project-search input {
  width: 100%;
  background: #0f0f0f;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
  padding: 0.7rem 1rem 0.7rem 2.6rem;
  color-scheme: dark;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.project-search input::placeholder { color: #565650; }

.project-search input:focus {
  outline: none;
  border-color: var(--line-green);
  box-shadow: 0 0 0 3px rgba(163, 230, 53, 0.08);
}

/* clear the native × affordance so it doesn't clash with the search icon */
.project-search input::-webkit-search-cancel-button { -webkit-appearance: none; }

.projects-modal-count {
  color: var(--text-dim);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  flex-shrink: 0;
}

.projects-modal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  /* without this, a height-constrained grid inside the shrunk flex item
     below compresses "auto" rows to fit its own box instead of sizing
     them to content and scrolling past it — min-content pins each row
     to its card's real height no matter how little space is available. */
  grid-auto-rows: min-content;
  align-content: start;
  gap: 1.1rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  /* flex children default to min-height:auto, which stops them from ever
     shrinking below their content size — that pushed the grid past the
     dialog's max-height and got hard-clipped by its overflow:hidden
     instead of scrolling. flex:1 + min-height:0 makes it the one part
     of the dialog that actually scrolls. */
  flex: 1 1 auto;
  min-height: 0;
  margin: -0.2rem;
  padding: 0.2rem 0.2rem 1rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(163, 230, 53, 0.35) transparent;
}

.projects-modal-grid::-webkit-scrollbar { width: 8px; }
.projects-modal-grid::-webkit-scrollbar-track { background: transparent; }
.projects-modal-grid::-webkit-scrollbar-thumb {
  background: rgba(163, 230, 53, 0.3);
  border-radius: 999px;
}
.projects-modal-grid::-webkit-scrollbar-thumb:hover { background: rgba(163, 230, 53, 0.5); }

.modal-project-card {
  background: #101010;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.35s var(--ease-out), border-color 0.35s;
  scroll-margin: 1rem;
}

.modal-project-card:hover { transform: translateY(-3px); border-color: var(--line-green); }

.modal-project-card.is-focused {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(163, 230, 53, 0.18);
}

.modal-project-img { aspect-ratio: 4 / 3; overflow: hidden; position: relative; }

.modal-project-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-out);
}

.modal-project-card:hover .modal-project-img img { transform: scale(1.06); }

.project-tag {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  background: rgba(12, 12, 12, 0.75);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(163, 230, 53, 0.35);
  color: var(--green);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
}

.modal-project-info { padding: 1rem 1.1rem 1.1rem; }

.modal-project-info h4 {
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 0.2rem;
}

.modal-project-location {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-dim);
  font-size: 0.72rem;
  margin-bottom: 0.5rem;
}

.modal-project-location svg { width: 12px; height: 12px; flex-shrink: 0; }

.modal-project-info p.modal-project-desc {
  color: var(--text-dim);
  font-size: 0.8rem;
  margin-bottom: 0.8rem;
}

.modal-project-cta {
  font-size: 0.68rem;
}

.projects-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  color: var(--text-dim);
  text-align: center;
  padding: 3rem 1rem;
}

/* [hidden] and .projects-empty{display:flex} have equal specificity, and
   this stylesheet loads after the UA sheet — without this, the unconditional
   display:flex above always won the tie and the empty state showed even
   with results in the grid. This wins by specificity, not source order. */
.projects-empty[hidden] { display: none; }

.projects-empty svg { width: 34px; height: 34px; opacity: 0.5; }
.projects-empty p { font-size: 0.9rem; max-width: 32ch; }

/* ============ Responsive ============ */

@media (max-width: 960px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .projects-grid { grid-template-columns: 1fr 1fr; }
  .about-grid, .why-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .contact-grid { grid-template-columns: 1fr; gap: 3rem; }
  .btn-header { display: none; }
  .projects-modal-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 680px) {
  .section { padding: 4.5rem 0; }
  .services-grid, .projects-grid { grid-template-columns: 1fr; }
  .why-features { grid-template-columns: 1fr; }
  .about-badges { flex-wrap: wrap; justify-content: flex-start; gap: 0.7rem; }
  .form-grid { grid-template-columns: 1fr; }
  .contact-form-card { padding: 1.6rem; }

  /* ---- Modals go full-screen on mobile ----
     A small centered card leaves almost no room for the service text or
     the project grid on short/narrow phones (verified: the project grid
     had ~100px of visible height at 375×600). Instead both dialogs become
     a full-width panel that slides in from the right, like a side menu
     that happens to cover the whole screen. */
  .service-modal,
  .projects-modal {
    inset: 0;
    margin: 0;
    width: 100%;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    border-radius: 0;
    border: 0;
    border-left: 1px solid var(--line-green);
    box-shadow: none;
    padding: 0.9rem 1.3rem 2rem;
    opacity: 1;
    transform: translateX(100%);
    transition: transform 0.45s var(--ease-expo);
  }

  .service-modal.is-visible,
  .projects-modal.is-visible {
    transform: translateX(0);
  }

  .service-modal::backdrop,
  .projects-modal::backdrop {
    /* the panel covers the full screen anyway; this only shows briefly
       while it slides in, so a plain dim is enough (skip the blur cost) */
    background: rgba(5, 5, 5, 0.5);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  /* the close button becomes an in-flow sticky bar instead of an absolute
     circle overlaid on the title — on a narrow screen that overlay could
     run into the title text; sticky keeps it reachable while the panel's
     own content (service text, or just the grid) scrolls beneath it */
  .service-modal .modal-close,
  .projects-modal .modal-close {
    position: sticky;
    top: 0;
    flex-shrink: 0;
    margin: 0 0 0.6rem auto;
    background: var(--card);
    z-index: 2;
  }

  .projects-modal {
    /* the dialog itself no longer scrolls (only #projectsGrid does), so
       the sticky close button just sits at its normal in-flow position */
    display: flex;
    flex-direction: column;
  }

  .projects-modal-head { padding-right: 0; }
  .projects-modal-grid { grid-template-columns: 1fr; padding-bottom: 1rem; }

  /* frees up vertical space for the project cards themselves on short screens */
  .projects-modal-intro { display: none; }

  .main-nav {
    position: fixed;
    inset: 0;
    z-index: 105;
    background: rgba(10, 10, 10, 0.97);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2.2rem;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.35s, visibility 0.35s;
  }

  .main-nav.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .main-nav .nav-link {
    font-size: 1.05rem;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out), color 0.3s;
  }

  .main-nav.open .nav-link {
    opacity: 1;
    transform: translateY(0);
  }

  .main-nav.open .nav-link:nth-child(1) { transition-delay: 0.05s; }
  .main-nav.open .nav-link:nth-child(2) { transition-delay: 0.11s; }
  .main-nav.open .nav-link:nth-child(3) { transition-delay: 0.17s; }
  .main-nav.open .nav-link:nth-child(4) { transition-delay: 0.23s; }
  .main-nav.open .nav-link:nth-child(5) { transition-delay: 0.29s; }

  .nav-toggle {
    display: flex;
    position: relative;
    z-index: 110;
  }

  body.nav-open { overflow: hidden; }
}
