/* =============================================================================
   Dossier profile template - stylesheet
   -----------------------------------------------------------------------------
   A typeset sheet on a desk. Sections:

     01  Design tokens (light / dark / accents)
     02  Reset & base
     03  Icons
     04  Skip link & focus
     05  Floating toolbar & menus
     06  Sheet
     07  Header (filing line, identity, portrait, actions)
     08  Body grid (reference column + reading column)
     09  Reference column blocks (contact, skills, languages, certificates)
     10  Reading column sections & entries
     11  Publications
     12  Recommendations
     13  Video row
     14  Sheet footer & QR
     15  Buttons, links, tags
     16  Share dialog & toast
     17  Responsive
     18  Accessibility preferences
     19  Print - the second first-class rendering of this template

   The print block at the end is not a nicety: "Save as PDF" is one of this
   template's primary actions, so treat any change here as a change to two
   layouts, and re-check both.
   ========================================================================== */

/* ------------------------------------------------------- 01 design tokens */

:root {
    --do-serif: "IBM Plex Serif", Georgia, "Times New Roman", serif;
    --do-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --do-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
    --do-arabic: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;

    /* Paper on a desk. Warm, not clinical. */
    --do-desk: #eceae3;
    --do-sheet: #fdfcf9;
    --do-ink: #1f1c18;
    --do-ink-soft: #57534c;
    --do-ink-faint: #8d887f;
    --do-rule: #e2ddd2;
    --do-rule-strong: #c9c3b6;
    --do-hover: #f4f1ea;
    --do-shadow: 0 1px 2px rgb(28 25 23 / 0.06), 0 12px 40px -12px rgb(28 25 23 / 0.18);

    /* Accent defaults (overridden per data-profile-accent below). Two grades:
       ink-grade for text on paper, bright for dark mode. */
    --do-accent: #0369a1;
    --do-accent-bright: #38bdf8;
}

html[data-theme="dark"] {
    --do-desk: #0b0c0f;
    --do-sheet: #16181d;
    --do-ink: #eae8e3;
    --do-ink-soft: #a6a29b;
    --do-ink-faint: #6b6761;
    --do-rule: #262931;
    --do-rule-strong: #363a44;
    --do-hover: #1d2026;
    --do-shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 16px 48px -12px rgb(0 0 0 / 0.55);
    --do-accent: var(--do-accent-bright);
}

/* Accent palettes - keys match ProfileTemplateCatalog.Accents. The light value
   is deliberately darker than the palette swatch: on paper the accent is ink,
   and #0ea5e9 text on near-white fails WCAG AA. */
html[data-profile-accent="modern"]   { --do-accent: #0369a1; --do-accent-bright: #38bdf8; }
html[data-profile-accent="classic"]  { --do-accent: #1e40af; --do-accent-bright: #93b6fd; }
html[data-profile-accent="minimal"]  { --do-accent: #475569; --do-accent-bright: #9aa8bc; }
html[data-profile-accent="creative"] { --do-accent: #be185d; --do-accent-bright: #f472b6; }

html[data-theme="dark"][data-profile-accent="modern"]   { --do-accent: #38bdf8; }
html[data-theme="dark"][data-profile-accent="classic"]  { --do-accent: #93b6fd; }
html[data-theme="dark"][data-profile-accent="minimal"]  { --do-accent: #9aa8bc; }
html[data-theme="dark"][data-profile-accent="creative"] { --do-accent: #f472b6; }

/* --------------------------------------------------------- 02 reset & base */

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

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

body.do-doc {
    margin: 0;
    background: var(--do-desk);
    color: var(--do-ink);
    font-family: var(--do-sans);
    font-size: 1rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

html[lang="ar"] body.do-doc {
    font-family: var(--do-arabic);
}

/* The `hidden` attribute is only UA-level display:none; any of our own display
   rules would beat it. This keeps the inactive language blocks truly gone. */
.do-doc [hidden] {
    display: none !important;
}

/* Element resets are wrapped in :where() so they carry zero element
   specificity: ".do-doc a" would otherwise be (0,1,1) and silently beat every
   single-class component rule such as .do-btn--solid (0,1,0) - which is
   exactly the bug that shipped ink-on-ink button text in the first cut. */
.do-doc :where(img) {
    max-width: 100%;
    display: block;
}

.do-doc :where(h1, h2, h3, p, ul, ol, figure, blockquote) {
    margin: 0;
    padding: 0;
}

.do-doc :where(ul, ol) {
    list-style: none;
}

.do-doc :where(a) {
    color: inherit;
    text-decoration: none;
}

.do-doc :where(button) {
    font: inherit;
    color: inherit;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}

.do-mono {
    font-family: var(--do-mono);
    font-size: 0.78rem;
    letter-spacing: 0.01em;
}

/* --------------------------------------------------------------- 03 icons */

/* Sprite symbols are stroke-only paths; without these rules they paint as
   solid black shapes. Kept at (0,1,1) deliberately: component rules that
   resize icons (.do-btn svg, .do-head__fact svg) appear later, so they win
   the tie on order. */
.do-doc svg {
    width: 1.05rem;
    height: 1.05rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: none;
}

/* ------------------------------------------------- 04 skip link & focus */

.do-skip {
    position: fixed;
    inset-block-start: 0.75rem;
    inset-inline-start: 0.75rem;
    z-index: 100;
    padding: 0.55rem 1rem;
    background: var(--do-ink);
    color: var(--do-sheet);
    border-radius: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    transform: translateY(-200%);
}

.do-skip:focus-visible {
    transform: none;
}

.do-doc :focus-visible {
    outline: 2px solid var(--do-accent);
    outline-offset: 2px;
    border-radius: 2px;
}

/* ------------------------------------------- 05 floating toolbar & menus */

.do-toolbar {
    position: fixed;
    inset-block-start: 0.9rem;
    inset-inline: 0;
    margin-inline: auto;
    width: fit-content;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem;
    background: color-mix(in oklab, var(--do-sheet) 88%, transparent);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid var(--do-rule);
    border-radius: 999px;
    box-shadow: var(--do-shadow);
}

.do-toolbar__brand {
    display: grid;
    place-items: center;
    width: 2.15rem;
    height: 2.15rem;
    border-radius: 999px;
    background: var(--do-ink);
    color: var(--do-sheet);
    font-family: var(--do-serif);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.do-toolbar__group {
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.do-tool {
    display: grid;
    place-items: center;
    width: 2.15rem;
    height: 2.15rem;
    border-radius: 999px;
    color: var(--do-ink-soft);
    transition: background-color 140ms ease, color 140ms ease;
}

.do-tool:hover {
    background: var(--do-hover);
    color: var(--do-ink);
}

.do-tool--lang span {
    font-family: var(--do-mono);
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1;
}

.do-menu {
    position: relative;
}

.do-menu__panel {
    position: absolute;
    inset-block-start: calc(100% + 0.6rem);
    inset-inline-end: 0;
    min-width: 10.5rem;
    padding: 0.35rem;
    background: var(--do-sheet);
    border: 1px solid var(--do-rule);
    border-radius: 0.75rem;
    box-shadow: var(--do-shadow);
    display: none;
}

.do-menu[data-open="true"] .do-menu__panel {
    display: block;
}

.do-menu__item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.5rem 0.65rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    color: var(--do-ink-soft);
    text-align: start;
}

.do-menu__item:hover {
    background: var(--do-hover);
    color: var(--do-ink);
}

.do-menu__item .do-menu__tick {
    margin-inline-start: auto;
    opacity: 0;
    width: 0.9rem;
    height: 0.9rem;
}

.do-menu__item[aria-checked="true"] {
    color: var(--do-ink);
    font-weight: 500;
}

.do-menu__item[aria-checked="true"] .do-menu__tick {
    opacity: 1;
    color: var(--do-accent);
}

/* --------------------------------------------------------------- 06 sheet */

#do-main {
    padding-block: 4.6rem 3rem;
    padding-inline: clamp(0.75rem, 3vw, 2rem);
}

.do-sheet {
    max-width: 62rem;
    margin-inline: auto;
    background: var(--do-sheet);
    border: 1px solid var(--do-rule);
    border-radius: 4px;
    box-shadow: var(--do-shadow);
    animation: do-rise 480ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes do-rise {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* -------------------------------------------------------------- 07 header */

.do-head {
    padding: clamp(1.4rem, 4vw, 2.75rem) clamp(1.4rem, 4.5vw, 3.25rem) 0;
}

.do-filing {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    flex-wrap: wrap;
    padding-block-end: 0.9rem;
    border-block-end: 1px solid var(--do-rule-strong);
    font-family: var(--do-mono);
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--do-ink-faint);
}

.do-filing__ref {
    letter-spacing: 0.06em;
    text-transform: none;
}

.do-head__grid {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: clamp(1.25rem, 4vw, 2.5rem);
    padding-block: clamp(1.5rem, 3.5vw, 2.4rem) 0;
}

.do-head__identity {
    min-width: 0;
}

.do-head__honorific {
    font-family: var(--do-mono);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--do-accent);
    margin-block-end: 0.4rem;
}

.do-head__name {
    font-family: var(--do-serif);
    font-size: clamp(2.1rem, 5.5vw, 3.2rem);
    font-weight: 500;
    line-height: 1.08;
    letter-spacing: -0.015em;
    text-wrap: balance;
}

html[lang="ar"] .do-head__name {
    font-family: var(--do-arabic);
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.3;
}

.do-head__role {
    margin-block-start: 0.7rem;
    font-size: clamp(1rem, 2.2vw, 1.15rem);
    font-weight: 500;
    color: var(--do-ink-soft);
}

.do-head__at {
    margin-block-start: 0.3rem;
    font-size: 0.9rem;
    color: var(--do-ink-faint);
}

.do-head__at strong {
    font-weight: 600;
    color: var(--do-ink-soft);
}

.do-head__facts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.4rem;
    margin-block-start: 1.1rem;
}

.do-head__fact {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-family: var(--do-mono);
    font-size: 0.78rem;
    color: var(--do-ink-soft);
}

.do-head__fact svg {
    width: 0.9rem;
    height: 0.9rem;
    color: var(--do-ink-faint);
}

/* Passport photo: mounted with a mat border; the monogram sits permanently
   behind the image so a broken URL degrades with no layout shift. */
.do-portrait {
    position: relative;
    flex: none;
    width: clamp(6rem, 16vw, 8rem);
    aspect-ratio: 5 / 6;
    padding: 0.3rem;
    background: var(--do-sheet);
    border: 1px solid var(--do-rule-strong);
}

.do-portrait__mono {
    position: absolute;
    inset: 0.3rem;
    display: grid;
    place-items: center;
    background: var(--do-hover);
    color: var(--do-ink-faint);
    font-family: var(--do-serif);
    font-size: 2rem;
    font-weight: 500;
    letter-spacing: 0.05em;
}

.do-portrait__img {
    position: relative;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(0.92);
}

.do-portrait[data-image-failed="true"] .do-portrait__img {
    display: none;
}

.do-head__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-block: clamp(1.4rem, 3vw, 2rem) clamp(1.4rem, 3vw, 1.9rem);
    border-block-end: 1px solid var(--do-rule);
}

/* --------------------------------------------------------- 08 body grid */

.do-body {
    display: grid;
    grid-template-columns: 16rem minmax(0, 1fr);
}

.do-body--single {
    grid-template-columns: minmax(0, 1fr);
}

.do-body--single .do-aside {
    border-inline-end: 0;
}

.do-aside {
    padding: clamp(1.4rem, 3vw, 2.2rem) clamp(1.25rem, 3vw, 1.9rem);
    border-inline-end: 1px solid var(--do-rule);
    display: flex;
    flex-direction: column;
    gap: 1.9rem;
}

.do-maincol {
    min-width: 0;
    padding: clamp(1.4rem, 3vw, 2.2rem) clamp(1.4rem, 4.5vw, 3.25rem);
    display: flex;
    flex-direction: column;
    gap: clamp(1.9rem, 4vw, 2.6rem);
}

/* --------------------------------------- 09 reference column blocks */

.do-block__title {
    font-family: var(--do-mono);
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--do-ink-faint);
    padding-block-end: 0.5rem;
    margin-block-end: 0.8rem;
    border-block-end: 1px solid var(--do-rule);
}

.do-contact {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.do-contact__row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding-block: 0.32rem;
    font-size: 0.85rem;
    color: var(--do-ink-soft);
    min-width: 0;
}

.do-contact__row > span {
    overflow-wrap: anywhere;
}

.do-contact__row svg {
    width: 0.95rem;
    height: 0.95rem;
    color: var(--do-ink-faint);
}

a.do-contact__row:hover {
    color: var(--do-accent);
}

a.do-contact__row:hover svg {
    color: var(--do-accent);
}

.do-contact__ext {
    margin-inline-start: auto;
    width: 0.8rem !important;
    height: 0.8rem !important;
    opacity: 0;
    transition: opacity 140ms ease;
}

a.do-contact__row:hover .do-contact__ext {
    opacity: 1;
}

.do-skillgroup + .do-skillgroup {
    margin-block-start: 1.1rem;
}

.do-skillgroup__title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--do-ink-soft);
    margin-block-end: 0.45rem;
}

.do-skills {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.do-skill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: var(--do-ink-soft);
}

.do-skill__name {
    min-width: 0;
    overflow-wrap: anywhere;
}

.do-skill__dots {
    display: inline-flex;
    gap: 0.25rem;
    flex: none;
}

.do-dot {
    width: 0.42rem;
    height: 0.42rem;
    border-radius: 999px;
    border: 1px solid var(--do-rule-strong);
}

.do-dot--on {
    background: var(--do-accent);
    border-color: var(--do-accent);
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

/* Inline "a · b · c" list for unscored skills and spoken languages. */
.do-taglist {
    font-size: 0.85rem;
    line-height: 1.9;
    color: var(--do-ink-soft);
}

.do-taglist li {
    display: inline;
}

.do-taglist li:not(:last-child)::after {
    content: " · ";
    color: var(--do-ink-faint);
}

.do-certs {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.do-cert {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.do-cert__name {
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.4;
}

.do-cert__org {
    font-size: 0.8rem;
    color: var(--do-ink-soft);
}

.do-cert__meta {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    flex-wrap: wrap;
    color: var(--do-ink-faint);
}

/* ------------------------------------ 10 reading column sections & entries */

.do-section__head {
    display: flex;
    align-items: baseline;
    gap: 0.8rem;
    padding-block-end: 0.55rem;
    margin-block-end: 1.15rem;
    border-block-end: 1px solid var(--do-rule);
}

.do-section__no {
    font-family: var(--do-mono);
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--do-accent);
    letter-spacing: 0.08em;
}

/* The video annex carries a play glyph in the number slot. */
.do-section__no svg {
    width: 0.72rem;
    height: 0.72rem;
    fill: currentColor;
    stroke: none;
}

.do-section__title {
    font-family: var(--do-serif);
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

html[lang="ar"] .do-section__title {
    font-family: var(--do-arabic);
    font-weight: 700;
    letter-spacing: 0;
}

.do-entries {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.do-entry {
    display: grid;
    grid-template-columns: 8.25rem minmax(0, 1fr);
    gap: 0.3rem 1.25rem;
}

.do-entry--plain {
    grid-template-columns: minmax(0, 1fr);
}

.do-entry__when {
    color: var(--do-ink-faint);
    line-height: 1.9;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
}

.do-now {
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--do-accent);
    border: 1px solid color-mix(in oklab, var(--do-accent) 45%, transparent);
    border-radius: 999px;
    padding: 0.1rem 0.5rem;
}

.do-entry__title {
    font-size: 0.98rem;
    font-weight: 600;
    line-height: 1.45;
}

.do-entry__titlelink {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.do-entry__titlelink svg {
    width: 0.85rem;
    height: 0.85rem;
    color: var(--do-ink-faint);
}

.do-entry__titlelink:hover {
    color: var(--do-accent);
}

.do-entry__org {
    font-size: 0.88rem;
    color: var(--do-ink-soft);
    margin-block-start: 0.1rem;
}

.do-entry__tech {
    color: var(--do-ink-faint);
    margin-block-start: 0.55rem;
}

html[dir="rtl"] .do-entry__tech {
    text-align: end;
}

.do-prose {
    margin-block-start: 0.55rem;
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--do-ink-soft);
}

.do-prose p + p,
.do-prose p + ul,
.do-prose ul + p {
    margin-block-start: 0.55rem;
}

.do-prose ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.do-prose li {
    position: relative;
    padding-inline-start: 1.05rem;
}

.do-prose li::before {
    content: "–";
    position: absolute;
    inset-inline-start: 0;
    color: var(--do-accent);
}

/* -------------------------------------------------------- 11 publications */

.do-papers {
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
}

.do-paper {
    display: grid;
    grid-template-columns: 2.6rem minmax(0, 1fr);
    gap: 1rem;
}

.do-paper__no {
    color: var(--do-ink-faint);
    line-height: 1.9;
}

.do-paper__title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.5;
}

.do-paper__authors {
    font-size: 0.85rem;
    color: var(--do-ink-soft);
    margin-block-start: 0.2rem;
}

.do-paper__where {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: var(--do-ink-soft);
    margin-block-start: 0.2rem;
}

.do-paper__where em {
    font-family: var(--do-serif);
    font-style: italic;
}

.do-paper__where .do-mono {
    color: var(--do-ink-faint);
}

.do-paper .do-link {
    margin-block-start: 0.45rem;
}

/* ----------------------------------------------------- 12 recommendations */

.do-quote {
    border-inline-start: 2px solid var(--do-accent);
    padding-inline-start: 1.15rem;
}

.do-quote > p {
    font-family: var(--do-serif);
    font-style: italic;
    font-size: 0.98rem;
    line-height: 1.75;
    color: var(--do-ink-soft);
}

html[lang="ar"] .do-quote > p {
    font-family: var(--do-arabic);
    font-style: normal;
}

.do-quote__by {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-block-start: 0.7rem;
}

.do-quote__name {
    font-size: 0.85rem;
    font-weight: 600;
}

.do-quote__role {
    font-size: 0.82rem;
    color: var(--do-ink-faint);
}

.do-quote__ext {
    display: inline-flex;
    color: var(--do-ink-faint);
}

.do-quote__ext:hover {
    color: var(--do-accent);
}

.do-quote__ext svg {
    width: 0.95rem;
    height: 0.95rem;
}

/* --------------------------------------------------------- 13 video row */

.do-videorow {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--do-rule);
    border-radius: 0.5rem;
    transition: border-color 140ms ease, background-color 140ms ease;
}

.do-videorow:hover {
    background: var(--do-hover);
    border-color: var(--do-rule-strong);
}

.do-videorow__icon {
    display: grid;
    place-items: center;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 999px;
    background: var(--do-ink);
    color: var(--do-sheet);
    flex: none;
}

.do-videorow__icon svg {
    width: 0.9rem;
    height: 0.9rem;
    fill: currentColor;
    stroke: none;
}

.do-videorow__text {
    font-size: 0.9rem;
    color: var(--do-ink-soft);
    min-width: 0;
}

.do-videorow .do-link {
    margin-inline-start: auto;
    flex: none;
}

/* --------------------------------------------------- 14 sheet footer & QR */

.do-foot {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1.5rem;
    flex-wrap: wrap;
    padding: clamp(1.3rem, 3vw, 1.9rem) clamp(1.4rem, 4.5vw, 3.25rem) clamp(1.5rem, 3.5vw, 2.2rem);
    border-block-start: 1px solid var(--do-rule-strong);
}

.do-foot__meta {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    color: var(--do-ink-faint);
}

.do-foot__meta a {
    color: var(--do-ink-soft);
    text-decoration: underline;
    text-decoration-color: var(--do-rule-strong);
    text-underline-offset: 0.2em;
}

.do-foot__meta a:hover {
    color: var(--do-accent);
}

.do-foot__site {
    font-size: 0.8rem;
    margin-block-start: 0.45rem;
}

.do-foot__qr {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    color: var(--do-ink-faint);
    text-align: center;
}

.do-qrbox {
    display: grid;
    place-items: center;
    padding: 0.4rem;
    background: #ffffff;
    border: 1px solid var(--do-rule-strong);
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.do-qrbox:empty {
    /* Reserve the box before the script draws, so the footer never jumps. */
    min-width: calc(104px + 0.8rem);
    min-height: calc(104px + 0.8rem);
}

.do-qrbox canvas {
    display: block;
}

/* ------------------------------------------------ 15 buttons, links, tags */

.do-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.95rem;
    border: 1px solid var(--do-rule-strong);
    border-radius: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--do-ink-soft);
    background: var(--do-sheet);
    transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
}

.do-btn:hover {
    background: var(--do-hover);
    color: var(--do-ink);
}

.do-btn svg {
    width: 0.95rem;
    height: 0.95rem;
}

.do-btn--solid {
    background: var(--do-ink);
    border-color: var(--do-ink);
    color: var(--do-sheet);
}

.do-btn--solid:hover {
    background: color-mix(in oklab, var(--do-ink) 86%, var(--do-sheet));
    color: var(--do-sheet);
}

.do-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--do-accent);
}

.do-link:hover {
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

.do-link svg {
    width: 0.8rem;
    height: 0.8rem;
}

/* ------------------------------------------------ 16 share dialog & toast */

.do-dialog {
    width: min(26rem, calc(100vw - 2rem));
    border: 1px solid var(--do-rule);
    border-radius: 0.9rem;
    background: var(--do-sheet);
    color: var(--do-ink);
    padding: 0;
    box-shadow: var(--do-shadow);
}

.do-dialog::backdrop {
    background: rgb(15 14 12 / 0.45);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

.do-dialog__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-block-end: 1px solid var(--do-rule);
}

.do-dialog__title {
    font-family: var(--do-serif);
    font-size: 1.05rem;
    font-weight: 600;
}

html[lang="ar"] .do-dialog__title {
    font-family: var(--do-arabic);
}

.do-dialog__body {
    padding: 1.25rem;
}

.do-share {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    align-items: center;
}

.do-share__qr {
    display: grid;
    place-items: center;
    padding: 0.5rem;
    background: #ffffff;
    border: 1px solid var(--do-rule-strong);
}

.do-share__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    width: 100%;
}

.do-share__btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 0.65rem 0.25rem;
    border: 1px solid var(--do-rule);
    border-radius: 0.6rem;
    font-size: 0.72rem;
    color: var(--do-ink-soft);
    transition: background-color 140ms ease, color 140ms ease;
}

.do-share__btn:hover {
    background: var(--do-hover);
    color: var(--do-ink);
}

.do-share__copy {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    min-width: 0;
}

.do-share__url {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--do-ink-faint);
    border: 1px solid var(--do-rule);
    border-radius: 0.5rem;
    padding: 0.5rem 0.7rem;
}

/* ------------------------------------------------------------- back to top
   A dossier is a long single page with no section nav, so the way back to the
   header has to be one click. Logical inset keeps it in the trailing corner in
   both directions. */

.do-top {
    position: fixed;
    inset-block-end: 1.25rem;
    inset-inline-end: 1.25rem;
    z-index: 80;
    display: grid;
    place-items: center;
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 999px;
    background: color-mix(in oklab, var(--do-sheet) 92%, transparent);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid var(--do-rule);
    color: var(--do-ink-soft);
    box-shadow: var(--do-shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(0.5rem);
    transition: opacity 200ms ease, transform 200ms ease, visibility 200ms, color 140ms ease, border-color 140ms ease;
}

.do-top svg {
    width: 1.05rem;
    height: 1.05rem;
}

.do-top[data-visible="true"] {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.do-top:hover {
    color: var(--do-accent);
    border-color: var(--do-rule-strong);
}

.do-toast {
    position: fixed;
    inset-block-end: 1.25rem;
    inset-inline: 0;
    margin-inline: auto;
    width: fit-content;
    max-width: calc(100vw - 2rem);
    z-index: 90;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.1rem;
    background: var(--do-ink);
    color: var(--do-sheet);
    border-radius: 999px;
    font-size: 0.85rem;
    box-shadow: var(--do-shadow);
    opacity: 0;
    transform: translateY(0.75rem);
    pointer-events: none;
    transition: opacity 200ms ease, transform 200ms ease;
}

.do-toast[data-visible="true"] {
    opacity: 1;
    transform: none;
}

.do-toast svg {
    width: 0.9rem;
    height: 0.9rem;
}

/* ---------------------------------------------------------- 17 responsive */

/* Scoped to screen: A4's content box (~700px) is narrower than this
   breakpoint, and without the scope the phone layout - reordered columns,
   stacked entries - leaks into the printed document. */
@media screen and (max-width: 47.99rem) {
    #do-main {
        padding-block-start: 4.2rem;
    }

    .do-body {
        grid-template-columns: minmax(0, 1fr);
    }

    /* On a phone the reading column (summary, experience) matters more than
       the reference column; the header actions already cover contact needs. */
    .do-aside {
        order: 2;
        border-inline-end: 0;
        border-block-start: 1px solid var(--do-rule);
    }

    .do-maincol {
        order: 1;
    }

    .do-entry {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.15rem;
    }

    .do-entry__when {
        flex-direction: row;
        align-items: center;
        gap: 0.6rem;
    }

    .do-head__grid {
        flex-direction: row-reverse;
        align-items: flex-start;
    }

    .do-foot {
        flex-direction: column;
        align-items: flex-start;
    }

    .do-foot__qr {
        align-items: flex-start;
        text-align: start;
    }
}

@media screen and (max-width: 35.99rem) {
    .do-paper {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.15rem;
    }

    .do-videorow .do-link {
        display: none;
    }
}

/* --------------------------------------- 18 accessibility preferences */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .do-sheet {
        animation: none;
    }

    .do-doc *,
    .do-doc *::before,
    .do-doc *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}

@media (prefers-contrast: more) {
    :root,
    html[data-theme="dark"] {
        --do-rule: var(--do-rule-strong);
        --do-ink-faint: var(--do-ink-soft);
    }
}

@media (forced-colors: active) {
    .do-sheet,
    .do-dialog,
    .do-toolbar {
        border: 1px solid CanvasText;
    }

    .do-dot--on {
        background: CanvasText;
    }
}

/* ----------------------------------------------------------- 19 print */

@page {
    size: A4;
    margin: 12mm 13mm;
}

@media print {
    /* Ink on paper regardless of the screen theme choice. */
    :root,
    html[data-theme="dark"] {
        --do-desk: #ffffff;
        --do-sheet: #ffffff;
        --do-ink: #191714;
        --do-ink-soft: #3d3a35;
        --do-ink-faint: #6d6961;
        --do-rule: #d4cfc5;
        --do-rule-strong: #aaa598;
        --do-hover: #ffffff;
        --do-shadow: none;
    }

    /* The accent stays its ink-grade light value even if dark mode was active. */
    html[data-theme="dark"][data-profile-accent="modern"]   { --do-accent: #0369a1; }
    html[data-theme="dark"][data-profile-accent="classic"]  { --do-accent: #1e40af; }
    html[data-theme="dark"][data-profile-accent="minimal"]  { --do-accent: #475569; }
    html[data-theme="dark"][data-profile-accent="creative"] { --do-accent: #be185d; }

    html {
        /* Slightly denser type for A4; every rem in the document scales down. */
        font-size: 13px;
    }

    body.do-doc {
        background: #ffffff;
    }

    [data-noprint],
    .do-section--noprint,
    .do-toolbar,
    .do-toast,
    .do-dialog,
    .do-skip {
        display: none !important;
    }

    #do-main {
        padding: 0;
    }

    .do-sheet {
        max-width: none;
        margin: 0;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        animation: none;
    }

    .do-head,
    .do-aside,
    .do-maincol,
    .do-foot {
        padding-inline: 0;
    }

    .do-head {
        padding-block-start: 0;
    }

    .do-head__grid {
        padding-block-start: 1.2rem;
    }

    /* The action row is gone in print, but its bottom border doubled as the
       header's closing rule - reinstate it on the grid itself. */
    .do-head__actions {
        display: none !important;
    }

    .do-head__grid {
        padding-block-end: 1.4rem;
        border-block-end: 1px solid var(--do-rule);
        margin-block-end: 0.4rem;
    }

    .do-aside {
        padding-inline-end: 1.5rem;
    }

    .do-maincol {
        padding-inline-start: 1.9rem;
    }

    .do-body {
        grid-template-columns: 15rem minmax(0, 1fr);
    }

    .do-body--single {
        grid-template-columns: minmax(0, 1fr);
    }

    /* Keep each record whole across page breaks. The footer counts as one
       record too: split, it leaves an orphaned empty QR frame on one page
       and its caption on the next. */
    .do-entry,
    .do-paper,
    .do-quote,
    .do-block,
    .do-cert,
    .do-videorow,
    .do-foot {
        break-inside: avoid;
    }

    .do-section__head {
        break-after: avoid;
    }

    .do-foot {
        margin-block-start: 0.8rem;
    }

    .do-doc a {
        color: inherit;
    }

    .do-link {
        color: var(--do-accent);
    }
}
