:root {
  --bg: #f6f3ee;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-strong: rgba(255, 255, 255, 0.9);
  --text: #111418;
  --muted: #5d6670;
  --line: rgba(17, 20, 24, 0.1);
  --line-strong: rgba(17, 20, 24, 0.18);
  --accent: #d96a2b;
  --accent-soft: rgba(217, 106, 43, 0.12);
  --shadow: 0 24px 80px rgba(25, 30, 38, 0.12);
  --max-width: 1180px;
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(217, 106, 43, 0.18), transparent 28%),
    radial-gradient(circle at 85% 14%, rgba(18, 140, 126, 0.1), transparent 24%),
    linear-gradient(180deg, #faf7f2 0%, #f3efe8 54%, #ece7e0 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.22)),
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 119px,
      rgba(17, 20, 24, 0.03) 119px,
      rgba(17, 20, 24, 0.03) 120px
    );
  pointer-events: none;
  opacity: 0.5;
}

section[id] {
  scroll-margin-top: 1rem;
}

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

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

.page-glow {
  position: fixed;
  width: 34rem;
  height: 34rem;
  border-radius: 50%;
  filter: blur(70px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.38;
}

.page-glow-one {
  left: -12rem;
  top: -10rem;
  background: rgba(217, 106, 43, 0.22);
}

.page-glow-two {
  right: -12rem;
  top: 16rem;
  background: rgba(31, 123, 116, 0.15);
}

.site-shell {
  width: min(calc(100% - 2rem), var(--max-width));
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem 0;
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(16px);
  margin-bottom: 1.5rem;
}

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

.brand-mark {
  display: block;
  width: clamp(4rem, 7vw, 5.5rem);
  height: auto;
  flex: 0 0 auto;
  filter: drop-shadow(0 10px 18px rgba(12, 34, 24, 0.16));
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}

.brand-copy strong,
.eyebrow,
h1,
h2,
h3 {
  font-family: "Syne", sans-serif;
}

.brand-copy span:last-child,
.topnav a,
.hero-text,
.section-note,
.service-grid p,
.coverage-card p,
.process-list p,
.contact-panel p,
.contact-card p,
.lightbox-copy p,
.hero-frame-copy p,
.metrics span {
  color: var(--muted);
}

.brand-copy strong {
  font-size: clamp(1.45rem, 2.2vw, 2.15rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 0.96;
}

.brand-copy span:last-child {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.topnav {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.35rem;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.52);
  border-radius: 999px;
  box-shadow: 0 8px 30px rgba(21, 25, 31, 0.06);
}

.topnav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 1rem;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.topnav a:hover,
.topnav a:focus-visible {
  background: var(--text);
  color: #fff;
  transform: translateY(-1px);
}

.hero,
.archive-hero {
  padding: 3rem 0 1rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 1.4rem;
  align-items: stretch;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.eyebrow::before {
  content: "";
  width: 32px;
  height: 1px;
  background: currentColor;
}

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

h1 {
  max-width: 10ch;
  margin-bottom: 1rem;
  font-size: clamp(3.3rem, 8vw, 6.4rem);
  line-height: 1.04;
  letter-spacing: -0.04em;
}

h2 {
  max-width: 11ch;
  margin-bottom: 0.75rem;
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

h3 {
  margin-bottom: 0.55rem;
  font-size: 1.35rem;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.hero-text {
  max-width: 60ch;
  font-size: 1.08rem;
  line-height: 1.75;
}

.hero-copy h1 {
  line-height: 1.08;
  padding-bottom: 0.08em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0.95rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, border-color 180ms ease;
}

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

.button-primary {
  border-color: transparent;
  background: var(--text);
  color: #fff;
  box-shadow: 0 18px 34px rgba(17, 20, 24, 0.16);
}

.button-secondary {
  background: rgba(255, 255, 255, 0.48);
}

.hero-panel,
.service-grid article,
.coverage-card,
.process-list article,
.contact-card,
.project-card,
.lightbox {
  border: 1px solid rgba(255, 255, 255, 0.58);
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-panel {
  display: grid;
  gap: 1rem;
  padding: 1.15rem;
}

.hero-frame {
  min-height: 330px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.35rem;
  border-radius: calc(var(--radius-xl) - 8px);
  background:
    linear-gradient(145deg, rgba(17, 20, 24, 0.92), rgba(38, 44, 52, 0.82)),
    radial-gradient(circle at top right, rgba(217, 106, 43, 0.24), transparent 38%);
  color: #f5f0e8;
  overflow: hidden;
  position: relative;
}

.hero-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(145deg, rgba(10, 14, 18, 0.78), rgba(26, 31, 36, 0.58)),
    linear-gradient(180deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.34)),
    var(--hero-frame-image, url("./assets/projects/refinery-01.webp"));
  background-repeat: no-repeat;
  background-size: cover, cover, cover;
  background-position: center, center, center;
  opacity: 0.96;
  transform: scale(1.02);
  transition: opacity 420ms ease, transform 5.8s ease;
}

.hero-frame.is-transitioning::before {
  opacity: 0.2;
  transform: scale(1.08);
}

.hero-frame::after {
  content: "";
  position: absolute;
  inset: auto -18% -28% auto;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(217, 106, 43, 0.24), transparent 68%);
  z-index: 0;
}

.hero-frame-copy {
  max-width: 28ch;
  position: relative;
  z-index: 1;
}

.hero-frame-copy p {
  margin-bottom: 0;
  font-size: 1rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.78);
}

.hero-frame-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.hero-frame-grid span,
.coverage-tags span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.75rem 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  backdrop-filter: blur(12px);
}

.metrics {
  display: grid;
  gap: 0.75rem;
}

.metrics article {
  padding: 1rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.45);
}

.metrics strong {
  display: block;
  margin-bottom: 0.3rem;
  font-family: "Syne", sans-serif;
  font-size: 1.05rem;
}

.section {
  padding: 3rem 0;
}

.section-heading {
  margin-bottom: 1.5rem;
}

.section-heading-inline {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
}

.section-note {
  max-width: 30ch;
  line-height: 1.7;
}

.project-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.project-search {
  display: grid;
  gap: 0.5rem;
  min-width: min(100%, 520px);
}

.project-search span,
.project-results-count {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.project-search-input {
  width: 100%;
  min-height: 52px;
  padding: 0.95rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.65);
  color: var(--text);
  font: inherit;
}

.project-results-count {
  margin: 0;
}

.archive-hero h1 {
  max-width: 11ch;
}

.service-grid,
.project-grid,
.coverage,
.contact {
  display: grid;
  gap: 1rem;
}

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

.service-grid article {
  padding: 1.35rem;
}

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

.project-card {
  appearance: none;
  width: 100%;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.58);
  color: inherit;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.project-card:hover,
.project-card:focus-visible {
  border-color: rgba(217, 106, 43, 0.35);
  box-shadow: 0 28px 60px rgba(25, 30, 38, 0.14);
}

.project-image {
  position: relative;
  aspect-ratio: 1.12 / 1;
  overflow: hidden;
}

.project-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 42%, rgba(9, 12, 14, 0.16) 100%);
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 280ms ease;
}

.project-card:hover .project-image img,
.project-card:focus-visible .project-image img {
  transform: scale(1.04);
}

.project-copy {
  padding: 1.15rem;
}

.project-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.8rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.project-copy p:last-child {
  margin-bottom: 0;
  line-height: 1.7;
  color: var(--muted);
}

.projects-archive-link {
  display: flex;
  justify-content: flex-start;
  margin-top: 1.4rem;
}

.coverage {
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: start;
}

.coverage-card,
.contact-card {
  padding: 1.5rem;
}

.coverage-card h2 {
  line-height: 1.12;
  padding-bottom: 0.1em;
}

.coverage-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

.coverage-tags span {
  min-height: 40px;
  border-color: rgba(17, 20, 24, 0.08);
  background: rgba(255, 255, 255, 0.58);
  color: var(--text);
}

.process-list {
  display: grid;
  gap: 0.9rem;
}

.process-list article {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  padding: 1.2rem;
}

.process-list span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: "Syne", sans-serif;
  font-size: 1rem;
  font-weight: 800;
}

.contact {
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  align-items: stretch;
}

.contact-panel {
  padding: 1rem 0;
}

.contact-card {
  display: grid;
  align-content: center;
  gap: 0.7rem;
  min-width: 0;
}

.contact-card a {
  font-family: "Syne", sans-serif;
  font-size: clamp(1.45rem, 3.2vw, 2.5rem);
  letter-spacing: -0.03em;
  line-height: 1;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.contact-card a[data-email-link] {
  font-size: clamp(1.35rem, 2.8vw, 2.15rem);
  line-height: 1.02;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem 0 2.2rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.lightbox {
  width: min(920px, calc(100% - 1.5rem));
  padding: 0;
  color: var(--text);
  overflow: hidden;
}

.lightbox::backdrop {
  background: rgba(17, 20, 24, 0.72);
  backdrop-filter: blur(8px);
}

.lightbox img {
  width: 100%;
  max-height: 72vh;
  object-fit: cover;
}

.lightbox-thumbs {
  display: flex;
  gap: 0.65rem;
  overflow-x: auto;
  padding: 0.9rem 1.25rem 0;
}

.lightbox-thumb {
  flex: 0 0 auto;
  width: 82px;
  height: 82px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  cursor: pointer;
  overflow: hidden;
}

.lightbox-thumb.is-active {
  border-color: var(--accent);
}

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

.lightbox-copy {
  padding: 1.2rem 1.25rem 1.3rem;
}

.lightbox-close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  min-height: 44px;
  padding: 0.7rem 0.95rem;
  border: 0;
  border-radius: 999px;
  background: rgba(17, 20, 24, 0.78);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.content-error {
  margin: 0;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.5);
  color: var(--muted);
}

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 700ms ease,
    transform 700ms ease;
  transition-delay: var(--reveal-delay, 0ms);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal,
  .reveal.is-visible,
  .button,
  .project-card,
  .project-image img,
  .topnav a {
    transition: none;
    transform: none;
    opacity: 1;
  }
}

@media (max-width: 980px) {
  .hero,
  .coverage,
  .contact,
  .service-grid,
  .project-grid {
    grid-template-columns: 1fr;
  }

  .section-heading-inline,
  .project-toolbar,
  .footer {
    flex-direction: column;
    align-items: start;
  }

  .hero,
  .archive-hero {
    padding-top: 2.2rem;
  }

  .topnav {
    justify-content: flex-start;
  }

  h1 {
    max-width: 11ch;
  }
}

@media (max-width: 640px) {
  .site-shell {
    width: min(calc(100% - 1rem), var(--max-width));
  }

  .topbar {
    position: static;
    flex-direction: column;
    align-items: start;
    padding-top: 0.9rem;
  }

  .brand {
    width: 100%;
    align-items: flex-start;
  }

  .topnav {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-radius: 22px;
  }

  .topnav a {
    min-height: 46px;
    padding: 0.75rem 0.6rem;
  }

  .hero,
  .archive-hero {
    padding-top: 1.25rem;
  }

  h1 {
    font-size: clamp(2.8rem, 14vw, 4rem);
  }

  h2 {
    font-size: clamp(2rem, 10vw, 3rem);
  }

  .hero-text,
  .section-note,
  .project-results-count,
  .project-copy p:last-child,
  .service-grid p,
  .coverage-card p,
  .process-list p,
  .contact-panel p,
  .contact-card p {
    font-size: 0.98rem;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .button {
    width: 100%;
  }

  .hero-panel,
  .service-grid article,
  .coverage-card,
  .contact-card,
  .process-list article {
    padding: 1rem;
  }

  .hero-frame {
    min-height: 260px;
  }

  .hero-frame-grid {
    grid-template-columns: 1fr 1fr;
  }

  .section {
    padding: 2.3rem 0;
  }

  .project-copy {
    padding: 1rem;
  }

  .project-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
  }

  .projects-archive-link {
    display: block;
  }

  .contact-card a {
    overflow-wrap: anywhere;
  }

  .lightbox {
    width: calc(100% - 0.8rem);
  }

  .lightbox img {
    max-height: 52vh;
  }
}

@media (max-width: 420px) {
  .site-shell {
    width: min(calc(100% - 0.75rem), var(--max-width));
  }

  .brand-mark {
    width: min(4.5rem, 20vw);
  }

  .process-list article {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }

  .project-image {
    aspect-ratio: 1 / 1;
  }
}
