/* The FloPro shelf. Tokens are the 2D studio system's (portfolio-website/src/os/site/studio.css). */
:root {
    --bg: #0b0b0b;
    --bg-2: #111111;
    --bg-3: #191919;
    --text: #f0eee9;
    --text-2: #a7a49f;
    --text-3: #8a8782;
    --accent: #ff5b23;
    --border: #ffffff15;
    --border-2: #ffffff28;
    --gutter: clamp(20px, 4.5vw, 72px);
    --sans: 'Inter', system-ui, sans-serif;
    --serif: 'Instrument Serif', Georgia, serif;
    --mono: 'IBM Plex Mono', ui-monospace, monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    -webkit-font-smoothing: antialiased;
    overflow-x: clip;
}
body.reading { overflow: hidden; }
a { color: inherit; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--accent); }

.top, .foot { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 var(--gutter); }
.top { min-height: 76px; }
.wordmark { font-size: 30px; font-weight: 700; letter-spacing: -1.8px; }
.wordmark::after { content: ''; display: inline-block; width: 8px; height: 8px; margin-left: 4px; border-radius: 50%; background: var(--accent); }
.top__link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 4px;
    background: var(--accent);
    color: #100d0b;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}
.top__link:hover { background: #ff7949; }
.foot {
    min-height: 52px;
    border-top: 1px solid var(--border);
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--text-3);
}
.foot a { text-decoration: none; }
.foot a:hover { color: var(--text); }

/* Wide screens: the pitch on the left, the shelf on the right. */
main {
    --room: 250px; /* viewport height not available to the books */
    flex: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 800px);
    align-items: center;
    gap: clamp(32px, 4vw, 72px);
    padding: 20px var(--gutter) 44px;
}
.shelf { max-width: 800px; }
.eyebrow {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-3);
}
.eyebrow i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px #ff5b2360; }
.intro h1 { margin-top: 18px; font-size: clamp(38px, 4.9vw, 84px); line-height: 1; font-weight: 600; letter-spacing: -0.045em; }
.intro h1 em { font-size: 1.08em; letter-spacing: -0.02em; }
.intro p { margin-top: 24px; max-width: 460px; font-size: 18px; line-height: 1.5; color: var(--text-2); }

/* shelf */
.row { display: flex; align-items: flex-end; gap: 5px; padding: 0 24px; }
/* Book height follows the viewport so the whole shelf sits above the fold. */
.slot { position: relative; width: var(--s); height: clamp(250px, calc((100vh - var(--room)) * var(--f)), 580px); flex: none; }
.book {
    position: absolute;
    inset: 0;
    display: block;
    border: 0;
    background: none;
    color: var(--ink);
    font: inherit;
    cursor: pointer;
    transform-style: preserve-3d;
    transform-origin: 100% 50%;
    transform: perspective(2000px) translateZ(0) rotateY(0deg);
    transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
    -webkit-tap-highlight-color: transparent;
}
.book--accent { --cloth: #ff5b23; --ink: #100d0b; --hi: #100d0b; }
.book--dark { --cloth: #171717; --ink: #f0eee9; --hi: #ff5b23; }
.book--light { --cloth: #f0eee9; --ink: #0b0b0b; --hi: #ff5b23; }
.book--stone { --cloth: #b9b4aa; --ink: #0b0b0b; --hi: #0b0b0b; }
.spine {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 18px 0;
    border-radius: 3px 1px 1px 3px;
    background: linear-gradient(90deg, #00000038, #ffffff14 14%, transparent 30%, transparent 78%, #00000040), var(--cloth);
    box-shadow: inset 0 0 0 1px #ffffff14;
    backface-visibility: hidden;
}
.spine__idx { font-family: var(--mono); font-size: 11px; letter-spacing: 1.4px; color: var(--hi); }
.spine__title { writing-mode: vertical-rl; font-size: 27px; font-weight: 600; letter-spacing: -0.8px; white-space: nowrap; }
.spine__title em { font-size: 1.12em; letter-spacing: -0.3px; color: var(--hi); }
.spine__mark { writing-mode: vertical-rl; font-family: var(--mono); font-size: 9.5px; letter-spacing: 1.6px; text-transform: uppercase; opacity: 0.65; }
.cover {
    position: absolute;
    top: 0;
    left: 100%;
    height: 100%;
    aspect-ratio: 1 / 1.377;
    transform-origin: 0 50%;
    transform: rotateY(90deg);
    background: var(--cloth);
    backface-visibility: hidden;
}
.cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.slot:hover, .slot:focus-within, .slot.flying { z-index: 5; }
.slot.flying { z-index: 60; }
.slot.lifted .book { transform: perspective(2000px) translateZ(50px) rotateY(-20deg); }
/* In flight the live book's cover stands in for the shelf's picture of it. */
.cover { transition: opacity 0.25s ease; }
.slot.live .cover { opacity: 0; }
.slot.out .book { visibility: hidden; }
.book:focus-visible { outline: none; }
.book:focus-visible .spine { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
@media (hover: hover) {
    .book:hover { transform: perspective(2000px) translateZ(50px) rotateY(-20deg); }
}
.book:focus-visible { transform: perspective(2000px) translateZ(50px) rotateY(-20deg); }

.card {
    align-self: flex-end;
    width: 300px;
    margin: 0 0 0 auto;
    padding: 22px 22px 18px;
    border-radius: 3px;
    background: #f0eee9;
    color: #0b0b0b;
    transform-origin: 50% 100%;
    transform: rotate(-2.5deg);
    box-shadow: 0 18px 40px #00000080;
}
.card__label { font-family: var(--mono); font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: #7b7872; }
.card h2 { margin-top: 12px; font-size: 27px; line-height: 1.02; font-weight: 600; letter-spacing: -1.1px; }
.card h2 em { font-size: 1.1em; }
.card p { margin-top: 10px; font-size: 13px; line-height: 1.45; color: #4a4844; }
.card ul { margin-top: 14px; list-style: none; border-top: 1px solid #0b0b0b22; }
.card li { display: grid; grid-template-columns: 74px 1fr; align-items: center; min-height: 38px; border-bottom: 1px solid #0b0b0b22; font-size: 13px; }
.card li:last-child { border-bottom: 0; }
.card li span { font-family: var(--mono); font-size: 9.5px; letter-spacing: 1.3px; text-transform: uppercase; color: #7b7872; }
.card li a, .card li b { font-weight: 500; letter-spacing: -0.2px; text-decoration: none; }
.card li a { display: flex; align-items: center; min-height: 38px; }
.card li a:hover { color: var(--accent); }

.board {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 9px 28px 10px;
    border-top: 1px solid var(--border-2);
    border-radius: 2px;
    background: linear-gradient(#262626, #151515);
    box-shadow: 0 26px 50px -8px #000000d0;
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: var(--text-3);
}

/* reader */
/* Kept rendered while closed so a hovered book can load before it is pulled. The iframe is
   see-through until its book lands, so during the flight only the live cover shows. */
.reader { position: fixed; inset: 0; z-index: 50; visibility: hidden; pointer-events: none; transition: visibility 0s 0.7s; }
.reader.open, .reader.showing { visibility: visible; transition: none; }
.reader.open { pointer-events: auto; }
.reader::before { content: ''; position: absolute; inset: 0; background: var(--bg); opacity: 0; transition: opacity 0.7s ease; }
.reader.open::before { opacity: 1; }
.reader iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: transparent; opacity: 0; transition: opacity 0.25s ease; }
.reader.showing iframe { opacity: 1; }
.reader__close {
    position: absolute;
    top: 8px;
    right: 14px;
    min-height: 34px;
    padding: 0 14px;
    border: 1px solid var(--border-2);
    border-radius: 30px;
    background: #0b0b0bd0;
    color: var(--text);
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.6px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.5s ease;
}
.reader.open .reader__close { opacity: 1; }
.reader__close:hover { border-color: var(--accent); color: var(--accent); }

/* Mid widths: pitch above, shelf below. */
@media (max-width: 1180px) {
    main { --room: 430px; grid-template-columns: minmax(0, 1fr); align-content: space-between; }
    .intro h1 { font-size: clamp(38px, 5.6vw, 60px); }
}

/* Small and portrait screens: the shelf becomes a grid of covers. */
@media (max-width: 860px), (orientation: portrait) {
    main { align-content: start; gap: 36px; }
    .shelf { max-width: none; }
    .row { display: grid; grid-template-columns: 1fr 1fr; align-items: start; gap: 14px; padding: 0; }
    .slot { width: auto; height: auto; aspect-ratio: 1 / 1.377; }
    .book, .book:hover, .book:focus-visible { transform: none; transition: none; }
    .spine { display: none; }
    .cover { position: static; display: block; width: 100%; height: 100%; transform: none; border-radius: 4px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--border-2); }
    .cover::after { content: ''; position: absolute; inset: 0; border-radius: 4px; box-shadow: inset 0 0 0 1px var(--border-2); pointer-events: none; }
    .book:focus-visible .cover { outline: 2px solid var(--accent); outline-offset: 3px; }
    .card { grid-column: 1 / -1; width: auto; margin: 10px 0 0; transform: none; box-shadow: none; }
    .board { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .book, .cover, .reader::before, .reader iframe, .reader__close { transition: none; }
}
