:root {
  --bg: #f5f3ed;
  --paper: #fffef9;
  --surface: var(--paper);
  --ink: #172019;
  --muted: #667067;
  --line: #d8ddd6;
  --green: #2f654d;
  --green-dark: #1f4c39;
  --green-soft: #dce9df;
  --sand: #e9e2d3;
  --blue: #dfe9ec;
  --shadow: 0 14px 40px rgba(25, 42, 31, .08);
  --radius: 22px;
  --max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; }

.wrap { width: min(var(--max), calc(100% - 48px)); margin-inline: auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid rgba(23, 32, 25, .08);
}
.nav {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  text-decoration: none;
  font-weight: 800;
  letter-spacing: -.025em;
}
.nav-links { display: flex; gap: 26px; align-items: center; }
.nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-size: .93rem;
  font-weight: 650;
}
.nav-links a:hover { color: var(--ink); }
.nav-cta {
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
}

.hero {
  padding: 108px 0 84px;
  display: grid;
  grid-template-columns: 1.5fr .75fr;
  align-items: center;
  gap: 80px;
}
.kicker {
  margin: 0 0 15px;
  font-size: .78rem;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--green);
}
.hero h1 {
  margin: 0;
  max-width: 850px;
  font-size: clamp(3.5rem, 8vw, 7rem);
  line-height: .92;
  letter-spacing: -.067em;
}
.hero .lead {
  max-width: 760px;
  margin: 30px 0 0;
  font-size: clamp(1.08rem, 1.7vw, 1.34rem);
  color: var(--muted);
}
.hero-aside {
  padding-left: 18px;
  color: var(--muted);
}
.hero-aside strong { display: block; color: var(--ink); margin-bottom: 8px; }
.hero-aside p { margin: 0; }

/* Small cropped image placed next to the main title */
.hero-image-small {
  width: 320px;
  max-height: 360px;
  overflow: hidden;
  border-radius: 12px;
  margin-bottom: 14px;
  align-self: center;
  border: 0;
  background: var(--paper);
}
.hero-image-small img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.section { padding: 76px 0; }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 40px;
  margin-bottom: 30px;
}
.section-head h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.5rem);
  letter-spacing: -.05em;
  line-height: 1;
}
.section-head p { max-width: 570px; margin: 0; color: var(--muted); }

.filters { display: flex; flex-wrap: wrap; gap: 9px; margin: 0 0 28px; }
.filter-btn {
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 8px 13px;
  font-weight: 700;
  font-size: .84rem;
}
.filter-btn:hover, .filter-btn.active {
  background: var(--ink);
  border-color: var(--ink);
  color: white;
}

.project-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 18px; }
.card {
  grid-column: span 6;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform .22s ease, box-shadow .22s ease;
}
.card.featured { grid-column: span 12; display: grid; grid-template-columns: 1.15fr .85fr; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card-media {
  position: relative;
  background: #e3e8e1;
  overflow: hidden;
  aspect-ratio: 16 / 10;
}

.card-media.card-media-preview {
  aspect-ratio: auto;
  height: auto;
  background: transparent;
}
.card.featured .card-media { aspect-ratio: auto; min-height: 420px; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 28px; }
.card.featured .card-body { padding: 42px; display: flex; flex-direction: column; justify-content: center; }
.card-label {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 15px;
}
.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 9px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .035em;
}
.pill.wip { background: #efe5c8; color: #6a5524; }
.card h3 { margin: 0; font-size: clamp(1.45rem, 2.4vw, 2.2rem); letter-spacing: -.035em; line-height: 1.05; }
.card p { color: var(--muted); margin: 15px 0 0; }
.card-link {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  margin-top: 24px;
  text-decoration: none;
  font-weight: 800;
  color: var(--green-dark);
}
.card-link:hover { text-decoration: underline; }

.placeholder-map {
  height: 100%;
  min-height: 290px;
  padding: 34px;
  display: flex;
  align-items: end;
  background:
    linear-gradient(120deg, transparent 48%, rgba(47,101,77,.14) 49%, rgba(47,101,77,.14) 51%, transparent 52%) 0 0 / 82px 82px,
    radial-gradient(circle at 28% 35%, rgba(47,101,77,.32) 0 5px, transparent 6px),
    radial-gradient(circle at 70% 62%, rgba(47,101,77,.32) 0 5px, transparent 6px),
    #e6ebe5;
}
.placeholder-map span {
  background: rgba(255,255,255,.92);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: .8rem;
  font-weight: 800;
  color: var(--green-dark);
}

.map-cover a {
  position: relative;
  z-index: 1;
}
.map-cover iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 290px;
  border: 0;
}
.map-cover-label {
  position: absolute;
  left: 20px;
  bottom: 18px;
  padding: 9px 12px;
  border-radius: 8px;
  background: rgba(255,255,255,.94);
  color: var(--green-dark);
  font-size: .82rem;
  font-weight: 800;
}
.map-links { display: flex; flex-wrap: wrap; gap: 0 18px; }
.map-links .card-link { margin-top: 18px; }

.pdf-thumb {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 180px;
  text-decoration: none;
  color: var(--ink);
  background: linear-gradient(180deg, #f7f9f7, #e9efe9);
  border-radius: 12px;
  border: 1px solid var(--line);
  font-weight: 800;
}

.project-bullets { margin: 12px 0 0 18px; color: var(--muted); }
.project-bullets li { margin-bottom: 6px; }

/* Vertical crop for map preview and rotated PDF button */
.crop-vertical {
  position: relative;
  width: 100%;
  height: 380px;
  overflow: visible; /* allow vertical button to extend outside without clipping */
  border-radius: 12px;
}
.crop-vertical img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: none;
}
.crop-vertical::before,
.crop-vertical::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 18%;
  pointer-events: none;
  z-index: 2;
}
.crop-vertical::before {
  top: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.28), rgba(0,0,0,0));
}
.crop-vertical::after {
  bottom: 0;
  background: linear-gradient(0deg, rgba(0,0,0,0.28), rgba(0,0,0,0));
}
.pdf-vertical-button {
  position: absolute;
  right: 12px; /* place inside the visible area */
  top: 50%;
  transform: translateY(-50%) rotate(-90deg); /* center vertically then rotate */
  transform-origin: center;
  background: var(--green-dark);
  color: white;
  padding: 10px 16px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 800;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
  z-index: 3;
}
.pdf-vertical-button:hover { opacity: .92; }

@media (max-width: 900px) {
  .crop-vertical { height: 300px; }
  .pdf-vertical-button { right: -18px; padding: 8px 12px; }
}

.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.gallery-item {
  min-height: 220px;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; }
.gallery-caption {
  position: absolute;
  inset: auto 12px 12px 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(8px);
  font-size: .82rem;
  font-weight: 750;
}
.gallery-placeholder { display: grid; place-items: center; min-height: 220px; background: var(--blue); color: #53676e; text-align: center; padding: 20px; }

.about-grid {
  display: grid;
  grid-template-columns: .7fr 1.3fr;
  gap: 72px;
  padding-top: 24px;
}
.about-grid h2 { margin: 0; font-size: 2.4rem; letter-spacing: -.04em; }
.about-grid p { margin-top: 0; color: var(--muted); font-size: 1.07rem; }
.about-links { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 24px; }
.text-link { font-weight: 800; text-decoration: none; border-bottom: 1px solid currentColor; }
.text-link:hover { color: var(--green); }

.footer {
  margin-top: 36px;
  border-top: 1px solid var(--line);
  padding: 28px 0 42px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: .88rem;
}

/* Project pages */
.project-hero { padding: 82px 0 46px; }
.project-hero h1 {
  margin: 0;
  max-width: 920px;
  font-size: clamp(2.8rem, 7vw, 5.8rem);
  line-height: .95;
  letter-spacing: -.06em;
}
.project-subtitle { max-width: 780px; margin: 24px 0 0; color: var(--muted); font-size: 1.2rem; }
.project-actions { display: flex; flex-wrap: wrap; gap: 11px; margin-top: 28px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 15px;
  border-radius: 999px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: white;
  text-decoration: none;
  font-weight: 800;
  font-size: .9rem;
}
.button.secondary { background: transparent; color: var(--ink); border-color: var(--line); }
.button:hover { opacity: .86; }
.hero-image { margin: 32px 0 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: white; }
.hero-image img { width: 100%; max-height: 760px; object-fit: cover; }
.hero-image.contain img { object-fit: contain; max-height: none; }

.project-content { display: grid; grid-template-columns: 260px 1fr; gap: 70px; padding: 40px 0 90px; }
.project-sidebar { position: sticky; top: 104px; align-self: start; }
.meta-block { padding: 18px 0; border-top: 1px solid var(--line); }
.meta-block:last-child { border-bottom: 1px solid var(--line); }
.meta-label { display: block; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 850; }
.meta-value { display: block; margin-top: 5px; font-weight: 700; }
.prose { max-width: 790px; }
.prose h2 { margin: 56px 0 16px; font-size: 2rem; letter-spacing: -.04em; }
.prose h2:first-child { margin-top: 0; }
.prose p { color: #4f5b52; font-size: 1.03rem; }
.prose ul { color: #4f5b52; padding-left: 22px; }
.callout {
  margin: 28px 0;
  padding: 22px 24px;
  border-radius: 16px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-weight: 650;
}
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 28px 0; }
.stat { padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); }
.stat strong { display: block; font-size: 1.7rem; letter-spacing: -.035em; }
.stat span { color: var(--muted); font-size: .83rem; }
.image-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 28px 0; }
.image-slot { min-height: 280px; border: 1px dashed #aab4ac; border-radius: 16px; background: #eef1ed; display: grid; place-items: center; padding: 24px; color: var(--muted); text-align: center; }
.process { counter-reset: step; display: grid; gap: 12px; margin: 24px 0; }
.process-step { position: relative; padding: 20px 20px 20px 62px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); }
.process-step::before { counter-increment: step; content: counter(step); position: absolute; left: 19px; top: 18px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: white; font-size: .78rem; font-weight: 800; }
.process-step strong { display: block; margin-bottom: 3px; }
.process-step span { color: var(--muted); }
.back-link { text-decoration: none; color: var(--muted); font-weight: 750; }
.back-link:hover { color: var(--ink); }

@media (max-width: 900px) {
  .hero, .about-grid, .project-content { grid-template-columns: 1fr; }
  .hero { gap: 36px; padding-top: 80px; }
  .hero-aside { padding: 24px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .card, .card.featured { grid-column: span 12; }
  .card.featured { grid-template-columns: 1fr; }
  .card.featured .card-media { min-height: 310px; }
  .gallery-grid { grid-template-columns: 1fr 1fr; }
  .project-sidebar { position: static; }
  .hero-image-small { display: none; }
}

@media (max-width: 650px) {
  .wrap { width: min(100% - 28px, var(--max)); }
  .nav-links a:not(.nav-cta) { display: none; }
  .hero { padding: 64px 0 58px; }
  .section { padding: 56px 0; }
  .section-head { flex-direction: column; align-items: start; gap: 14px; }
  .gallery-grid, .image-pair, .stats { grid-template-columns: 1fr; }
  .card-body, .card.featured .card-body { padding: 24px; }
  .footer { flex-direction: column; }
}

/* Contact popup */

.contact-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;

  display: none;
  align-items: center;
  justify-content: center;

  padding: 24px;
  background: rgba(17, 25, 20, 0.45);
  backdrop-filter: blur(6px);
}

.contact-modal.open {
  display: flex;
}

.contact-modal-box {
  position: relative;
  width: 100%;
  max-width: 460px;

  padding: 36px;
  border: 1px solid var(--line);
  border-radius: 18px;

  background: var(--surface);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.18);
}

.contact-modal-box h2 {
  margin: 0 0 28px;
  font-size: 2rem;
  letter-spacing: -0.04em;
}

.contact-close {
  position: absolute;
  top: 16px;
  right: 18px;

  border: 0;
  background: none;
  color: var(--muted);

  font-size: 1.8rem;
  cursor: pointer;
}

.contact-options {
  display: grid;
  gap: 12px;
}

.contact-options a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;

  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;

  text-decoration: none;
  font-weight: 750;
}

.contact-options a:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.contact-options span {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
}
