/* ============================================================
   tanso.market — y2k-futurism × bento-box × book-scholarly
   Palette: #0B1426 #1A2236 #A8B4C4 #E8E0D0 #D4DCE8 #7A8B6E
            #C45B4A #5B6B82 #0F1A2E
   ============================================================ */

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

:root {
    --navy-deep: #0B1426;
    --navy-mid: #1A2236;
    --navy-darker: #0F1A2E;
    --navy-shadow: #5B6B82;
    --steel: #A8B4C4;
    --chrome-hi: #D4DCE8;
    --vellum: #E8E0D0;
    --bronze: #7A8B6E;
    --signal: #C45B4A;
    --chrome-grad: linear-gradient(135deg, #5B6B82 0%, #A8B4C4 40%, #D4DCE8 55%, #A8B4C4 70%, #5B6B82 100%);
    --spine-grad: repeating-linear-gradient(0deg, #0B1426 0px, #0F1A2E 1px, #0B1426 2px);
}

html, body {
    background: var(--navy-deep);
    color: var(--vellum);
    font-family: "Crimson Pro", Georgia, serif;
    overflow-x: hidden;
}

html {
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
}

/* ============================================================
   Bento Grid
   ============================================================ */

.bento {
    height: 100vh;
    width: 100vw;
    padding: 16px;
    background: var(--spine-grad);
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(6, 1fr);
    gap: 3px;
    background-color: var(--steel);
    position: relative;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    animation: borderDraw 600ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes borderDraw {
    from { clip-path: inset(50% 50% 50% 50%); }
    to { clip-path: inset(0 0 0 0); }
}

.cell {
    background: var(--navy-deep);
    position: relative;
    overflow: hidden;
    padding: 24px;
    transform-style: preserve-3d;
    transition: transform 0.4s ease-out, box-shadow 0.3s ease;
    opacity: 0;
    will-change: transform;
    animation: cellEnter 500ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes cellEnter {
    from {
        opacity: 0;
        transform: perspective(800px) rotateX(4deg) translateY(12px);
    }
    to {
        opacity: 1;
        transform: perspective(800px) rotateX(0deg) translateY(0px);
    }
}

.cell[data-cell="1"] { grid-column: 1 / 6;  grid-row: 1 / 4; animation-delay: 900ms; }
.cell[data-cell="2"] { grid-column: 6 / 9;  grid-row: 1 / 2; animation-delay: 980ms; }
.cell[data-cell="3"] { grid-column: 6 / 9;  grid-row: 2 / 4; animation-delay: 1060ms; background: var(--navy-mid); }
.cell[data-cell="4"] { grid-column: 1 / 9;  grid-row: 4 / 5; animation-delay: 1140ms; padding: 18px 24px; display: flex; gap: 16px; }
.cell[data-cell="5"] { grid-column: 1 / 5;  grid-row: 5 / 7; animation-delay: 1220ms; background: var(--vellum); color: var(--navy-mid); }
.cell[data-cell="6"] { grid-column: 5 / 9;  grid-row: 5 / 7; animation-delay: 1300ms; background: var(--navy-deep); }

/* ============================================================
   Hero Cell
   ============================================================ */

.hero-cell {
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-photo {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.vintage-svg {
    width: 100%;
    height: 100%;
    filter: sepia(15%) saturate(70%) hue-rotate(200deg) contrast(1.05);
    animation: drift 30s ease-in-out infinite alternate;
}

@keyframes drift {
    from { transform: scale(1.05) translate(-1%, -0.5%); }
    to   { transform: scale(1.08) translate(2%, 1%); }
}

.hero-overlay {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    height: 100%;
    gap: 18px;
}

.chrome-badge {
    position: relative;
    width: 168px;
    height: 168px;
    display: grid;
    place-items: center;
}

.badge-svg {
    width: 100%;
    height: 100%;
    animation: spin 60s linear infinite;
    filter: drop-shadow(0 0 18px rgba(168, 180, 196, 0.18));
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.badge-glyph {
    transform-origin: 100px 100px;
    animation: spinReverse 60s linear infinite;
}

@keyframes spinReverse {
    from { transform: rotate(0deg); }
    to   { transform: rotate(-360deg); }
}

.orbital {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--steel);
    box-shadow: 0 0 8px rgba(212, 220, 232, 0.6);
    top: 50%;
    left: 50%;
    margin-top: -3px;
    margin-left: -3px;
}

.orbital-1 { animation: orbit1 8s linear infinite; }
.orbital-2 { animation: orbit2 12s linear infinite; animation-delay: -3s; }
.orbital-3 { animation: orbit3 16s linear infinite; animation-delay: -7s; }

@keyframes orbit1 {
    from { transform: rotate(0deg) translateX(100px) rotate(0deg); }
    to   { transform: rotate(360deg) translateX(100px) rotate(-360deg); }
}
@keyframes orbit2 {
    from { transform: rotate(0deg) translateX(115px) rotate(0deg); }
    to   { transform: rotate(-360deg) translateX(115px) rotate(360deg); }
}
@keyframes orbit3 {
    from { transform: rotate(0deg) translateX(86px) rotate(0deg); }
    to   { transform: rotate(360deg) translateX(86px) rotate(-360deg); }
}

.hero-title {
    font-family: "Varela Round", "Nunito", sans-serif;
    font-weight: 400;
    font-size: clamp(2rem, 4.5vw, 3.8rem);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: var(--chrome-grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    line-height: 1.1;
}

.hero-title .dot {
    color: var(--signal);
    -webkit-text-fill-color: var(--signal);
}

.hero-subtitle {
    font-family: "Nunito", sans-serif;
    font-weight: 300;
    font-size: clamp(0.7rem, 1.2vw, 0.85rem);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--chrome-hi);
    opacity: 0.78;
}

/* ============================================================
   Navigation Capsule
   ============================================================ */

.nav-cell {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    background: var(--navy-mid);
}

.pill {
    display: block;
    text-align: center;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 999px;
    background: var(--chrome-grad);
    background-size: 200% 200%;
    background-position: 0% 50%;
    color: var(--navy-deep);
    font-family: "Varela Round", sans-serif;
    font-size: clamp(0.78rem, 1vw, 0.95rem);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    border: 1px solid rgba(212, 220, 232, 0.4);
    transition: background-position 0.4s ease, transform 0.3s ease, color 0.3s ease;
    transform: perspective(600px) rotateY(0deg);
}

.pill:hover {
    background: var(--navy-deep);
    color: var(--chrome-hi);
    border-color: var(--steel);
    transform: perspective(600px) rotateY(6deg);
}

.pill span {
    display: inline-block;
}

/* ============================================================
   Quote Cell
   ============================================================ */

.quote-cell {
    background: var(--navy-mid);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: left;
}

.bookmark-svg {
    position: absolute;
    top: 16px;
    left: 18px;
    width: 18px;
    height: 26px;
}

.bookmark-path {
    stroke-dasharray: 120;
    stroke-dashoffset: 120;
    animation: drawBookmark 800ms ease-out 1300ms forwards;
}

@keyframes drawBookmark {
    to { stroke-dashoffset: 0; }
}

.quote-stack {
    position: relative;
    width: 100%;
    min-height: 110px;
    padding: 0 4px;
}

.quote {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    opacity: 0;
    animation: quoteCycle 48s ease-in-out infinite, breathe 6s ease-in-out infinite;
}

.quote.q-1 { animation-delay: 0s,    0s; }
.quote.q-2 { animation-delay: 12s,   0s; }
.quote.q-3 { animation-delay: 24s,   0s; }
.quote.q-4 { animation-delay: 36s,   0s; }

@keyframes quoteCycle {
    0%   { opacity: 0; }
    4%   { opacity: 1; }
    20%  { opacity: 1; }
    25%  { opacity: 0; }
    100% { opacity: 0; }
}

@keyframes breathe {
    0%, 100% { filter: brightness(1); }
    50%      { filter: brightness(1.08); }
}

.quote p {
    font-family: "Crimson Pro", Georgia, serif;
    font-style: italic;
    font-weight: 500;
    font-size: clamp(0.92rem, 1.3vw, 1.1rem);
    line-height: 1.55;
    color: var(--vellum);
}

.quote cite {
    font-family: "Nunito", sans-serif;
    font-style: normal;
    font-weight: 300;
    font-size: 0.7rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--steel);
    opacity: 0.8;
}

/* ============================================================
   Catalog Row
   ============================================================ */

.catalog-cell {
    background: var(--navy-deep);
}

.catalog-card {
    flex: 1;
    background: var(--navy-mid);
    border: 2px solid var(--steel);
    box-shadow: inset 0 0 0 1px rgba(11, 20, 38, 0.4);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    cursor: pointer;
    will-change: transform;
}

.catalog-card:hover {
    border-color: var(--chrome-hi);
    box-shadow: 0 8px 24px rgba(11, 20, 38, 0.6);
    transform: perspective(800px) rotateX(3deg) rotateY(-3deg);
}

.catalog-photo {
    width: 100%;
    flex: 1;
    overflow: hidden;
}

.catalog-photo svg {
    width: 100%;
    height: 100%;
    filter: sepia(15%) saturate(70%) hue-rotate(200deg) contrast(1.05);
    transition: transform 0.3s ease;
}

.catalog-card:hover .catalog-photo svg {
    transform: scale(1.06);
}

.card-title {
    font-family: "Varela Round", sans-serif;
    font-weight: 400;
    font-size: clamp(0.78rem, 1vw, 0.95rem);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--chrome-hi);
}

.card-meta {
    font-family: "JetBrains Mono", "Courier New", monospace;
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    color: var(--bronze);
}

/* ============================================================
   Essay Cell
   ============================================================ */

.essay-cell {
    background: var(--vellum);
    color: var(--navy-mid);
    border-left: 1px solid rgba(26, 34, 54, 0.18);
    overflow: hidden;
}

.essay-cell::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 14px;
    width: 1px;
    background: rgba(26, 34, 54, 0.18);
}

.essay-body {
    font-family: "Crimson Pro", Georgia, serif;
    font-size: clamp(0.85rem, 1.2vw, 1rem);
    line-height: 1.7;
    color: var(--navy-mid);
    transition: transform 0.3s ease;
    padding-left: 6px;
}

.essay-cell.note-open .essay-body {
    transform: translateX(-12px);
}

.dropcap {
    float: left;
    font-family: "Varela Round", sans-serif;
    font-size: 4em;
    line-height: 0.85;
    padding: 4px 8px 0 0;
    background: var(--chrome-grad);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: shimmer 1.5s ease-out 1500ms 1 both;
    shape-outside: margin-box;
}

@keyframes shimmer {
    from { background-position: 0% 50%; }
    to   { background-position: 100% 50%; }
}

.margin-ref {
    color: var(--signal);
    font-weight: 600;
    cursor: pointer;
    padding: 0 2px;
    font-size: 0.7em;
}

.margin-ref:hover {
    text-decoration: underline;
}

.margin-note {
    position: absolute;
    top: 24px;
    right: 0;
    bottom: 24px;
    width: 60%;
    background: rgba(11, 20, 38, 0.92);
    color: var(--vellum);
    padding: 18px 16px;
    border-left: 1px solid var(--steel);
    transform: translateX(110%);
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    font-family: "Crimson Pro", Georgia, serif;
    font-size: 0.85rem;
    line-height: 1.55;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.margin-note.is-open {
    transform: translateX(0);
}

.note-num {
    font-family: "Nunito", sans-serif;
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    color: var(--steel);
    text-transform: uppercase;
}

.note-close {
    align-self: flex-start;
    background: transparent;
    border: 1px solid var(--steel);
    color: var(--steel);
    padding: 4px 10px;
    border-radius: 999px;
    font-family: "Nunito", sans-serif;
    font-size: 0.65rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease;
}

.note-close:hover {
    background: var(--steel);
    color: var(--navy-deep);
}

/* ============================================================
   Signal Cell
   ============================================================ */

.signal-cell {
    background: var(--navy-deep);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
}

.ensou-svg {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 70%;
    height: 70%;
    pointer-events: none;
}

.constellation-svg {
    width: 92%;
    height: auto;
    max-height: 76%;
    position: relative;
    z-index: 2;
}

.node {
    fill: var(--steel);
    transform-box: fill-box;
    transform-origin: center center;
}

.node.n-1  { animation: pulse 1.5s ease-in-out 2.4s infinite; }
.node.n-2  { animation: pulse 1.5s ease-in-out 4.1s infinite; }
.node.n-3  { animation: pulse 1.5s ease-in-out 6.8s infinite; }
.node.n-4  { animation: pulse 1.5s ease-in-out 3.2s infinite; }
.node.n-5  { animation: pulse 1.5s ease-in-out 5.5s infinite; }
.node.n-6  { animation: pulse 1.5s ease-in-out 7.9s infinite; }
.node.n-7  { animation: pulse 1.5s ease-in-out 2.9s infinite; }
.node.n-8  { animation: pulse 1.5s ease-in-out 4.7s infinite; }
.node.n-9  { animation: pulse 1.5s ease-in-out 6.2s infinite; }
.node.n-10 { animation: pulse 1.5s ease-in-out 3.7s infinite; }
.node.n-11 { animation: pulse 1.5s ease-in-out 5.1s infinite; }
.node.n-12 { animation: pulse 1.5s ease-in-out 7.3s infinite; }

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        fill: var(--steel);
    }
    50% {
        transform: scale(1.3);
        fill: var(--signal);
    }
}

.signal-label {
    position: absolute;
    bottom: 18px;
    left: 24px;
    font-family: "Nunito", sans-serif;
    font-weight: 300;
    font-size: 0.7rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--bronze);
    z-index: 3;
}

/* ============================================================
   Descend Hint
   ============================================================ */

.descend-hint {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--steel);
    text-decoration: none;
    font-family: "Nunito", sans-serif;
    font-size: 0.65rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 99;
    opacity: 0.7;
    animation: descendPulse 3s ease-in-out infinite;
}

.descend-hint svg {
    width: 14px;
    height: 14px;
}

@keyframes descendPulse {
    0%, 100% { opacity: 0.5; transform: translate(-50%, 0); }
    50%      { opacity: 0.95; transform: translate(-50%, 4px); }
}

/* ============================================================
   Essay Page (second viewport)
   ============================================================ */

.essay-page {
    min-height: 100vh;
    background: var(--vellum);
    color: var(--navy-mid);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 24px;
    scroll-snap-align: start;
}

.essay-page-inner {
    max-width: 640px;
    width: 100%;
    font-family: "Crimson Pro", Georgia, serif;
    font-size: clamp(1rem, 1.3vw, 1.18rem);
    line-height: 1.78;
    letter-spacing: 0.01em;
}

.essay-page-title {
    font-family: "Varela Round", sans-serif;
    font-weight: 400;
    font-size: clamp(2rem, 4vw, 3rem);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--navy-mid);
    margin-bottom: 32px;
    background: linear-gradient(135deg, #1A2236, #5B6B82, #1A2236);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.essay-page-lede {
    margin-bottom: 1.4em;
}

.essay-page-inner p {
    margin-bottom: 1.2em;
}

.dropcap-page {
    font-size: 4.5em;
    line-height: 0.85;
}

.essay-signoff {
    font-family: "Nunito", sans-serif;
    font-weight: 300;
    font-size: 0.85rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--bronze);
    margin-top: 2em;
}

/* ============================================================
   Responsive Collapse
   ============================================================ */

@media (max-width: 768px) {
    html, body {
        overflow-y: auto;
    }

    html {
        scroll-snap-type: none;
    }

    .bento {
        height: auto;
        min-height: 100vh;
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: 12px;
        padding: 12px;
    }

    .cell[data-cell="1"],
    .cell[data-cell="2"],
    .cell[data-cell="3"],
    .cell[data-cell="4"],
    .cell[data-cell="5"],
    .cell[data-cell="6"] {
        grid-column: 1 / -1;
        grid-row: auto;
        min-height: 280px;
    }

    .cell[data-cell="1"] { min-height: 380px; }

    .catalog-cell {
        flex-wrap: wrap;
    }

    .catalog-card {
        flex: 1 1 calc(50% - 16px);
        min-height: 180px;
    }

    .descend-hint {
        display: none;
    }

    .margin-note {
        width: 86%;
    }
}
