/* The local photograph and the graphite pass share one SVG coordinate system
   so the contours stay aligned at every crop and viewport size. */
:root:not(.can-play-ombra-intro) button[data-play-intro] { display: none; }
.utility:has(.intro-replay-link) { height: auto; min-height: 44px; }
.utility .intro-replay-link, .site-footer .intro-replay-link {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    min-height: 44px;
    font: 600 .9rem/1.3 'DM Sans', sans-serif;
    text-decoration: none;
    letter-spacing: .015em;
    color: #d8f1dc;
    white-space: nowrap;
}
.utility .wrap { gap: .75rem; }
.intro-replay-link span { font-size: .75em; }
.intro-replay-link:hover { text-decoration: underline; text-underline-offset: .2em; }
.intro-replay-link:focus-visible { outline: 2px solid #c5ebcf; outline-offset: 2px; }
dialog.graphite-intro {
    --gutter: clamp(22px, 5vw, 100px);
    --intro-ink: #10231f;
    --intro-ivory: #f4f0e6;
    --scene-time: 3450ms;
    height: 100%;
    height: 100dvh;
    color: var(--intro-ivory);
    background: radial-gradient(ellipse at 72% 40%, #293c32 0%, #13241f 44%, #091612 100%);
    transition: opacity .23s ease;
}
.graphite-intro .graphite-masthead,
.graphite-intro .graphite-progress {
    position: absolute;
    z-index: 2;
    left: max(var(--gutter), env(safe-area-inset-left));
    right: max(var(--gutter), env(safe-area-inset-right));
}
.graphite-masthead {
    top: max(clamp(18px, 4vh, 56px), env(safe-area-inset-top));
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.graphite-brand { display: flex; align-items: center; gap: 11px; }
.graphite-brand > img { width: clamp(36px, 4vw, 53px); height: auto; }
.graphite-brand > .graphite-custom-logo { width: auto; max-width: min(200px, 47vw); max-height: 62px; }
.graphite-wordmark {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-family: 'DM Sans', Arial, sans-serif;
    font-size: clamp(17px, 1.6vw, 24px);
    font-weight: 600;
    line-height: 1;
    letter-spacing: .21em;
}
.graphite-wordmark small { font-size: .47em; letter-spacing: .54em; }
.graphite-skip {
    min-height: 44px;
    padding: 7px 22px;
    font: 500 .875rem/1.3 'DM Sans', sans-serif;
    color: var(--intro-ivory);
    border: 1px solid #c4c8b273;
    border-radius: 24px;
    background: #11201c;
    cursor: pointer;
}
.graphite-skip:hover { background: #263c30; border-color: #e4e5cd; }
.graphite-skip:focus-visible { outline: 2px solid #dbd5ac; outline-offset: 4px; }

.graphite-scenes {
    position: absolute;
    inset: max(95px, 15vh) max(var(--gutter), env(safe-area-inset-right)) max(65px, 10vh) max(var(--gutter), env(safe-area-inset-left));
}
.graphite-scene {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: minmax(0, .75fr) minmax(0, 1.65fr);
    column-gap: clamp(26px, 5vw, 100px);
    align-items: center;
    opacity: 0;
    visibility: hidden;
}
.graphite-scene.is-current { visibility: visible; opacity: 1; }
.graphite-caption { align-self: end; padding-bottom: clamp(14px, 4.8vh, 68px); }
.graphite-caption::before {
    content: '';
    display: block;
    width: clamp(42px, 4.8vw, 88px);
    height: 2px;
    margin-bottom: clamp(15px, 2.6vh, 44px);
    background: #c2c7a2;
}
.graphite-caption h3 {
    margin: 0;
    font: 400 clamp(40px, 5.55vw, 104px)/.98 Italiana, Georgia, serif;
    letter-spacing: -.04em;
    color: var(--intro-ivory);
    text-wrap: balance;
}
.graphite-caption p {
    margin: clamp(17px, 2.8vh, 34px) 0 0;
    max-width: 33ch;
    font: 400 clamp(16px, 1.13vw, 20px)/1.52 'DM Sans', sans-serif;
    color: #d1d8cd;
}
.graphite-art {
    position: relative;
    height: 100%;
    max-height: max(58vh, 480px);
    min-height: 0;
    width: 100%;
    border: 1px solid #a9b19a61;
    background: #eae6da;
}
.graphite-art::before {
    content: '';
    position: absolute;
    pointer-events: none;
    z-index: -1;
    inset: -9px 9px 9px -9px;
    border: 1px solid #d4d7b73b;
}
.graphite-art svg { display: block; width: 100%; height: 100%; overflow: hidden; }
.graphite-scene.is-current .graphite-caption { animation: ombra-caption-enter .4s ease-out both; }
.graphite-scene.is-current .graphite-pencil { animation: ombra-pencil-enter var(--scene-time) linear both; }
.graphite-scene.is-current .graphite-colour { animation: ombra-colour-enter var(--scene-time) cubic-bezier(.46,.02,.23,.99) both; }
@keyframes ombra-caption-enter {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}
/* Start on a partially traced sheet, finish the drawing, then lay colour
   across it on an angled edge like a moving stroke. */
@keyframes ombra-pencil-enter {
    0% { clip-path: polygon(0 0, 2% 0, 45% 100%, 0 100%); }
    20%, 100% { clip-path: polygon(0 0, 145% 0, 186% 100%, 0 100%); }
}
@keyframes ombra-colour-enter {
    0%, 40% { clip-path: polygon(0 0, -41% 0, -1% 100%, 0 100%); }
    81%, 100% { clip-path: polygon(0 0, 101% 0, 141% 100%, 0 100%); }
}
.graphite-progress {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    bottom: max(clamp(20px, 4.5vh, 56px), env(safe-area-inset-bottom));
}
.graphite-progress span { height: 2px; background: #a2b3a340; overflow: hidden; }
.graphite-progress i { display: block; height: 100%; background: #c2cca7; transform-origin: left; transform: scaleX(0); }
.graphite-progress .is-current i { animation: ombra-graphite-progress var(--scene-time) linear both; }
.graphite-progress .is-complete i { transform: scaleX(1); }
@keyframes ombra-graphite-progress { to { transform: scaleX(1); } }

@media (max-width: 720px) and (orientation: portrait) {
    .graphite-scenes { top: max(83px, 12.5vh); bottom: max(45px, 7.5vh); }
    .graphite-scene { grid-template-columns: 1fr; grid-template-rows: minmax(0, min(50vh, 85vw)) auto; align-content: center; gap: clamp(15px, 3.3vh, 34px); }
    .graphite-art { grid-row: 1; height: 100%; max-height: none; }
    .graphite-art::before { inset: -5px 5px 5px -5px; }
    .graphite-caption { grid-row: 2; padding: 0; }
    .graphite-caption::before { width: 33px; margin-bottom: 12px; }
    .graphite-caption h3 { font-size: clamp(36px, 9.2vw, 60px); }
    .graphite-caption p { margin-top: 10px; max-width: 42ch; }
}
@media (max-height: 520px) and (orientation: landscape) {
    .graphite-scenes { top: 71px; bottom: 32px; }
    .graphite-masthead { top: max(9px, env(safe-area-inset-top)); }
    .graphite-caption { padding-bottom: 8px; }
    .graphite-caption::before { margin-bottom: 8px; }
    .graphite-caption h3 { font-size: clamp(31px, 4.5vw, 56px); }
    .graphite-caption p { font-size: .94rem; line-height: 1.35; margin-top: 10px; }
    .graphite-progress { bottom: 13px; }
}
@media (prefers-reduced-motion: reduce) {
    .graphite-intro .graphite-pencil, .graphite-intro .graphite-progress { display: none; }
    .graphite-intro .graphite-scene.is-current .graphite-caption,
    .graphite-intro .graphite-scene.is-current .graphite-colour { clip-path: none; animation: none; }
    .graphite-scenes { bottom: max(76px, 12vh); }
}
.graphite-controls:not([hidden]) {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(6px, 2vw, 24px);
    position: absolute;
    bottom: max(8px, env(safe-area-inset-bottom));
    left: var(--gutter);
    right: var(--gutter);
    z-index: 2;
    font: 500 .875rem/1.25 'DM Sans', sans-serif;
    text-align: center;
}
.graphite-controls button {
    min-height: 44px;
    padding: .45rem .7rem;
    border: 1px solid #9caca0;
    border-radius: 8px;
    color: var(--intro-ivory);
    background: #14271e;
    font: inherit;
    cursor: pointer;
}
.graphite-controls button:disabled { opacity: .45; cursor: default; }
