:root {
  /* Colors */
  --color-bg: #f5f1e8;
  --color-bg-alt: #ffffff;
  --color-surface: #fdfbf7;
  --color-text: #1b1917;
  --color-muted: #615951;
  --color-border: #d9cec3;
  --color-accent: #b24a2c; /* soil */
  --color-accent-dark: #933820;
  --color-secondary: #2f8f5b; /* vegetation */
  --color-info: #1c6f8c; /* sea */
  --color-highlight: #f8db00; /* sun */
  --color-soft-blue: #8ec9e6; /* sky */

  /* Typography */
  --font-heading: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Layout */
  --max-width: 1200px;
  --header-bar-h: 72px;

  /* Spacing */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;

  /* Breakpoints (for documentation - use in @media queries) */
  --breakpoint-mobile: 480px;
  --breakpoint-tablet: 768px;
  --breakpoint-nav: 860px;
  --breakpoint-desktop: 993px;
}

html { scroll-behavior: smooth; }

/* Global text selection color */
::selection {
  background: var(--color-highlight);
  color: var(--color-text);
}
::-moz-selection {
  background: var(--color-highlight);
  color: var(--color-text);
}

/* Improve focus visibility for keyboard users */
:where(.btn, .site-nav .menu a, .nav-toggle, .language-switcher a, .portfolio-card):focus-visible {
  outline: 3px solid var(--color-soft-blue);
  outline-offset: 2px;
}

/* Offset anchored headings under sticky header */
h2, h3, h4 { scroll-margin-top: calc(var(--header-bar-h) + var(--space-2)); }

/* Prevent body scroll when overlays/menus are open */
body.no-scroll { overflow: hidden; }

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

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
}

a {
  color: var(--color-accent);
  text-decoration: none;
}

a:hover,
a:focus {
  color: var(--color-accent-dark);
}

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

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  margin: 0 0 var(--space-2);
  line-height: 1.2;
  color: var(--color-text);
}

h1 {
  font-size: clamp(2rem, 1rem + 3vw, 3rem);
  line-height: 1.15;
  font-weight: 700;
}

h2 {
  font-size: clamp(1.6rem, 0.9rem + 2vw, 2.25rem);
  line-height: 1.25;
  font-weight: 600;
}

h3 {
  font-size: clamp(1.25rem, 1rem + 0.8vw, 1.5rem);
  line-height: 1.35;
  font-weight: 600;
}

h4 {
  font-size: 1.25rem;
  line-height: 1.4;
  font-weight: 500;
}

p,
li {
  font-weight: 400;
}

.text-small,
small {
  font-size: 0.95rem;
  line-height: 1.5;
}

p {
  margin: 0 0 var(--space-2);
  color: var(--color-muted);
}

.container {
  width: min(100% - 2 * var(--space-2), var(--max-width));
  margin-inline: auto;
}

.site-header {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
  top: 0;
  z-index: 10;
  color: var(--color-text);
  position: sticky;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: var(--header-bar-h);
  padding: 0;
}

.brand {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: inherit;
  display: inline-flex;
  align-items: baseline;
  gap: 0.35ch;
}

.site-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.site-nav .menu {
  list-style: none;
  display: flex;
  gap: var(--space-3);
  padding: 0;
  margin: 0;
}

.site-nav .menu a {
  color: inherit;
  font-weight: 500;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}


.languages { display: block; }
.languages .language-switcher ul { gap: 0.5rem; }

.site-header a { color: inherit; }

.site-header.is-scrolled,
.site-header.nav-open {
  background: rgba(255, 255, 255, 0.95);
}

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

.language-switcher ul {
  list-style: none;
  display: flex;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  justify-content: flex-start;
}

.language-switcher a,
.language-switcher span {
  font-size: 0.875rem;
  color: var(--color-muted);
}

.language-switcher span {
  font-weight: 600;
  color: var(--color-text);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn-primary {
  background: var(--color-accent);
  color: #fff;
}

.btn-primary:hover,
.btn-primary:focus {
  background: var(--color-accent-dark);
}

.btn-secondary {
  border-color: var(--color-secondary);
  color: var(--color-secondary);
}

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

.btn-outline {
  border-color: var(--color-info);
  color: var(--color-info);
  background: transparent;
}

.hero {
  margin-top: 0;
  padding: calc(var(--space-5) + var(--space-4)) 0 var(--space-4);
  min-height: 75vh;
  position: relative;
  color: #fff;
}
.hero .hero-inner { position: relative; z-index: 2; }
.hero .hero-bg { position: absolute; inset: 0; background: center/cover no-repeat; z-index: 0; }
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(27, 25, 23, 0.82), rgba(27, 25, 23, 0.55)),
    linear-gradient(180deg, rgba(142, 201, 230, 0.55), rgba(245, 180, 51, 0.25));
  z-index: 1;
}

.hero-copy h1,
.hero-copy p {
  color: #fff;
}


.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.services {
  padding: var(--space-5) 0;
  background: var(--color-bg-alt);
}

.transition-strip {
  background: linear-gradient(90deg, rgba(28, 111, 140, 0.12), rgba(28, 111, 140, 0.12));
  padding: 0.75rem 0;
}
.transition-line { margin: 0; color: var(--color-text); opacity: 0.8; font-weight: 500; }

.transition-strip--page { margin-bottom: var(--space-5); }
.transition-strip--sea {
  background: linear-gradient(135deg, rgba(28, 111, 140, 0.85), rgba(28, 111, 140, 0.7));
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-3);
}

.service-card {
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  background: var(--color-surface);
  min-height: 200px;
}

.differentiators {
  padding: var(--space-5) 0;
}

.mid-banner {
  padding: var(--space-5) 0;
  background: linear-gradient(135deg, rgba(47, 143, 91, 0.85), rgba(47, 143, 91, 0.7));
  color: #fff;
  text-align: center;
}
.mid-banner h2 { color: #fff; margin: 0; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-3);
}

.card {
  padding: var(--space-3);
  border-radius: 16px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
}

.portfolio-preview {
  padding: var(--space-5) 0;
  background: var(--color-bg-alt);
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-3);
}

.portfolio-card {
  border: 1px solid var(--color-border);
  border-radius: 18px;
  overflow: hidden;
  background: var(--color-bg-alt);
  display: flex;
  flex-direction: column;
  min-height: 100%;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.portfolio-card:hover,
.portfolio-card:focus {
  border-color: var(--color-accent);
}

.portfolio-card:hover h3,
.portfolio-card:hover h2 { color: var(--color-text); }

/* Prevent global link color from coloring entire card */
.portfolio-card,
.portfolio-card:hover,
.portfolio-card:focus {
  color: inherit;
}

.portfolio-card figure {
  aspect-ratio: 4 / 3;
  background: var(--color-border);
  margin: 0;
}

.portfolio-card-body {
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.portfolio-card-body h3 {
  margin-bottom: 0;
}

.project-meta {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--color-muted);
}


.investment {
  padding: var(--space-5) 0;
  background: var(--color-accent);
  color: #fff;
}
.investment h2, .investment p, .investment a { color: #fff; }

.investment-inner {
  display: grid;
  gap: var(--space-3);
  align-items: start;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.investment-block { min-width: 0; }
.investment-block h2 { margin: 0 0 0.25rem; }
.investment-block p { margin: 0; }
.investment-actions { grid-column: 1 / -1; justify-self: center; margin-top: var(--space-2); }

/* Button style for investment band */
.btn-contact {
  border: 2px solid var(--color-accent-dark);
  background: transparent;
  color: #fff;
}
.btn-contact:hover,
.btn-contact:focus {
  background: var(--color-accent-dark);
  border-color: var(--color-accent-dark);
  color: #fff;
}

.page-hero {
  margin-top: 0;
  padding: calc(var(--space-5) + var(--space-4)) 0 var(--space-4);
  min-height: 48vh;
  position: relative;
  color: #fff;
}
.page-hero h1,
.page-hero p,
.page-hero a { color: #fff; }
.page-hero .hero-bg { position: absolute; inset: 0; background: center/cover no-repeat; z-index: 0; }
.page-hero > .container { position: relative; z-index: 2; }
.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(27, 25, 23, 0.82), rgba(27, 25, 23, 0.55)),
    linear-gradient(180deg, rgba(142, 201, 230, 0.55), rgba(245, 180, 51, 0.25));
  z-index: 1;
}

/* Ensure meta list in hero inherits white text */
.page-hero .project-meta,
.page-hero .project-meta strong { color: #fff; }

.portfolio-list {
  padding-bottom: var(--space-5);
}

.page-content,
.project-body,
.contact-form {
  padding-bottom: var(--space-5);
}

.project-detail .project-meta {
  margin-top: var(--space-2);
}

/* .project-gallery removed (placeholder slider will replace) */

/* Placeholder for future gallery slider */
.slider-placeholder {
  margin-top: var(--space-3);
  margin-bottom: var(--space-3);
  border: 1px dashed var(--color-border);
  border-radius: 16px;
  background: var(--color-surface);
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  color: var(--color-muted);
}

.project-back {
  padding: 0 0 var(--space-5);
}

/* Minimal slider (CSS scroll-snap) */

/* About page */
.about { padding: 0 0 var(--space-5); }
.about-grid {
  display: grid;
  gap: var(--space-3);
  align-items: stretch; /* equal height columns */
  grid-template-columns: 1.2fr 1fr;
}
.about-grid > * { height: 100%; min-width: 0; }
@media (max-width: 992px) {
  .about-grid { grid-template-columns: 1fr; }
}
.about-photo { padding: 0; margin: 0; overflow: hidden; position: relative; }
.about-photo img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.about-photo-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.5rem 0.75rem;
  background: rgba(27, 25, 23, 0.8);
  color: #fff;
  font-weight: 400;
  font-size: 0.95rem;
  text-align: center;
}
/* Match smaller headings like portfolio cards */
.about-copy h2 {
  font-size: clamp(1.25rem, 1rem + 0.8vw, 1.5rem);
  line-height: 1.35;
  font-weight: 600;
}
.slider { margin: var(--space-5) 0 var(--space-5); position: relative; }
.slider .slides {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  gap: var(--space-2);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-snap-stop: always;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  border-radius: 16px;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}
.slider .slides::-webkit-scrollbar {
  display: none; /* Chrome/Safari/Opera */
}
.slider .slides figure {
  scroll-snap-align: start;
  margin: 0;
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  background: var(--color-border);
  cursor: pointer;
}
.slider .slides img { width: 100%; height: 100%; object-fit: cover; display: block; }
.slider-dots {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%);
  display: flex; gap: 0.5rem; z-index: 2; pointer-events: auto;
}
.slider-dots a {
  width: 14px; height: 14px; border-radius: 999px; border: 2px solid #fff;
  background: transparent; display: inline-block; text-indent: -9999px; overflow: hidden;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.35));
}
.slider-dots a.is-active { background: #fff; }
.slider-dots a:focus-visible { outline: 3px solid var(--color-soft-blue); outline-offset: 2px; }

/* Lite YouTube embed */
.lite-yt {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
  background: var(--color-border) center/cover no-repeat;
  cursor: pointer;
  margin: var(--space-4) 0;
}
.lite-yt::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(0,0,0,.15), rgba(0,0,0,.35));
}
.lite-yt.is-playing::after { display: none; }
.lite-yt .play {
  position: absolute; inset: 0; display: grid; place-items: center; z-index: 1;
}
.lite-yt .play svg { width: 64px; height: 64px; fill: #fff; filter: drop-shadow(0 2px 8px rgba(0,0,0,.35)); }
.lite-yt iframe { width: 100%; height: 100%; display: block; border: 0; }

.contact-form .container {
  display: block;
  padding-top: var(--space-3);
}
.contact-form .contact { max-width: 560px; }

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

.contact input,
.contact textarea {
  padding: 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  font: inherit;
}

.contact .form-field { margin-bottom: var(--space-2); }
.contact .form-field:not(:first-child) { margin-top: calc(var(--space-2) * 2); }
.contact label { font-weight: 600; margin-bottom: 0.35rem; }
.contact input, .contact textarea { width: 100%; font-size: 1rem; }
.contact textarea { min-height: 10rem; }

.contact .btn-primary { border: 2px solid var(--color-accent-dark); font-size: 1.125rem; margin-top: calc(var(--space-2) * 2); }
.contact .btn-primary:hover,
.contact .btn-primary:focus { background: var(--color-accent-dark); border-color: var(--color-accent-dark); }

.site-footer {
  background: var(--color-text);
  color: #fff;
  padding: var(--space-5) 0 var(--space-4);
  border-top: 4px solid var(--color-accent);
}

.footer-stack { display: flex; flex-direction: column; gap: var(--space-2); }
.site-footer h1, .site-footer h2, .site-footer h3, .site-footer h4 { color: #fff; }
.footer-brand { margin: 0; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; display: inline-flex; align-items: baseline; gap: 0.35ch; }

.brand-primary { font-weight: 800; }
.brand-secondary { font-weight: 400; opacity: 0.9; letter-spacing: 0.02em; }
.site-footer .brand-secondary { opacity: 1; }

.brand, .footer-brand { white-space: nowrap; }

.footer-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: nowrap;
  gap: var(--space-2);
  white-space: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.footer-contacts p { margin: 0.25rem 0; color: #fff; }

.site-footer a {
  color: #fff;
}

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-bottom {
  margin-top: var(--space-4);
  text-align: center;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  left: 50%;
  top: 10px;
  width: auto;
  height: auto;
  padding: 0.75rem 1rem;
  transform: translateX(-50%);
  background: #000;
  color: #fff;
  z-index: 100;
}

@media (max-width: 860px) {
  .hero {
    padding-top: calc(var(--space-5) + var(--space-4));
  }

  .header-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: var(--header-bar-h) auto;
    align-items: center;
    padding: 0;
    row-gap: 0;
    column-gap: var(--space-3);
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .site-nav {
    order: 2;
    margin-left: 0;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
    grid-column: 1 / -1;
  }

  .site-nav .menu {
    width: 100%;
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
    padding: 0;
  }

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

  .site-nav .menu li {
    width: 100%;
  }

  .site-nav .menu a {
    display: inline-block;
  }

  .site-header.nav-open .nav-toggle {
    align-self: center;
  }

  .site-header.nav-open .site-nav .menu {
    padding-top: var(--space-2);
    border-top: 1px solid var(--color-border);
    gap: var(--space-1);
  }

  .languages {
    display: none;
  }

  .site-header.nav-open .languages {
    display: block;
    width: 100%;
    padding-bottom: var(--space-2);
  }

  .site-header.nav-open .languages .language-switcher ul {
    margin-top: var(--space-1);
    gap: 0.75rem;
    justify-content: flex-start;
  }
  .investment-inner { grid-template-columns: 1fr; }
  .investment-actions { justify-self: center; }
}

@media (max-width: 768px) {
  .hero {
    background: var(--color-text);
    padding-top: calc(var(--space-5) + var(--space-5));
  }
}

@media (max-width: 480px) {
  body {
    font-size: 1rem;
  }

  .hero {
    padding: calc(var(--space-5) + var(--space-5)) 0 var(--space-4);
  }

  .section-heading {
    flex-direction: column;
    align-items: flex-start;
  }

  .btn {
    width: 100%;
  }

  /* Stack brand text into two lines on very small screens */
  .brand, .footer-brand { white-space: normal; }
  .brand { flex-direction: column; align-items: flex-start; gap: 0.15rem; line-height: 1.1; }
  .footer-brand { flex-direction: column; align-items: flex-start; gap: 0.15rem; line-height: 1.1; }
  .footer-bottom .footer-copy, .footer-bottom .company-nib { line-height: 1.4; }
}

/* Legal pages helpers */
.legal-box { margin-bottom: var(--space-3); }
.legal-updated { font-size: 0.95rem; line-height: 1.5; color: var(--color-muted); margin-top: var(--space-2); }
