/* Calcul Taxes Québec — black & white modern theme */
:root {
  --bg: #FFFFFF;
  --ink: #0A0A0A;
  --text: #0A0A0A;
  --muted: #6E6E6E;
  --line: #E6E6E6;
  --line-strong: #0A0A0A;
  --card: #FFFFFF;
  --surface: #F4F4F4;
  --accent: #0A0A0A;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 0 var(--line);
  --maxw: 720px;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "Roboto Mono", Menlo, Consolas, monospace;
  font-synthesis: none;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--ink); }

.skip-link {
  position: absolute; left: 8px; top: -56px; z-index: 50;
  background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 10px;
  text-decoration: none; font-weight: 700; transition: top .15s;
}
.skip-link:focus { top: 8px; outline: 3px solid #fff; }

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

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 18px; }

/* Header */
.site-header {
  background: var(--bg);
  border-bottom: 1.5px solid var(--line-strong);
  position: sticky;
  top: 0;
  z-index: 20;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--text); }
.brand .logo {
  width: 36px; height: 36px; flex: none;
  border-radius: 10px; background: var(--ink);
  display: grid; place-items: center;
}
.brand .logo svg { width: 22px; height: 22px; }
.brand .name { font-weight: 800; font-size: 17px; letter-spacing: -.3px; line-height: 1.05; }
.brand .tagline { display: block; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-top: 2px; }

.lang-toggle { display: inline-flex; border: 1.5px solid var(--ink); border-radius: 999px; overflow: hidden; background: var(--bg); }
.lang-toggle a {
  padding: 7px 13px; font-size: 12px; font-weight: 800; text-decoration: none;
  color: var(--ink); background: transparent; line-height: 1.2; letter-spacing: .04em;
}
.lang-toggle a[aria-current="true"] { background: var(--ink); color: #fff; }

/* Hero */
.hero { padding: 34px 0 10px; }
.hero h1 { margin: 0; }
h1 {
  font-size: clamp(32px, 8.5vw, 52px);
  line-height: .98;
  margin: 0 0 14px;
  letter-spacing: -1.4px;
  font-weight: 800;
  text-wrap: balance;
}
.hero p.intro { margin: 0; color: var(--muted); font-size: 16px; max-width: 56ch; }

/* Cards */
.card {
  background: var(--card);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 22px 20px;
  margin: 18px 0;
}

/* Calculator */
.calc { padding: 22px 20px 20px; }
.mode-switch {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  border: 1.5px solid var(--ink); border-radius: 999px; padding: 4px; margin-bottom: 20px;
  background: var(--bg);
}
.mode-switch button {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  font: inherit; font-weight: 700; font-size: 14px; color: var(--ink);
  padding: 11px 8px; border-radius: 999px; transition: background .15s, color .15s;
  letter-spacing: -.1px;
}
.mode-switch button[aria-pressed="true"] { background: var(--ink); color: #fff; }

.field label {
  display: block; font-weight: 700; font-size: 12px; margin-bottom: 10px;
  text-transform: uppercase; letter-spacing: .1em; color: var(--muted);
}
.input-money { position: relative; }
.input-money input {
  width: 100%; font-family: var(--mono); font-size: 38px; font-weight: 600; color: var(--text);
  padding: 14px 48px 14px 16px; border: 0; border-bottom: 2.5px solid var(--ink); border-radius: 0;
  background: transparent; line-height: 1.05; letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
}
.input-money input::placeholder { color: #C7C7C7; }
.input-money input:focus { outline: none; border-bottom-color: var(--ink); box-shadow: 0 2.5px 0 var(--ink); }
.input-money .cur { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 26px; font-weight: 700; color: var(--ink); pointer-events: none; font-family: var(--mono); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chips button {
  appearance: none; cursor: pointer; font: inherit; font-weight: 700; font-size: 13px;
  border: 1.5px solid var(--line); background: var(--bg); color: var(--text);
  padding: 8px 14px; border-radius: 999px; transition: border-color .12s, background .12s, color .12s;
  font-variant-numeric: tabular-nums;
}
.chips button:hover { border-color: var(--ink); }
.chips button:active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Result */
.result { margin-top: 24px; }
.breakdown { display: grid; gap: 0; margin: 0 0 16px; }
.breakdown .row { display: flex; justify-content: space-between; align-items: baseline; padding: 13px 0; border-bottom: 1px solid var(--line); }
.breakdown .row:first-child { border-top: 1px solid var(--line); }
.breakdown .row .k { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.breakdown .row .v { font-weight: 600; font-variant-numeric: tabular-nums; font-size: 18px; font-family: var(--mono); }

.total-box {
  background: var(--ink); color: #fff; border-radius: var(--radius-sm);
  padding: 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap;
}
.total-box .lbl { font-weight: 700; color: #fff; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; }
.total-box .amt { font-weight: 700; font-size: clamp(30px, 9vw, 44px); color: #fff; font-variant-numeric: tabular-nums; letter-spacing: -1px; font-family: var(--mono); }

.actions { display: flex; gap: 10px; margin-top: 16px; }
.actions button {
  flex: 1; appearance: none; cursor: pointer; font: inherit; font-weight: 700; font-size: 14px;
  padding: 14px 10px; border-radius: 999px; border: 1.5px solid var(--ink);
  transition: background .12s, color .12s; letter-spacing: .02em;
}
.btn-copy { background: var(--ink); color: #fff; }
.btn-copy:hover { background: #222; }
.btn-copy.copied { background: #fff; color: var(--ink); }
.btn-clear { background: #fff; color: var(--ink); }
.btn-clear:hover { background: var(--surface); }

.note { font-size: 12px; color: var(--muted); margin-top: 14px; letter-spacing: .01em; }

/* Trust / info */
.info-card { background: var(--surface); border: 1.5px solid var(--line); }
.info-card p { margin: 0; }
.info-card .updated { display: inline-block; margin-top: 12px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }
.rate-pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.rate-pills .pill { background: var(--bg); border: 1.5px solid var(--ink); border-radius: 999px; padding: 7px 14px; font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.rate-pills .pill b { font-weight: 800; }

/* Content */
section.content { margin: 34px 0; }
h2 { font-size: clamp(22px, 6vw, 30px); margin: 0 0 12px; letter-spacing: -.8px; font-weight: 800; line-height: 1.1; }
h3 { font-size: 17px; margin: 20px 0 6px; letter-spacing: -.2px; }
section.content p { color: var(--muted); margin: 0 0 12px; }
.content ul.benefits { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 10px; }
.content ul.benefits li { position: relative; padding-left: 30px; color: var(--text); font-weight: 500; }
.content ul.benefits li::before {
  content: ""; position: absolute; left: 0; top: 3px; width: 20px; height: 20px;
  background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z'/%3E%3C/svg%3E") center/13px no-repeat;
  border-radius: 6px;
}

/* Internal links */
.links-grid { display: grid; grid-template-columns: 1fr; gap: 0; margin-top: 8px; border-top: 1.5px solid var(--ink); }
.links-grid a {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border-bottom: 1.5px solid var(--line); padding: 18px 4px;
  text-decoration: none; color: var(--text); font-weight: 800; font-size: 17px; letter-spacing: -.3px;
  transition: padding .15s;
}
.links-grid a::after { content: "→"; font-weight: 700; font-size: 18px; color: var(--ink); transition: transform .15s; }
.links-grid a:hover { padding-left: 10px; }
.links-grid a:hover::after { transform: translateX(4px); }
.links-grid a span { display: block; font-weight: 500; font-size: 13px; color: var(--muted); margin-top: 3px; letter-spacing: 0; }
.links-grid a > :first-child { display: block; }

/* FAQ */
.faq details {
  border-bottom: 1.5px solid var(--line);
  padding: 0 2px;
}
.faq details:first-of-type { border-top: 1.5px solid var(--ink); }
.faq summary {
  cursor: pointer; font-weight: 700; font-size: 17px; padding: 18px 0; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 12px; letter-spacing: -.2px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 24px; color: var(--ink); font-weight: 400; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details > p { margin: 0 0 18px; color: var(--muted); }

/* Breadcrumb */
.crumbs { font-size: 11px; color: var(--muted); padding-top: 18px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.crumbs a { text-decoration: none; color: var(--muted); }
.crumbs a:hover { color: var(--ink); }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
.crumbs li::after { content: "/"; margin-left: 8px; color: var(--line-strong); }
.crumbs li:last-child::after { content: ""; }
.crumbs li:last-child span { color: var(--ink); }

/* Footer */
.site-footer { border-top: 1.5px solid var(--line-strong); background: var(--bg); margin-top: 44px; padding: 28px 0; }
.site-footer .wrap { display: flex; flex-direction: column; gap: 14px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.site-footer nav a { font-size: 13px; font-weight: 700; text-decoration: none; color: var(--ink); text-transform: uppercase; letter-spacing: .06em; }
.site-footer nav a:hover { text-decoration: underline; text-underline-offset: 3px; }
.site-footer .legal { font-size: 12px; color: var(--muted); }

/* Article / blog */
.answer {
  border: 1.5px solid var(--ink); border-radius: var(--radius); padding: 18px 20px; margin: 4px 0 22px;
  background: var(--bg);
}
.answer .tag { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; font-weight: 800; color: var(--muted); display: block; margin-bottom: 8px; }
.answer p { margin: 0; font-size: 17px; font-weight: 600; color: var(--ink); line-height: 1.5; }
.answer p + p { margin-top: 10px; }

.keyfacts { margin: 0 0 22px; }
.keyfacts h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 0 0 10px; }
.keyfacts ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.keyfacts li { display: flex; justify-content: space-between; gap: 16px; padding: 10px 2px; border-bottom: 1px solid var(--line); font-size: 15px; }
.keyfacts li b { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.prose { margin: 8px 0 0; }
.prose h2 { margin: 30px 0 10px; }
.prose h3 { margin: 22px 0 6px; font-size: 17px; }
.prose p { color: #2A2A2A; margin: 0 0 14px; }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 22px; color: #2A2A2A; }
.prose li { margin: 6px 0; }
.prose strong { font-weight: 700; }
.prose a { font-weight: 600; text-underline-offset: 3px; }

.formula {
  font-family: var(--mono); font-size: 15px; line-height: 1.8; background: var(--surface);
  border: 1.5px solid var(--line); border-left: 4px solid var(--ink); border-radius: 10px;
  padding: 16px 18px; margin: 0 0 18px; overflow-x: auto; font-variant-numeric: tabular-nums;
}

.data-table { width: 100%; border-collapse: collapse; margin: 0 0 18px; font-variant-numeric: tabular-nums; }
.data-table th, .data-table td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); font-size: 15px; }
.data-table thead th { border-bottom: 1.5px solid var(--ink); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.data-table td:last-child, .data-table th:last-child { text-align: right; font-family: var(--mono); }
.data-table tr:last-child td { border-bottom: 0; font-weight: 700; }

.cta {
  background: var(--ink); color: #fff; border-radius: var(--radius); padding: 20px;
  margin: 22px 0; display: flex; flex-direction: column; gap: 14px;
}
.cta p { margin: 0; color: #fff; font-size: 16px; font-weight: 600; }
.cta a {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: #fff; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 15px;
  padding: 13px 18px; border-radius: 999px; align-self: flex-start; letter-spacing: .01em;
}
.cta a::after { content: "→"; }

.post-meta { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; margin: 0 0 18px; }

.post-list { display: grid; gap: 0; border-top: 1.5px solid var(--ink); margin-top: 10px; }
.post-list a {
  display: block; border-bottom: 1.5px solid var(--line); padding: 20px 4px; text-decoration: none; color: var(--text);
}
.post-list a:hover { background: var(--surface); }
.post-list h2 { font-size: 19px; margin: 0 0 6px; letter-spacing: -.3px; }
.post-list p { margin: 0; color: var(--muted); font-size: 14px; }

.lang-only-en { display: none; }

@media (min-width: 640px) {
  .links-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 44px; }
}

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