:root {
  --moss: #314f35;
  --fern: #4d7b42;
  --laurel: #6f9f5b;
  --sea: #1d6674;
  --deep: #12231f;
  --mist: #f3f7ef;
  --sand: #e6d7b5;
  --granite: #67716a;
  --white: #ffffff;
  --shadow: 0 24px 70px rgba(18, 35, 31, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--deep);
  background: var(--mist);
}

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

a {
  color: inherit;
}

button,
a.button {
  min-height: 44px;
}

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 14px clamp(16px, 4vw, 54px);
  color: var(--white);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 180ms ease, box-shadow 180ms ease, color 180ms ease;
}

.site-header.is-scrolled {
  color: var(--white);
  background: rgba(49, 79, 53, 0.94);
  border-bottom-color: rgba(143, 214, 109, 0.32);
  box-shadow: 0 10px 36px rgba(18, 35, 31, 0.18);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-family: Georgia, serif;
}

.nav {
  display: flex;
  justify-content: center;
  gap: clamp(12px, 3vw, 34px);
  font-size: 0.92rem;
  font-weight: 700;
}

.nav a {
  text-decoration: none;
}

.language-switcher,
.lang-toggle,
.site-footer button,
.chips button {
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.language-switcher {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.lang-toggle {
  position: relative;
  overflow: hidden;
  width: 44px;
  height: 44px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-weight: 700;
  opacity: 0.74;
  transition: background 180ms ease, color 180ms ease, opacity 180ms ease, border-color 180ms ease;
}

.lang-toggle::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0;
  transition: opacity 180ms ease;
}

.lang-toggle.is-active {
  border-color: var(--sand);
  color: var(--deep);
  background: transparent;
  font-weight: 900;
  opacity: 1;
}

.lang-toggle.is-active::before {
  opacity: 0.5;
}

.lang-toggle[data-lang-button="ga"]::before {
  background:
    linear-gradient(135deg, transparent 38%, #6aa4d8 39%, #6aa4d8 57%, transparent 58%),
    #ffffff;
}

.lang-toggle[data-lang-button="es"]::before {
  background: linear-gradient(#c60b1e 0 25%, #ffc400 25% 75%, #c60b1e 75% 100%);
}

.lang-toggle[data-lang-button="en"]::before {
  background: url("img/language-en-usa-uk-flag.png") center / cover;
}

.lang-toggle span {
  position: relative;
  z-index: 1;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  align-items: end;
  gap: clamp(24px, 5vw, 64px);
  min-height: 92svh;
  padding: 128px clamp(18px, 5vw, 72px) 72px;
  color: var(--white);
  background:
    linear-gradient(110deg, rgba(18, 35, 31, 0.86), rgba(18, 35, 31, 0.36) 52%, rgba(29, 102, 116, 0.28)),
    url("img/ria_vigo_sanmiguel_canido_toralla.jpg") center / cover;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 18vh;
  background: linear-gradient(0deg, var(--mist), transparent);
}

.hero-content,
.hero-panel {
  position: relative;
  z-index: 1;
}

.eyebrow,
.section-kicker {
  margin: 0 0 14px;
  color: var(--laurel);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: min(10ch, 100%);
  margin: 0;
  font-family: Montserrat, Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(4.5rem, 12vw, 10rem);
  font-weight: 800;
  line-height: 0.82;
}

.hero-copy {
  max-width: min(700px, 100%);
  margin: 26px 0 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(1.05rem, 2vw, 1.45rem);
  line-height: 1.55;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 800;
}

.button.primary {
  color: var(--deep);
  background: var(--sand);
}

.button.ghost {
  border: 1px solid rgba(255, 255, 255, 0.64);
}

.hero-panel {
  align-self: end;
  max-width: 440px;
  padding: 22px;
  border-left: 1px solid rgba(255, 255, 255, 0.42);
  background: rgba(18, 35, 31, 0.34);
  backdrop-filter: blur(10px);
}

.hero-panel span {
  font-weight: 800;
}

.hero-panel strong {
  display: block;
  margin: 8px 0;
  font-size: 3.4rem;
  line-height: 1;
}

.hero-panel p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.45;
}

.intro-band,
.section,
.split-section,
.quote-band {
  padding: clamp(56px, 9vw, 112px) clamp(18px, 5vw, 72px);
}

.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 520px);
  gap: 42px;
  max-width: 1180px;
  margin: 0 auto;
  align-items: center;
}

h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.2rem, 5vw, 4.8rem);
  font-weight: 500;
  line-height: 0.98;
}

.intro-copy p:last-child,
.section-heading p:last-child,
.split-copy p,
.landscape-card p {
  color: #41524a;
  line-height: 1.75;
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  overflow: hidden;
  border: 1px solid rgba(49, 79, 53, 0.2);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.stat-strip div {
  min-width: 0;
  padding: 26px 18px;
}

.stat-strip div + div {
  border-left: 1px solid rgba(49, 79, 53, 0.16);
}

.stat-strip strong {
  display: block;
  color: var(--sea);
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1;
}

.stat-strip span:last-child {
  display: block;
  margin-top: 8px;
  color: var(--granite);
  font-size: 0.9rem;
  font-weight: 700;
}

.section {
  max-width: 1240px;
  margin: 0 auto;
}

.section-heading {
  max-width: 820px;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 42px;
}

.timeline-item,
.landscape-card {
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 16px 50px rgba(18, 35, 31, 0.09);
}

.timeline-item {
  padding: 28px;
  border-top: 6px solid var(--fern);
}

.timeline-item span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  color: var(--white);
  background: var(--sea);
  font-weight: 900;
}

h3 {
  margin: 22px 0 10px;
  font-size: 1.2rem;
}

.timeline-item p {
  margin: 0;
  color: #485850;
  line-height: 1.65;
}

.split-section {
  display: grid;
  grid-template-columns: minmax(280px, 0.92fr) minmax(0, 1fr);
  gap: clamp(28px, 6vw, 72px);
  align-items: center;
  max-width: 1320px;
  margin: 0 auto;
}

.image-slab {
  min-height: clamp(380px, 60vw, 720px);
  border-radius: 8px;
  background: center / cover;
  box-shadow: var(--shadow);
}

.freixeiro-photo {
  background-image: url("img/vigo-ria-toralla-cies-background.jpg");
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 28px 0 18px;
}

.chips button {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(49, 79, 53, 0.28);
  border-radius: 999px;
  color: var(--moss);
  background: rgba(111, 159, 91, 0.1);
  font-weight: 800;
}

.chips button.is-active {
  color: var(--white);
  background: var(--moss);
}

.topic-output {
  min-height: 72px;
  padding: 18px 0 0;
  border-top: 1px solid rgba(49, 79, 53, 0.22);
}

.cies-section {
  max-width: 1320px;
}

.landscape-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 42px;
}

.landscape-card {
  overflow: hidden;
}

.landscape-card img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.landscape-card h3,
.landscape-card p {
  padding: 0 22px;
}

.landscape-card p {
  margin-bottom: 24px;
}

.quote-band {
  color: var(--white);
  background:
    linear-gradient(90deg, rgba(18, 35, 31, 0.8), rgba(29, 102, 116, 0.52)),
    url("img/cies-vegetation-quote-background.jpg") center / cover fixed;
}

.quote-inner {
  max-width: 960px;
  margin: 0 auto;
}

.quote-inner p {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.4rem, 6vw, 5.7rem);
  line-height: 1;
}

.sources {
  padding-bottom: 56px;
}

.source-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin-top: 30px;
}

.source-list a {
  display: flex;
  align-items: center;
  min-height: 84px;
  padding: 18px;
  border: 1px solid rgba(49, 79, 53, 0.18);
  border-radius: 8px;
  color: var(--moss);
  background: var(--white);
  font-weight: 800;
  text-decoration: none;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 28px clamp(18px, 5vw, 72px);
  color: var(--white);
  background: var(--deep);
}

.site-footer button {
  font-weight: 800;
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 600ms ease, transform 600ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (max-width: 920px) {
  .site-header {
    grid-template-columns: auto auto;
  }

  .nav {
    grid-column: 1 / -1;
    order: 3;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .language-switcher {
    justify-self: end;
  }

  .intro-grid,
  .split-section,
  .timeline,
  .landscape-grid,
  .source-list {
    grid-template-columns: 1fr;
  }

  .hero {
    gap: 28px;
    min-height: 96svh;
    padding-top: 154px;
  }

  .hero-panel {
    max-width: 420px;
  }

  .stat-strip {
    grid-template-columns: 1fr;
  }

  .stat-strip div + div {
    border-top: 1px solid rgba(49, 79, 53, 0.16);
    border-left: 0;
  }

  .split-section {
    padding-top: 40px;
  }
}

@media (max-width: 560px) {
  .hero-actions,
  .button {
    width: 100%;
  }

  .hero h1 {
    font-size: clamp(4rem, 21vw, 6.8rem);
  }

  .quote-band {
    background-attachment: scroll;
  }

  .site-footer {
    flex-direction: column;
  }
}

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

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
