/* RootedNomad | Expeditions room + Expedition Log */

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

html, body { margin: 0; height: 100%; }

body.expeditions-page {
    background: #090504;
    color: #2b1d10;
    font-family: "Cormorant Garamond", Georgia, serif;
    overflow: hidden;
}

body.expeditions-page.log-open { overflow: hidden; }

.exp-home {
    position: fixed;
    top: 14px;
    left: 18px;
    z-index: 20;
    color: #e9d9b8;
    text-decoration: none;
    font-size: 1.05rem;
    letter-spacing: .04em;
    text-shadow: 0 1px 6px rgba(0, 0, 0, .8);
    opacity: .85;
}
.exp-home:hover { opacity: 1; }

/* ---------- the room ---------- */

.exp-stage-wrap {
    height: 100vh;
    height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.exp-stage {
    position: relative;
    width: min(100vw, calc(100vh * 16 / 9));
    width: min(100vw, calc(100dvh * 16 / 9));
    aspect-ratio: 16 / 9;
    container-type: inline-size;
    overflow: hidden;
    background: #1a0f08;
}

.exp-room {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}

/* soft light spilling from the window, and a warm pool on the wall */
.exp-window-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 22% 38% at 94% 28%, rgba(190, 215, 200, .20), transparent 70%);
    mix-blend-mode: screen;
    pointer-events: none;
    animation: windowBreath 9s ease-in-out infinite;
}
.exp-lamp-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 34% 40% at 50% 38%, rgba(255, 190, 110, .14), transparent 70%);
    mix-blend-mode: screen;
    pointer-events: none;
}
@keyframes windowBreath {
    0%, 100% { opacity: .75; }
    50% { opacity: 1; }
}

/* ---------- the map on the back wall ---------- */

.exp-map-frame {
    position: absolute;
    margin: 0;
    left: 28.5%;
    top: 8%;
    width: 43%;
    padding: 1.1cqw;
    background: linear-gradient(145deg, #5a3a1c, #2e1b0c 55%, #4b2f16);
    border-radius: .35cqw;
    box-shadow:
        0 1.2cqw 2.6cqw rgba(0, 0, 0, .65),
        0 .2cqw .5cqw rgba(0, 0, 0, .6),
        inset 0 0 0 .12cqw rgba(255, 205, 140, .22),
        inset 0 0 1cqw rgba(0, 0, 0, .55);
}

.exp-map {
    position: relative;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    box-shadow: inset 0 0 1.6cqw rgba(30, 15, 0, .7);
}
.exp-map img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    filter: sepia(.12) contrast(1.02) brightness(.97);
}
.exp-map::after { /* aged vignette over the paper */
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 45%, transparent 55%, rgba(50, 25, 0, .32) 100%);
    pointer-events: none;
}

.exp-plaque {
    position: absolute;
    left: 50%;
    bottom: -2.6cqw;
    transform: translateX(-50%);
    padding: .25cqw 1.6cqw;
    font-size: 1.15cqw;
    letter-spacing: .32em;
    text-transform: uppercase;
    color: #3a2508;
    background: linear-gradient(180deg, #d9b972, #a47f3a);
    border-radius: .25cqw;
    box-shadow: 0 .3cqw .6cqw rgba(0, 0, 0, .6), inset 0 0 0 .08cqw rgba(255, 240, 200, .5);
    font-weight: 600;
    white-space: nowrap;
}

/* ---------- pins ---------- */

.pin {
    position: absolute;
    z-index: 3;
    width: 1.1cqw;
    height: 1.5cqw;
    min-width: 16px;
    min-height: 22px;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    transform: translate(-50%, -100%);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.pin-head {
    position: absolute;
    left: 50%;
    top: 4%;
    width: 62%;
    aspect-ratio: 1;
    transform: translateX(-50%);
    border-radius: 50%;
    background: radial-gradient(circle at 32% 28%, #ff9a8c 0, #e0281c 38%, #8c0e08 100%);
    box-shadow: 0 .35cqw .6cqw rgba(0, 0, 0, .55), inset 0 -.2cqw .3cqw rgba(60, 0, 0, .5);
    transition: transform .18s ease;
}
.pin-stem {
    position: absolute;
    left: 50%;
    top: 58%;
    width: 8%;
    height: 42%;
    transform: translateX(-50%);
    background: linear-gradient(90deg, #888, #eee, #777);
    clip-path: polygon(0 0, 100% 0, 60% 100%, 40% 100%);
}
.pin::before { /* soft ground shadow where the point lands */
    content: "";
    position: absolute;
    left: 50%;
    bottom: -4%;
    width: 60%;
    height: 10%;
    transform: translateX(-50%);
    background: radial-gradient(ellipse, rgba(0, 0, 0, .5), transparent 70%);
}
.pin::after { /* pulse ring at the point of the pin */
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 140%;
    aspect-ratio: 1;
    transform: translate(-50%, 50%) scale(.2);
    border-radius: 50%;
    border: .16cqw solid rgba(224, 40, 28, .75);
    opacity: 0;
    animation: pinPulse 2.8s ease-out infinite;
    pointer-events: none;
}
.pin + .pin::after { animation-delay: 1.4s; }
@keyframes pinPulse {
    0% { transform: translate(-50%, 50%) scale(.2); opacity: .9; }
    80%, 100% { transform: translate(-50%, 50%) scale(1); opacity: 0; }
}

.pin:hover .pin-head,
.pin:focus-visible .pin-head { transform: translateX(-50%) translateY(-6%) scale(1.14); }
.pin:focus-visible { outline: 2px solid #f4d9a0; outline-offset: 4px; border-radius: 6px; }

.pin-label {
    position: absolute;
    left: 50%;
    bottom: 128%;
    transform: translate(-50%, 6px);
    padding: .3cqw .9cqw;
    font-family: inherit;
    font-size: 1.25cqw;
    line-height: 1.2;
    white-space: nowrap;
    color: #2b1d10;
    background: #f0e0bd;
    border-radius: .25cqw;
    box-shadow: 0 .3cqw .7cqw rgba(0, 0, 0, .55);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
}
.pin-label small { display: block; font-size: .85em; opacity: .7; letter-spacing: .08em; }
.pin:hover .pin-label,
.pin:focus-visible .pin-label { opacity: 1; transform: translate(-50%, 0); }

.exp-hint {
    position: absolute;
    left: 0;
    right: 0;
    top: 2.2cqw;
    margin: 0;
    text-align: center;
    font-size: 1.3cqw;
    letter-spacing: .12em;
    color: rgba(240, 222, 185, .78);
    text-shadow: 0 1px 6px #000;
    pointer-events: none;
}

/* ---------- room decor ---------- */

.deco { position: absolute; margin: 0; padding: 0; border: 0; background: none; display: block; text-decoration: none; }
.deco img { display: block; width: 100%; height: auto; filter: drop-shadow(0 .5cqw .6cqw rgba(0, 0, 0, .6)); user-select: none; -webkit-user-drag: none; }
.exp-hint { z-index: 4; }

.deco-rug { left: 33.5%; top: 82.4%; width: 22%; transform: scaleY(.8); transform-origin: top center; pointer-events: none; opacity: .95; }
.deco-boots { left: 65.2%; top: 87%; width: 7.4%; pointer-events: none; z-index: 2; }

.obj { cursor: pointer; transition: transform .18s ease, filter .18s ease; -webkit-tap-highlight-color: transparent; font: inherit; }
.obj:hover, .obj:focus-visible { transform: translateY(-.35cqw) scale(1.05); filter: brightness(1.12); }
.obj:focus-visible, .obj:focus { outline: none; }
.obj:focus-visible { outline: 2px solid #f4d9a0; outline-offset: 4px; border-radius: 6px; }
.obj-label {
    position: absolute; left: 50%; bottom: 102%;
    transform: translate(-50%, 6px);
    padding: .25cqw .8cqw;
    font-size: 1.15cqw; line-height: 1.2; white-space: nowrap;
    color: #2b1d10; background: #f0e0bd; border-radius: .25cqw;
    box-shadow: 0 .3cqw .7cqw rgba(0, 0, 0, .55);
    opacity: 0; pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
    z-index: 5;
}
.obj:hover .obj-label, .obj:focus-visible .obj-label, .shelf-item:hover .obj-label, .shelf-item:focus-visible .obj-label { opacity: 1; transform: translate(-50%, 0); }

.deco-compass { left: 21.2%; top: 60.6%; width: 3.7%; }
.deco-barrel { left: 77%; top: 68%; width: 7%; }
.deco-duffel { left: 57.5%; top: 80%; width: 12%; }

/* corkboard: the picture is the ChatGPT cutout; links sit over its pinned notes */
.deco-board { left: 16.2%; top: 14%; width: 10.8%; }
.board-title {
    position: absolute; top: -.2cqw; left: 50%; transform: translate(-50%, -100%);
    font-size: .95cqw; letter-spacing: .24em; text-transform: uppercase;
    color: #e9d3a4; text-shadow: 0 1px 3px #000; white-space: nowrap;
}
.board-title:hover { color: #fff; }
/* field-note pictures pinned on the paper slips (not clickable yet) */
.fnote {
    position: absolute; object-fit: cover; object-position: center top;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .55); pointer-events: none;
}
.deco-board .fn1 { left: 13.5%; top: 14.5%; width: 34%; height: 40%; transform: rotate(-2deg); }
.deco-board .fn2 { left: 59.5%; top: 21%; width: 25.5%; height: 26%; transform: rotate(3deg); }
.deco-board .fn3 { left: 41.5%; top: 59%; width: 32%; height: 27%; transform: rotate(-3deg); }
.deco-board .fnote { filter: none; }
.note {
    position: absolute; display: flex; align-items: center; justify-content: center;
    padding: .1cqw; text-align: center; font-size: .58cqw; line-height: 1.05;
    color: #3a2410; text-decoration: none; overflow: hidden;
    transition: background .15s ease;
}
.note:hover { background: rgba(255, 252, 240, .55); }
.n1 { left: 12%; top: 10%; width: 40%; height: 28%; transform: rotate(-4deg); }
.n2 { left: 58%; top: 15%; width: 29%; height: 24%; transform: rotate(5deg); }
.n3 { left: 40%; top: 60%; width: 36%; height: 27%; transform: rotate(-3deg); }

/* shelf: products stand on the plank */
/* shelf box = the plank image's own proportions; items are positioned in % of it so they stay on the plank at any size */
.deco-shelf { left: 72.6%; top: 29.9%; width: 11.8%; aspect-ratio: 480 / 246; height: auto; }
.shelf-img { position: absolute; z-index: 1; left: 0; bottom: 0; width: 100%; height: auto; filter: drop-shadow(0 .5cqw .6cqw rgba(0, 0, 0, .6)); }
.shelf-row { position: absolute; inset: 0; z-index: 2; transform: rotate(3deg); transform-origin: 100% 12%; pointer-events: none; }
.shelf-row > .shelf-item { pointer-events: auto; }
.shelf-item {
    position: absolute; bottom: 88%; z-index: 2; box-sizing: border-box;
    background: #e9dbb8; padding: .15cqw;
    box-shadow: 0 .25cqw .5cqw rgba(0, 0, 0, .55);
    transition: transform .18s ease, filter .18s ease;
}
.shelf-item img { display: block; width: 100%; height: 100%; object-fit: cover; filter: none; }
.shelf-item:hover, .shelf-item:focus-visible { transform: translateY(-.3cqw) scale(1.06); filter: brightness(1.12); }
.shelf-item:focus-visible { outline: 2px solid #f4d9a0; outline-offset: 3px; }
.s1 { left: 4%;  width: 25.4%; aspect-ratio: 3 / 4.1; transform: rotate(-3deg); }
.s2 { left: 37%; width: 30.5%; aspect-ratio: 3.6 / 2.6; }
.s3 { left: 74%; width: 25.4%; aspect-ratio: 3 / 3.6; transform: rotate(2deg); }
.shelf-item.s1:hover { transform: rotate(-3deg) translateY(-.3cqw) scale(1.06); }
.shelf-item.s3:hover { transform: rotate(2deg) translateY(-.3cqw) scale(1.06); }

/* ---------- Expedition Log ---------- */

.log-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(10px, 3vh, 34px) clamp(8px, 4vw, 48px);
    opacity: 0;
    transition: opacity .25s ease;
}
.log-overlay[hidden] { display: none; }
.log-overlay.show { opacity: 1; }

.log-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 4, 2, .55);
    backdrop-filter: blur(1.5px);
}

.log-book {
    position: relative;
    width: min(960px, 100%);
    max-height: 100%;
    display: flex;
    border-radius: 6px;
    background: #ecdcb7 url("/observations/paper-8x12.jpg") center / cover;
    box-shadow:
        0 24px 70px rgba(0, 0, 0, .75),
        0 0 0 1px rgba(60, 35, 10, .5),
        inset 0 0 70px rgba(120, 70, 20, .28);
    transform: translateY(18px) scale(.985);
    transition: transform .28s ease;
}
.log-overlay.show .log-book { transform: none; }

.log-close {
    position: absolute;
    top: 8px;
    right: 12px;
    z-index: 2;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: rgba(70, 40, 12, .1);
    color: #4a2c0e;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
}
.log-close:hover { background: rgba(70, 40, 12, .22); }

.log-scroll {
    width: 100%;
    overflow-y: auto;
    padding: clamp(24px, 5vw, 52px) clamp(20px, 6vw, 68px) clamp(24px, 4vw, 44px);
    overscroll-behavior: contain;
}

.log-head { border-bottom: 1px solid rgba(90, 55, 20, .35); padding-bottom: 14px; margin-bottom: 8px; }
.log-kicker {
    margin: 0 0 4px;
    font-size: .95rem;
    letter-spacing: .28em;
    text-transform: uppercase;
    color: #8a2f1c;
    font-weight: 600;
}
.log-head h1 {
    margin: 0;
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 500;
    line-height: 1.05;
    color: #2b1a0a;
}
.log-meta { margin: 8px 0 0; font-size: 1.1rem; font-style: italic; color: #5a3d1e; }

.log-section { margin-top: 26px; }
.log-section h2 {
    margin: 0 0 10px;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: #6b4520;
}
.log-section p { font-size: 1.22rem; line-height: 1.6; margin: 0 0 12px; color: #2b1d10; }
.log-section .tbd {
    padding: 10px 14px;
    border-left: 3px solid #b44a2f;
    background: rgba(180, 74, 47, .08);
    font-style: italic;
}
.log-section[hidden] { display: none; }

.log-facts {
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    font-size: 1rem;
    color: #5a3d1e;
}
.log-facts li::before { content: "\2022\00a0"; color: #b44a2f; }

.log-captions {
    margin: 14px 0 0;
    font-size: 1.15rem;
    font-style: italic;
    color: #4a2f14;
}
.log-captions span { display: inline-block; margin-right: 18px; }

.log-obs { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.log-obs a {
    display: block;
    padding: 12px 16px;
    text-decoration: none;
    color: #2b1d10;
    background: rgba(255, 248, 228, .55);
    border: 1px solid rgba(90, 55, 20, .3);
    border-radius: 4px;
    transition: background .15s, transform .15s, box-shadow .15s;
}
.log-obs a:hover { background: rgba(255, 250, 235, .9); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(60, 30, 5, .2); }
.log-obs strong { display: block; font-size: 1.3rem; font-weight: 600; }
.log-obs em { font-size: 1rem; color: #6b4a28; }
.log-obs .none { color: #6b4a28; font-style: italic; font-size: 1.1rem; }

.log-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}
.log-gallery button {
    padding: 6px 6px 22px;
    border: 0;
    background: #fbf5e4;
    box-shadow: 0 3px 10px rgba(50, 25, 0, .35);
    cursor: zoom-in;
    transform: rotate(var(--tilt, 0deg));
    transition: transform .18s ease;
    position: relative;
    font: inherit;
}
.log-gallery button:nth-child(3n+1) { --tilt: -1.2deg; }
.log-gallery button:nth-child(3n+2) { --tilt: .9deg; }
.log-gallery button:hover { transform: rotate(0) scale(1.03); }
.log-gallery img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; display: block; background: #d9c8a2; }
.log-gallery span {
    position: absolute;
    left: 8px; right: 8px; bottom: 3px;
    font-size: .82rem;
    color: #5a3d1e;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.log-products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
    gap: 14px;
}
.log-products a {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: #2b1d10;
    background: rgba(255, 248, 228, .6);
    border: 1px solid rgba(90, 55, 20, .3);
    border-radius: 4px;
    overflow: hidden;
    transition: transform .15s, box-shadow .15s;
}
.log-products a:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(60, 30, 5, .28); }
.log-products img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: #d9c8a2; }
.log-products .pi { padding: 9px 11px 12px; }
.log-products .pt { font-size: 1.02rem; line-height: 1.2; font-weight: 600; }
.log-products .pp { margin-top: 4px; font-size: .95rem; color: #8a2f1c; }
.log-products .soon { opacity: .7; }
.log-products .soon .pp { color: #6b4a28; font-style: italic; }

.log-foot { margin: 26px 0 0; text-align: center; font-size: 1.1rem; }
.log-foot a { color: #8a2f1c; }

/* ---------- lightbox ---------- */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(6, 3, 1, .9);
    padding: 24px;
    cursor: zoom-out;
}
.lightbox[hidden] { display: none; }
.lightbox .lb-wrap { position: relative; max-width: 100%; max-height: 100%; display: flex; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 48px); box-shadow: 0 10px 50px #000; }
.lightbox .lb-wrap::after { /* faint repeating watermark over the picture */
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='260' height='170'><text x='20' y='95' transform='rotate(-24 130 85)' font-family='Georgia,serif' font-size='20' letter-spacing='4' fill='white' fill-opacity='.22'>ROOTEDNOMAD</text></svg>");
}
.log-gallery img, .log-products img, .lightbox img, .deco img, .exp-room, .exp-map img { -webkit-touch-callout: none; user-select: none; -webkit-user-drag: none; }
.lightbox-close {
    position: absolute; top: 12px; right: 18px;
    width: 44px; height: 44px;
    border: 0; background: none;
    color: #f0e0bd; font-size: 2.4rem; cursor: pointer;
}

.exp-noscript { position: fixed; inset: 0; z-index: 60; padding: 60px 24px; background: #1a0f08; color: #f0e0bd; font-size: 1.3rem; }

/* ---------- small screens ---------- */

@media (max-width: 720px) {
    /* the room stays 16:9 but the pins/labels need to remain tappable */
    .pin-label { font-size: 12px; padding: 3px 8px; }
    .exp-hint { font-size: 11px; bottom: 6px; }
    .exp-plaque { font-size: 8px; bottom: -14px; }
    .log-overlay { padding: 0; }
    .log-book { max-height: 100%; height: 100%; border-radius: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .pin::after, .exp-window-glow { animation: none; }
    .log-book, .log-overlay { transition: none; }
}

/* Expedition map */
.log-map { margin: 0; }
.log-map button {
    display: block;
    width: 100%;
    padding: 8px;
    border: 0;
    background: #fbf5e4;
    box-shadow: 0 4px 14px rgba(50, 25, 0, .4);
    cursor: zoom-in;
    font: inherit;
}
.log-map img { display: block; width: 100%; height: auto; background: #d9c8a2; }
.log-map figcaption {
    margin-top: 8px;
    font-size: .95rem;
    font-style: italic;
    color: #5a3d1e;
    text-align: center;
}
