/* renai.reviews — A dossier-wall single-page experience
   Seed: skeuomorphic | bento-box | baskerville-refined | neon-electric
         typewriter-effect | geometric-abstract | crystalline | bold-confident
*/

/* ------------------ Reset & Base ------------------ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Libre Baskerville', Georgia, serif;
    background: #0d0a14;
    color: #f4ead5;
    line-height: 1.85;
    font-size: 1.05rem;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    padding: 48px 32px 64px;
}

/* ------------------ Z-Layer Stack ------------------ */
.backplate {
    position: fixed;
    inset: 0;
    background: #0d0a14;
    z-index: 0;
    pointer-events: none;
}

.lattice {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background-attachment: fixed;
    background-image:
        repeating-linear-gradient(60deg,
            rgba(168, 117, 255, 0.12) 0,
            rgba(168, 117, 255, 0.12) 1px,
            transparent 1px,
            transparent 42px),
        repeating-linear-gradient(120deg,
            rgba(168, 117, 255, 0.12) 0,
            rgba(168, 117, 255, 0.12) 1px,
            transparent 1px,
            transparent 42px);
}

/* Slate backplate strip behind the bento wall */
.dossier-wall {
    position: relative;
    z-index: 2;
    max-width: 1320px;
    margin: 0 auto;
    padding: 36px 28px;
    background: #1c1820;
    background-image:
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/><feColorMatrix values='0 0 0 0 0.05 0 0 0 0 0.04 0 0 0 0 0.07 0 0 0 0.6 0'/></filter><rect width='160' height='160' filter='url(%23n)' opacity='0.42'/></svg>");
    border: 1px solid #2a1a12;
    box-shadow:
        inset 0 0 0 6px #1c1820,
        inset 0 0 0 7px rgba(176, 141, 87, 0.4),
        0 32px 80px rgba(0, 0, 0, 0.55);

    /* Bento grid */
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: 88px;
    gap: 18px;
}

/* ------------------ Tile Base ------------------ */
.tile {
    position: relative;
    padding: 22px 24px;
    border: 1px solid rgba(176, 141, 87, 0.35);
    box-shadow:
        0 6px 14px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    overflow: hidden;
    opacity: 0;
    transform: translateY(8px) rotate(0deg);
    transition: opacity 480ms ease-out, transform 480ms ease-out;
}

.tile.is-pinned {
    opacity: 1;
}

/* Apply tile-specific rotation on .is-pinned (read from inline data attribute via CSS custom property set by JS) */
.tile.is-pinned {
    transform: translateY(0) rotate(var(--tile-rotate, 0deg));
}

/* ------------------ Tile Materials ------------------ */
.tile-cream {
    background: #f4ead5;
    color: #2a1a12;
    background-image:
        repeating-linear-gradient(180deg,
            rgba(42, 26, 18, 0.03) 0,
            rgba(42, 26, 18, 0.03) 1px,
            transparent 1px,
            transparent 4px);
    clip-path: polygon(
        0 0, 100% 0,
        100% calc(100% - 4px), 99% 100%, 96% calc(100% - 2px), 93% 100%, 90% calc(100% - 3px),
        86% 100%, 82% calc(100% - 2px), 78% 100%, 74% calc(100% - 3px), 70% 100%,
        66% calc(100% - 2px), 62% 100%, 58% calc(100% - 3px), 54% 100%, 50% calc(100% - 2px),
        46% 100%, 42% calc(100% - 3px), 38% 100%, 34% calc(100% - 2px), 30% 100%,
        26% calc(100% - 3px), 22% 100%, 18% calc(100% - 2px), 14% 100%, 10% calc(100% - 3px),
        6% 100%, 3% calc(100% - 2px), 0 100%
    );
    border-color: rgba(42, 26, 18, 0.25);
    box-shadow:
        0 8px 18px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.tile-foxed {
    background: #f4ead5;
    color: #2a1a12;
    background-image:
        radial-gradient(circle at 14% 22%, rgba(120, 70, 30, 0.18) 0, transparent 22px),
        radial-gradient(circle at 78% 18%, rgba(120, 70, 30, 0.14) 0, transparent 28px),
        radial-gradient(circle at 32% 78%, rgba(120, 70, 30, 0.16) 0, transparent 24px),
        radial-gradient(circle at 86% 72%, rgba(120, 70, 30, 0.12) 0, transparent 30px),
        repeating-linear-gradient(180deg,
            rgba(42, 26, 18, 0.03) 0,
            rgba(42, 26, 18, 0.03) 1px,
            transparent 1px,
            transparent 4px);
    border-color: rgba(42, 26, 18, 0.3);
    box-shadow:
        0 8px 18px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.tile-leather {
    background: #2a1a12;
    color: #f4ead5;
    background-image:
        radial-gradient(circle at 22% 30%, rgba(0, 0, 0, 0.45) 0, transparent 80px),
        radial-gradient(circle at 78% 60%, rgba(0, 0, 0, 0.4) 0, transparent 90px),
        radial-gradient(circle at 50% 90%, rgba(0, 0, 0, 0.35) 0, transparent 70px);
    border-color: rgba(176, 141, 87, 0.5);
    box-shadow:
        0 8px 18px rgba(0, 0, 0, 0.55),
        inset 0 1px 0 rgba(244, 234, 213, 0.12);
}

.tile-brass {
    background: #b08d57;
    color: #1c1820;
    background-image:
        repeating-linear-gradient(180deg,
            rgba(255, 255, 255, 0.04) 0,
            rgba(255, 255, 255, 0.04) 1px,
            transparent 1px,
            transparent 2px);
    border-color: rgba(28, 24, 32, 0.45);
    box-shadow:
        0 8px 18px rgba(0, 0, 0, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(0, 0, 0, 0.25);
}

.tile-acrylic {
    background: rgba(244, 234, 213, 0.28);
    backdrop-filter: blur(14px) saturate(1.2);
    -webkit-backdrop-filter: blur(14px) saturate(1.2);
    color: #f4ead5;
    border-color: rgba(33, 247, 255, 0.35);
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 0 0 1px rgba(33, 247, 255, 0.18);
}

.tile-acrylic .case-body,
.tile-acrylic .case-title,
.tile-acrylic .filing-code,
.tile-acrylic .pull-quote {
    color: #f4ead5;
}

.tile-slate {
    background: #1c1820;
    color: #f4ead5;
    background-image:
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/><feColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.4 0 0 0 0 0.6 0 0 0 0.08 0'/></filter><rect width='200' height='200' filter='url(%23n)'/></svg>");
    border-color: rgba(168, 117, 255, 0.4);
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(168, 117, 255, 0.1);
}

.tile-slate-dark {
    background: #1c1820;
    color: #f4ead5;
    background-image:
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/><feColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.4 0 0 0 0 0.6 0 0 0 0.08 0'/></filter><rect width='200' height='200' filter='url(%23n)'/></svg>");
    border-color: rgba(168, 117, 255, 0.32);
    box-shadow:
        0 8px 20px rgba(0, 0, 0, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* ------------------ Bento Placement ------------------ */
.tile-hero {
    grid-column: 1 / span 7;
    grid-row: 1 / span 5;
    padding: 36px 40px 44px;
}

.tile-verdict {
    grid-column: 8 / span 5;
    grid-row: 1 / span 4;
    padding: 30px 32px;
}

.tile-editor {
    grid-column: 8 / span 5;
    grid-row: 5 / span 3;
}

#case-00042 {
    grid-column: 1 / span 4;
    grid-row: 6 / span 4;
}

#case-00017 {
    grid-column: 5 / span 4;
    grid-row: 8 / span 4;
}

#case-00028 {
    grid-column: 9 / span 4;
    grid-row: 8 / span 4;
}

#case-00031 {
    grid-column: 1 / span 5;
    grid-row: 10 / span 4;
}

#case-00039 {
    grid-column: 6 / span 4;
    grid-row: 12 / span 4;
}

#case-00044 {
    grid-column: 10 / span 3;
    grid-row: 12 / span 4;
}

.tile-method {
    grid-column: 1 / span 8;
    grid-row: 16 / span 3;
}

.tile-nameplate {
    grid-column: 9 / span 4;
    grid-row: 16 / span 3;
    padding: 24px 26px;
}

/* ------------------ Typography ------------------ */
.filing-code {
    font-family: 'Special Elite', 'Courier New', monospace;
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    opacity: 0.78;
    margin-bottom: 14px;
    line-height: 1.5;
}

.masthead {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(2.4rem, 6vw, 5.2rem);
    line-height: 1.05;
    color: #2a1a12;
    letter-spacing: -0.01em;
    margin-bottom: 8px;
}

.masthead .ren {
    display: inline;
}

.masthead .dot {
    color: #ff2bd6;
    text-shadow: 0 0 12px rgba(255, 43, 214, 0.6);
}

.masthead .ext {
    font-feature-settings: "smcp" 1;
    font-variant-caps: small-caps;
    font-style: normal;
    letter-spacing: 0.04em;
}

.tagline {
    font-size: 1.05rem;
    line-height: 1.7;
    color: #2a1a12;
    max-width: 56ch;
    margin-bottom: 22px;
    font-style: italic;
    opacity: 0.86;
}

.typewriter-row {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-style: italic;
    font-size: clamp(1.05rem, 1.8vw, 1.45rem);
    color: #2a1a12;
    min-height: 2.4em;
    line-height: 1.5;
    border-top: 1px solid rgba(42, 26, 18, 0.25);
    padding-top: 18px;
    margin-top: 6px;
}

.typewriter {
    white-space: pre-wrap;
}

.caret {
    color: #ff2bd6;
    font-style: normal;
    margin-left: 2px;
    animation: caret-blink 1.06s steps(2, end) infinite;
    text-shadow: 0 0 8px rgba(255, 43, 214, 0.7);
}

@keyframes caret-blink {
    0%, 50%   { opacity: 1; }
    50.01%, 100% { opacity: 0; }
}

/* Big Verdict */
.verdict-eyebrow {
    font-family: 'Special Elite', monospace;
    font-size: 0.86rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #b08d57;
    margin-bottom: 14px;
    line-height: 1.5;
}

.big-verdict {
    font-family: 'Playfair Display', 'Libre Baskerville', Georgia, serif;
    font-weight: 700;
    font-style: italic;
    font-size: clamp(1.3rem, 2.2vw, 1.85rem);
    line-height: 1.32;
    letter-spacing: -0.01em;
    color: #f4ead5;
    margin-bottom: 22px;
    position: relative;
    z-index: 2;
}

.big-verdict em {
    color: #ff2bd6;
    font-style: italic;
    text-shadow: 0 0 12px rgba(255, 43, 214, 0.45);
}

.tile-verdict {
    position: relative;
}

.tile-verdict::before {
    content: "";
    position: absolute;
    inset: 8px;
    background: radial-gradient(ellipse at 50% 50%,
        rgba(33, 247, 255, 0.14) 0,
        rgba(33, 247, 255, 0.04) 50%,
        transparent 75%);
    pointer-events: none;
    z-index: 1;
}

/* Verdict score chip */
.verdict-score {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    border: 1px solid #21f7ff;
    background: rgba(33, 247, 255, 0.08);
    box-shadow: 0 0 14px rgba(33, 247, 255, 0.2), inset 0 0 8px rgba(33, 247, 255, 0.12);
    border-radius: 2px;
    position: relative;
    z-index: 2;
}

.verdict-score .score-label {
    font-family: 'Special Elite', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #f4ead5;
    opacity: 0.85;
}

.verdict-score .score-value {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    font-size: 1.05rem;
    color: #21f7ff;
    text-shadow: 0 0 8px rgba(33, 247, 255, 0.5);
    letter-spacing: 0.02em;
}

.verdict-score.small {
    padding: 4px 9px;
    gap: 7px;
    margin-top: 12px;
}

.verdict-score.small .score-label {
    font-size: 0.62rem;
}

.verdict-score.small .score-value {
    font-size: 0.92rem;
}

/* Tile-leather and tile-slate-dark verdict scores still cyan */
.tile-leather .verdict-score,
.tile-slate-dark .verdict-score {
    background: rgba(33, 247, 255, 0.1);
}

/* Editor / Case titles */
.editor-title,
.case-title {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-style: italic;
    font-size: 1.42rem;
    font-weight: 400;
    line-height: 1.25;
    letter-spacing: -0.005em;
    margin-bottom: 12px;
}

.tile-editor .editor-title,
.tile-brass .case-title {
    color: #1c1820;
}

.editor-body,
.case-body {
    font-size: 1rem;
    line-height: 1.75;
    margin-bottom: 14px;
}

.editor-body em,
.case-body em {
    font-style: italic;
}

.tile-editor .editor-body {
    color: #1c1820;
}

.pull-quote {
    font-family: 'Special Elite', 'Courier New', monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    border-left: 2px solid #b08d57;
    padding: 6px 0 6px 14px;
    margin: 10px 0 6px;
    color: inherit;
    opacity: 0.92;
}

.tile-cream .pull-quote,
.tile-foxed .pull-quote {
    color: #2a1a12;
}

/* ------------------ Wax Seal ------------------ */
.wax-seal {
    position: absolute;
    right: 38px;
    bottom: 34px;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 35% 35%,
            #ff7be9 0%,
            #ff2bd6 30%,
            #c01ea8 70%,
            #841476 100%);
    box-shadow:
        inset 0 -6px 12px rgba(0, 0, 0, 0.45),
        inset 0 4px 8px rgba(255, 255, 255, 0.35),
        0 0 22px #ff2bd6,
        0 4px 10px rgba(0, 0, 0, 0.4);
    filter: drop-shadow(0 0 8px rgba(255, 43, 214, 0.6));
    display: flex;
    align-items: center;
    justify-content: center;
    animation: seal-pulse 5.4s ease-in-out infinite alternate;
}

.wax-seal .monogram {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-style: italic;
    font-weight: 700;
    font-size: 1.3rem;
    color: rgba(13, 10, 20, 0.55);
    text-shadow:
        0 1px 0 rgba(255, 255, 255, 0.18),
        0 -1px 0 rgba(0, 0, 0, 0.4);
    letter-spacing: -0.02em;
}

.wax-seal.small {
    width: 56px;
    height: 56px;
    position: relative;
    right: auto;
    bottom: auto;
    flex-shrink: 0;
}

.wax-seal.small .monogram {
    font-size: 0.85rem;
}

@keyframes seal-pulse {
    0%   { box-shadow:
        inset 0 -6px 12px rgba(0, 0, 0, 0.45),
        inset 0 4px 8px rgba(255, 255, 255, 0.35),
        0 0 22px #ff2bd6,
        0 4px 10px rgba(0, 0, 0, 0.4);
    }
    100% { box-shadow:
        inset 0 -6px 12px rgba(0, 0, 0, 0.45),
        inset 0 4px 8px rgba(255, 255, 255, 0.35),
        0 0 32px #ff2bd6,
        0 4px 14px rgba(0, 0, 0, 0.45);
    }
}

/* Mini wax seal on each case tile */
.wax-seal-mini {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #ff7be9 0%, #ff2bd6 50%, #841476 100%);
    box-shadow:
        inset 0 -2px 3px rgba(0, 0, 0, 0.4),
        0 0 8px rgba(255, 43, 214, 0.7);
    z-index: 3;
}

/* ------------------ Corner Geometric Glyphs ------------------ */
.corner-glyph {
    position: absolute;
    bottom: 14px;
    right: 14px;
    width: 60px;
    height: 60px;
    opacity: 0.85;
}

.corner-glyph.corner-tl {
    bottom: auto;
    right: auto;
    top: 22px;
    right: 24px;
    position: absolute;
    width: 50px;
    height: 50px;
    opacity: 0.65;
}

/* ------------------ Pinned-Thread Connectors ------------------ */
.connector {
    position: absolute;
    background: #a875ff;
    height: 1px;
    transform-origin: top left;
    pointer-events: none;
    opacity: 0.55;
    z-index: 3;
}

.connector .pin {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #b08d57;
    box-shadow: 0 0 4px rgba(176, 141, 87, 0.7);
}

.connector .pin-a { left: -2px; top: -2px; }
.connector .pin-b { right: -3px; top: -2px; }

/* Connector positions: hand-placed to suggest thread between specific tiles */
.connector-1 {
    /* hero → verdict */
    top: 18%;
    left: 56%;
    width: 110px;
    transform: rotate(-12deg);
}

.connector-2 {
    /* verdict → editor */
    top: 30%;
    left: 78%;
    width: 80px;
    transform: rotate(78deg);
}

.connector-3 {
    /* case-00042 → case-00017 */
    top: 52%;
    left: 30%;
    width: 140px;
    transform: rotate(22deg);
}

.connector-4 {
    /* case-00028 → case-00031 */
    top: 65%;
    left: 50%;
    width: 160px;
    transform: rotate(38deg);
}

/* ------------------ Nameplate ------------------ */
.tile-nameplate {
    padding: 22px 24px;
}

.nameplate-inner {
    display: flex;
    align-items: center;
    gap: 18px;
}

.nameplate-text {
    flex: 1;
    min-width: 0;
}

.nameplate-line {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: 0.92rem;
    line-height: 1.55;
    color: #1c1820;
    margin-bottom: 4px;
    font-style: italic;
}

.nameplate-line.muted {
    opacity: 0.7;
    font-style: normal;
    font-size: 0.82rem;
    margin-top: 6px;
}

/* ------------------ Color fixes per tile material ------------------ */
.tile-leather .case-title,
.tile-leather .case-body,
.tile-leather .filing-code,
.tile-leather .pull-quote,
.tile-slate-dark .case-title,
.tile-slate-dark .case-body,
.tile-slate-dark .filing-code,
.tile-slate-dark .pull-quote,
.tile-slate .filing-code,
.tile-slate .verdict-eyebrow {
    color: #f4ead5;
}

.tile-slate-dark .pull-quote,
.tile-leather .pull-quote {
    border-left-color: #ff2bd6;
}

/* ------------------ Responsive collapse ------------------ */
@media (max-width: 980px) {
    body {
        padding: 28px 16px 48px;
    }

    .dossier-wall {
        grid-template-columns: repeat(6, 1fr);
        grid-auto-rows: 80px;
        gap: 14px;
        padding: 22px 16px;
    }

    .tile-hero,
    .tile-verdict,
    .tile-editor,
    .tile-method,
    .tile-nameplate,
    #case-00042,
    #case-00017,
    #case-00028,
    #case-00031,
    #case-00039,
    #case-00044 {
        grid-column: 1 / -1;
        grid-row: auto / span 5;
    }

    .tile-hero {
        grid-row: auto / span 6;
    }

    .wax-seal {
        width: 72px;
        height: 72px;
        right: 22px;
        bottom: 22px;
    }

    .wax-seal .monogram {
        font-size: 1rem;
    }

    .connector {
        display: none;
    }

    .masthead {
        font-size: clamp(2rem, 8vw, 3.4rem);
    }

    .big-verdict {
        font-size: clamp(1.15rem, 4vw, 1.45rem);
    }
}

@media (max-width: 560px) {
    .tile {
        padding: 18px 18px;
    }

    .tile-hero {
        padding: 22px 22px 28px;
    }

    .wax-seal {
        width: 60px;
        height: 60px;
    }

    .wax-seal .monogram {
        font-size: 0.85rem;
    }

    .corner-glyph,
    .corner-glyph.corner-tl {
        width: 42px;
        height: 42px;
    }
}
