:root {
  --paper: #f3ecdf;
  --paper-2: #e7ddcc;
  --card: #fffaf3;
  --ink: #1c1915;
  --ink-soft: #4a433a;
  --line: rgba(28, 25, 21, 0.14);
  --cobalt: #1d4e89;
  --cobalt-deep: #14345f;
  --clay: #b5522a;
  --sea: #1c6b66;
  --focus: #0b3a82;
  --shadow: 0 16px 40px rgba(28, 25, 21, 0.08);
  --serif: "Fraunces", "Iowan Old Style", Palatino, Georgia, serif;
  --sans: "Outfit", "Avenir Next", "Segoe UI", sans-serif;
  --pad: clamp(1rem, 4vw, 1.5rem);
  --max: 72rem;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  overflow-x: clip;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% -10%, rgba(29, 78, 137, 0.08), transparent 32rem),
    linear-gradient(180deg, #f7f1e6 0%, var(--paper) 18rem);
  font-family: var(--sans);
  font-size: 1.05rem;
  line-height: 1.6;
}

body::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.45;
  background-image:
    linear-gradient(rgba(28, 25, 21, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(28, 25, 21, 0.035) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, #000, transparent 70%);
}

img { max-width: 100%; }

a { color: var(--cobalt-deep); }

a:hover { color: var(--clay); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  background: var(--ink);
  color: white;
  padding: 0.6rem 0.9rem;
  border-radius: 999px;
}

.skip:focus { top: 0.6rem; }

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

.compliance {
  background: var(--cobalt-deep);
  color: #f6f0e6;
  font-size: 0.92rem;
}

.compliance .wrap {
  display: flex;
  gap: 0.75rem 1.25rem;
  justify-content: space-between;
  align-items: center;
  padding-block: 0.55rem;
  flex-wrap: wrap;
}

.compliance a { color: #fff; }

.age-pill {
  display: inline-grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  border: 1.5px solid #f6f0e6;
  font-weight: 600;
  letter-spacing: 0.02em;
  flex: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(243, 236, 223, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.4rem;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: inherit;
  text-decoration: none;
}

.brand-lockup:hover { color: inherit; }

.mark {
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  padding: 4px;
  border-radius: 8px;
  background: #10284d;
}

.mark i:nth-child(1) { background: #ffc857; }
.mark i:nth-child(2) { background: #ff5d3a; }
.mark i:nth-child(3) { background: #1ec8b0; }
.mark i:nth-child(4) { background: #fff6e4; }
.mark i { display: block; border-radius: 2px; }

.brand-name {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 620;
  letter-spacing: -0.03em;
  line-height: 1;
}

.brand-name small {
  display: block;
  margin-top: 0.2rem;
  font-family: var(--sans);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 500;
}

.nav-toggle {
  display: none;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  min-height: 2.75rem;
  padding: 0 0.95rem;
  font: inherit;
  font-weight: 600;
}

.nav {
  display: flex;
  gap: 0.35rem 1.1rem;
  align-items: center;
}

.nav a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 500;
  padding: 0.35rem 0;
}

.nav a[aria-current="page"] {
  color: var(--clay);
  box-shadow: inset 0 -2px 0 var(--clay);
}

.opening { padding: 1.35rem 0 0.4rem; }

.kicker {
  margin: 0 0 0.45rem;
  color: var(--clay);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 620;
  letter-spacing: -0.03em;
  line-height: 1.12;
}

h1 {
  margin: 0 0 0.6rem;
  font-size: clamp(2rem, 7vw, 4.1rem);
  max-width: 16ch;
}

.lede, .deck {
  max-width: 42rem;
  color: var(--ink-soft);
  font-size: 1.08rem;
}

.rail-label {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
  margin: 1.25rem 0 0.7rem;
  font-size: 0.92rem;
}

.rail-label strong { font-family: var(--serif); font-size: 1.25rem; color: var(--ink); }

.rail-bleed { margin-inline: calc(var(--pad) * -1); }

.rail {
  display: flex;
  gap: 0.8rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--pad);
  padding: 0.15rem var(--pad) 0.9rem;
  -webkit-overflow-scrolling: touch;
}

.rail::-webkit-scrollbar { height: 8px; }
.rail::-webkit-scrollbar-thumb { background: rgba(20, 52, 95, 0.35); border-radius: 99px; }

.azulejo {
  flex: 0 0 9.6rem;
  scroll-snap-align: start;
  text-decoration: none;
  color: inherit;
}

.azulejo:hover { color: inherit; }

.face {
  --h: 214;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 1.15rem;
  color: #fffaf3;
  background:
    radial-gradient(circle at 28% 26%, rgba(255, 255, 255, 0.34) 0 7px, transparent 8px),
    radial-gradient(circle at 72% 72%, rgba(255, 255, 255, 0.22) 0 10px, transparent 11px),
    linear-gradient(155deg, hsl(var(--h) 72% 46%), hsl(var(--h) 64% 30%));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), var(--shadow);
  position: relative;
  overflow: hidden;
}

.face::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(255, 250, 243, 0.35);
  border-radius: 0.8rem;
}

.face b {
  position: relative;
  z-index: 1;
  font-family: var(--serif);
  font-size: 2.15rem;
  font-weight: 620;
  letter-spacing: -0.04em;
}

.azulejo-name {
  display: block;
  margin-top: 0.55rem;
  font-weight: 650;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.azulejo-lic {
  display: block;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.filters {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding-bottom: 0.2rem;
  margin: 0.4rem 0 1rem;
}

.chip, .btn, .nav-toggle { cursor: pointer; }

.chip {
  flex: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  border-radius: 999px;
  min-height: 2.75rem;
  padding: 0 0.95rem;
  font: inherit;
  font-weight: 550;
}

.chip.is-on {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

#filter-count {
  min-height: 1.4rem;
  margin: 0 0 0.8rem;
  color: var(--ink-soft);
}

.stack { display: grid; gap: 0.9rem; }

.brand {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 1.35rem;
  padding: 1rem;
  box-shadow: var(--shadow);
}

.brand-id {
  display: grid;
  grid-template-columns: 5.6rem 1fr;
  gap: 0.9rem;
  align-items: center;
  text-decoration: none;
  color: inherit;
}

.brand-id:hover { color: inherit; }

.brand-id .face { width: 5.6rem; border-radius: 1rem; box-shadow: none; }
.brand-id .face b { font-size: 1.55rem; }

.brand h2 {
  margin: 0.1rem 0 0.15rem;
  font-size: clamp(1.7rem, 6vw, 2.2rem);
}

.entity, .micro, .note { color: var(--ink-soft); }

.entity { margin: 0; font-size: 0.92rem; }

.lic-line {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cobalt-deep);
}

.brand .deck { margin: 0.85rem 0; font-size: 1rem; }

.tags, .checks { display: flex; flex-wrap: wrap; gap: 0.35rem; padding: 0; margin: 0 0 0.9rem; list-style: none; }

.tags li, .checks li {
  border-radius: 999px;
  background: var(--paper);
  padding: 0.2rem 0.6rem;
  font-size: 0.82rem;
}

.acts { display: grid; gap: 0.5rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.15rem;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 650;
  border: 1.5px solid transparent;
  text-align: center;
}

.btn.primary { background: #1a56c4; color: white; }
.btn.primary:hover { background: var(--cobalt-deep); color: white; }
.btn.ghost { background: transparent; border-color: var(--cobalt-deep); color: var(--cobalt-deep); }
.btn.ghost:hover { background: var(--cobalt-deep); color: white; }

.micro { margin: 0.65rem 0 0; font-size: 0.82rem; }

.panel {
  margin: 1.5rem 0;
  padding: 1.15rem 1.15rem 1.2rem;
  border-left: 6px solid var(--clay);
  background: rgba(255, 250, 243, 0.72);
  border-radius: 0 1rem 1rem 0;
}

.grid-2, .grid-3 { display: grid; gap: 0.9rem; }

.plain-card, .help-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  padding: 1rem 1.05rem;
}

.help-card strong { display: block; font-family: var(--serif); font-size: 1.45rem; }

.prose { padding-bottom: 1rem; }
.prose h1 { max-width: 18ch; font-size: clamp(2.1rem, 6vw, 3.5rem); }
.prose h2 { font-size: clamp(1.5rem, 4vw, 2rem); margin: 1.6rem 0 0.45rem; }
.prose p { max-width: 44rem; }
.prose ul, .prose ol { max-width: 44rem; padding-left: 1.15rem; }

.sources {
  background: var(--cobalt-deep);
  color: #f6f0e6;
  border-radius: 1.1rem;
  padding: 1rem 1.1rem;
  max-width: 44rem;
}

.sources a { color: #fff; }

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
  margin: 1rem 0 0;
}

.crumbs a { color: inherit; }

.site-footer {
  margin-top: 2rem;
  background: var(--cobalt-deep);
  color: #f4ecdf;
  padding: 1.6rem 0 2rem;
}

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

.footer-statement {
  border: 1px solid rgba(246, 240, 230, 0.35);
  border-radius: 1rem;
  padding: 1rem;
  font-size: 1.02rem;
  background: rgba(255, 255, 255, 0.04);
}

.footer-grid {
  display: grid;
  gap: 1.2rem;
  margin-top: 1.2rem;
}

.site-footer h2 {
  font-size: 1.05rem;
  margin: 0 0 0.4rem;
}

.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 0.25rem 0; }

.colophon { margin-top: 1.2rem; color: rgba(246, 240, 230, 0.78); font-size: 0.88rem; }

.muted-card { opacity: 0.78; }

dialog {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: calc(100% - 1.5rem);
}

dialog::backdrop { background: rgba(20, 24, 21, 0.62); }

.age-card {
  width: min(32rem, 100%);
  background: var(--card);
  color: var(--ink);
  border-radius: 1.3rem;
  padding: 1.2rem;
  box-shadow: var(--shadow);
}

.age-card h2 { margin: 0.2rem 0 0.5rem; font-size: 2rem; }

.age-actions { display: grid; gap: 0.5rem; margin-top: 1rem; }

form .field { display: grid; gap: 0.3rem; margin-bottom: 0.8rem; }
input, textarea {
  font: inherit;
  color: inherit;
  background: white;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  padding: 0.75rem 0.8rem;
  min-height: 3rem;
}
textarea { min-height: 8rem; resize: vertical; }
.checkline { display: flex; gap: 0.6rem; align-items: flex-start; }

.sent {
  display: none;
  border-radius: 1rem;
  background: #e7f2ef;
  padding: 0.9rem 1rem;
}

@media (min-width: 420px) {
  .acts { grid-template-columns: 1.35fr 0.8fr; }
  .age-actions { grid-template-columns: 1.2fr 0.8fr; }
}

@media (min-width: 760px) {
  .nav-toggle { display: none; }
  .opening-grid { display: block; }
  .rail-bleed { margin-inline: 0; }
  .rail {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1rem 0.9rem;
    overflow: visible;
    padding: 0;
  }
  .rail-label span { display: none; }
  .azulejo { flex: none; min-width: 0; }
  .azulejo-name { font-size: 1.12rem; }
  .stack.home-brands { grid-template-columns: 1fr 1fr; }
  .home-brands .brand-id { grid-template-columns: 6.5rem 1fr; }
  .home-brands .brand-id .face { width: 6.5rem; height: 6.5rem; }
  .home-brands .brand-id .face b { font-size: 1.9rem; }
  .home-brands .brand h2 { font-size: 2.25rem; }
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr 1fr; }
  .footer-grid { grid-template-columns: 1.3fr 1fr 1fr; }
  .brand { padding: 1.15rem; }
}

@media (max-width: 759px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    flex-direction: column;
    align-items: stretch;
    background: #f7f1e6;
    border-bottom: 1px solid var(--line);
    padding: 0.4rem var(--pad) 0.9rem;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 0.7rem 0; border-bottom: 1px solid var(--line); }

  .compliance .wrap {
    flex-wrap: nowrap;
    gap: 0.6rem;
    font-size: 0.78rem;
  }
  .compliance .wrap > span {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .compliance a { white-space: nowrap; flex: none; }
  .age-pill { width: 2rem; height: 2rem; font-size: 0.72rem; }
  .header-row { min-height: 3.6rem; }
  .opening { display: block; padding: 0.7rem 0 0.1rem; }
  .opening .deck,
  .opening .rail-label,
  .opening .rail-bleed { display: none; }
  .opening h1 {
    font-size: 1.45rem;
    max-width: none;
    margin: 0;
  }

  #marcas {
    display: flex;
    flex-direction: column;
    padding-top: 0.35rem;
  }
  #marcas .panel { order: 4; }
  #marcas .filters {
    order: 1;
    margin: 0.45rem 0 0.35rem;
  }
  #marcas #filter-count { order: 2; margin: 0 0 0.4rem; }
  #marcas .home-brands { order: 3; gap: 0.4rem; }

  .stack > .brand {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.45rem 0.6rem;
    padding: 0.55rem 0.6rem;
    border-radius: 0.95rem;
    border-color: rgba(16, 40, 77, 0.16);
    box-shadow: 0 8px 22px rgba(16, 40, 77, 0.08);
  }
  .stack > .brand .brand-id { grid-template-columns: 3.7rem minmax(0, 1fr); gap: 0.7rem; }
  .stack > .brand .face {
    width: 3.7rem;
    height: 3.7rem;
    border-radius: 0.8rem;
    box-shadow: none;
  }
  .stack > .brand .face::after { inset: 4px; border-radius: 0.5rem; }
  .stack > .brand .face b { font-size: 1.15rem; }
  .stack > .brand h2 {
    font-size: 1.5rem;
    line-height: 1.05;
  }
  .stack > .brand .entity,
  .stack > .brand .deck,
  .stack > .brand .tags,
  .stack > .brand .micro,
  .stack > .brand .btn.ghost { display: none; }
  .stack > .brand .lic-line {
    font-size: 0.68rem;
    letter-spacing: 0.04em;
  }
  .stack > .brand .acts { display: flex; }
  .stack > .brand .btn.primary {
    min-height: 2.6rem;
    padding: 0 0.75rem;
    font-size: 0.88rem;
    white-space: nowrap;
  }
}

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