/* Berimbau – hand-written CSS, no framework.
   Colours come from the logo. Contrast on white (WCAG):
   --text 10.8:1 · --brown 6.5:1 (headings, links, buttons) · logo brown 5.0:1.
   The leaf colours are decorative only – never use them for text. */

:root {
  --bg: #ffffff;
  --text: #5a3418;
  --brown: #8a4f26;
  --brown-dark: #5a3418;
  --cream: #fbf6ef;
  --line: #e9d9c6;

  --leaf-red: #eb1306;
  --leaf-orange: #f86e35;
  --leaf-yellow: #febb20;
  --leaf-green: #528933;
  --leaf-blue: #5476c7;
  --leaf-purple: #753881;
  --leaf-pink: #e74b7a;

  --font: ui-rounded, "Nunito", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  --radius: 0.75rem;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1.125rem/1.65 var(--font);
}

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

.wrap { width: min(100% - 2rem, 74rem); margin-inline: auto; }

/* ---------- Text ---------- */

h1, h2, h3 { color: var(--brown); line-height: 1.2; font-weight: 700; }
h1 { font-size: clamp(1.9rem, 4.5vw + 0.5rem, 3rem); margin: 2rem 0 1rem; }
h2 { font-size: clamp(1.4rem, 2vw + 0.8rem, 1.9rem); margin: 2.5rem 0 0.75rem; }
h3 { font-size: 1.25rem; margin: 0 0 0.5rem; }
p { margin: 0 0 1rem; }

a { color: var(--brown); text-underline-offset: 0.2em; text-decoration-thickness: 0.08em; }
a:hover { color: var(--brown-dark); text-decoration-thickness: 0.15em; }

:focus-visible { outline: 3px solid var(--brown-dark); outline-offset: 3px; border-radius: 2px; }

.lead { font-size: 1.25rem; }
.eyebrow { margin: 0 0 0.25rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--brown); }
.prose { max-width: 46rem; }
.prose > section > h2:first-child { margin-top: 2rem; }

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 10;
  background: var(--brown-dark); color: #fff; padding: 0.6rem 1rem; border-radius: var(--radius);
}
.skip-link:focus { top: 1rem; color: #fff; }

.button {
  display: inline-block; padding: 0.75rem 1.5rem; border-radius: 999px;
  background: var(--brown); color: #fff; font-weight: 700; text-decoration: none;
}
.button:hover { background: var(--brown-dark); color: #fff; }

/* ---------- Header ---------- */

.site-header { border-bottom: 1px solid var(--line); position: relative; }
/* Row of "leaf" colours, purely decorative */
.site-header::after {
  content: ""; display: block; height: 5px;
  background: linear-gradient(90deg, var(--leaf-red), var(--leaf-orange), var(--leaf-yellow), var(--leaf-green), var(--leaf-blue), var(--leaf-purple), var(--leaf-pink));
}
.site-header__inner {
  display: grid; gap: 0.5rem 1rem; align-items: center; padding-block: 0.75rem;
  grid-template-columns: 1fr auto;
  grid-template-areas: "brand toggle" "menu menu";
}
.brand { grid-area: brand; justify-self: start; line-height: 0; }
.brand img { width: 200px; height: auto; }

.site-header ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; }
.site-header a { display: block; padding: 0.4rem 0.7rem; border-radius: 999px; text-decoration: none; font-weight: 600; }
.site-header a:hover { background: var(--cream); }
.site-header a[aria-current] { text-decoration: underline; text-decoration-thickness: 0.15em; text-underline-offset: 0.3em; }

/* Language dropdown: <details>, so it works without JavaScript */
.lang-menu { position: relative; }
.lang-menu summary {
  display: inline-flex; align-items: center; gap: 0.45rem; min-height: 2.5rem; padding: 0.3rem 0.85rem;
  border: 2px solid var(--brown); border-radius: 999px; color: var(--brown); font-weight: 700;
  letter-spacing: 0.04em; cursor: pointer; list-style: none;
}
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary::after {
  content: ""; width: 0.45rem; height: 0.45rem; margin-top: -0.2rem;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg);
}
.lang-menu[open] summary::after { margin-top: 0.15rem; transform: rotate(-135deg); }
.lang-menu summary:hover { background: var(--cream); }
.lang-menu ul {
  position: absolute; right: 0; top: calc(100% + 0.4rem); z-index: 5; min-width: 10rem; flex-direction: column;
  padding: 0.4rem; gap: 0; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 6px 20px rgb(90 52 24 / 0.15);
}
.lang-menu ul a { padding: 0.5rem 0.75rem; border-radius: 0.5rem; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* Burger button: only shown on small screens, and only when JavaScript is running.
   Without JS the menu simply stays open. */
.menu-toggle {
  grid-area: toggle; display: none; align-items: center; gap: 0.6rem; min-height: 2.75rem;
  padding: 0.4rem 1rem; border: 2px solid var(--brown); border-radius: 999px;
  background: var(--bg); color: var(--brown); font: inherit; font-weight: 700; cursor: pointer;
}
.menu-toggle:hover { background: var(--cream); }
.menu-icon, .menu-icon::before, .menu-icon::after {
  display: block; width: 1.25rem; height: 2px; background: currentColor; border-radius: 2px;
  transition: transform 0.2s, background-color 0.2s;
}
.menu-icon { position: relative; }
.menu-icon::before, .menu-icon::after { content: ""; position: absolute; left: 0; }
.menu-icon::before { top: -6px; }
.menu-icon::after { top: 6px; }
.menu-toggle[aria-expanded="true"] .menu-icon { background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-icon::before { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-icon::after { transform: translateY(-6px) rotate(-45deg); }
@media (prefers-reduced-motion: reduce) { .menu-icon, .menu-icon::before, .menu-icon::after { transition: none; } }

.site-menu { grid-area: menu; display: flex; flex-direction: column; gap: 0.75rem; }

@media (max-width: 47.99em) {
  .js .menu-toggle { display: inline-flex; }
  .js .site-menu { display: none; }
  .js .menu-open .site-menu { display: flex; }
  .main-nav ul { flex-direction: column; gap: 0; }
  .main-nav li + li { border-top: 1px solid var(--line); }
  .main-nav a { padding: 0.8rem 0.25rem; border-radius: 0; }
  .lang { padding-top: 0.75rem; border-top: 2px solid var(--line); }
  .lang-menu ul { position: static; margin-top: 0.5rem; box-shadow: none; }
}

/* From tablet up the menu wrapper steps aside and its children join the header grid */
@media (min-width: 48em) {
  .site-menu { display: contents; }
  .site-header__inner { grid-template-areas: "brand lang" "nav nav"; }
  .main-nav { grid-area: nav; }
  .lang { grid-area: lang; }
}

/* Wide screens: everything on one row */
@media (min-width: 75em) {
  .site-header__inner {
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "brand nav lang";
  }
  .brand img { width: 180px; }
  .main-nav ul { justify-content: center; gap: 0.1rem; }
  .main-nav a { padding: 0.4rem 0.6rem; font-size: 1rem; }
}

/* ---------- Home ---------- */

.hero { display: grid; gap: 1.5rem 3rem; align-items: center; padding-block: 1rem 2rem; }
.hero h1 { margin-top: 0.5rem; font-size: clamp(1.7rem, 3vw + 0.6rem, 2.5rem); }
.hero__logo { max-width: 32rem; justify-self: center; }
@media (min-width: 48em) {
  .hero { grid-template-columns: 3fr 2fr; }
}

.facts {
  display: grid; gap: 1rem; margin: 0 0 2rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}
.facts div { background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; }
.facts dt { font-weight: 700; color: var(--brown); }
.facts dd { margin: 0; }

.feature { margin: 0 0 1rem; }
.feature img { width: 100%; border-radius: var(--radius); aspect-ratio: 16 / 9; object-fit: cover; object-position: center 40%; }

/* ---------- Cards ---------- */

.cards {
  list-style: none; margin: 1rem 0 2rem; padding: 0; display: grid; gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}
.card {
  position: relative; background: var(--cream); border: 1px solid var(--line);
  border-top: 6px solid var(--leaf-green); border-radius: var(--radius); padding: 1.25rem 1.25rem 0.5rem;
}
.card:nth-child(6n + 1) { border-top-color: var(--leaf-red); }
.card:nth-child(6n + 2) { border-top-color: var(--leaf-orange); }
.card:nth-child(6n + 3) { border-top-color: var(--leaf-yellow); }
.card:nth-child(6n + 4) { border-top-color: var(--leaf-green); }
.card:nth-child(6n + 5) { border-top-color: var(--leaf-blue); }
.card:nth-child(6n + 6) { border-top-color: var(--leaf-purple); }
.card h3 a { text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; } /* whole card is the link target */
.card:has(h3 a:hover) { border-color: var(--brown); }
.card:has(h3 a:focus-visible) { outline: 3px solid var(--brown-dark); outline-offset: 3px; }
.card h3 a:focus-visible { outline: none; }

/* ---------- Timeline ---------- */

.timeline { list-style: none; margin: 1.5rem 0 3rem; padding: 0 0 0 1.75rem; border-left: 4px solid var(--line); max-width: 46rem; }
.timeline li { position: relative; padding-bottom: 1.75rem; }
.timeline li::before {
  content: ""; position: absolute; left: calc(-1.75rem - 11px); top: 0.3rem;
  width: 18px; height: 18px; border-radius: 50%; background: var(--leaf-green); border: 3px solid var(--bg);
}
.timeline li:nth-child(6n + 1)::before { background: var(--leaf-red); }
.timeline li:nth-child(6n + 2)::before { background: var(--leaf-orange); }
.timeline li:nth-child(6n + 3)::before { background: var(--leaf-yellow); }
.timeline li:nth-child(6n + 4)::before { background: var(--leaf-green); }
.timeline li:nth-child(6n + 5)::before { background: var(--leaf-blue); }
.timeline li:nth-child(6n + 6)::before { background: var(--leaf-purple); }
.timeline h2 { margin: 0 0 0.25rem; font-size: 1.4rem; }
.timeline__time { margin: 0; font-weight: 700; }

/* ---------- Gallery ---------- */

.gallery { list-style: none; margin: 1rem 0 2rem; padding: 0; column-width: 16rem; column-gap: 1rem; }
.gallery li { break-inside: avoid; margin: 0 0 1rem; }
.gallery img { width: 100%; border-radius: var(--radius); background: var(--cream); }

/* ---------- Info & contact ---------- */

.items { margin: 0 0 1rem; padding-left: 1.25rem; }
.items li { margin-bottom: 0.75rem; }

.contact { margin: 1.5rem 0; display: grid; gap: 1rem; }
.contact div { background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; }
.contact dt { font-weight: 700; }
.contact dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- Footer ---------- */

main { min-height: 50vh; padding-bottom: 2rem; }
.site-footer { background: var(--cream); border-top: 1px solid var(--line); margin-top: 2rem; padding-block: 2rem; font-size: 1rem; }
.site-footer__inner { display: grid; gap: 1.5rem; }
.site-footer p, .site-footer address { margin: 0; font-style: normal; overflow-wrap: anywhere; }
@media (min-width: 48em) {
  .site-footer__inner { grid-template-columns: 2fr 2fr 1fr; align-items: start; }
  .site-footer__copy { text-align: right; }
}
