/*
 * Bica static site: one shared stylesheet (copied to <out>/site.css by scripts/build-site.ts).
 * Same palette and fonts as the app (src/index.css): azul cobalt, deep-blue ink, gold (the swallow's
 * beak), cream; Fraunces for headings and Figtree for text. Mobile first.
 */
@font-face {
  font-family: 'Figtree';
  src: url('/fonts/figtree-latin-wght-normal.woff2') format('woff2');
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Fraunces';
  src: url('/fonts/fraunces-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --azul-50: #f1f5fc;
  --azul-100: #e0e9f8;
  --azul-200: #c3d3f0;
  --azul-300: #97b3e3;
  --azul-600: #1d4fa3;
  --azul-700: #183f82;
  --azul-800: #15336a;
  --terracota-50: #fdf3ef;
  --terracota-600: #b84e2a;
  --ocre-50: #fdf8ea;
  --ocre-100: #fbf0d4;
  --ocre-600: #b07a10;
  --ink: #15336a;
  --gold: #f2b134;
  --gold-600: #d99a1e;
  --muted: #5b6478;
  --line: #e4e7ee;
  --cream: #fbf9f4;
  --white: #fff;
  --radius: 16px;
  --shadow: 0 1px 2px rgb(29 39 66 / 0.05);
  --font-sans: 'Figtree', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Fraunces', ui-serif, Georgia, serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  font-weight: 450;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--ink);
  margin: 0;
}
h1 {
  font-size: clamp(2rem, 1.4rem + 3vw, 3rem);
}
h2 {
  font-size: clamp(1.5rem, 1.25rem + 1.2vw, 2rem);
  margin-top: 2.75rem;
  margin-bottom: 0.75rem;
}
h3 {
  font-size: 1.25rem;
  margin-top: 1.75rem;
  margin-bottom: 0.4rem;
}
p {
  margin: 0 0 1rem;
}
ul,
ol {
  margin: 0 0 1rem;
  padding-left: 1.3rem;
}
li + li {
  margin-top: 0.3rem;
}

a {
  color: var(--azul-600);
  text-underline-offset: 0.15em;
  text-decoration-thickness: 1px;
}
a:hover {
  color: var(--azul-800);
}
:focus-visible {
  outline: 3px solid var(--azul-300);
  outline-offset: 2px;
  border-radius: 4px;
}

img,
svg {
  max-width: 100%;
}

/* Portuguese text */
.pt {
  font-weight: 650;
  color: var(--azul-700);
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--white);
  padding: 0.5rem 1rem;
  z-index: 10;
}
.skip:focus {
  left: 0.5rem;
  top: 0.5rem;
}

.wrap {
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}
.prose {
  max-width: 44rem;
}
/* Lesson and article pages: one centred reading column. */
.wrap.narrow {
  max-width: calc(46rem + 4rem);
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 0.9rem;
}

/* Header */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 1.4rem;
  letter-spacing: -0.01em;
}
.brand img {
  width: 34px;
  height: 34px;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.site-nav a:not(.btn) {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  padding: 0.5rem 0.7rem;
  border-radius: 999px;
}
.site-nav a:not(.btn):hover {
  background: var(--azul-50);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  background: var(--azul-600);
  color: var(--white);
  font-weight: 650;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  box-shadow: 0 2px 0 rgb(21 51 106 / 0.35);
  transition: background-color 0.1s, transform 0.1s;
}
.btn:hover {
  background: var(--azul-700);
  color: var(--white);
}
.btn:active {
  transform: scale(0.97);
}
.btn-sm {
  min-height: 2.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.95rem;
}
.btn-white {
  background: var(--white);
  color: var(--azul-700);
  box-shadow: 0 2px 0 rgb(21 51 106 / 0.25);
}
.btn-white:hover {
  background: var(--azul-50);
  color: var(--azul-800);
}
.btn-ghost {
  background: transparent;
  color: var(--white);
  box-shadow: inset 0 0 0 2px rgb(255 255 255 / 0.7);
}
.btn-ghost:hover {
  background: rgb(255 255 255 / 0.12);
  color: var(--white);
}
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* Azulejo tiles */
.band {
  background-color: var(--azul-600);
  background-image: linear-gradient(rgb(29 79 163 / 0.88), rgb(29 79 163 / 0.88)), url('/azulejo.svg');
  background-size: auto, 88px 88px;
  color: var(--white);
}
.tiles {
  height: 22px;
  background-color: var(--cream);
  background-image: linear-gradient(rgb(251 249 244 / 0.35), rgb(251 249 244 / 0.35)), url('/azulejo.svg');
  background-size: auto, 44px 44px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

/* Hero (landing page) */
.hero {
  /* Only top and bottom: the sides come from .wrap. */
  padding-top: 2.25rem;
  padding-bottom: 3rem;
}
.hero h1 {
  color: var(--white);
  max-width: 16ch;
  font-size: clamp(2.3rem, 1.4rem + 4.5vw, 3.9rem);
  line-height: 1.08;
}
.hero .lead {
  color: var(--azul-50);
  font-size: 1.2rem;
  max-width: 38rem;
  margin-top: 1.1rem;
}
.hero .pt {
  color: var(--white);
}
.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.2rem;
  padding: 0;
  list-style: none;
}
.hero-tags li {
  margin: 0;
  background: rgb(255 255 255 / 0.14);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
}

/* Page heads (lessons, articles) */
.page-head {
  padding: 1.5rem 0 0.5rem;
}
.eyebrow {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.6rem;
  align-items: center;
  margin: 0 0 0.6rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--muted);
}
.lead {
  font-size: 1.15rem;
  margin-top: 1rem;
}
.kicker {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.badge {
  display: inline-block;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.5;
  vertical-align: middle;
  background: var(--azul-100);
  color: var(--azul-800);
}
.badge-a2 {
  background: var(--ocre-100);
  color: #6b4a07;
}

/* Breadcrumb */
.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  list-style: none;
  padding: 0;
  margin: 1.25rem 0 0;
  font-size: 0.92rem;
  color: var(--muted);
}
.crumbs li {
  margin: 0;
}
.crumbs li + li::before {
  content: '›';
  margin-right: 0.35rem;
  color: var(--azul-300);
}
.crumbs a {
  color: var(--muted);
}

/* Cards */
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
}
.grid {
  display: grid;
  gap: 1rem;
}
/* Sections */
.section {
  padding: 1rem 0 2rem;
}
.section > h2:first-child {
  margin-top: 1.5rem;
}

/* Audio buttons */
.play {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--azul-50);
  color: var(--azul-600);
  cursor: pointer;
  transition: background-color 0.1s, transform 0.1s;
}
.play:hover {
  background: var(--azul-100);
}
.play:active {
  transform: scale(0.94);
}
.play.on {
  background: var(--azul-600);
  color: var(--white);
}
.play svg {
  width: 1rem;
  height: 1rem;
  margin-left: 2px;
}
.play-gap {
  flex: none;
  width: 2.25rem;
}
.say {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}
.say .play {
  margin-top: -0.1rem;
}

/* Vocabulary tables */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
  margin: 0 0 1.25rem;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
}
caption {
  text-align: left;
  font-weight: 700;
  padding: 0.85rem 1rem 0.25rem;
}
th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.7rem 0.75rem;
  border-top: 1px solid var(--line);
}
td:first-child,
th:first-child {
  padding-left: 1rem;
}
/* Keep short Portuguese phrases ("o galão") on one line on phones. */
.vocab td:first-child {
  width: 46%;
  min-width: 9.5rem;
}
thead th {
  border-top: 0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
}
td .alt,
td .note {
  display: block;
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 0.2rem;
}
td .pt {
  font-size: 1.05rem;
}
.compare th[scope='row'] {
  font-weight: 600;
}
.compare .col-br {
  color: #4a5266;
}
.flag {
  white-space: nowrap;
}

/* Sentences */
.sentences {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.6rem;
}
.sentences li {
  margin: 0;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  box-shadow: var(--shadow);
}
.sentences .line {
  display: block;
  font-size: 1.08rem;
}
.sentences .en {
  display: block;
  color: #3a4560;
}
.sentences .note {
  display: block;
  font-size: 0.92rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

/* Grammar notes */
.tip {
  margin-bottom: 1rem;
}
.tip h3 {
  margin-top: 0;
  margin-bottom: 0.6rem;
}
.tip p:last-child {
  margin-bottom: 0;
}
.tip .sentences {
  margin-top: 0.75rem;
}
.tip .sentences li {
  background: var(--cream);
  box-shadow: none;
}

/* Calls to action */
.cta {
  margin: 2.5rem 0 1.5rem;
  padding: 1.5rem;
  border-radius: 20px;
}
.cta h2 {
  color: var(--white);
  margin: 0 0 0.5rem;
  font-size: 1.6rem;
}
.cta p {
  color: var(--azul-50);
  margin: 0;
}
.cta .pt {
  color: var(--white);
}
.cta .btn-row {
  margin-top: 1.1rem;
}

.callout {
  border-left: 4px solid var(--azul-600);
  background: var(--azul-50);
  border-radius: 0 12px 12px 0;
  padding: 0.9rem 1.1rem;
  margin: 0 0 1.25rem;
}
.callout p:last-child {
  margin-bottom: 0;
}
.callout.warn {
  border-left-color: var(--ocre-600);
  background: var(--ocre-50);
}

/* Prev / next */
.pager {
  display: grid;
  gap: 0.75rem;
  margin: 2rem 0;
}
.pager a {
  display: block;
  text-decoration: none;
  color: var(--ink);
}
.pager a:hover {
  border-color: var(--azul-300);
}
.pager .dir {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.pager .ttl {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
}
.pager .next {
  text-align: right;
}

/* Unit lists */
.units {
  display: grid;
  gap: 1rem;
}
.unit h3 {
  margin: 0.15rem 0 0.35rem;
}
.unit .num {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.unit .pt-title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  color: var(--azul-700);
}
.unit p {
  margin: 0 0 0.6rem;
  color: #3a4560;
}
.lessons {
  margin: 0;
  padding-left: 1.3rem;
}
.lessons li {
  margin-top: 0.25rem;
}
.lessons .words {
  display: block;
  font-size: 0.9rem;
  color: var(--muted);
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  padding: 0;
  margin: 0.4rem 0 0;
}
.chips li {
  margin: 0;
}
.chips a {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: var(--azul-50);
  color: var(--azul-700);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
}
.chips a:hover {
  background: var(--azul-100);
}

/* Landing page */
.btn-gold {
  background: var(--gold);
  color: var(--ink);
  box-shadow: 0 2px 0 var(--gold-600);
}
.btn-gold:hover {
  background: #f5c25a;
  color: var(--ink);
}
.hero-grid {
  display: grid;
  gap: 1.5rem;
  align-items: center;
}
.hero-mascot {
  order: -1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 999px;
  background: var(--white);
  box-shadow: 0 6px 20px rgb(21 51 106 / 0.3);
}
.hero-mascot svg {
  width: 78%;
  height: auto;
}
.hero-note {
  margin: 0.9rem 0 0;
  font-size: 0.92rem;
  color: var(--azul-100);
}
.pairs {
  grid-template-columns: 1fr;
}
.pair {
  padding: 1rem;
}
.pairs,
.how,
.unit-cards {
  display: grid;
  gap: 0.75rem;
  list-style: none;
  padding: 0;
  margin: 1.25rem 0;
}
.pairs li,
.how li,
.unit-cards li {
  margin: 0;
}
.pair p {
  margin: 0;
}
.pair-en {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.pair-pt {
  margin-top: 0.5rem !important;
}
.pair-pt .say {
  align-items: center;
}
.pair-pt .pt {
  font-family: var(--font-display);
  font-size: 1.2rem;
  line-height: 1.2;
}
.pair-br {
  margin-top: 0.45rem !important;
  font-size: 0.9rem;
  color: var(--muted);
}
.pair-label {
  margin-top: 0.6rem !important;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--azul-600);
}
.pair-label + .pair-pt {
  margin-top: 0.2rem !important;
}
.level-group h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.unit-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.9rem 1rem;
}
.unit-card .unit-icon {
  flex: none;
  display: inline-flex;
  width: 2.75rem;
  height: 2.75rem;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: var(--cream);
  font-size: 1.4rem;
}
.unit-card .num {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
}
.unit-card h4 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.25;
}
.unit-card h4 a {
  color: var(--ink);
  text-decoration: none;
}
.unit-card h4 a::after {
  content: '';
  position: absolute;
  inset: 0;
}
.unit-card {
  position: relative;
}
.unit-card:hover {
  border-color: var(--azul-300);
}
.unit-card .pt-title {
  margin: 0;
}
.moving-card {
  border: 0;
  background: var(--ink);
  color: var(--azul-50);
  padding: 1.5rem;
  background-image: linear-gradient(rgb(21 51 106 / 0.93), rgb(21 51 106 / 0.93)), url('/azulejo.svg');
  background-size: auto, 88px 88px;
}
.moving-card h2 {
  color: var(--white);
  margin-top: 0;
}
.moving-card strong {
  color: var(--gold);
}
.moving-card a {
  color: var(--white);
  font-weight: 650;
}
.moving-card .links {
  margin: 0;
  line-height: 2;
}
.how .icon {
  display: inline-flex;
  width: 2.75rem;
  height: 2.75rem;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgb(242 177 52 / 0.18);
  color: var(--ink);
}
.how h3 {
  margin-top: 0.6rem;
  font-size: 1.15rem;
}
.how p {
  margin: 0.35rem 0 0;
  color: #3a4560;
}

/* Unit pages */
.pt-subtitle {
  margin: 0.35rem 0 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.35rem;
  color: var(--azul-600);
}
.unit-lesson-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  margin: 1.5rem 0 0.6rem;
}
.unit-lesson-head h3 {
  margin: 0;
  font-size: 1.15rem;
}
.unit-lesson-head h3 a {
  color: var(--ink);
}

/* FAQ */
.faq details {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.25rem 1.1rem;
  margin-bottom: 0.6rem;
}
.faq summary {
  cursor: pointer;
  font-weight: 700;
  padding: 0.75rem 0;
  list-style-position: outside;
}
.faq details p {
  margin: 0 0 0.9rem;
}

/* Sources */
.sources {
  font-size: 0.95rem;
}
.sources li {
  margin-top: 0.45rem;
}

/* Footer */
.site-footer {
  margin-top: 3rem;
  background: var(--white);
}
.site-footer .wrap {
  padding-top: 2rem;
  padding-bottom: 2.5rem;
}
.footer-cols {
  display: grid;
  gap: 1.5rem;
}
.site-footer h2 {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 0.5rem;
}
.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.site-footer li {
  margin: 0.3rem 0 0;
}
.site-footer a {
  color: var(--ink);
}
.site-footer .fine {
  margin-top: 1.75rem;
  font-size: 0.88rem;
  color: var(--muted);
}

@media (min-width: 640px) {
  .wrap {
    padding: 0 2rem;
  }
  .pager {
    grid-template-columns: 1fr 1fr;
  }
  .pairs,
  .unit-cards {
    grid-template-columns: repeat(2, 1fr);
  }
  .how {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-cols {
    grid-template-columns: 2fr 1fr 1fr;
  }
  .cta {
    padding: 2rem;
  }
}

@media (min-width: 960px) {
  .hero {
    padding-top: 4.5rem;
    padding-bottom: 4.75rem;
  }
  .units-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  .hero-grid {
    grid-template-columns: 1fr auto;
  }
  .hero-mascot {
    order: 0;
    width: 15rem;
    height: 15rem;
  }
  .pairs {
    grid-template-columns: repeat(4, 1fr);
  }
  .unit-cards {
    grid-template-columns: repeat(3, 1fr);
  }
  .how {
    grid-template-columns: repeat(5, 1fr);
  }
  .page-head {
    padding-top: 2.25rem;
  }
}

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