:root {
  color-scheme: dark;

  --accent: #206648;
  --accent-eyebrow: #40c1899e;
  --accent-rgb: 32, 102, 72;
  --green: #206648;

  --bg: #081314;
  --bg-deep: #050b0c;
  --bg-soft: #0b1718;
  --panel: rgba(10, 24, 28, 0.72);
  --panel-strong: rgba(13, 31, 35, 0.9);

  --text: #f2f7f8;
  --muted: #a9babf;
  --text-muted: #a9babf;

  --line: rgba(32, 102, 72, 0.2);
  --line-strong: rgba(32, 102, 72, 0.38);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);

  --max-width: 1180px;
  --header-height: 76px;

  scroll-padding-top: calc(var(--header-height) + 18px);
}

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

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

body {
  margin: 0;
  overflow-x: clip;
  background:
    radial-gradient(circle at 16% 8%, rgba(var(--accent-rgb), 0.18), transparent 34rem),
    radial-gradient(circle at 82% 36%, rgba(var(--accent-rgb), 0.08), transparent 46rem),
    linear-gradient(
      180deg,
      #0d1819 0%,
      #0b1516 32%,
      #091314 68%,
      #060d0e 100%
    );
  color: var(--text);
  font-family: Inter, "Open Sans", Arial, sans-serif;
  line-height: 1.6;
}

@supports not (overflow: clip) {
  html,
  body {
    overflow-x: hidden;
  }
}

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

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  line-height: 1.12;
  letter-spacing: 0;
}

h1 {
  max-width: 840px;
  margin-bottom: 22px;
  font-size: clamp(2.4rem, 5vw, 4.25rem);
}

h2 {
  margin-bottom: 18px;
  font-size: clamp(1.8rem, 3vw, 2.75rem);
}

h3 {
  margin-bottom: 8px;
  font-size: 1.08rem;
}

p {
  color: var(--muted);
}

a {
  color: inherit;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(var(--accent-rgb), 0.75);
  outline-offset: 4px;
}

#about,
#services,
#carousel_2a36,
#contact {
  scroll-margin-top: calc(var(--header-height) + 18px);
}

/* 3. Layout primitives */
.container,
.section-inner {
  width: min(var(--max-width), calc(100% - 40px));
  margin-inline: auto;
}

.hero-eyebrow {
  margin-bottom: 12px;
  color: var(--text);
  font-size: 2.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow {
  margin-bottom: 12px;
  color: var(--accent-eyebrow);
  font-size: 2.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition:
    border-color 180ms ease,
    background 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  background: var(--accent);
  color: #f4fbf7;
  box-shadow: 0 0 24px rgba(var(--accent-rgb), 0.2);
}

.button-primary:hover,
.button-primary:focus-visible {
  background: #287958;
  box-shadow: 0 0 30px rgba(var(--accent-rgb), 0.35);
}

.button-secondary {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.button-secondary:hover,
.button-secondary:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

.text-link {
  margin-top: auto;
  margin-bottom: auto;
  color: var(--text);
  font-weight: 800;
  text-decoration-color: var(--accent);
  text-underline-offset: 4px;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: var(--header-height);
  padding: 14px max(1rem, calc((100% - var(--max-width)) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(5, 13, 15, 0.92);
  backdrop-filter: blur(16px);
  overflow: visible;
}

.brand {
  display: inline-flex;
  align-items: center;
}

.brand img {
  width: auto;
  height: 42px;
}

.site-nav,
.footer-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-nav a,
.footer-links a {
  padding: 8px 10px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 800;
  text-decoration: none;
  transition: color 180ms ease;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.footer-links a:hover,
.footer-links a:focus-visible {
  color: var(--accent);
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 999px;
  background: var(--text);
  transition: transform 180ms ease, opacity 180ms ease;
}

.nav-toggle.is-open {
  border-color: rgba(var(--accent-rgb), 0.75);
  background: rgba(var(--accent-rgb), 0.1);
}

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

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

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

.hero {
  position: relative;
  display: grid;
  align-items: center;
  min-height: min(720px, calc(100vh - var(--header-height)));
  overflow: hidden;
  border-bottom: 0;
  background: #071114;
  isolation: isolate;
}

.hero-bg,
.hero-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-bg {
  z-index: 0;
  object-fit: cover;
  object-position: center;
  opacity: 0.68;
  filter: none;
}

.hero-overlay {
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(7, 17, 20, 0.54), rgba(7, 17, 20, 0.24) 52%, rgba(7, 17, 20, 0.38)),
    radial-gradient(ellipse at center, rgba(var(--accent-rgb), 0.08), rgba(7, 17, 20, 0.24) 76%);
}

.hero::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  z-index: 2;
  height: clamp(130px, 18vw, 240px);
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(11, 21, 22, 0) 0%,
    rgba(11, 21, 22, 0.52) 58%,
    #0b1516 100%
  );
}

.hero-content {
  position: relative;
  z-index: 3;
  padding-block: clamp(88px, 12vw, 138px);
}

.hero-lead {
  max-width: 700px;
  color: #d6e5e8;
  font-size: 1.16rem;
}

.hero-actions,
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.expertise-section {
  position: relative;
  padding-block: clamp(56px, 8vw, 100px);
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, #0b1516 0%, rgba(11, 21, 22, 0.82) 52%, rgba(9, 19, 20, 0.72) 100%);
}

.expertise-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}

.about-copy {
  align-self: start;
  max-width: 640px;
}

.about-copy > h2 {
  margin-bottom: 15px;
}

.about-copy p:last-of-type {
  margin-bottom: 0;
}

.about-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 1.5rem;
}

.service-column {
  min-width: 0;
}

.service-column > h2 {
  max-width: 620px;
}

.service-rail {
  display: grid;
  gap: 14px;
  margin-top: 28px;
}

.service-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: start;
  min-width: 0;
  padding: 18px 20px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(var(--accent-rgb), 0.13), rgba(255, 255, 255, 0.025)),
    rgba(10, 24, 28, 0.76);
  opacity: 0;
  transform: translateX(28px);
  transition:
    opacity 620ms ease,
    transform 620ms cubic-bezier(0.19, 1, 0.22, 1),
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.service-card.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.service-card:hover,
.service-card:focus-within {
  border-color: rgba(var(--accent-rgb), 0.75);
  background:
    linear-gradient(135deg, rgba(var(--accent-rgb), 0.2), rgba(255, 255, 255, 0.035)),
    rgba(11, 28, 32, 0.88);
}

.service-card:nth-child(1) {
  transition-delay: 60ms;
}

.service-card:nth-child(2) {
  transition-delay: 120ms;
}

.service-card:nth-child(3) {
  transition-delay: 180ms;
}

.service-card:nth-child(4) {
  transition-delay: 240ms;
}

.service-card:nth-child(5) {
  transition-delay: 300ms;
}

.service-icon {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.service-card h3 {
  margin: 0 0 6px;
  color: var(--text);
}

.service-card p {
  margin-bottom: 0;
  font-size: 0.94rem;
}

.about-snapshot {
  margin-top: clamp(1.75rem, 4vw, 2.5rem);
  padding: 1.25rem;
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  border-radius: 0.75rem;
  background: rgba(7, 17, 20, 0.62);
}

.snapshot-label {
  margin: 0 0 1rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.snapshot-list {
  display: grid;
  gap: 0.95rem;
}

.snapshot-item {
  display: grid;
  gap: 0.25rem;
}

.snapshot-item strong {
  color: #fff;
  font-size: 0.95rem;
}

.snapshot-item span {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.projects-section {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-block: clamp(4rem, 8vw, 7rem);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--text);
  background: #081314;
}

.projects-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0.58;
  filter: none;
}

.projects-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, #091314 0%, rgba(9, 19, 20, 0) 16%, rgba(9, 19, 20, 0) 82%, #081314 100%),
    linear-gradient(90deg, rgba(7, 17, 20, 0.56), rgba(7, 17, 20, 0.26) 52%, rgba(7, 17, 20, 0.46)),
    radial-gradient(ellipse at center, rgba(var(--accent-rgb), 0.08), rgba(7, 17, 20, 0.34) 78%);
}

.projects-content {
  position: relative;
  z-index: 2;
}

.projects-header {
  max-width: 760px;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}

.projects-header .eyebrow {
  margin-bottom: 8px;
  text-align: center;
}

.projects-header h2 {
  margin-bottom: 1rem;
}

.projects-header p:last-child {
  max-width: 680px;
  color: var(--muted);
}

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

.project-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100%;
  margin-bottom: 20px;
  padding: 10px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 18px;
  text-align: center;
  background: transparent;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.project-card:hover,
.project-card:focus-within {
  transform: translateY(-4px);
  border-color: rgba(var(--accent-rgb), 0.72);
  background:
    linear-gradient(180deg, rgba(var(--accent-rgb), 0.22), rgba(255, 255, 255, 0.025)),
    rgba(7, 17, 20, 0.42);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
}

.project-card > img {
  width: 100%;
  height: 160px;
  padding: 1.6rem;
  object-fit: contain;
  background: transparent;
}

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

.project-card h3 {
  margin: 0 0 0.65rem;
  color: var(--text);
  font-size: 1.1rem;
}

.project-card p {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.65;
}

.project-card dl {
  display: grid;
  gap: 0.75rem;
  margin: 0 0 1.25rem;
}

.project-card dt {
  color: var(--green);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project-card dd {
  margin: 0;
  color: #d4e2e5;
  font-size: 0.92rem;
  line-height: 1.5;
}

.contact-section {
  padding-block: clamp(64px, 8vw, 96px);
  background:
    radial-gradient(circle at 18% 0%, rgba(var(--accent-rgb), 0.14), transparent 32rem),
    linear-gradient(180deg, #081314 0%, #071114 100%);
}

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 36px;
  align-items: center;
}

.contact-grid p {
  max-width: 620px;
}

.contact-actions {
  justify-content: flex-end;
  margin-top: 0;
}

/* 10. Modal */
.modal[hidden] {
  display: none;
}

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

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 8, 10, 0.78);
  backdrop-filter: blur(10px);
}

.modal-panel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(100%, 980px);
  height: min(88vh, 820px);
  overflow: hidden;
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  border-radius: 12px;
  background: rgba(7, 17, 20, 0.96);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.55);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.2rem;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.cv-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #111;
}

body.modal-open {
  overflow: hidden;
}

/* 11. Footer */
.site-footer {
  padding-block: 42px;
  border-top: 1px solid var(--line);
  background: #050c0f;
}

.footer-inner {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto;
  gap: 22px;
  align-items: center;
}

.footer-mark {
  display: inline-flex;
}

.footer-mark img {
  width: 54px;
  height: 54px;
}

.footer-name {
  margin-bottom: 2px;
  color: var(--text);
  font-weight: 800;
}

.copyright {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.92rem;
  text-align: center;
}

@media (max-width: 960px) {
  :root {
    --header-height: 68px;
  }

  .site-header {
    min-height: var(--header-height);
    padding: 10px 1rem;
  }

  .brand {
    min-width: 0;
  }

  .brand img {
    height: 42px;
  }

  .expertise-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .about-copy {
    max-width: 760px;
  }

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

  .contact-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    right: 0;
    z-index: 1001;
    display: none;
    align-items: stretch;
    flex-direction: column;
    gap: 0;
    max-height: calc(100vh - var(--header-height) - 1rem);
    overflow-y: auto;
    padding: 10px 1rem 16px;
    border-bottom: 1px solid var(--line);
    background: rgba(7, 17, 20, 0.98);
    box-shadow: 0 22px 44px rgba(0, 0, 0, 0.36);
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    width: 100%;
    padding: 12px 0;
  }

  body.nav-open {
    overflow-x: clip;
  }

  .hero {
    min-height: 620px;
  }

  .hero-content {
    padding-block: 84px 70px;
  }

  .hero::after {
    height: 170px;
  }

  .eyebrow,
  .hero-eyebrow {
    font-size: clamp(1.6rem, 10vw, 2.78rem);
  }

  .service-card {
    transform: translateY(22px);
  }

  .service-card.is-visible {
    transform: translateY(0);
  }

  .projects-grid {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 1.25rem;
  }

  .project-card {
    min-height: 0;
    height: auto;
    margin-bottom: 0;
    padding: 0.9rem;
    background: rgba(7, 17, 20, 0.28);
  }

  .project-card:hover,
  .project-card:focus-within {
    transform: none;
  }

  .project-card > img {
    width: 100%;
    height: auto;
    max-height: 170px;
    padding: 0.7rem;
    object-fit: contain;
  }

  .project-card-body {
    padding: 0.9rem 0.5rem 0.3rem;
  }

  .project-card::before,
  .project-card::after,
  .projects-section::before,
  .projects-section::after {
    display: none;
    content: none;
  }

  .projects-bg {
    z-index: 0;
    object-position: center top;
    opacity: 0.44;
  }

  .projects-overlay {
    z-index: 1;
    background:
      linear-gradient(180deg, #091314 0%, rgba(9, 19, 20, 0.36) 18%, rgba(9, 19, 20, 0.36) 82%, #081314 100%),
      rgba(7, 17, 20, 0.42);
  }

  .projects-content {
    z-index: 2;
  }

  .footer-inner {
    grid-template-columns: 1fr;
  }

  .footer-links {
    align-items: flex-start;
    flex-direction: column;
    gap: 0;
  }

  .footer-links a {
    padding-left: 0;
  }
}

@media (max-width: 520px) {
  .container,
  .section-inner {
    width: min(100% - 1.5rem, var(--max-width));
  }

  .hero {
    min-height: 560px;
  }

  .button {
    width: 100%;
  }

  .service-card {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px;
  }

  .service-icon {
    width: 38px;
    height: 38px;
  }

  .projects-section {
    padding-block: 4rem;
  }

  .project-card > img {
    max-height: 140px;
  }

  .modal {
    padding: 12px;
  }

  .modal-panel {
    height: min(90vh, 760px);
  }

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

  .modal-actions,
  .modal-actions .button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .service-card {
    opacity: 1;
    transform: none;
  }
}
