/* DTT. Ink, paper and asphalt; yellow belongs to the taxis and to what can be clicked. */
@font-face {
  font-family: 'Radio Canada';
  src: url('/assets/fonts/RadioCanada-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --white: #fff;
  --paper: #e8eae9;
  --ink: #232323;
  --asphalt: #333;      /* the plate of the DTT logo */
  --muted: #555957;
  --line: #c3c7c5;
  --yellow: #f5b81f;    /* reserved for links, buttons and taxis */
  --money: #cde6f2;     /* tint of the Taxi Money logo blue */
  --error: #a32626;

  --margin: 20px;
  --gutter: 4px;
  --pad: 20px;
  --r-outer: 28px;
  --r-inner: calc(var(--r-outer) - var(--pad)); /* inner radius = outer radius - padding */

  --text: 'Radio Canada', Arial, sans-serif;
  --h1: clamp(32px, 3.2vw, 52px);
  --h2: clamp(26px, 2.3vw, 36px);
  --h3: clamp(21px, 1.6vw, 25px);
  --header-h: 80px;
  color-scheme: light;
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--white); color: var(--ink); font: 400 17px/1.5 var(--text); }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a, button { -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 600; line-height: 1.12; letter-spacing: -.02em; overflow-wrap: break-word; text-wrap: balance; }
h1 { font-size: var(--h1); line-height: 1.08; letter-spacing: -.025em; }
h2 { font-size: var(--h2); }
h3 { font-size: var(--h3); }
[hidden] { display: none !important; }
/* Two-tone ring: visible on paper, asphalt and yellow alike. */
:focus-visible { outline: 3px solid var(--white); outline-offset: 2px; box-shadow: 0 0 0 8px var(--ink); border-radius: var(--r-inner); }

.wrap { width: 100%; max-width: 1680px; margin-inline: auto; padding-inline: var(--margin); }
.icon { width: 24px; height: 24px; flex: none; }
.skip-link { position: fixed; top: 12px; left: 16px; z-index: 100; padding: 12px 20px; border-radius: var(--r-inner); background: var(--yellow); transform: translateY(-200%); }
.skip-link:focus { transform: none; }

/* Header: same height on every page and at every scroll position. */
.site-header { position: sticky; top: 0; z-index: 10; background: var(--white); view-transition-name: site-header; }
.header-inner { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gutter); align-items: center; height: var(--header-h); }
.brand { justify-self: start; margin-left: var(--pad); }
.brand img { width: auto; height: 60px; }
.main-nav { grid-column: 2; margin-left: var(--pad); display: flex; gap: clamp(18px, 2vw, 32px); white-space: nowrap; font-weight: 500; }
.main-nav a { padding-block: 11px; border-bottom: 3px solid transparent; }
.main-nav a:hover, .main-nav a[aria-current=page] { border-color: var(--yellow); }
.header-actions { grid-column: 3; justify-self: end; display: flex; align-items: center; gap: 16px; margin-right: var(--pad); }
.languages { display: flex; }
.languages button { min-width: 44px; min-height: 44px; font-weight: 500; color: var(--muted); }
.languages button span, .languages button { text-underline-offset: 8px; text-decoration-thickness: 3px; }
.languages button[aria-pressed=true] { color: var(--ink); font-weight: 700; text-decoration-line: underline; text-decoration-color: var(--yellow); }
.menu-toggle { display: none; }

/* Text */
.lead { font-size: 19px; line-height: 1.45; max-width: 50ch; }
.status { font-weight: 600; }

/* Actions */
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; margin-top: 22px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 54px; padding: 12px 22px; border-radius: var(--r-inner); background: var(--yellow); color: var(--ink); font-weight: 600; line-height: 1.25; text-align: center; transition: background-color .15s, transform .15s; }
.button:hover { background: #ffcb47; }
.button:active { transform: scale(.97); }
.text-link { display: inline-block; padding-block: 10px 6px; border-bottom: 3px solid var(--yellow); font-weight: 600; line-height: 1.3; transition: border-color .15s; }
.text-link:hover { border-color: currentColor; }

/* Opening: one column of words facing two columns of image. */
.hero { margin-top: 0; }
.hero .module { min-height: clamp(480px, 41vw, 680px); }
.hero-copy > p { margin-top: 18px; max-width: 46ch; }
.hero-copy > .status { margin-top: 18px; }
.hero-copy .actions { flex-direction: column; align-items: flex-start; gap: 10px; margin-top: auto; padding-top: 32px; }
.hero-logo { width: 150px; margin: -18px 0 4px -14px; }
.hero .module--road { background: linear-gradient(var(--paper) 72%, var(--asphalt) 72%); }
.module--road .vehicle { position: absolute; left: 0; bottom: 6%; width: min(64%, 674px); } /* the picture is cut on its left side */
.vehicle { display: block; }

.opening { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px var(--gutter); padding: clamp(36px, 4.5vw, 72px) 0 clamp(32px, 3.6vw, 56px); }
.opening > * { padding-inline: var(--pad); }
.opening > * { grid-column: 1 / -1; }
.opening h1 { max-width: 20em; }
.opening .lead { max-width: calc(62ch + var(--pad) * 2); }

/* A quiet statement between two groups of modules. */
.statement { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px var(--gutter); padding-top: clamp(64px, 6.5vw, 104px); }
.statement > * { padding-inline: var(--pad); }
.statement > :last-child { grid-column: 2 / -1; }
.statement .text-link { margin-top: 14px; }
.statement--pilot { padding-bottom: clamp(40px, 4vw, 64px); }
.statement--pilot h2 + p { margin-top: 12px; }
.figure-number { font-size: clamp(56px, 5vw, 80px); font-weight: 600; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.figure-number + p { margin-top: 8px; max-width: 24ch; text-wrap: balance; }

/* Modules: three columns, 4px gutters, one or two columns each. */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gutter); margin-top: var(--gutter); }
.module { position: relative; display: flex; flex-direction: column; min-height: clamp(320px, 27vw, 440px); padding: var(--pad); border-radius: var(--r-outer); background: var(--paper); overflow: hidden; }
.module--2 { grid-column: span 2; }
.module--3 { grid-column: 1 / -1; }
.module--asphalt { background: var(--asphalt); color: var(--white); }
.module--money { background: var(--money); }
.module--photo { padding: 0; }
.module--photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 60%; }
.module--payment img { object-position: 52% 45%; }
figure { margin: 0; }
.module--photo figcaption { position: absolute; left: var(--pad); bottom: var(--pad); max-width: calc(100% - var(--pad) * 2); padding: 6px 12px; border-radius: var(--r-inner); background: var(--white); font-size: 14px; line-height: 1.4; }
.module-copy { position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; align-items: flex-start; max-width: 440px; }
.module-copy > p { margin-top: 12px; }
.module-copy > .status { margin-top: 14px; }
.module-copy > .status + p { margin-top: 2px; }
.module-copy > h2:only-of-type + p:last-child { margin-top: auto; padding-top: 32px; }
.module-copy > .text-link, .module-copy > .button { margin-top: auto; }
.module--money .product-logo { position: absolute; right: 3%; top: 50%; width: 42%; max-width: 380px; transform: translateY(-50%); }
.module--split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--pad); }
.module--split figure { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.module--split img { flex: 1; width: 100%; min-height: 0; object-fit: cover; border-radius: var(--r-inner); }
figcaption { font-size: 14px; line-height: 1.4; }
.module--2.module--money .module-copy { max-width: min(50%, 440px); }
.module--wide { min-height: clamp(400px, 34vw, 520px); }
.module--wide .module-copy { max-width: 30%; }
.module--wide .vehicle { position: absolute; right: 2%; bottom: 20px; width: 42%; max-width: 640px; }
.module--wide .product-logo { top: 0; right: auto; left: 34%; width: 17%; transform: none; }

.section-title { margin: clamp(64px, 6.5vw, 104px) var(--pad) clamp(22px, 2vw, 32px); max-width: 22em; }
.section-title--sub { margin-bottom: 0; }
.section-sub { margin: 10px var(--pad) clamp(22px, 2vw, 32px); }

/* Payment steps beside the demo screens */
.flow { justify-content: space-between; gap: 12px; padding-inline: 0; }
.flow img { width: 100%; margin-block: auto; }
.flow figcaption { padding-inline: var(--pad); }
html[lang=fr] [data-only=en], html[lang=en] [data-only=fr] { display: none; }
.steps { margin: 0; justify-content: space-between; gap: 28px; list-style: none; counter-reset: step; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 2.2em 1fr; }
.steps li::before { content: counter(step); grid-row: 1 / 3; font-size: var(--h3); font-weight: 600; line-height: 1.12; font-variant-numeric: tabular-nums; }
.steps p { margin-top: 8px; }

/* Rows share the three-column grid. */
.row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gutter); align-items: baseline; padding: 22px 0; border-top: 1px solid var(--line); }
.rows { border-bottom: 1px solid var(--line); }
.row > h3, .row > p { padding-inline: var(--pad); }
.row p { max-width: calc(44ch + var(--pad) * 2); }
.row--pair p { grid-column: 2 / -1; }
.row--link { position: relative; align-items: center; min-height: 84px; padding-block: 16px; }
.row--link p { grid-column: 2 / -1; max-width: none; padding-right: 88px; }
.row--link .icon { position: absolute; right: var(--pad); top: calc(50% - 22px); width: 44px; height: 44px; padding: 10px; border-radius: var(--r-inner); background: var(--yellow); transition: transform .15s; }
.row--link:hover .icon { transform: translateX(-6px); }
.after-rows { margin: 20px var(--pad) 0; }
.after-rows, .grid--after { margin-bottom: 0; }
.rows + .grid, .after-rows + .grid { margin-top: clamp(64px, 7vw, 112px); }


/* Closing module with the rays of the logo */
.closer { justify-content: space-between; gap: 48px; min-height: clamp(300px, 25vw, 400px); }
.closer h2 { position: relative; z-index: 1; max-width: 11em; }
.closer.module--3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px var(--gutter); align-items: start; min-height: 220px; }
.closer.module--3 .closer-copy { grid-column: 2; padding-left: calc(var(--pad) * 2 / 3); } /* aligns with the page columns */
.closer.module--3 .brand-rays { width: 15%; max-width: 220px; }
.closer-copy { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 20px; max-width: 460px; }
.brand-rays { position: absolute; right: var(--pad); bottom: var(--pad); width: 88px; aspect-ratio: 672 / 500; overflow: hidden; }
.brand-rays img { position: absolute; top: 0; left: -116%; width: 230%; max-width: none; }

/* Direct address at the end of the home page */
.write { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 16px 40px; padding: clamp(64px, 6.5vw, 104px) var(--pad) 0; }
.email { font-size: var(--h2); font-weight: 600; line-height: 1.3; letter-spacing: -.02em; border-bottom: 3px solid var(--yellow); transition: border-color .15s; }
.email:hover { border-color: var(--ink); }

/* Contact */
.contact-grid { align-items: start; }
.contact-details { gap: 44px; min-height: 0; }
.contact-details h2, .contact-form-section > h2 { font-size: var(--h3); }
.contact-address { display: flex; flex-direction: column; align-items: flex-start; }
.contact-line { margin: 6px 0 24px; font-size: 22px; font-weight: 600; line-height: 1.5; border-bottom: 3px solid var(--yellow); font-variant-numeric: tabular-nums; }
.contact-line:hover { border-color: currentColor; }
.contact-context { margin-top: 16px; }
.to-form { display: none; }
.contact-topics { margin-top: 12px; }
.contact-topic { display: block; padding: 14px 0; border-top: 1px solid #6a6a6a; }
.contact-topic h3 { display: inline; font-size: 17px; line-height: 1.5; letter-spacing: 0; border-bottom: 3px solid var(--yellow); }
.contact-topic p { margin-top: 4px; color: #d9d9d9; font-size: 15px; }
.contact-topic:hover h3 { border-color: currentColor; }
.contact-topic.is-selected h3 { background: var(--yellow); color: var(--ink); box-shadow: 0 0 0 4px var(--yellow); }
.form-intro { margin-top: 6px; max-width: 56ch; }
.form-preview { margin-top: 16px; padding: 12px 16px; border-radius: var(--r-inner); background: var(--white); font-size: 15px; }
.contact-form { margin-top: 28px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 16px; }
.form-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.form-field--wide { grid-column: 1 / -1; }
.form-field label { font-weight: 600; }
.form-field input, .form-field select, .form-field textarea { width: 100%; min-width: 0; min-height: 54px; padding: 13px 14px; border: 1px solid #7b7f7d; border-radius: var(--r-inner); background: var(--white); color: var(--ink); font: inherit; }
.form-field textarea { min-height: 180px; resize: vertical; }
.form-field [aria-invalid=true] { border-color: var(--error); box-shadow: inset 0 0 0 1px var(--error); }
.form-field [aria-invalid=true]:focus-visible { box-shadow: 0 0 0 8px var(--ink); }
.field-error { color: var(--error); font-size: 15px; font-weight: 600; }
.field-hint, .form-privacy { color: var(--muted); font-size: 15px; }
.form-privacy { margin: 20px 0; max-width: 70ch; }
.button[disabled] { opacity: .65; cursor: wait; }
.form-status { margin-top: 20px; padding: 16px; border-radius: var(--r-inner); background: var(--white); font-weight: 600; }
.form-status[data-state=success] { background: var(--asphalt); color: var(--white); animation: confirm .36s ease-out; }
.form-status[data-state=error] { color: var(--error); }
.form-trap { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@keyframes confirm { 40% { transform: scale(1.02); } }

/* Footer */
.site-footer { margin-top: clamp(64px, 7vw, 112px); padding-bottom: 24px; font-size: 15px; }
.footer-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gutter); padding: 28px 0 40px; border-top: 1px solid var(--line); }
.footer-grid > * { margin-left: var(--pad); }
.footer-brand { justify-self: start; }
.footer-brand img { width: 120px; }
.footer-grid nav, .footer-legal { display: flex; flex-direction: column; align-items: flex-start; }
.footer-grid nav a, .footer-legal > * { padding-block: 6px; text-align: left; text-underline-offset: 6px; text-decoration-thickness: 2px; }
.footer-grid nav a:hover, .footer-legal > *:hover { text-decoration-line: underline; text-decoration-color: var(--yellow); }
.footer-note { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 24px; padding-inline: var(--pad); color: var(--muted); font-size: 13px; }
.footer-note a { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.footer-note a:hover { text-decoration-color: currentColor; }
.noscript-note { padding: 24px 40px; }

/* Dialogs */
dialog { width: min(640px, calc(100% - 40px)); max-height: calc(100dvh - 40px); overflow-y: auto; padding: var(--pad); border: 0; border-radius: var(--r-outer); color: var(--ink); background: var(--white); }
dialog::backdrop { background: rgb(35 35 35 / .7); }
dialog p { margin-bottom: 14px; }
dialog > a { border-bottom: 3px solid var(--yellow); font-weight: 600; }
.dialog-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.dialog-close { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: var(--r-inner); background: var(--yellow); }

/* Page changes: the header stays, only the content below it changes. */
@view-transition { navigation: auto; }
::view-transition-group(*) { animation-duration: .32s; animation-timing-function: cubic-bezier(.3, 0, .1, 1); }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .16s; }

/* Compact header */
@media (max-width: 1180px) {
  .header-inner { grid-template-columns: auto 1fr auto; gap: 32px; }
  .main-nav { justify-content: flex-end; margin-left: 0; }
}
@media (max-width: 980px) {
  :root { --header-h: 72px; }
  .header-inner { grid-template-columns: 1fr auto; }
  .brand img { height: 52px; }
  .header-actions { grid-column: 2; gap: 12px; margin-right: 0; }
  .menu-toggle { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 14px; border-radius: var(--r-inner); background: var(--yellow); font-weight: 600; }
  .menu-icons { display: grid; }
  .menu-icons .icon { grid-area: 1 / 1; transition: opacity .18s, filter .18s, transform .18s; }
  .menu-toggle[aria-expanded=false] .icon:last-child, .menu-toggle[aria-expanded=true] .icon:first-child { opacity: 0; filter: blur(4px); transform: scale(.6); }
  .main-nav { display: none; position: absolute; inset: 100% 0 auto; flex-direction: column; gap: 0; padding: 4px calc(var(--margin) + var(--pad)) 28px; background: var(--white); border-bottom: 1px solid var(--line); max-height: calc(100vh - var(--header-h)); max-height: calc(100dvh - var(--header-h)); overflow-y: auto; overscroll-behavior: contain; }
  .main-nav.is-open { display: flex; }
  .main-nav a { padding: 12px 0; border: 0; font-size: 24px; font-weight: 600; line-height: 1.2; letter-spacing: -.02em; }
  .main-nav a[aria-current=page] { text-decoration: underline; text-decoration-color: var(--yellow); text-decoration-thickness: 4px; text-underline-offset: 8px; }
  .no-js .header-inner { height: auto; grid-template-columns: 1fr; }
  .no-js .main-nav { display: flex; position: static; grid-column: 1; max-height: none; }
  .no-js .menu-toggle { display: none; }
}
.no-js .languages, .no-js .contact-form-section, .no-js .to-form, .no-js .footer-legal button { display: none; }

/* Tablet: two columns */
@media (max-width: 980px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .module--2 { grid-column: 1 / -1; }
  .module--wide { min-height: 460px; }
  .module--wide .module-copy { max-width: 46%; }
  .module--wide .product-logo { left: auto; right: 4%; width: 26%; }
  .module--2 + .module:last-child, .module--2 + .module:has(+ .module--3) { grid-column: 1 / -1; min-height: 260px; }
  .closer.module--3 { grid-template-columns: minmax(0, 1fr); }
  .closer.module--3 .closer-copy { grid-column: 1; padding-left: 0; }
  .hero .module { min-height: 0; }
  .hero .module--2 { order: -1; min-height: 48vw; }
  .hero-copy { grid-column: 1 / -1; }
  .hero-copy .actions { flex-direction: row; align-items: center; gap: 12px 28px; padding-top: 26px; }
  .flow + .steps, .flow + .flow + .steps { grid-column: 1 / -1; min-height: 0; }
  .statement { grid-template-columns: minmax(0, 1fr); }
  .statement--pilot { row-gap: 36px; }
  .statement > :last-child { grid-column: 1; }
  .contact-grid { grid-template-columns: minmax(0, 1fr); }
  .contact-grid > * { grid-column: 1; }
  .to-form { display: inline-flex; }
}

/* Phone: the road goes under the vehicle, the actions under the road. */
@media (max-width: 700px) {
  :root { --margin: 8px; }
  body { font-size: 16px; }
  .lead { font-size: 17px; }
  .header-inner { gap: 12px; }
  .brand { margin-left: 12px; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .grid > .module { grid-column: 1; min-height: 300px; }
  .actions .button { width: 100%; }
  .grid.hero > .module { min-height: 0; }
  .grid.hero > .module--road { aspect-ratio: 4 / 3; }
  .hero-logo { width: 120px; }
  .module--split { grid-template-columns: minmax(0, 1fr); }
  .module--split img { aspect-ratio: 4 / 3; flex: none; }
  .grid > .flow, .grid > .steps { min-height: 0; }
  .module--photo figcaption { left: 12px; bottom: 12px; max-width: calc(100% - 24px); font-size: 13px; }
  .grid > .module--photo { min-height: 0; aspect-ratio: 4 / 3; }
  .module--money .product-logo, .module--wide .product-logo { position: static; order: -1; width: 150px; margin: -18px 0 4px -14px; transform: none; }
  .module--wide .module-copy, .module--2.module--money .module-copy { max-width: none; }
  .module-copy > .text-link, .module-copy > .button { margin-top: 24px; }
  .module--wide .vehicle { position: static; width: 88%; margin: 28px 0 0; }
  .module--wide .vehicle { align-self: flex-end; }
  .row, .row--link { grid-template-columns: minmax(0, 1fr); gap: 8px; padding-block: 20px; }
  .row--pair p { grid-column: 1; }
  .row--link { padding-right: 72px; }
  .row--link p { grid-column: 1; padding-right: 0; }
  .closer { padding-bottom: var(--pad); }
  .closer .brand-rays { top: 24px; right: 20px; bottom: auto; width: 84px; }
  .closer h2 { padding-right: 92px; }
  .closer-copy .button { width: 100%; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .contact-form .button { width: 100%; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px 16px; }
  .footer-brand { grid-column: 1 / -1; }
}

/* Landscape phones and strong zoom: give the height back to the content. */
@media (max-width: 980px) and (max-height: 480px) {
  .site-header { position: relative; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  @view-transition { navigation: none; }
}
