/* Joana AI — guides (/learn). Same tokens as the landing page (docs/design-system.md). */
:root {
  --bg: #F7F3EA; --surface: #FFFDF6; --sunken: #F1EBDD;
  --ink: #1A1A1A; --text-2: #5C574E; --text-3: #9B958A; --on-ink: #F7F3EA;
  --pink-t: #FBE3F0; --blue: #B6CAEB; --blue-t: #DCE6F5;
  --olive: #9AAB63; --olive-t: #E9EFDA; --yellow: #F5D867; --yellow-t: #FBF0C8;
  --voice: #F0715B; --voice-t: #FADDD6; --wrong: #C74F3E; --right: #55682B;
  --border: #E5DECF;
  --display: "Bricolage Grotesque", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font: 400 18px/1.7 Figtree, system-ui, sans-serif; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:focus-visible, summary:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 12px; }
p, li, td, th { overflow-wrap: break-word; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 50; background: #fff; padding: 8px 12px; border-radius: 8px; }

/* Header — mirrors the landing page */
.site-header { position: sticky; top: 0; z-index: 40; background: rgba(247,243,234,.88); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.site-header .in { max-width: 72rem; height: 64px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font: 700 20px/1 var(--display); letter-spacing: -.025em; text-decoration: none; }
.brand img { width: 32px; height: 32px; border-radius: 99px; object-fit: cover; }
.site-nav { display: none; gap: 32px; font-size: 15px; font-weight: 500; }
.site-nav a { color: var(--text-2); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current] { color: var(--ink); }
@media (min-width: 768px) { .site-nav { display: flex; } .site-header .in { padding: 0 32px; } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .6rem; border-radius: 999px; background: var(--ink); color: var(--on-ink); font-weight: 600; text-decoration: none; line-height: 1.2; transition: transform .12s, opacity .12s; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(.98); opacity: .85; }
.btn svg { width: 20px; height: 20px; fill: currentColor; flex: none; }
.btn-sm { padding: 10px 20px; font-size: 14px; }
.btn-lg { padding: 16px 28px; font-size: 17px; }

.eyebrow { display: inline-flex; align-items: center; gap: .5rem; border-radius: 999px; padding: .4rem .85rem; font-size: 13px; font-weight: 600; line-height: 1.2; background: var(--surface); border: 1px solid var(--border); }
.eyebrow i { width: 8px; height: 8px; border-radius: 99px; background: var(--olive); }
.hl { background: linear-gradient(transparent 58%, var(--yellow) 58%, var(--yellow) 92%, transparent 92%); padding: 0 .08em; }

/* Article */
.article { max-width: 720px; margin: 0 auto; padding: 20px 20px 64px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 20px; padding: 0; list-style: none; font-size: 14px; color: var(--text-2); }
.crumbs li { margin: 0; }
.crumbs li + li::before { content: "›"; margin-right: 6px; color: var(--text-3); }
.crumbs a { color: var(--text-2); }
h1, h2, h3 { font-family: var(--display); color: var(--ink); }
h1 { margin: 20px 0 0; font-size: clamp(2.3rem, 7.5vw, 3.4rem); line-height: 1.05; font-weight: 700; letter-spacing: -.025em; }
h2 { margin: 56px 0 14px; font-size: clamp(1.65rem, 4.6vw, 2.15rem); line-height: 1.15; font-weight: 700; letter-spacing: -.02em; scroll-margin-top: 80px; }
h3 { margin: 32px 0 8px; font-size: 1.28rem; line-height: 1.3; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0 0 18px; }
ul, ol { margin: 0 0 18px; padding-left: 24px; }
li { margin: 8px 0; }
.byline { margin: 16px 0 0; font-size: 15px; color: var(--text-2); }
.lead { margin-top: 20px; font-size: 20px; line-height: 1.6; color: var(--text-2); }

.answer { margin: 28px 0 8px; padding: 22px 24px 6px; border-radius: 24px; background: var(--blue-t); }
.answer .label { margin: 0 0 8px; font-size: 13px; font-weight: 700; letter-spacing: .02em; color: var(--text-2); }
.answer p { font-size: 18.5px; }

.toc { margin: 28px 0 0; padding: 18px 22px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); font-size: 16px; }
.toc p { margin: 0 0 6px; font-weight: 600; }
.toc ol { margin: 0; padding-left: 20px; }
.toc li { margin: 4px 0; }

.table { margin: 20px 0 26px; overflow-x: auto; border-radius: 18px; background: var(--surface); box-shadow: 0 6px 20px rgba(31,27,19,.06); }
table { width: 100%; border-collapse: collapse; font-size: 16px; line-height: 1.45; }
th, td { padding: 12px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
th { background: var(--sunken); font-weight: 600; font-size: 14.5px; }
tr:last-child td { border-bottom: 0; }
td.pt { font-weight: 600; }
td.br { color: var(--text-2); }
table.apps { table-layout: fixed; }
table.apps .c-app { width: 29%; }
table.apps .c-var { width: 29%; }
table.apps th, table.apps td { -webkit-hyphens: auto; hyphens: auto; }
@media (max-width: 480px) {
  th, td { padding: 10px 10px; font-size: 15px; }
  th { font-size: 13.5px; }
}

/* Listen buttons: shown only when the device has a European Portuguese (pt-PT) voice.
   Negative vertical margins keep the 28px button from making its line taller than the others. */
.say { display: inline-grid; place-items: center; width: 28px; height: 28px; margin: -6px 0 -6px 6px; vertical-align: middle; border: 0; border-radius: 99px; background: var(--voice-t); color: var(--voice); cursor: pointer; font-size: 11px; line-height: 1; }
.nowrap { white-space: nowrap; }
.say:hover { background: var(--voice); color: #fff; }
.say:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.voice-note { display: none; font-size: 15px; color: var(--text-2); }
.has-voice .voice-note { display: block; }
td.sound { color: var(--text-2); font-size: 15px; }

.wrong { display: inline-block; border-radius: 10px; padding: .1rem .5rem; background: var(--voice-t); color: var(--wrong); text-decoration: line-through; font-weight: 600; }
.right { display: inline-block; border-radius: 10px; padding: .1rem .5rem; background: var(--olive-t); color: var(--right); font-weight: 700; }

.note { margin: 24px 0; padding: 18px 22px 2px; border-radius: 18px; background: var(--yellow-t); }
.note p { font-size: 17px; }

.steps { list-style: none; padding: 0; margin: 20px 0 24px; counter-reset: s; }
.steps li { position: relative; margin: 0 0 18px; padding-left: 52px; counter-increment: s; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 99px; background: var(--ink); color: var(--on-ink); font: 700 17px/1 var(--display); }
.steps b { display: block; font-size: 18px; }

/* Real app screenshots in an iPhone frame (same as landing) */
.shots { display: grid; gap: 28px; margin: 28px 0; }
@media (min-width: 560px) { .shots { grid-template-columns: 1fr 1fr; gap: 24px; } }
.shots figure { margin: 0; }
.phone { max-width: 290px; margin: 0 auto; border-radius: 42px; background: #111; padding: 8px; box-shadow: 0 34px 60px -32px rgba(31,27,19,.55), 0 0 0 1px rgba(0,0,0,.08); }
.phone > div { border-radius: 35px; overflow: hidden; background: var(--bg); }
figcaption { margin-top: 12px; font-size: 14.5px; line-height: 1.45; color: var(--text-2); text-align: center; }

.cta { display: grid; gap: 22px; align-items: center; margin: 48px 0; padding: 30px 24px; border-radius: 32px; background: var(--blue-t); }
.cta h2 { margin: 0 0 8px; font-size: clamp(1.6rem, 4.6vw, 2.1rem); }
.cta p { color: var(--text-2); }
.cta .small { margin: 12px 0 0; font-size: 14px; }
.cta img { order: -1; width: 88px; height: 88px; border-radius: 99px; object-fit: cover; box-shadow: 0 0 0 5px var(--surface); }
@media (min-width: 600px) { .cta { grid-template-columns: 1fr auto; padding: 36px 36px; } .cta img { order: 0; width: 150px; height: 150px; box-shadow: 0 0 0 6px var(--surface); } }

.faq details { margin: 0 0 12px; padding: 18px 22px; border-radius: 24px; background: var(--surface); box-shadow: 0 6px 20px rgba(31,27,19,.06); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; list-style: none; font-size: 17.5px; font-weight: 600; line-height: 1.35; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary span { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 99px; background: var(--sunken); font-size: 20px; transition: transform .15s; }
.faq details[open] summary span { transform: rotate(45deg); }
.faq details p { margin: 12px 0 4px; font-size: 16.5px; color: var(--text-2); }

.sources { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--border); font-size: 15px; color: var(--text-2); }
.sources h2 { margin: 0 0 8px; font-size: 1.2rem; }
.sources a { color: var(--text-2); }
.sources li { margin: 4px 0; }

/* Guides index */
.cards { display: grid; gap: 14px; margin: 28px 0; padding: 0; list-style: none; }
.cards li { margin: 0; }
.cards a { display: block; padding: 22px 24px; border-radius: 24px; background: var(--surface); box-shadow: 0 6px 20px rgba(31,27,19,.06); text-decoration: none; transition: transform .12s; }
.cards a:hover { transform: translateY(-1px); }
.cards b { display: block; font: 700 1.3rem/1.25 var(--display); letter-spacing: -.01em; }
.cards span { display: block; margin-top: 6px; font-size: 16px; color: var(--text-2); }

/* Footer — mirrors the landing page */
.site-footer .in { max-width: 72rem; margin: 0 auto; padding: 40px 20px; display: flex; flex-direction: column; gap: 16px; font-size: 14px; color: var(--text-2); }
.site-footer p { margin: 0; }
.site-footer .name { font: 700 17px/1 var(--display); color: var(--ink); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.site-footer a { color: var(--text-2); text-decoration: none; }
.site-footer a:hover { color: var(--ink); }
@media (min-width: 768px) { .site-footer .in { flex-direction: row; align-items: center; justify-content: space-between; padding: 40px 32px; } }
