/* ---------- Base ---------- */
:root {
  --green: #2e8b12;
  --green-dark: #246f0e;
  --black: #000;
  --white: #fff;
  --text: #1a1a1a;
  --tile: #f6f6f6;
  --max: 1100px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  font-family: "Montserrat", Arial, sans-serif;
  color: var(--text);
  background: var(--white);
  line-height: 1.5;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; }

.btn {
  display: inline-block;
  background: var(--green);
  color: var(--white);
  padding: 0.55rem 1.4rem;
  border-radius: 999px;
  font-size: 1.05rem;
  transition: background 0.2s;
}
.btn:hover { background: var(--green-dark); }

h2 { font-size: 1.35rem; font-weight: 500; letter-spacing: 0.01em; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1.25rem;
  background: var(--white);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}
.logo img { height: 28px; width: auto; }
.nav { display: flex; align-items: center; gap: 2rem; font-size: 1.15rem; }
.nav a.active { text-decoration: underline; text-underline-offset: 6px; }
.menu-toggle { display: none; }

/* ---------- Hero ---------- */
.hero { position: relative; background: #e9e9e9; }
.hero img { width: 100%; height: auto; aspect-ratio: 2.05; object-fit: cover; }
.hero-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem;
}
.hero h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); font-weight: 400; line-height: 1.15; }
.hero p { font-size: clamp(1.05rem, 2.2vw, 1.5rem); margin-top: 0.4rem; }

/* ---------- Principles ---------- */
.principles {
  max-width: var(--max);
  margin: 0 auto;
  padding: 3rem 1.25rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}
.principles figure { text-align: center; }
.principles img { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--tile); }
.principles figcaption { margin-top: 0.6rem; font-size: 0.95rem; }

/* ---------- Featured projects ---------- */
.featured { background: var(--black); color: var(--white); padding: 2.5rem 1.25rem 3rem; }
.featured h2 { text-align: center; margin-bottom: 1.5rem; }
.featured-grid {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}
.project-card { position: relative; display: block; overflow: hidden; }
.project-card img { width: 100%; aspect-ratio: 1.06; object-fit: cover; transition: transform 0.4s; }
.project-card:hover img { transform: scale(1.03); }
.project-title {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 2.5rem 1.25rem 1rem;
  font-size: 1.6rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0));
}
.project-title svg { width: 2.4rem; height: auto; }

/* ---------- Areas of work ---------- */
.areas { max-width: var(--max); margin: 0 auto; padding: 2.5rem 1.25rem 3rem; }
.area {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: center;
  margin-top: 2.5rem;
}
.area img { width: 100%; aspect-ratio: 1.22; object-fit: cover; }
.area h3 { font-size: 1.6rem; font-weight: 400; line-height: 1.25; margin-bottom: 1rem; }
.area p { font-size: 0.95rem; max-width: 36ch; }
.cta { text-align: center; margin-top: 3.5rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--black); color: var(--white); padding: 3rem 1.25rem 2rem; }
.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem 1rem;
}
.footer-logo img { height: 72px; width: auto; }
.footer-links { display: grid; gap: 1rem; font-size: 0.95rem; align-content: start; }
.footer-links a:hover { text-decoration: underline; }
.footer-bottom {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-top: 2rem;
  font-size: 0.9rem;
}
.social { display: flex; gap: 0.75rem; }
.social svg { width: 34px; height: 34px; }
.social a:hover { opacity: 0.7; }

/* ---------- Tablet ---------- */
@media (max-width: 900px) {
  .principles { grid-template-columns: repeat(2, 1fr); }
  .featured-grid { gap: 1rem; }
}

/* ---------- Mobile ---------- */
@media (max-width: 700px) {
  .logo img { height: 24px; }

  /* Hamburger that turns into an X */
  .menu-toggle {
    position: relative;
    z-index: 11;
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: 0;
    padding: 0.5rem;
    cursor: pointer;
  }
  .menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    transition: transform 0.2s, opacity 0.2s;
  }
  .menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* Full-screen white menu */
  .nav {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 5;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.75rem;
    padding: 6.5rem 1.5rem 1.5rem;
    background: var(--white);
    font-size: 1.9rem;
  }
  .nav.open { display: flex; }
  .nav a,
  .nav .btn {
    background: none;
    color: var(--text);
    padding: 0;
    border-radius: 0;
    font-size: inherit;
    text-decoration: underline;
    text-underline-offset: 6px;
  }
  body.menu-open { overflow: hidden; }

  .hero img { aspect-ratio: 1.23; }
  .hero p { max-width: 20ch; }

  .principles { padding: 2.5rem 1.5rem; gap: 1.5rem 1rem; }

  .featured-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .project-title { font-size: 1.5rem; }

  .area { grid-template-columns: 1fr; gap: 1rem; margin-top: 2.25rem; }
  .area h3 { font-size: 1.4rem; margin-bottom: 0.75rem; }
  .area p { max-width: none; font-size: 1rem; }

  .footer-inner { grid-template-columns: 1fr; }
  .footer-logo img { height: 64px; }
  .footer-bottom { flex-direction: column-reverse; align-items: flex-start; margin-top: 0.5rem; }
}

/* ---------- Project pages (Cyclux, Insight, ...) ---------- */
.project { max-width: var(--max); margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }
.breadcrumb { font-size: 0.8rem; color: #666; margin-bottom: 1.5rem; }

.project-intro {
  display: grid;
  grid-template-columns: 1fr 2.3fr;
  grid-template-rows: 1fr 1fr;
  grid-template-areas: "title hero" "tagline hero";
  column-gap: 2rem;
}
.project-intro h1 { grid-area: title; align-self: center; font-size: 2.6rem; font-weight: 400; line-height: 1.1; }
.project-hero { grid-area: hero; width: 100%; aspect-ratio: 1.5; object-fit: cover; }
.tagline { grid-area: tagline; align-self: center; font-size: 1.8rem; font-weight: 400; line-height: 1.25; color: #666; }

.project-block {
  display: grid;
  grid-template-columns: 1fr 2.3fr;
  column-gap: 2rem;
  align-items: center;
  margin-top: 1.5rem;
}
.project-block p { font-size: 0.95rem; max-width: 22ch; }
.project-block img { width: 100%; aspect-ratio: 1.5; object-fit: cover; }

.image-pair { display: grid; grid-template-columns: 1.17fr 1fr; gap: 1rem; aspect-ratio: 1.5; }
.image-pair img { width: 100%; height: 100%; aspect-ratio: auto; object-fit: cover; }

.see-also { margin-top: 3rem; }
.see-also h2 { font-size: 2.2rem; font-weight: 400; margin-bottom: 0.5rem; }
.see-also-link { display: block; width: 42%; }
.see-also-link img { width: 100%; aspect-ratio: 1.6; object-fit: cover; }

@media (max-width: 700px) {
  .project { padding-top: 1.25rem; }
  .project-intro {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    grid-template-areas: "title" "hero" "tagline";
  }
  .project-intro h1 { font-size: 2.3rem; margin-bottom: 1rem; }
  .tagline { font-size: 1.6rem; margin-top: 1.25rem; }
  .project-block { grid-template-columns: 1fr; row-gap: 1rem; margin-top: 2rem; }
  .project-block img, .image-pair { order: -1; }
  .project-block p { max-width: none; font-size: 1.05rem; line-height: 1.6; order: 1; }
  .image-pair.stack-mobile { grid-template-columns: 1fr; aspect-ratio: auto; row-gap: 1rem; }
  .image-pair.stack-mobile img { height: auto; aspect-ratio: 0.78; }
  .see-also { margin-top: 2.5rem; }
  .see-also h2 { font-size: 1.9rem; }
  .see-also-link { width: 100%; }
}

/* ---------- Contact page ---------- */
.contact { padding: 5rem clamp(1.25rem, 6vw, 5.5rem) 7rem; }
.contact h1 { font-size: clamp(2rem, 4.2vw, 3.2rem); font-weight: 600; line-height: 1.2; margin-bottom: clamp(2rem, 8vw, 7rem); }
.contact p { font-size: clamp(1.15rem, 2.2vw, 1.75rem); line-height: 1.35; max-width: 34em; }
.contact p + p { margin-top: 0.25rem; }
.contact .contact-email { margin-top: clamp(2.5rem, 5vw, 4.5rem); }
.contact-email a { text-decoration: underline; text-underline-offset: 4px; overflow-wrap: anywhere; }
.contact-email a:hover { color: var(--green); }

@media (max-width: 700px) {
  .contact { padding: 3.5rem 1.5rem 4.5rem; }
  .contact p { line-height: 1.6; }
  .contact p + p { margin-top: 1rem; }
  .contact .contact-email { font-size: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* ==========================================================
   Typography: Montserrat Medium, sizes from the Figma desktop
   frame (1440 px). Sizes scale down smoothly on smaller screens.
   32 = header, 65 = page headings, 40 = sub-headings and large
   text, 25 = body text, captions and footer.
   ========================================================== */
:root {
  --max: 1312px;
  --fs-nav: clamp(1.1rem, 2.22vw, 32px);
  --fs-h1: clamp(2.2rem, 4.51vw, 65px);
  --fs-l: clamp(1.3rem, 2.78vw, 40px);
  --fs-m: clamp(1rem, 1.74vw, 25px);
}
body { font-weight: 500; font-size: var(--fs-m); }

/* Header */
.site-header { padding: clamp(0.6rem, 1.5vw, 1.4rem) clamp(1.25rem, 2.2vw, 2.2rem); }
.logo img { height: clamp(26px, 2.8vw, 40px); }
.nav { font-size: var(--fs-nav); gap: clamp(1.5rem, 4.4vw, 63px); }
.btn { font-size: var(--fs-nav); padding: 0.3em 0.6em; }

/* Home */
.hero h1 { font-size: var(--fs-h1); font-weight: 500; }
.hero p { font-size: var(--fs-l); }
.principles figcaption { font-size: var(--fs-m); }
.featured h2, .areas h2 { font-size: var(--fs-l); font-weight: 500; }
.project-title { font-size: var(--fs-l); }
.area h3 { font-size: var(--fs-l); font-weight: 500; }
.area p { font-size: var(--fs-m); max-width: 34ch; }

/* Project pages */
.breadcrumb { font-size: calc(var(--fs-m) * 0.8); }
.project-intro h1 { font-size: var(--fs-h1); font-weight: 500; }
.tagline { font-size: var(--fs-l); font-weight: 500; }
.project-block p { font-size: var(--fs-m); max-width: none; }
.see-also h2 { font-size: var(--fs-h1); font-weight: 500; }

/* Contact page */
.contact h1 { font-size: var(--fs-h1); font-weight: 500; }
.contact p, .contact .contact-email { font-size: var(--fs-l); }
.contact-email strong { font-weight: 700; }

/* Footer */
.footer-links, .footer-bottom { font-size: var(--fs-m); }
.footer-logo img { height: clamp(64px, 8.6vw, 124px); }
.social svg { width: clamp(34px, 3.6vw, 52px); height: clamp(34px, 3.6vw, 52px); }

@media (max-width: 700px) {
  :root { --fs-nav: 1.25rem; --fs-h1: 2.3rem; --fs-l: 1.6rem; --fs-m: 1.125rem; }
  .logo img { height: 24px; }
  .nav { font-size: 1.9rem; gap: 1.75rem; }
  .hero p { font-size: var(--fs-m); }
  .featured h2, .areas h2 { font-size: 1.35rem; }
  .area p { max-width: none; }
  .see-also h2 { font-size: 1.9rem; }
  .contact h1 { font-size: 2rem; }
  .contact p, .contact .contact-email { font-size: var(--fs-m); }
  .footer-links { font-size: 0.95rem; }
  .footer-bottom { font-size: 0.9rem; }
  .footer-logo img { height: 64px; }
  .social svg { width: 34px; height: 34px; }
}
