:root {
    --cream: #F3E8D0;
    --teal: #2F6868;
    --brass: #B58A42;
    --coral: #D9826B;
    --charcoal: #252525;
    --sage: #9BAE8E;
    --bluegray: #7D91A0;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--charcoal);
    font-family: "Outfit", sans-serif;
    background:
        radial-gradient(circle at 20% 8%, rgba(181, 138, 66, .22), transparent 26rem),
        radial-gradient(circle at 84% 18%, rgba(217, 130, 107, .18), transparent 23rem),
        linear-gradient(90deg, rgba(37,37,37,.035) 1px, transparent 1px),
        linear-gradient(0deg, rgba(37,37,37,.025) 1px, transparent 1px),
        var(--cream);
    background-size: auto, auto, 42px 42px, 42px 42px, auto;
}

.case-desk { overflow: hidden; }

.hero-inspection {
    position: relative;
    min-height: 100vh;
    padding: clamp(18px, 3vw, 42px);
    display: grid;
    place-items: center;
    perspective: 1100px;
}

.desk-glow {
    position: absolute;
    inset: 8% 7%;
    background: radial-gradient(circle, rgba(243,232,208,.7), transparent 60%);
    transform: rotate(-3deg);
}

.case-strings {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: .62;
}

.string-path, .route {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 4;
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
}

.string-path.teal, .route-clean { stroke: var(--teal); }
.string-path.coral, .route-noise { stroke: var(--coral); }
.string-path.sage { stroke: var(--sage); }

.bento-board {
    position: relative;
    z-index: 2;
    width: min(1180px, 100%);
    min-height: 720px;
    display: grid;
    grid-template-columns: 1fr 1.25fr .95fr;
    grid-template-rows: 1fr .85fr .72fr;
    gap: 18px;
    transform: rotateX(5deg) rotateZ(-1deg);
}

.tile, .chapter {
    position: relative;
    border: 2px solid var(--brass);
    border-radius: 28px 18px 30px 18px;
    background: rgba(243, 232, 208, .9);
    box-shadow: 0 24px 50px rgba(37, 37, 37, .15), inset 0 0 0 1px rgba(255,255,255,.36);
    padding: 24px;
}

.tile::before, .chapter::before {
    content: "";
    position: absolute;
    inset: 9px;
    border: 1px dashed rgba(181,138,66,.48);
    border-radius: inherit;
    pointer-events: none;
}

.tile h1, .tile h2, .chapter h2 {
    margin: 0;
    line-height: .95;
}

.title-folder {
    grid-column: 1 / 3;
    grid-row: 1 / 3;
    padding: clamp(32px, 5vw, 64px);
    background: linear-gradient(145deg, rgba(243,232,208,.98), rgba(155,174,142,.22));
    transform: translateY(18px) rotate(-1deg);
}

.paper-stack::after {
    content: "";
    position: absolute;
    left: 8%; right: 8%; bottom: -16px;
    height: 30px;
    border: 2px solid var(--brass);
    border-top: 0;
    border-radius: 0 0 26px 26px;
    background: rgba(243,232,208,.55);
    z-index: -1;
}

.tab-label {
    position: absolute;
    top: -18px;
    left: 44px;
    padding: 9px 18px;
    border: 2px solid var(--brass);
    border-bottom: 0;
    border-radius: 16px 16px 0 0;
    background: var(--sage);
    font: 700 .76rem "Outfit", sans-serif;
    text-transform: uppercase;
    letter-spacing: .15em;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--teal);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .19em;
    font-size: .78rem;
}

h1 {
    font-family: "Limelight", serif;
    font-size: clamp(3.8rem, 11vw, 9.4rem);
    color: var(--charcoal);
    text-shadow: 3px 3px 0 rgba(181, 138, 66, .32);
}

h2 {
    font-family: "Forum", serif;
    font-size: clamp(1.7rem, 3vw, 3.25rem);
    color: var(--charcoal);
}

.folder-copy {
    max-width: 640px;
    font-size: clamp(1.05rem, 1.8vw, 1.45rem);
    line-height: 1.45;
}

.brass-nameplate, .nameplate-tile, .rubber-stamp, .chapter-number {
    font-family: "Limelight", serif;
    color: var(--charcoal);
}

.brass-nameplate {
    display: inline-block;
    margin-top: 18px;
    padding: 12px 18px;
    background: var(--brass);
    border-radius: 10px;
    box-shadow: inset 0 2px rgba(255,255,255,.35);
}

.clause-card {
    grid-column: 3;
    grid-row: 1;
    background: rgba(255, 248, 229, .95);
    transform: rotate(2.2deg) translateY(10px);
}

.pin {
    position: absolute;
    right: 24px;
    top: 18px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--coral);
    box-shadow: 0 4px 0 rgba(37,37,37,.18);
}

.clause-text {
    font-family: "Forum", serif;
    font-size: 1.25rem;
    line-height: 1.35;
}

mark { background: rgba(217,130,107,.28); color: inherit; border-bottom: 3px solid var(--coral); }

.magnifier { width: 78%; stroke: var(--teal); fill: rgba(47,104,104,.07); stroke-width: 8; }
.magnifier .sketch-line { fill: none; stroke: var(--coral); stroke-width: 6; stroke-dasharray: 170; stroke-dashoffset: 170; }

.courthouse-terminal { grid-column: 3; grid-row: 2 / 4; transform: rotate(-1.4deg); }
.iso-court { width: 210px; margin: 24px auto; filter: drop-shadow(16px 18px 0 rgba(37,37,37,.1)); }
.roof { height: 54px; background: var(--teal); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.columns { display: flex; gap: 14px; justify-content: center; padding: 15px; background: rgba(125,145,160,.28); border: 2px solid var(--brass); }
.columns span { width: 25px; height: 72px; background: var(--cream); border: 2px solid var(--brass); }
.terminal { background: var(--charcoal); color: var(--sage); padding: 12px; border-radius: 0 0 12px 12px; letter-spacing: .08em; }

.stamp-tile { grid-column: 1; grid-row: 3; background: rgba(217,130,107,.12); transform: rotate(2deg) translateX(15px); }
.rubber-stamp { display: inline-block; margin-bottom: 20px; padding: 12px 20px; border: 5px double var(--coral); color: var(--coral); border-radius: 50%; text-transform: uppercase; transform: rotate(-10deg); }
.stamp-tile li { margin: 9px 0; text-transform: uppercase; letter-spacing: .12em; }

.trace-tile { grid-column: 2; grid-row: 3; background: rgba(47,104,104,.12); transform: rotate(-1deg) translateY(-6px); }
.route-map { width: 100%; max-height: 190px; fill: none; stroke-width: 8; stroke-linecap: round; stroke-linejoin: round; }
.route-map circle { fill: var(--brass); stroke: var(--charcoal); stroke-width: 3; }
.check { stroke: var(--sage); stroke-width: 10; stroke-dasharray: 120; stroke-dashoffset: 120; }

.nameplate-tile { grid-column: 1; grid-row: 1; align-self: start; justify-self: start; z-index: 4; background: var(--brass); padding: 16px 22px; transform: translate(-12px, -28px) rotate(-5deg); }
.nameplate-tile span, .nameplate-tile strong { display: block; }
.nameplate-tile span { font-family: "Outfit", sans-serif; font-size: .7rem; text-transform: uppercase; letter-spacing: .18em; }

.inspection-chapters { padding: 30px clamp(18px, 5vw, 78px) 90px; }
.deco-divider { display: grid; grid-template-columns: 1fr auto 1fr; gap: 18px; align-items: center; margin: 0 auto 34px; max-width: 1120px; font-family: "Limelight", serif; text-transform: uppercase; letter-spacing: .12em; }
.deco-divider span { height: 10px; border-top: 2px solid var(--brass); border-bottom: 2px solid var(--brass); }

.chapter {
    max-width: 1120px;
    margin: 22px auto;
    min-height: 250px;
    display: grid;
    grid-template-columns: 100px minmax(0, 1fr) minmax(230px, .62fr);
    gap: clamp(18px, 4vw, 48px);
    align-items: center;
    background: rgba(243,232,208,.86);
    transform: translateY(36px);
    opacity: .35;
    transition: transform .7s ease, opacity .7s ease, box-shadow .7s ease;
}

.chapter.is-visible, .tile.is-active { transform: translateY(0) rotate(0deg); opacity: 1; box-shadow: 0 26px 60px rgba(47,104,104,.22); }
.chapter-number { font-size: 3.4rem; color: var(--brass); }
.chapter p { font-size: 1.08rem; line-height: 1.55; }
.mini-document, .status-stack, .fix-kit { min-height: 160px; border: 2px solid var(--bluegray); border-radius: 20px; background: rgba(255,255,255,.24); padding: 20px; }
.mini-document span { display: block; height: 12px; margin: 16px 0; background: var(--bluegray); border-radius: 999px; }
.mini-document span:nth-child(2) { width: 68%; background: var(--coral); }
.mini-document em { color: var(--coral); font-family: "Forum", serif; font-size: 1.4rem; }
.ledger-path { width: 100%; fill: none; stroke-width: 5; }
.ledger-path circle { fill: var(--cream); stroke: var(--brass); stroke-width: 4; }
.status-stack { display: grid; gap: 12px; }
.status-stack span { padding: 12px 16px; border-radius: 12px; border: 2px solid var(--brass); text-transform: uppercase; letter-spacing: .14em; }
.status-stack span:first-child { background: rgba(217,130,107,.28); }
.status-stack span:nth-child(2) { background: rgba(125,145,160,.24); }
.status-stack span:last-child { background: rgba(155,174,142,.38); }
.fix-kit { position: relative; }
.fix-kit i, .fix-kit b, .fix-kit small { position: absolute; display: block; background: var(--teal); box-shadow: 12px 14px 0 rgba(37,37,37,.1); }
.fix-kit i { width: 118px; height: 38px; left: 36px; top: 54px; transform: rotate(-18deg); border-radius: 18px; }
.fix-kit b { width: 52px; height: 52px; right: 46px; top: 38px; border-radius: 50%; background: var(--brass); }
.fix-kit small { width: 142px; height: 14px; right: 28px; bottom: 42px; background: var(--sage); border-radius: 999px; }

.drawn { animation: drawPath 2.4s ease forwards; }
.stamp-hit { animation: stampHit .55s cubic-bezier(.2, 1.8, .35, 1) forwards; }
.lifted { animation: liftIcon 1.2s ease-in-out infinite alternate; }

@keyframes drawPath { to { stroke-dashoffset: 0; } }
@keyframes stampHit { 0% { transform: scale(1.5) rotate(-24deg); opacity: .1; } 100% { transform: scale(1) rotate(-10deg); opacity: 1; } }
@keyframes liftIcon { to { transform: translateY(-8px); } }

@media (max-width: 900px) {
    .bento-board { grid-template-columns: 1fr; grid-template-rows: auto; transform: none; min-height: 0; }
    .title-folder, .clause-card, .courthouse-terminal, .stamp-tile, .trace-tile, .nameplate-tile { grid-column: auto; grid-row: auto; transform: none; }
    .nameplate-tile { justify-self: stretch; }
    .chapter { grid-template-columns: 1fr; }
}
