/*
 * Design tokens of Dalvo, copied from
 * dalvo-project-management/src/specification/dalvo-design-system.md.
 * This is the only file allowed to hold a color value: every other rule
 * references a token by its role name. Contrasts are measured in the design
 * system (section 2.3); do not substitute a value here without it.
 */

:root {
    color-scheme: light dark;

    /* Colors, light theme (section 2.2) */
    --fond: #FFFFFF;
    --surface: #F4F6F9;
    --bordure: #CBD5E0;
    --texte-principal: #0E2536;
    --texte-secondaire: #566B80;
    --identite: #163A63;
    --identite-fond: #163A63;
    --encre-identite: #FFFFFF;
    --action: #0B5FB0;
    --action-remplie: #0B5FB0;
    --encre-action: #FFFFFF;
    --destructif: #B3261E;

    /* A filled button needs no outline in the light theme (section 2.3) */
    --filet-bouton: transparent;

    /* Typography, system fonts only (section 3), sizes in rem for 16 px */
    --police: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --taille-affichage: 1.75rem;
    --interligne-affichage: 1.2143;
    --taille-titre-1: 1.375rem;
    --interligne-titre-1: 1.2727;
    --taille-titre-2: 1.0625rem;
    --interligne-titre-2: 1.2941;
    --taille-corps: 1rem;
    --interligne-corps: 1.375;
    --taille-meta: 0.8125rem;
    --interligne-meta: 1.3846;
    --taille-etiquette: 0.75rem;
    --interligne-etiquette: 1.3333;
    --graisse-affichage: 700;
    --graisse-titre: 600;
    --graisse-etiquette: 500;
    --graisse-corps: 400;

    /* Spacing scale, base 4 (section 4) */
    --espace-4: 0.25rem;
    --espace-8: 0.5rem;
    --espace-12: 0.75rem;
    --espace-16: 1rem;
    --espace-20: 1.25rem;
    --espace-24: 1.5rem;
    --espace-32: 2rem;
    --espace-40: 2.5rem;
    --espace-48: 3rem;

    /* Radii (section 4) */
    --rayon-petit: 4px;
    --rayon-carte: 8px;
    --rayon-feuille: 12px;
    --rayon-pastille: 999px;

    /* Minimal touch target (section 6) */
    --cible-tactile: 3rem;
}

@media (prefers-color-scheme: dark) {
    :root {
        --fond: #0B131C;
        --surface: #151F2B;
        --bordure: #2A3745;
        --texte-principal: #E6ECF2;
        --texte-secondaire: #9DAEC0;
        --identite: #8FB4DE;
        --identite-fond: #2B6CB0;
        --encre-identite: #FFFFFF;
        --action: #6BA8EE;
        --action-remplie: #1F4FA8;
        --encre-action: #FFFFFF;
        --destructif: #F0857B;

        /* action-remplie stands out from fond at 2.44 only: a 1 px rule in action delimits it */
        --filet-bouton: var(--action);
    }
}

/*
 * Site styles. Colors, sizes, spacings and radii come from tokens.css only.
 */

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

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

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    font-family: var(--police);
    font-size: var(--taille-corps);
    font-weight: var(--graisse-corps);
    line-height: var(--interligne-corps);
    color: var(--texte-principal);
    background-color: var(--fond);
}

img {
    max-width: 100%;
    height: auto;
}

/* Links and focus */

a {
    color: var(--action);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.15em;
}

a:hover {
    text-decoration-thickness: 2px;
}

:focus-visible {
    outline: 2px solid var(--action);
    outline-offset: 2px;
    border-radius: var(--rayon-petit);
}

main:focus {
    outline: none;
}

.skip-link {
    position: absolute;
    top: var(--espace-8);
    left: var(--espace-8);
    z-index: 1;
    padding: var(--espace-8) var(--espace-16);
    color: var(--encre-action);
    background-color: var(--action-remplie);
    border: 1px solid var(--filet-bouton);
    border-radius: var(--rayon-petit);
    transform: translateY(-200%);
}

.skip-link:focus {
    transform: none;
}

/* Header */

.site-header {
    border-bottom: 1px solid var(--bordure);
}

.site-header-inner,
.site-footer-inner,
.page {
    width: 100%;
    max-width: 60rem;
    margin: 0 auto;
    padding-left: var(--espace-16);
    padding-right: var(--espace-16);
}

.site-header-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--espace-8) var(--espace-16);
    padding-top: var(--espace-12);
    padding-bottom: var(--espace-12);
}

.brand {
    display: inline-flex;
    align-items: center;
    min-height: var(--cible-tactile);
}

.brand img {
    display: block;
    width: auto;
    height: var(--espace-40);
}

.language-switch {
    display: inline-flex;
    align-items: center;
    min-height: var(--cible-tactile);
    padding: 0 var(--espace-16);
    font-weight: var(--graisse-titre);
    text-decoration: none;
    border: 1px solid var(--bordure);
    border-radius: var(--rayon-pastille);
}

.language-switch:hover {
    border-color: var(--action);
}

/* Main content */

.page {
    flex: 1 0 auto;
    padding-top: var(--espace-32);
    padding-bottom: var(--espace-48);
}

.page h1,
.page h2,
.page h3 {
    color: var(--identite);
    font-weight: var(--graisse-titre);
}

.page h1 {
    margin: 0 0 var(--espace-24);
    font-size: var(--taille-affichage);
    font-weight: var(--graisse-affichage);
    line-height: var(--interligne-affichage);
}

.page h2 {
    margin: var(--espace-40) 0 var(--espace-12);
    font-size: var(--taille-titre-1);
    line-height: var(--interligne-titre-1);
}

.page h3 {
    margin: var(--espace-24) 0 var(--espace-8);
    font-size: var(--taille-titre-2);
    line-height: var(--interligne-titre-2);
}

.page p,
.page ul,
.page ol,
.page table {
    margin: 0 0 var(--espace-16);
}

.page li + li {
    margin-top: var(--espace-4);
}

.page code {
    padding: 0 var(--espace-4);
    font-size: var(--taille-meta);
    overflow-wrap: anywhere;
    background-color: var(--surface);
    border: 1px solid var(--bordure);
    border-radius: var(--rayon-petit);
}

/* Legal pages read in one column of about 65 characters */
.prose {
    max-width: 65ch;
}

.page .meta {
    font-size: var(--taille-meta);
    line-height: var(--interligne-meta);
    color: var(--texte-secondaire);
}

.table-wrapper {
    overflow-x: auto;
}

.page table {
    width: 100%;
    border-collapse: collapse;
}

.page th,
.page td {
    padding: var(--espace-8) var(--espace-12);
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--bordure);
}

.page th {
    font-weight: var(--graisse-titre);
}

.note {
    margin-bottom: var(--espace-16);
    padding: var(--espace-16) var(--espace-20);
    background-color: var(--surface);
    border: 1px solid var(--bordure);
    border-radius: var(--rayon-carte);
}

.note > :last-child {
    margin-bottom: 0;
}

/* Buttons: centered label, 1 px rule in the dark theme (design system 2.3) */

.button,
.actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--cible-tactile);
    padding: 0 var(--espace-24);
    font-weight: var(--graisse-titre);
    text-align: center;
    text-decoration: none;
    color: var(--encre-action);
    background-color: var(--action-remplie);
    border: 1px solid var(--filet-bouton);
    border-radius: var(--rayon-carte);
}

.button:hover,
.actions a:hover {
    text-decoration: underline;
}

/* Home */

.hero {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--espace-16);
    max-width: 40rem;
}

.page .hero h1,
.page .hero p {
    margin: 0;
}

.hero .lead {
    font-size: var(--taille-titre-2);
    line-height: var(--interligne-corps);
    color: var(--texte-secondaire);
}

.brand-symbol img {
    display: block;
    width: 5rem;
    height: auto;
}

.features {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--espace-16);
}

/* Desktop: the home pages use the full 60rem (960 px) width, three cards in a
   row whatever the text size; long texts stay in .prose at about 65ch. */
@media (min-width: 48rem) {
    .features {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.card {
    padding: var(--espace-20);
    background-color: var(--surface);
    border: 1px solid var(--bordure);
    border-radius: var(--rayon-carte);
}

.page .card h3 {
    margin-top: 0;
}

.card > :last-child {
    margin-bottom: 0;
}

/* Store badges and screenshots */

.store-badge-list,
.screenshot-list,
.footer-links {
    margin: 0;
    padding: 0;
    list-style: none;
}

.page .store-badge-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--espace-16);
    margin: 0;
}

.page .store-badge-list li + li {
    margin-top: 0;
}

.store-badge-list a {
    display: inline-block;
    border-radius: var(--rayon-carte);
}

.store-badge-list img {
    display: block;
    width: auto;
    height: var(--espace-48);
}

.screenshot-list {
    display: flex;
    gap: var(--espace-16);
    overflow-x: auto;
}

.screenshot-list img {
    display: block;
    width: 12rem;
    border: 1px solid var(--bordure);
    border-radius: var(--rayon-feuille);
}

/* Root language choice and 404 */

.language-choice,
.not-found {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.page .language-choice-title {
    margin: var(--espace-16) 0 0;
}

.language-choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: var(--espace-16);
    width: 100%;
    margin-top: var(--espace-24);
}

.language-card {
    padding: var(--espace-24) var(--espace-20);
    background-color: var(--surface);
    border: 1px solid var(--bordure);
    border-radius: var(--rayon-carte);
}

.page .language-card h1,
.page .language-card h2 {
    margin: 0 0 var(--espace-12);
    font-size: var(--taille-titre-1);
    line-height: var(--interligne-titre-1);
}

.page .language-card .store-badges h2 {
    margin-top: var(--espace-24);
    font-size: var(--taille-titre-2);
    line-height: var(--interligne-titre-2);
}

.language-card .store-badge-list {
    justify-content: center;
}

/* Placeholders left for the owner, highlighted in preview builds only */

.marker {
    padding: 0 var(--espace-4);
    font-weight: var(--graisse-titre);
    color: var(--encre-identite);
    background-color: var(--identite-fond);
    outline: 2px dashed var(--action);
    border-radius: var(--rayon-petit);
}

/* Footer, in the document flow */

.site-footer {
    flex-shrink: 0;
    font-size: var(--taille-meta);
    line-height: var(--interligne-meta);
    color: var(--texte-secondaire);
    background-color: var(--surface);
    border-top: 1px solid var(--bordure);
}

.site-footer-inner {
    padding-top: var(--espace-16);
    padding-bottom: var(--espace-24);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0 var(--espace-24);
}

.footer-links a {
    display: inline-flex;
    align-items: center;
    min-height: var(--cible-tactile);
}

.footer-links a[aria-current="page"] {
    font-weight: var(--graisse-titre);
    color: var(--texte-principal);
}

.copyright {
    margin: var(--espace-8) 0 0;
}

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}
