@font-face {
    font-family: "ShantellSans";
    src: url("fonts/ShantellSans-VariableFont_BNCE,INFM,SPAC,wght.ttf")
        format("truetype");
    font-weight: 100 900;
    font-style: normal;
}

@font-face {
    font-family: "ShantellSans";
    src: url("fonts/ShantellSans-Italic-VariableFont_BNCE,INFM,SPAC,wght.ttf")
        format("truetype");
    font-weight: 100 900;
    font-style: italic;
}

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

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: sans-serif;
}

/* ── TOOL ROLL ── */

/* Mat/tray that sits BEHIND the pens — pens render on top */
.tool-roll-strip {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 540px;
    height: 120px;
    background-image: url("images/nav_background.png");
    background-size: 540px auto;
    background-position: top center;
    background-repeat: no-repeat;
    filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.45));
    z-index: 499; /* behind pens */
}

/* Row of tool items, centred, IN FRONT of the strip */
.tool-items-row {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 501;
    padding: 0 8px;
    pointer-events: none;
}

/* Individual tool */
.tool-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    pointer-events: auto;
    /* SVG is 140px. Want ~65px peeking out in resting state.
     Translate up by: 140 - 65 = 75px */
    transform: translateY(-75px);
    transition: transform 0.4s cubic-bezier(0.34, 1.3, 0.64, 1);
    outline: none;
}

.tool-item:hover,
.tool-item:focus-visible {
    transform: translateY(8px);
}

/* Photo nav item test (ruler): shaft is 250px tall instead of 140px, so its
   resting peek needs its own offset. Want ~116px peeking out at rest:
   translate up by 250 - 116 = 134px. Still yields to :hover/.is-open above,
   since those selectors have higher specificity than this single class. */
.tool-item--photo {
    transform: translateY(-134px);
}

.tool-item.is-open {
    /* Active: ~105px visible */
    transform: translateY(-35px);
}

.tool-item.is-open:hover,
.tool-item.is-open:focus-visible {
    transform: translateY(8px);
}

/* Photo nav item test (ruler), open state (not hovering): pulled back in from
   the full pen-style "Active" proportion — 250 - 150 = 100px. Needs the extra
   .tool-item class repeated to out-specificity .is-open. */
.tool-item.is-open.tool-item--photo {
    transform: translateY(-100px);
}

/* Photo nav item test (ruler), hover — whether the folder is open or closed.
   Reuses the amount that used to be the open-state reveal (~187px), since the
   pens' full-length hover reveal (translateY(8px)) went too far on a 250px
   shaft. Needs :hover/:focus-visible repeated on both class combos to
   out-specificity the base .tool-item(.is-open):hover rules above. */
.tool-item--photo:hover,
.tool-item--photo:focus-visible,
.tool-item.is-open.tool-item--photo:hover,
.tool-item.is-open.tool-item--photo:focus-visible {
    transform: translateY(-63px);
}

.tool-shaft {
    display: block;
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.5));
    transition: filter 0.2s;
}

.tool-item:hover .tool-shaft,
.tool-item.is-open .tool-shaft {
    filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.6));
}

.tool-label {
    margin-top: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
    white-space: nowrap;
    opacity: 0;
    transform: translateY(-4px);
    transition:
        opacity 0.2s ease,
        transform 0.2s ease;
}

.tool-item:hover .tool-label {
    opacity: 1;
    transform: translateY(0);
}

/* ── FIRST-TIME HINTS ── */
/* "click here" / "drag me" doodles. JS toggles .hint-hidden permanently once
   the matching action happens once (see dismissHint() in board.js). */
.board-hint {
    font-family: "ShantellSans", sans-serif;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.board-hint.hint-hidden {
    opacity: 0;
}

.board-hint .hint-arrow {
    display: block;
}

.board-hint .hint-text {
    display: block;
    white-space: nowrap;
}

.board-hint--click {
    position: fixed;
    top: 60px;
    left: calc(50% - 260px);
    z-index: 502;
    transform: rotate(-4deg);
}

.board-hint--click .hint-text {
    margin-top: 2px;
    position: relative;
    left: -10px;
}

.board-hint--drag {
    position: absolute;
    z-index: 3;
    transform: rotate(3deg);
}

.board-hint--drag .hint-text {
    position: relative;
    left: 10px;
}

.board-hint--drag .hint-arrow {
    margin-top: -6px;
}

/* Persistent (non-dismissing) pan instructions, bottom-right corner. */
.pan-note {
    position: fixed;
    bottom: 40px;
    right: 56px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 502;
}

.pan-note-arrows {
    display: grid;
    grid-template-columns: repeat(3, 32px);
    grid-template-rows: repeat(2, 32px);
    gap: 4px;
    flex-shrink: 0;
}

.pan-note-key {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 5px;
}

.pan-note-arrow {
    display: block;
    width: 24px;
    height: 24px;
}

.pan-note-key--up {
    grid-column: 2;
    grid-row: 1;
}

.pan-note-key--left {
    grid-column: 1;
    grid-row: 2;
}

.pan-note-key--down {
    grid-column: 2;
    grid-row: 2;
}

.pan-note-key--right {
    grid-column: 3;
    grid-row: 2;
}

/* ── VIEWPORT ── */
.viewport {
    position: fixed;
    inset: 0;
    overflow: hidden;
    cursor: default;
    user-select: none;
}

/* ── BOARD ── */
.board {
    position: absolute;
    width: 4000px;
    height: 3000px;
    background-color: #216359;
    background-image:
        linear-gradient(to right, #0ac4a8 1px, transparent 1px),
        linear-gradient(to bottom, #0ac4a8 1px, transparent 1px),
        linear-gradient(
            to right,
            rgba(10, 196, 168, 0.25) 1px,
            transparent 1px
        ),
        linear-gradient(
            to bottom,
            rgba(10, 196, 168, 0.25) 1px,
            transparent 1px
        );
    background-size:
        100px 100px,
        100px 100px,
        10px 10px,
        10px 10px;
}

/* ── CARDS ── */
.card {
    position: absolute;
    cursor: grab;
    touch-action: none;
    will-change: transform;
    transition: box-shadow 0.15s ease;
}

.card.lifting {
    cursor: grabbing;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4) !important;
    z-index: 1000;
    transition: box-shadow 0.15s ease;
}

.card-sticker {
    z-index: 50;
}

.card-sticker.lifting {
    box-shadow: none !important;
}

/* White die-cut outline for sticker images that have no built-in stroke.
   Stacked 0-blur white drop-shadows trace the shape; the last shadow is the
   usual soft drop shadow. */
.sticker-outline {
    filter: drop-shadow(2px 0 0 #fff) drop-shadow(-2px 0 0 #fff)
        drop-shadow(0 2px 0 #fff) drop-shadow(0 -2px 0 #fff)
        drop-shadow(1.5px 1.5px 0 #fff) drop-shadow(-1.5px 1.5px 0 #fff)
        drop-shadow(1.5px -1.5px 0 #fff) drop-shadow(-1.5px -1.5px 0 #fff)
        drop-shadow(2px 4px 10px rgba(0, 0, 0, 0.22));
}

/* Case study card */
.card-case {
    width: 350px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 2px 4px 16px rgba(0, 0, 0, 0.18);
    overflow: hidden;
    font-family: sans-serif;
    transition:
        box-shadow 0.2s ease,
        rotate 0.2s ease;
}

.card-case:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
    cursor: pointer;
    rotate: 2deg;
}

.card-case .card-thumb {
    width: 100%;
    height: 197px;
    background: #e8e8e8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    overflow: hidden;
}

/* Image covers show in full at the card's width — the thumb grows to the
   image's natural height instead of cropping it into the fixed box. */
.card-case .card-thumb:has(img) {
    height: auto;
}

.card-case .card-thumb img {
    width: 100%;
    height: auto;
    display: block;
}

.card-case .card-body {
    padding: 15px 18px 18px;
}

.card-case .card-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 4px;
}

.card-case .card-title {
    font-size: 18px;
    font-weight: 700;
    color: #111;
    line-height: 1.3;
    margin-bottom: 2px;
}

.card-case .card-company {
    font-size: 12px;
    color: #888;
    margin-bottom: 8px;
}

.card-case .card-desc {
    font-size: 13px;
    color: #555;
    line-height: 1.5;
}

.card-case .card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.card-case .card-badge {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #666;
    background: #f0f0f0;
    border-radius: 100px;
    padding: 4px 10px;
}

/* ── Button ── reusable CTA. Tactile "sticker" feel: a hard (un-blurred) offset
   shadow that lifts on hover and presses down on click. Use on <a> or <button>. */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 13px 24px;
    background: #0b00e4;
    color: #fff;
    font-family: "ShantellSans", sans-serif;
    font-weight: 700;
    font-size: 16px;
    line-height: 1;
    border: none;
    border-radius: 12px;
    box-shadow: 3px 4px 0 rgba(0, 0, 0, 0.22);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition:
        transform 0.12s ease,
        box-shadow 0.12s ease,
        background 0.15s ease;
}

.btn:hover {
    background: #4e45ff;
    transform: translate(-1px, -2px);
    box-shadow: 5px 7px 0 rgba(0, 0, 0, 0.24);
}

.btn:active {
    transform: translate(1px, 2px);
    box-shadow: 1px 2px 0 rgba(0, 0, 0, 0.22);
}

/* Photo card */
.card-photo {
    background: #fff;
    padding: 10px 10px 36px;
    box-shadow: 2px 4px 16px rgba(0, 0, 0, 0.18);
    font-family: sans-serif;
}

.card-photo .card-img {
    width: 220px;
    height: 220px;
    background: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.card-photo .card-caption {
    margin-top: 8px;
    font-size: 11px;
    color: #555;
    text-align: center;
}

/* Merch card (polaroid with thick caption) */
.card-merch {
    background: #fff;
    padding: 10px 10px 0;
    box-shadow: 2px 4px 16px rgba(0, 0, 0, 0.18);
    width: 220px;
}

.card-merch img {
    width: 100%;
    display: block;
}

.card-merch .merch-caption {
    padding: 14px 8px 18px;
    font-size: 11px;
    font-family: "ShantellSans", sans-serif;
    font-weight: 700;
    text-align: center;
    color: #333;
    line-height: 1.4;
}

/* Sticky note card */
.card-sticky {
    width: 220px;
    height: 220px;
    padding: 20px 18px 18px;
    font-family: "ShantellSans", sans-serif;
    box-shadow: 2px 4px 16px rgba(0, 0, 0, 0.15);
    border-radius: 2px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.card-sticky .sticky-heading {
    font-size: 13px;
    font-weight: 700;
    color: rgba(0, 0, 0, 0.7);
    line-height: 1.3;
}

.card-sticky .sticky-body {
    font-size: 12px;
    color: rgba(0, 0, 0, 0.65);
    line-height: 1.6;
}

/* Talk stack card. The outer .card-stack is just a positioning shell; the white
   card the user sees is .stack-face, and the two fanned cards are ::before/
   ::after behind it. */
.card-stack {
    width: 470px;
    font-family: sans-serif;
    cursor: pointer;
    transition: rotate 0.2s ease;
}

/* Needs to be absolute on the board (from .card) but also a positioned ancestor
   for ::before/::after — .card.card-stack wins over either rule alone */
.card.card-stack {
    position: absolute;
}

/* The actual white card the image + text sit on. It's its own element above the
   backing cards, so the content always has a solid white surface at exactly its
   own angle — never the angle of a fanned card behind it. */
.stack-face {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 6px;
    padding: 24px 24px 28px;
    box-shadow: 2px 4px 16px rgba(0, 0, 0, 0.18);
    transition: box-shadow 0.2s ease;
}

.card-stack::before,
.card-stack::after {
    content: "";
    position: absolute;
    inset: 0;
    background: #fff;
    border-radius: 6px;
    box-shadow: 2px 4px 12px rgba(0, 0, 0, 0.13);
    z-index: 0;
    /* Pivot near the bottom so they fan open like a hand of cards, instead of
     spinning each rectangle about its own centre. */
    transform-origin: 50% 90%;
    transition: transform 0.2s ease;
}

/* Backing cards sit permanently fanned out behind the front card, like a
   stack of papers — different directions so the stack reads as a fan. */
.card-stack::before {
    transform: translate(6px, 5px) rotate(3deg);
}

.card-stack::after {
    transform: translate(-6px, 7px) rotate(-3.5deg);
}

.card-stack:hover {
    cursor: pointer;
    rotate: 2deg;
}

.card-stack:hover .stack-face {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
}

/* On hover the fan opens a little wider. The front card (image + text) keeps
   the rotation above; these just splay a touch further from the same fan. */
.card-stack:hover::before {
    transform: translate(9px, 4px) rotate(5deg);
}

.card-stack:hover::after {
    transform: translate(-9px, 6px) rotate(-5.5deg);
}

.stack-cover {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #e8e8e8;
    border-radius: 3px;
    margin-bottom: 16px;
    overflow: hidden;
}

.stack-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.card-stack .stack-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 8px;
}

.card-stack .stack-title {
    font-size: 16px;
    font-weight: 700;
    color: #111;
    line-height: 1.3;
    margin-bottom: 6px;
}

.card-stack .stack-venue {
    font-size: 12px;
    color: #888;
}

/* Stack modal slideshow */
.slideshow {
    position: relative;
    background: #111;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.slideshow-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: none;
}

.slideshow-img.active {
    display: block;
}

.slideshow-placeholder {
    color: #555;
    font-size: 13px;
}

.slideshow-nav {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    pointer-events: none;
}

.slideshow-btn {
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.slideshow-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}
.slideshow-btn:disabled {
    opacity: 0.2;
    pointer-events: none;
}

/* Light-background slides (e.g. the Notion talk): white arrows vanish, so use
   translucent black instead. */
.slideshow--light .slideshow-btn {
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
}
.slideshow--light .slideshow-btn:hover {
    background: rgba(0, 0, 0, 0.5);
}
.slideshow--light .slideshow-counter {
    color: rgba(0, 0, 0, 0.55);
}

.slideshow-counter {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 11px;
    font-family: sans-serif;
}

.stack-photos-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.stack-video {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #111;
    display: block;
    border: none;
}

/* ── FOLDER CARD STATE ── */
.card[data-folder] {
    opacity: 0;
    pointer-events: none;
}

.card[data-folder].is-animating {
    transition:
        transform 0.5s cubic-bezier(0.34, 1.4, 0.64, 1),
        opacity 0.35s ease;
}

.card[data-folder].is-visible {
    opacity: 1;
    pointer-events: auto;
}

/* ── MODAL ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: background 0.25s ease;
    padding: 24px;
}

.modal-overlay--visible {
    background: rgba(0, 0, 0, 0.55);
}

.modal-panel {
    position: relative;
    background: #f4f4f4;
    border-radius: 6px;
    width: 100%;
    max-width: 640px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.35);
    transform: translateY(16px) scale(0.97);
    opacity: 0;
    transition:
        transform 0.3s cubic-bezier(0.25, 1.1, 0.5, 1),
        opacity 0.25s ease;
}

/* Case study modals are wider and taller than the talk slideshow modals. */
.modal-panel--case {
    max-width: 900px;
    min-height: 780px;
}

/* Tile-style heading: case study title big, company grey + smaller below. */
.modal-panel--case .modal-title {
    margin-bottom: 4px;
}

.modal-company {
    font-family: sans-serif;
    font-size: 14px;
    color: #888;
    margin-bottom: 18px;
}

/* Coloured callout box under the title/company, above the body copy. */
.modal-callout {
    background: #fef9e7;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 24px;
    font-size: 15px;
    color: #333;
    line-height: 1.6;
}

/* Any <img> in a case study body bleeds to the full modal width, ignoring the
   body's 28px side padding. The text paragraphs stay in the padded column. */
.modal-panel--case .modal-body img {
    display: block;
    width: calc(100% + 56px);
    max-width: none;
    margin: 24px -28px;
}

/* Opt an image out of the full-width bleed — constrain it (set the width inline
   on the figure) and centre it, rather than stretching to the edges.
   <figure class="natural" style="width:600px"><img><figcaption>…</figcaption></figure> */
.modal-panel--case .modal-body figure.natural {
    width: fit-content;
    max-width: 100%;
    margin: 24px auto;
}

.modal-panel--case .modal-body figure.natural img {
    width: auto;
    max-width: 100%;
    margin: 0;
}

/* Captioned image: <figure><img><figcaption>…</figcaption></figure>.
   The figure carries the full-width bleed; the caption is small + centred. */
.modal-panel--case .modal-body figure {
    width: calc(100% + 56px);
    margin: 24px -28px;
}

.modal-panel--case .modal-body figure img,
.modal-panel--case .modal-body figure svg {
    width: 100%;
    height: auto;
    display: block;
    margin: 0;
}

.modal-panel--case .modal-body figcaption {
    margin-top: 8px;
    padding: 0 28px;
    text-align: center;
    font-size: 12px;
    color: #999;
}

/* Fixed-height "scroll window" for tall reference screenshots (old versions,
   competitor examples, etc.) — the full image is scrollable inside a short
   frame instead of pushing the page down to its full height. A label badge
   stays pinned in the corner regardless of scroll position, so it's never
   mistaken for a full-bleed hero image of the author's own work. Sits within
   the padded text column rather than bleeding to the modal edges.
   <figure class="screenshot-frame">
     <div class="screenshot-frame-inner" style="height:380px">
       <span class="screenshot-label">Old version — not my design</span>
       <div class="screenshot-scroll"><img src="…" alt="" /></div>
     </div>
     <figcaption>…</figcaption>
   </figure> */
.modal-panel--case .modal-body figure.screenshot-frame {
    width: 100%;
    margin: 24px 0;
}

.modal-panel--case .modal-body .screenshot-frame-inner {
    position: relative;
    height: 380px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.modal-panel--case .modal-body .screenshot-scroll {
    position: absolute;
    inset: 0;
    overflow-y: scroll;
}

.modal-panel--case .modal-body .screenshot-scroll img {
    width: 100%;
    height: auto;
    display: block;
    margin: 0;
}

.modal-panel--case .modal-body .screenshot-label {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    background: rgba(20, 20, 20, 0.75);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 100px;
    pointer-events: none;
}

/* Section headings inside a case study body. h2 = section, h3 = sub-section.
   The generous top margins separate sections from the content above them. */
.modal-panel--case .modal-body h2 {
    font-size: 20px;
    font-weight: 700;
    color: #111;
    line-height: 1.3;
    margin: 36px 0 10px;
}

.modal-panel--case .modal-body h3 {
    font-size: 16px;
    font-weight: 700;
    color: #111;
    line-height: 1.3;
    margin: 28px 0 8px;
}

.modal-panel--case .modal-body hr {
    border: none;
    border-top: 1px solid #e6e6e6;
    margin: 36px 0;
}

/* Lists match the body paragraph styling, with room for the bullets/numbers. */
.modal-panel--case .modal-body ul,
.modal-panel--case .modal-body ol {
    font-size: 15px;
    color: #333;
    line-height: 1.7;
    margin: 0 0 14px;
    padding-left: 22px;
}

.modal-panel--case .modal-body li {
    margin-bottom: 6px;
}

/* Two-column layout: wrap content in <div class="cols">…</div>. Each direct
   child becomes a column (wrap a column's contents in a <div> if it needs more
   than one element). Images/figures inside don't bleed — they fill their column. */
.modal-panel--case .modal-body .cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
    margin-bottom: 14px;
}

/* A column whose contents are wrapped in a <div> can hold multiple stacked
   items (text and/or images). Paragraphs keep their normal spacing; figures get
   spacing back (the .cols reset zeroes their margins), except the last one. */
.modal-panel--case .modal-body .cols > div > figure {
    margin: 16px 0;
}

.modal-panel--case .modal-body .cols > div > figure:first-child {
    margin-top: 0;
}

.modal-panel--case .modal-body .cols > div > figure:last-child {
    margin-bottom: 0;
}

.modal-panel--case .modal-body .cols img,
.modal-panel--case .modal-body .cols figure {
    width: 100%;
    margin: 0;
}

.modal-panel--case .modal-body .cols figcaption {
    padding: 0;
}

.modal-panel--case .modal-body .cols > :last-child,
.modal-panel--case .modal-body .cols p:last-child {
    margin-bottom: 0;
}

/* Two-column image grid: <div class="grid-2"><img>…</div>. Images fit their
   cell rather than bleeding to the full modal width. */
.modal-panel--case .modal-body .grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin: 24px 0;
}

.modal-panel--case .modal-body .grid-2 img {
    width: 100%;
    margin: 0;
}

.modal-panel--case .modal-body .grid-2 p {
    margin: 10px 0 2px;
}

/* Three-column grid — for images, or text cells (e.g. a label + caption per
   cell wrapped in a <div>). Six cells wrap to two rows. */
.modal-panel--case .modal-body .grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px 24px;
    margin: 8px 0 14px;
}

.modal-panel--case .modal-body .grid-3 img,
.modal-panel--case .modal-body .grid-3 figure {
    width: 100%;
    margin: 0;
}

.modal-panel--case .modal-body .grid-3 figcaption {
    padding: 0;
}

.modal-panel--case .modal-body .grid-3 p {
    margin: 0 0 2px;
}

/* Muted secondary line (dates, meta) — same grey as our other secondary text. */
.modal-panel--case .modal-body .meta {
    color: #888;
    font-size: 13px;
}

/* Big-number stat cards: <div class="stat-cards"><div class="stat-card">
   <div class="stat-number">…</div><div class="stat-body">…</div></div>…</div>
   Two side-by-side callouts for a headline metric + supporting context. */
.modal-panel--case .modal-body .stat-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin: 24px 0;
}

.modal-panel--case .modal-body .stat-card {
    background: #bfe1c8;
    border-radius: 8px;
    padding: 24px;
}

.modal-panel--case .modal-body .stat-number {
    font-size: 40px;
    font-weight: 800;
    color: #367354;
    line-height: 1.1;
    margin-bottom: 8px;
}

.modal-panel--case .modal-body .stat-body {
    font-size: 14px;
    color: #555;
    line-height: 1.5;
}

.modal-overlay--visible .modal-panel {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* Zero-height sticky wrapper: keeps the close button pinned to the top of
   the scrollable modal panel without adding any space to the layout. */
.modal-close-sticky {
    position: sticky;
    top: 0;
    height: 0;
    z-index: 2;
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(0, 0, 0, 0.08);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #444;
    z-index: 1;
    transition: background 0.15s;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.15);
}

.modal-hero {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* When the hero is a cover image, let it be as tall as it naturally is at full
   width — image on top, text below, no cropping. */
.modal-hero--cover {
    height: auto;
    display: block;
    overflow: visible;
}

.modal-hero--cover img {
    width: 100%;
    height: auto;
    display: block;
}

.modal-emoji {
    font-size: 4rem;
}

.modal-body {
    padding: 24px 28px 32px;
    font-family: sans-serif;
}

.modal-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 6px;
}

.modal-title {
    font-size: 26px;
    font-weight: 700;
    color: #111;
    margin-bottom: 16px;
    line-height: 1.2;
}

.modal-body p {
    font-size: 15px;
    color: #333;
    line-height: 1.7;
    margin-bottom: 14px;
}

.modal-panel--case .modal-body {
    --link-color: #0b00e4;
}

.modal-panel--case .modal-body a,
.modal-panel--case .modal-body a:visited {
    color: var(--link-color);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: color-mix(
        in srgb,
        var(--link-color) 35%,
        transparent
    );
    text-underline-offset: 2px;
    transition:
        color 0.15s ease,
        text-decoration-color 0.15s ease;
}

.modal-panel--case .modal-body a:hover {
    filter: brightness(1.3);
    text-decoration-color: currentColor;
}

.modal-placeholder-imgs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 20px;
}

.modal-img-block {
    height: 140px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #666;
}

/* ── MOBILE VIEW ── */
.mobile-view {
    display: none;
}

.mobile-tabs {
    position: sticky;
    top: 0;
    z-index: 20;
    background: #0a7d6c;
}

.mobile-tabs-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    color: #fff;
    font-family: sans-serif;
    font-size: 15px;
    font-weight: 600;
    padding: 14px 16px;
}

.mobile-tabs-trigger-icon {
    flex-shrink: 0;
}

.mobile-tabs-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 12px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition:
        max-height 0.3s ease,
        opacity 0.25s ease,
        transform 0.25s ease,
        padding 0.3s ease;
}

.mobile-tabs-menu.is-open {
    max-height: 360px;
    opacity: 1;
    transform: translateY(0);
    padding: 0 12px 12px;
}

.mobile-tab {
    width: 100%;
    text-align: left;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-family: sans-serif;
    font-size: 14px;
    font-weight: 600;
    padding: 12px 14px;
    border-radius: 10px;
}

.mobile-tab.is-active {
    background: #fff;
    border-color: #fff;
    color: #0b2e2a;
}

.mobile-section {
    display: none;
    padding: 20px 16px 48px;
}

.mobile-section.is-active {
    display: block;
}

/* Case-study card */
.m-card-case {
    display: block;
    width: 100%;
    background: #fff;
    color: #111;
    border: none;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    margin-bottom: 20px;
    text-align: left;
    font: inherit;
    padding: 0;
    -webkit-appearance: none;
    appearance: none;
}

.m-card-case .card-thumb {
    width: 100%;
    background: #e8e8e8;
}

.m-card-case .card-thumb img {
    width: 100%;
    height: auto;
    display: block;
}

.m-card-case .card-body {
    padding: 14px 16px 16px;
}

.m-card-case .card-title {
    font-size: 17px;
    font-weight: 700;
    color: #111;
    line-height: 1.3;
    margin-bottom: 2px;
}

.m-card-case .card-company {
    font-size: 12px;
    color: #888;
    margin-bottom: 8px;
}

.m-card-case .card-desc {
    font-size: 13px;
    color: #555;
    line-height: 1.5;
}

.m-card-case .card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.m-card-case .card-badge {
    font-size: 10px;
    font-weight: 700;
    color: #666;
    background: #f0f0f0;
    border-radius: 100px;
    padding: 4px 10px;
}

/* Talk/stack card */
.m-card-stack {
    display: block;
    width: 100%;
    background: #fff;
    color: #111;
    border: none;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    margin-bottom: 20px;
    text-align: left;
    font: inherit;
    padding: 0;
    -webkit-appearance: none;
    appearance: none;
}

.m-card-stack .stack-cover {
    width: 100%;
    height: 220px;
    background: #e8e8e8;
    background-size: cover;
    background-position: center;
}

.m-card-stack .stack-body {
    padding: 14px 16px 16px;
}

.m-card-stack .stack-title {
    font-size: 16px;
    font-weight: 700;
}

.m-card-stack .stack-venue {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}

/* Sticky note */
.m-sticky {
    border-radius: 4px;
    padding: 16px 18px;
    margin-bottom: 20px;
    font-family: "ShantellSans", sans-serif;
    color: rgba(0, 0, 0, 0.8);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

.m-sticky .sticky-heading {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 6px;
}

.m-sticky .sticky-body {
    font-size: 13px;
    line-height: 1.6;
}

/* Merch / sketchbook photo — the "polaroid" look: white frame, caption
   written in the margin below, matching the desktop .card-merch style. */
.m-merch {
    background: #fff;
    padding: 10px 10px 0;
    border-radius: 4px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    margin-bottom: 20px;
}

.m-merch img {
    width: 100%;
    height: auto;
    display: block;
}

.m-merch .merch-caption {
    padding: 14px 8px 18px;
    font-size: 12px;
    font-family: "ShantellSans", sans-serif;
    font-weight: 700;
    text-align: center;
    color: #333;
    line-height: 1.4;
}

/* Event posters — plain photo with a soft shadow, no frame (matches desktop). */
.m-poster {
    margin-bottom: 20px;
}

.m-poster img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 6px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

.m-btn-wrap {
    margin-bottom: 20px;
    text-align: center;
}

.m-embed {
    margin-bottom: 20px;
}

.m-embed iframe {
    width: 100%;
    display: block;
}

.mobile-main {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.mobile-main h1 {
    font-size: 1.5rem;
    line-height: 1.4;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .viewport {
        display: none;
    }
    .tool-roll-strip,
    .tool-items-row,
    .board-hint--click,
    .pan-note {
        display: none;
    }
    .mobile-view {
        display: block;
        overflow-y: auto;
        height: 100%;
        color: #fff;
        background-color: #216359;
        background-image:
            linear-gradient(to right, #0ac4a8 1px, transparent 1px),
            linear-gradient(to bottom, #0ac4a8 1px, transparent 1px),
            linear-gradient(
                to right,
                rgba(10, 196, 168, 0.25) 1px,
                transparent 1px
            ),
            linear-gradient(
                to bottom,
                rgba(10, 196, 168, 0.25) 1px,
                transparent 1px
            );
        background-size:
            100px 100px,
            100px 100px,
            10px 10px,
            10px 10px;
    }
    .mobile-main a {
        color: #0ac4a8;
    }
    .mobile-main a.btn {
        background: #fff;
        color: #0a7d6c;
    }

    /* Modals need to behave differently on narrow screens: multi-column
       layouts collapse to one column, and the desktop-sized minimum height
       (meant to make short case studies look substantial on a big screen)
       just wastes scroll space on a phone. */
    .modal-overlay {
        padding: 0;
    }
    .modal-panel--case {
        min-height: 0;
        max-height: 100%;
        border-radius: 0;
    }
    .modal-panel {
        max-height: 100%;
        border-radius: 0;
    }
    /* Presentation modals (talks/stacks) are shorter than case studies, so
       going full-bleed edge-to-edge looks odd. Bring them in a bit instead. */
    .modal-panel:not(.modal-panel--case):not(.password-gate) {
        width: calc(100% - 32px);
    }
    .modal-title {
        font-size: 21px;
    }
    .modal-panel--case .modal-body .cols,
    .modal-panel--case .modal-body .grid-2,
    .modal-panel--case .modal-body .grid-3,
    .modal-panel--case .modal-body .stat-cards {
        grid-template-columns: 1fr;
    }
}
