/* www.prof21.pt: the pages by subject and the guide. The home page has its own styles inline. */
:root {
    --navy: #022a3f;
    --navy-2: #033a55;
    --ink: #023047;
    --text: #334155;
    --muted: #64748b;
    --line: #e2e8f0;
    --paper: #f3f8fa;
    --blue: #0086b4;
    --blue-2: #006f96;
    --sky: #5cc8ef;
    --green: #00b57e;
    --green-2: #00875f;
    --mint: #3fd6a6;
    --amber: #8a5300;
    --radius: 20px;
    --font: "Segoe UI Variable Display", "Segoe UI Variable Text", -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--text); background: #fff; line-height: 1.6; -webkit-font-smoothing: antialiased; }
img, video, svg { display: block; max-width: 100%; }
a { color: inherit; }
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 26px; border-radius: 999px; font-weight: 700; font-size: 16px; text-decoration: none; border: 0; cursor: pointer; font-family: inherit; transition: transform .2s ease, background-color .2s ease, border-color .2s ease, color .2s ease; }
.btn:focus-visible { outline: 3px solid var(--mint); outline-offset: 3px; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--green); color: #01291d; }
.btn-primary:hover { background: var(--mint); }
.btn-ghost { background: transparent; border: 1.5px solid rgba(255,255,255,.35); color: #fff; }
.btn-ghost:hover { border-color: #fff; background: rgba(255,255,255,.06); }
.btn-line { background: #fff; border: 1.5px solid var(--line); color: var(--ink); }
.btn-line:hover { border-color: var(--blue); color: var(--blue-2); }
.btn svg { width: 18px; height: 18px; }

/* Brand */
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; font-weight: 800; font-size: 22px; letter-spacing: -.02em; }
.brand b { color: var(--mint); font-weight: 800; }

/* Header and intro */
.head { position: relative; background: var(--navy); color: #fff; overflow: hidden; isolation: isolate; }
.head::before { content: ""; position: absolute; right: -220px; top: -260px; width: 720px; height: 720px; border-radius: 50%; background: radial-gradient(closest-side, rgba(0,181,126,.22), rgba(0,181,126,0)); z-index: -1; }
.head::after { content: ""; position: absolute; left: -200px; bottom: -340px; width: 640px; height: 640px; border-radius: 50%; background: radial-gradient(closest-side, rgba(0,134,180,.3), rgba(0,134,180,0)); z-index: -1; }
.head .bar { display: flex; align-items: center; gap: 24px; min-height: 84px; }
.head nav { display: flex; align-items: center; gap: 26px; margin-left: auto; font-size: 15px; font-weight: 600; }
.head nav a:not(.btn) { color: rgba(255,255,255,.82); text-decoration: none; }
.head nav a:not(.btn):hover { color: #fff; }
.head nav .btn { min-height: 44px; padding: 0 20px; font-size: 15px; }
.intro { padding-top: 40px; padding-bottom: 96px; }
.intro h1 { max-width: 900px; }
.crumbs { margin: 0; font-size: 14px; color: rgba(255,255,255,.6); }
.crumbs a { color: rgba(255,255,255,.8); text-decoration: none; }
.crumbs a:hover { color: #fff; text-decoration: underline; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; margin-top: 26px; padding: 7px 14px; border-radius: 999px; background: rgba(92,200,239,.12); border: 1px solid rgba(92,200,239,.38); color: var(--sky); font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.eyebrow i { width: 7px; height: 7px; border-radius: 50%; background: var(--sky); box-shadow: 0 0 0 4px rgba(92,200,239,.25); }
.intro h1 { margin: 22px 0 0; font-size: clamp(40px, 6.4vw, 72px); line-height: 1; letter-spacing: -.035em; font-weight: 800; text-wrap: balance; }
.intro h1 em { font-style: normal; color: var(--mint); }
.intro .lead { margin: 24px 0 0; max-width: 660px; font-size: clamp(18px, 1.6vw, 20.5px); color: rgba(255,255,255,.86); }
.intro .ctas { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.trust { display: flex; flex-wrap: wrap; gap: 10px 26px; margin: 36px 0 0; padding: 0; list-style: none; font-size: 15px; color: rgba(255,255,255,.8); }
.trust li { display: flex; align-items: center; gap: 9px; }
.trust svg { width: 18px; height: 18px; color: var(--mint); }

/* Sections */
section { scroll-margin-top: 20px; }
.band { padding: 104px 0; }
.band.paper { background: var(--paper); }
.kicker { color: var(--blue); font-weight: 800; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; }
.title { margin: 12px 0 0; color: var(--ink); font-size: clamp(30px, 3.8vw, 48px); line-height: 1.06; letter-spacing: -.03em; font-weight: 800; text-wrap: balance; }
.sub { margin: 18px 0 0; max-width: 660px; font-size: 19px; color: var(--muted); }
.ticks { margin: 30px 0 0; padding: 0; list-style: none; display: grid; gap: 14px; }
.ticks li { display: flex; gap: 12px; font-size: 16.5px; }
.ticks svg { flex: none; width: 22px; height: 22px; margin-top: 1px; color: var(--green); }
.ticks strong { color: var(--ink); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; align-items: center; }

/* The ready-made model, as a card */
.model-wrap { position: relative; isolation: isolate; }
.model-wrap::before { content: ""; position: absolute; inset: -18px -18px auto auto; width: 140px; height: 140px; border-radius: 32px; background: linear-gradient(135deg, var(--blue), var(--green)); opacity: .16; z-index: -1; }
.model { margin: 0; padding: 30px; border-radius: 28px; background: #fff; border: 1px solid var(--line); box-shadow: 0 40px 80px -40px rgba(2,48,71,.35); }
.model-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.model-head strong { color: var(--ink); font-size: 18px; line-height: 1.3; }
.model-head span { font-size: 14px; color: var(--muted); }
.doms { display: grid; gap: 16px; margin: 20px 0 0; padding: 0; list-style: none; }
.dom-row { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.dom-row b { color: var(--ink); font-weight: 700; }
.dom-row span { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.dom .bar { height: 8px; margin-top: 7px; border-radius: 99px; background: #edf2f6; overflow: hidden; }
.dom .bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--green)); }
.dom .parts { margin: 8px 0 0; font-size: 13.5px; color: var(--muted); }
.scale { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 22px 0 0; padding: 18px 0 0; border-top: 1px solid var(--line); list-style: none; }
.scale li { padding: 10px 6px 8px; border-radius: 12px; background: var(--paper); text-align: center; border-top: 4px solid var(--c); }
.scale b { display: block; color: var(--ink); font-size: 20px; line-height: 1.1; }
.scale span { display: block; margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.convert { display: flex; align-items: center; gap: 8px; margin: 22px 0 0; padding: 18px 0 0; border-top: 1px solid var(--line); }
.convert div { flex: 1; min-width: 0; padding: 10px 6px 8px; border-radius: 12px; background: var(--paper); text-align: center; }
.convert b { display: block; color: var(--ink); font-size: 19px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.convert span { display: block; margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.convert svg { flex: none; width: 16px; height: 16px; color: var(--muted); }
.pasted { margin: 20px 0 0; padding: 14px 16px; border-radius: 12px; background: var(--paper); border: 1px dashed #b6c4d1; font: 13.5px/1.7 ui-monospace, "Cascadia Mono", Consolas, monospace; color: var(--ink); }
.pasted div { display: flex; justify-content: space-between; gap: 12px; }
.pasted .out { color: var(--muted); text-decoration: line-through; }
.pasted-note { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.model-line { margin: 18px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--paper); font-size: 14.5px; color: var(--ink); }
.model-note { margin: 14px 0 0; font-size: 13px; color: var(--muted); }

/* Feature cards */
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 56px; }
.feature { padding: 30px; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); box-shadow: 0 30px 60px -44px rgba(2,48,71,.3); }
.icon-tile { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: #e6f4f9; color: var(--blue); }
.icon-tile svg { width: 24px; height: 24px; }
.feature h3 { margin: 20px 0 0; color: var(--ink); font-size: 20px; line-height: 1.3; letter-spacing: -.01em; }
.feature p { margin: 10px 0 0; font-size: 16px; }
.feature .eg { margin: 16px 0 0; padding: 10px 14px; border-radius: 12px; background: var(--paper); font-size: 14.5px; color: var(--ink); }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; margin-top: 56px; counter-reset: step; }
.step { padding-top: 26px; border-top: 2px solid var(--line); }
.step::before { counter-increment: step; content: "0" counter(step); display: block; font-size: 56px; line-height: 1; font-weight: 800; letter-spacing: -.04em; color: transparent; -webkit-text-stroke: 1.5px var(--blue); }
.step h3 { margin: 18px 0 0; color: var(--ink); font-size: 22px; letter-spacing: -.01em; }
.step p { margin: 10px 0 0; font-size: 16.5px; }

/* Errors found in real matrices */
.found { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 56px; }
.found article { display: flex; flex-direction: column; padding: 28px; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); }
.tag { display: inline-flex; align-self: flex-start; padding: 5px 11px; border-radius: 999px; background: #fff7e6; color: var(--amber); font-size: 12px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.found h3 { margin: 16px 0 0; color: var(--ink); font-size: 19px; line-height: 1.3; }
.found p { margin: 10px 0 0; font-size: 15.5px; }
.found .fix { display: flex; gap: 10px; margin-top: auto; padding-top: 18px; color: var(--ink); font-size: 15px; }
.found .fix span { padding-top: 14px; border-top: 1px dashed var(--line); }
.found .fix svg { flex: none; width: 20px; height: 20px; margin-top: 16px; color: var(--green); }
.more { display: inline-flex; align-items: center; gap: 8px; margin-top: 36px; color: var(--blue-2); font-weight: 700; font-size: 17px; text-decoration: none; }
.more:hover { text-decoration: underline; }
.more svg { width: 18px; height: 18px; }

/* Guide teaser */
.teaser { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; margin-top: 56px; padding: 36px 40px; border-radius: 24px; background: #fff; border: 1px solid var(--line); box-shadow: 0 30px 60px -44px rgba(2,48,71,.3); }
.teaser h3 { margin: 10px 0 0; color: var(--ink); font-size: 24px; line-height: 1.2; letter-spacing: -.01em; }
.teaser p { margin: 10px 0 0; max-width: 620px; font-size: 16.5px; }

/* Other subjects */
.subjects { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin-top: 40px; }
.subject { display: flex; flex-direction: column; gap: 6px; padding: 24px; border-radius: 18px; background: #fff; border: 1px solid var(--line); text-decoration: none; transition: border-color .2s ease, transform .2s ease; }
a.subject:hover { border-color: var(--blue); transform: translateY(-2px); }
a.subject:focus-visible { outline: 3px solid var(--mint); outline-offset: 3px; }
.subject strong { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--ink); font-size: 18px; line-height: 1.3; }
.subject strong svg { flex: none; width: 18px; height: 18px; color: var(--blue); }
.subject span { font-size: 14.5px; color: var(--muted); }
.subject.plain { background: transparent; border-style: dashed; }

/* Final call */
.final { padding: 0 0 104px; }
.final.on-paper { padding-top: 0; background: var(--paper); }
.final .box { position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 28px; padding: 64px; border-radius: 32px; background: linear-gradient(120deg, #005f80, var(--blue-2) 45%, var(--green-2)); color: #e8f7fb; overflow: hidden; isolation: isolate; }
.final .box::after { content: ""; position: absolute; right: -80px; bottom: -160px; width: 420px; height: 420px; border-radius: 50%; border: 60px solid rgba(255,255,255,.07); z-index: -1; }
.final h2 { margin: 0; max-width: 640px; color: #fff; font-size: clamp(28px, 3.4vw, 44px); line-height: 1.06; letter-spacing: -.03em; font-weight: 800; text-wrap: balance; }
.final p { margin: 14px 0 0; font-size: 18px; color: rgba(232,247,251,.88); }
.final .btn-primary { background: #fff; color: var(--blue-2); }
.final .btn-primary:hover { background: #e8f7fb; }

/* Footer */
footer { background: var(--navy); color: rgba(255,255,255,.65); font-size: 15px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 20px 40px; align-items: center; justify-content: space-between; padding-top: 40px; padding-bottom: 40px; }
footer nav { display: flex; flex-wrap: wrap; gap: 10px 26px; }
footer a { color: rgba(255,255,255,.75); text-decoration: none; }
footer a:hover { color: #fff; text-decoration: underline; }
footer .legal { width: 100%; margin: 0; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.1); font-size: 13.5px; color: rgba(255,255,255,.5); }

/* The guide */
.article { max-width: 820px; margin: 0 auto; padding: 64px 24px 40px; font-size: 17.5px; line-height: 1.7; }
.article > p { margin: 16px 0 0; }
.article .lead { margin-top: 0; font-size: 20px; color: var(--ink); line-height: 1.6; }
.article strong { color: var(--ink); }
.article a { color: var(--blue-2); font-weight: 600; }
.menu { color: var(--ink); font-weight: 600; }
.quick { margin: 40px 0 0; padding: 32px 34px; border-radius: 24px; background: var(--paper); border: 1px solid var(--line); }
.quick h2 { margin: 8px 0 0; color: var(--ink); font-size: 26px; line-height: 1.2; letter-spacing: -.02em; }
.quick > p { margin: 10px 0 0; font-size: 16.5px; }
.quick ol { margin: 20px 0 0; padding: 0; list-style: none; counter-reset: quick; display: grid; gap: 14px; }
.quick li { position: relative; padding-left: 46px; font-size: 16.5px; }
.quick li::before { counter-increment: quick; content: counter(quick); position: absolute; left: 0; top: -1px; width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: #fff; border: 1px solid var(--line); color: var(--blue-2); font-weight: 800; font-size: 15px; }
.quick .after { margin: 20px 0 0; padding-top: 18px; border-top: 1px solid var(--line); font-size: 16px; }
.toc { margin: 40px 0 0; padding: 24px 28px; border: 1px solid var(--line); border-radius: 18px; }
.toc strong { display: block; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--blue); }
.toc ol { margin: 12px 0 0; padding-left: 24px; columns: 2; column-gap: 36px; font-size: 16px; }
.toc li { break-inside: avoid; }
.toc li + li { margin-top: 6px; }
.toc a { font-weight: 500; text-decoration: none; }
.toc a:hover { text-decoration: underline; }
.error { margin: 64px 0 0; padding-top: 48px; border-top: 1px solid var(--line); scroll-margin-top: 24px; }
.error-head { display: flex; align-items: center; gap: 20px; }
.error-head .n { flex: none; font-size: 54px; line-height: .9; font-weight: 800; letter-spacing: -.04em; color: transparent; -webkit-text-stroke: 1.5px var(--blue); font-variant-numeric: tabular-nums; }
.error h2 { margin: 0; color: var(--ink); font-size: clamp(25px, 3vw, 31px); line-height: 1.15; letter-spacing: -.02em; text-wrap: balance; }
.error > p { margin: 18px 0 0; }
.label { display: block; margin-bottom: 6px; color: var(--blue); font-size: 12.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.howto { margin: 24px 0 0; padding: 20px 24px; border-radius: 16px; background: var(--paper); font-size: 16.5px; }
.howto p { margin: 0; }
.howto p + p { margin-top: 10px; }
.ours { display: flex; gap: 14px; margin: 14px 0 0; padding: 18px 24px; border-radius: 16px; background: linear-gradient(90deg, rgba(0,181,126,.1), rgba(0,181,126,.02)); color: var(--ink); font-size: 16.5px; }
.ours svg { flex: none; width: 22px; height: 22px; margin-top: 3px; color: var(--green); }
.ours .label { color: var(--green-2); }
.ours p { margin: 0; }
.extras { margin: 64px 0 0; padding-top: 48px; border-top: 1px solid var(--line); }
.extras h2 { margin: 0; color: var(--ink); font-size: clamp(25px, 3vw, 31px); line-height: 1.15; letter-spacing: -.02em; }
.extras ul { margin: 18px 0 0; padding-left: 22px; }
.extras li + li { margin-top: 12px; }
.closing { margin: 64px 0 0; padding: 36px 38px; border-radius: 24px; background: var(--navy); color: rgba(255,255,255,.82); }
.closing h2 { margin: 0; color: #fff; font-size: clamp(25px, 3vw, 31px); line-height: 1.15; letter-spacing: -.02em; }
.closing p { margin: 14px 0 0; font-size: 17px; }
.closing .ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin: 40px 0 0; font-size: 16px; color: var(--muted); }
.share .btn { min-height: 44px; padding: 0 18px; font-size: 15px; }
.share [data-copied] { color: var(--green-2); font-weight: 700; }

/* The worked example in the grids guide */
.calc-wrap { margin: 22px 0 0; overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; }
.calc-wrap:focus-visible { outline: 3px solid var(--mint); outline-offset: 3px; }
.calc { width: 100%; border-collapse: collapse; font-size: 15.5px; line-height: 1.35; font-variant-numeric: tabular-nums; }
.calc th, .calc td { padding: 11px 14px; border-top: 1px solid var(--line); text-align: right; vertical-align: top; }
.calc thead th { border-top: 0; background: var(--paper); color: var(--ink); font-size: 14px; font-weight: 700; }
.calc th:first-child { text-align: left; }
.calc tbody th { color: var(--ink); font-weight: 600; }
.calc small { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; }
.calc .off { color: var(--muted); font-size: 14px; }
.calc tfoot th, .calc tfoot td { background: var(--paper); color: var(--ink); font-weight: 800; }
.calc-note { margin: 10px 0 0; color: var(--muted); font-size: 14.5px; }
.calc-line { margin: 18px 0 0; padding: 14px 18px; border-radius: 12px; background: var(--paper); color: var(--ink); font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.formula { display: block; margin: 10px 0 0; padding: 12px 14px; border-radius: 10px; background: #fff; border: 1px solid var(--line); color: var(--ink); font-family: ui-monospace, Consolas, Menlo, monospace; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.howto .formula + p { margin-top: 10px; }
.howto .formula-name { margin-top: 12px; color: var(--ink); font-size: 14.5px; font-weight: 700; }
.howto .formula-name + .formula { margin-top: 4px; }
.extras h3 { margin: 32px 0 0; color: var(--ink); font-size: 20px; line-height: 1.3; }
.extras > p { margin: 14px 0 0; }
.extras .after-slips { margin-top: 32px; }

@media (max-width: 960px) {
    .head nav .hide-md { display: none; }
    .split, .features, .found, .steps { grid-template-columns: 1fr; }
    .split { gap: 48px; }
    .final .box { padding: 44px 28px; }
    .teaser { padding: 30px 28px; }
}
@media (max-width: 640px) {
    .head nav .hide-sm { display: none; }
    .intro { padding-bottom: 72px; }
    .band { padding: 76px 0; }
    .model { padding: 22px; }
    .scale { gap: 6px; }
    .scale b { font-size: 18px; }
    .scale span { font-size: 11.5px; }
    .convert { gap: 4px; }
    .convert b { font-size: 16px; }
    .convert span { font-size: 11.5px; }
    .convert svg { width: 12px; height: 12px; }
    .article { padding-top: 48px; font-size: 17px; }
    .quick, .closing { padding: 26px 22px; }
    .toc ol { columns: 1; }
    .error-head { gap: 14px; }
    .error-head .n { font-size: 42px; }
    .howto, .ours { padding: 16px 18px; }
    .calc th, .calc td { padding: 9px 7px; }
    .calc { font-size: 13.5px; }
    .calc thead th { font-size: 12.5px; }
    .calc small { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .btn, .subject { transition: none; }
}
@media print {
    .head nav, .head .ctas, .trust, footer nav, .share, .closing .ctas, .final { display: none; }
    .head, footer, .closing { background: #fff; color: #000; }
    .head::before, .head::after { display: none; }
    .intro h1, .intro h1 em, .intro .lead, .crumbs, .brand, .brand b, .closing h2, .closing p { color: #000; }
    .eyebrow { color: #000; border-color: #999; background: none; }
    .error { break-inside: avoid-page; }
}

/* The languages (as digisousa.pt): flags to the same page in the others, in the header and the footer.
   In the header they do not fit beside the brand and the button on a phone: the footer keeps them. */
.langs { display: flex; align-items: center; gap: 8px; }
.langs a { display: inline-flex; border-radius: 3px; opacity: .55; transition: opacity .15s; }
.langs a:hover, .langs a:focus-visible, .langs a[aria-current] { opacity: 1; }
.langs svg { width: 24px; height: 16px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(255,255,255,.35); }
.langs a[aria-current] svg { box-shadow: 0 0 0 2px var(--mint); }
.langs .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.langs-foot { width: 100%; }
@media (max-width: 640px) { .langs-head { display: none; } }
