/* The Guazabara Foundation, Inc.
   Shared entity type system (Fraunces, Public Sans).
   Foundation palette, ruled 2026-09-30: night ground, gold signal, cream for reading. */

:root {
  --night: #141826;
  --night-lift: #1F2740;
  --night-deep: #0D1019;
  --gold: #D6A62D;
  --gold-soft: #E6C568;
  --gold-ink: #7A5E14;
  --cream: #F7F0E1;
  --cream-deep: #EFE5CF;
  --ink: #141826;
  --ink-soft: #4A4E5E;
  --rule: #D8CDB6;
  --rule-dark: rgba(214, 166, 45, 0.35);
  --measure: 66ch;
  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Public Sans", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
}

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

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

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
}

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

a { color: var(--ink); text-underline-offset: 0.18em; text-decoration-thickness: 1px; text-decoration-color: var(--gold); }
a:hover { color: var(--gold-ink); text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px var(--cream);
}
.masthead a:focus-visible, .masthead button:focus-visible, .hero a:focus-visible, section.dark a:focus-visible, .footer a:focus-visible {
  outline-color: var(--gold);
  box-shadow: 0 0 0 6px var(--night);
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--gold); color: var(--night); padding: 12px 18px; z-index: 50;
}
.skip:focus { left: 8px; top: 8px; }

/* Masthead */

.masthead { border-top: 6px solid var(--gold); background: var(--night); color: var(--cream); }
.masthead .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; padding-top: 18px; padding-bottom: 18px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 16px; text-decoration: none; color: var(--cream); }
.brand img { width: 104px; }
.brand-name { font-family: var(--serif); font-weight: 500; font-size: 1.3rem; line-height: 1.15; letter-spacing: -0.005em; }

.nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 22px; align-items: center; }
.nav a {
  font-size: 0.92rem; font-weight: 500; color: var(--cream); text-decoration: none;
  padding: 8px 0; border-bottom: 2px solid transparent; display: inline-block;
}
.nav a:hover { border-bottom-color: var(--rule-dark); color: var(--cream); }
.nav a[aria-current="page"] { border-bottom-color: var(--gold); }
.nav a.cta {
  background: var(--gold); color: var(--night); padding: 10px 18px; border: 0; border-radius: 2px; font-weight: 600;
}
.nav a.cta:hover { background: var(--gold-soft); color: var(--night); }
.nav a.lang { font-weight: 600; border: 1px solid var(--rule-dark); padding: 8px 12px; border-radius: 2px; }
.nav a.lang:hover { border-color: var(--gold); }

.menu-toggle {
  display: none; font: inherit; font-size: 0.92rem; font-weight: 600;
  background: none; border: 1px solid var(--cream); color: var(--cream);
  padding: 9px 16px; border-radius: 2px; cursor: pointer;
}

@media (max-width: 860px) {
  .menu-toggle { display: inline-block; }
  .nav { flex-basis: 100%; display: none; }
  .nav.open { display: block; }
  .nav ul { flex-direction: column; align-items: stretch; gap: 0; }
  .nav li { border-top: 1px solid var(--rule-dark); }
  .nav a { display: block; padding: 14px 0; border-bottom: 0; }
  .nav a.cta { margin: 14px 0 4px; text-align: center; }
  .nav a.lang { text-align: center; margin-bottom: 8px; }
  .brand img { width: 84px; }
  .brand-name { font-size: 1.12rem; }
}

/* Type */

h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.12; letter-spacing: -0.012em; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.3rem, 5.6vw, 4.1rem); font-variation-settings: "opsz" 144, "SOFT" 30; }
h2 { font-size: clamp(1.65rem, 3.2vw, 2.35rem); }
h3 { font-size: 1.28rem; font-weight: 500; line-height: 1.25; }
p { margin: 0 0 1.1em; max-width: var(--measure); }
p:last-child { margin-bottom: 0; }
h2 + p, h2 + ul, h2 + .table-scroll { margin-top: 20px; }

.eyebrow {
  font-family: var(--sans); font-size: 0.74rem; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--gold-ink); margin: 0 0 18px;
}
.lede { font-family: var(--serif); font-size: clamp(1.18rem, 2vw, 1.42rem); line-height: 1.5; font-weight: 300; max-width: 38em; }

/* Hero: night ground, cream type, gold signal. Image or mark panel on the right at desktop. */

.hero { background: var(--night); color: var(--cream); padding: clamp(56px, 9vw, 112px) 0 clamp(48px, 7vw, 88px); overflow: hidden; }
.hero .eyebrow { color: var(--gold); }
.hero h1 { max-width: 15em; }
.hero .lede { margin-top: 28px; color: var(--cream); }
.hero a { color: var(--cream); }
.hero.page h1 { font-size: clamp(2rem, 4.6vw, 3.2rem); }

.hero.home .wrap { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
.hero.home { padding-top: 0; padding-bottom: 0; }
.hero.home .wrap > div:first-child { padding: clamp(56px, 9vw, 112px) 0 clamp(48px, 7vw, 88px); }

/* Hero carousel: the art fades in from the right over night. Crossfade only; no sliding. */
.hero-carousel { position: relative; align-self: stretch; min-height: 420px; }
.hero-carousel .slides { list-style: none; margin: 0; padding: 0; position: absolute; inset: 0; }
.hero-carousel .slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.2s ease; }
.hero-carousel .slide.current { opacity: 1; }
.hero-carousel .slide img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
.hero-carousel .slide::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(to right, var(--night) 0%, rgba(20, 24, 38, 0.6) 22%, rgba(20, 24, 38, 0) 50%),
    linear-gradient(to bottom, var(--night) 0%, rgba(20, 24, 38, 0) 18%, rgba(20, 24, 38, 0) 82%, var(--night) 100%);
}
.carousel-controls { position: absolute; left: 0; bottom: 18px; display: flex; align-items: center; gap: 14px; z-index: 2; }
.carousel-pause { font: inherit; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; background: rgba(20, 24, 38, 0.7); color: var(--cream); border: 1px solid rgba(247, 240, 225, 0.4); border-radius: 2px; padding: 6px 10px; cursor: pointer; }
.carousel-pause:hover { border-color: var(--gold); }
.dots { display: flex; gap: 8px; }
.dots button { width: 12px; height: 12px; padding: 0; border-radius: 50%; border: 1px solid var(--cream); background: transparent; cursor: pointer; }
.dots button[aria-current="true"] { background: var(--gold); border-color: var(--gold); }
@media (prefers-reduced-motion: reduce) { .hero-carousel .slide { transition: none; } }
@media (max-width: 860px) {
  .hero.home .wrap { grid-template-columns: 1fr; }
  .hero.home .wrap > div:first-child { padding-bottom: 24px; }
  .hero-carousel { min-height: 0; height: 320px; margin: 0 calc(-1 * var(--gutter)); }
  .hero-carousel .slide::after { background: linear-gradient(to bottom, var(--night) 0%, rgba(20, 24, 38, 0) 25%, rgba(20, 24, 38, 0) 100%); }
  .carousel-controls { left: var(--gutter); }
}

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.btn {
  display: inline-block; font-weight: 600; font-size: 0.95rem; text-decoration: none;
  padding: 14px 22px; border-radius: 2px; border: 1px solid var(--ink); color: var(--ink);
}
.btn:hover { background: var(--ink); color: var(--cream); }
.btn.primary { background: var(--gold); border-color: var(--gold); color: var(--night); }
.btn.primary:hover { background: var(--gold-soft); border-color: var(--gold-soft); color: var(--night); }
.hero .btn, section.dark .btn { border-color: var(--cream); color: var(--cream); }
.hero .btn:hover, section.dark .btn:hover { background: var(--cream); color: var(--night); }
.hero .btn.primary, section.dark .btn.primary { background: var(--gold); border-color: var(--gold); color: var(--night); }
.hero .btn.primary:hover, section.dark .btn.primary:hover { background: var(--gold-soft); border-color: var(--gold-soft); }

/* Sections */

section { padding: clamp(48px, 7vw, 88px) 0; }
section + section { border-top: 1px solid var(--rule); }
section.paper { background: var(--cream-deep); }
section.dark { background: var(--night-lift); color: var(--cream); border-top: 0; }
section.dark + section { border-top: 0; }
section.dark .eyebrow { color: var(--gold); }
section.dark a { color: var(--cream); text-decoration-color: var(--gold); }
section.dark a:hover { color: var(--gold-soft); }

.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

/* A book cover beside a text column. */
.cover-split { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); align-items: center; }
.cover-split h2 + p { margin-top: 20px; }
.cover { margin: 0; justify-self: end; max-width: 300px; }
.cover img { width: 100%; box-shadow: 0 18px 40px -18px rgba(20, 24, 38, 0.55), 0 0 0 1px rgba(20, 24, 38, 0.08); }
.cover figcaption { font-size: 0.82rem; color: var(--ink-soft); margin-top: 14px; line-height: 1.5; }
.cover figcaption strong { font-weight: 600; color: var(--ink); }
@media (max-width: 860px) { .cover-split { grid-template-columns: 1fr; } .cover { justify-self: start; max-width: 220px; } }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0; margin-top: 40px; border-top: 1px solid var(--ink); }
.card { padding: 28px 24px 32px 0; border-bottom: 1px solid var(--rule); }
.card h3 { margin-bottom: 10px; }
.card p { font-size: 0.98rem; color: var(--ink-soft); }
.card .num { font-family: var(--serif); font-size: 0.95rem; color: var(--gold-ink); display: block; margin-bottom: 14px; font-style: italic; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0; border-top: 1px solid var(--ink); margin: 0; padding: 0; }
.facts div { padding: 22px 24px 24px 0; border-bottom: 1px solid var(--rule); }
.facts dt { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.13em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 8px; }
.facts dd { margin: 0; font-family: var(--serif); font-size: 1.22rem; line-height: 1.3; }
section.dark .facts { border-top-color: var(--gold); }
section.dark .facts div { border-bottom-color: var(--rule-dark); }
section.dark .facts dt { color: var(--gold-soft); }

.layers { margin: 36px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--ink); }
.layers li { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 12px 40px; padding: 26px 0; border-bottom: 1px solid var(--rule); }
.layers .term { font-family: var(--serif); font-size: 1.3rem; line-height: 1.25; }
.layers .term small { display: block; font-family: var(--sans); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.13em; text-transform: uppercase; color: var(--gold-ink); margin-top: 8px; }
.layers p { font-size: 1rem; }
@media (max-width: 700px) { .layers li { grid-template-columns: 1fr; } }

.steps { counter-reset: step; list-style: none; margin: 36px 0 0; padding: 0; border-top: 1px solid var(--ink); }
.steps li { counter-increment: step; position: relative; padding: 24px 0 24px 64px; border-bottom: 1px solid var(--rule); max-width: 46em; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 22px;
  font-family: var(--serif); font-size: 1.7rem; font-style: italic; color: var(--gold-ink);
}
.steps strong { display: block; font-family: var(--serif); font-weight: 500; font-size: 1.15rem; margin-bottom: 4px; }

.plain { margin: 0 0 1.1em; padding-left: 1.15em; max-width: var(--measure); }
.plain li { margin-bottom: 0.5em; }

.notice { border-left: 4px solid var(--gold); background: var(--cream-deep); padding: 22px 26px; margin: 0 0 36px; max-width: 46em; }
.notice p { margin-bottom: 0.5em; }
.notice strong { font-weight: 600; }

.table-scroll { overflow-x: auto; margin-top: 32px; }
table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: 0.98rem; }
th, td { text-align: left; vertical-align: top; padding: 14px 20px 14px 0; border-bottom: 1px solid var(--rule); }
thead th { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.13em; text-transform: uppercase; color: var(--ink-soft); border-bottom: 1px solid var(--ink); }
tbody th { font-weight: 600; width: 34%; }

.close { padding: clamp(56px, 8vw, 96px) 0; }
.close h2 { max-width: 18em; }
.close p { margin-top: 18px; }

/* Footer */

.footer { background: var(--night-deep); color: #C9C3B3; padding: 56px 0 40px; font-size: 0.92rem; }
.footer a { color: var(--cream); text-decoration-color: var(--gold); }
.footer a:hover { color: var(--gold-soft); }
.footer .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 36px 48px; }
.footer img { width: 120px; margin-bottom: 18px; }
.footer h2 { font-family: var(--sans); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); margin-bottom: 14px; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin-bottom: 8px; }
.footer .name { font-family: var(--serif); font-size: 1.2rem; color: var(--cream); margin-bottom: 8px; }
.footer .legal { border-top: 1px solid var(--rule-dark); margin-top: 44px; padding-top: 24px; color: #B3AD9C; font-size: 0.84rem; }
.footer .legal p { max-width: 74ch; margin-bottom: 0.7em; }

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

@media print {
  .masthead, .footer, .actions, .menu-toggle { display: none; }
  body { background: #fff; }
  .hero { background: #fff; color: #000; }
  section { padding: 24px 0; }
}
