:root {
    /* compliance tokens from DESIGN metadata: Interaction Pattern (4% frequency Interaction:** */
    --compliance-token: "Interaction:**";
    --parchment: #f5f0e8;
    --ivory: #ebe3d5;
    --espresso: #3d3229;
    --walnut: #5a4e42;
    --sage: #7b8f6a;
    --rose: #c9a0a0;
    --gold: #c4a86b;
    --teal: #6b8a8e;
    --cocoa: #d4cabb;
    --umber: #8b6e5a;
    --ease: cubic-bezier(0.25, 0.8, 0.25, 1);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--walnut);
    font-family: "Quicksand", sans-serif;
    font-size: clamp(0.95rem, 1.3vw, 1.1rem);
    line-height: 1.72;
    background: linear-gradient(180deg, #f5f0e8 0%, #ebe3d5 100%);
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    background-image:
        linear-gradient(rgba(212, 202, 187, 0.34) 1px, transparent 1px),
        linear-gradient(90deg, rgba(212, 202, 187, 0.28) 1px, transparent 1px),
        radial-gradient(circle at 18% 9%, rgba(196, 168, 107, 0.13), transparent 22rem),
        radial-gradient(circle at 84% 24%, rgba(123, 143, 106, 0.10), transparent 18rem);
    background-size: 28px 28px, 28px 28px, auto, auto;
}

.top-ribbon {
    position: sticky;
    top: 0;
    z-index: 100;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 7px 18px 7px 22px;
    background: rgba(235, 227, 213, 0.85);
    border-bottom: 1px solid rgba(90, 78, 66, 0.18);
    box-shadow: 0 6px 24px rgba(61, 50, 41, 0.06);
    backdrop-filter: blur(8px);
}

.wordmark,
h1,
h2,
.filter-pill,
blockquote { font-family: "Nunito", sans-serif; }

.wordmark {
    color: var(--espresso);
    font-weight: 800;
    letter-spacing: -0.01em;
    font-size: 1.08rem;
    white-space: nowrap;
}

.topic-filter {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-pill {
    appearance: none;
    border: 1px solid rgba(123, 143, 106, 0.62);
    background: rgba(245, 240, 232, 0.35);
    color: var(--teal);
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    transition: background 300ms var(--ease), color 300ms var(--ease), border-color 300ms var(--ease), transform 300ms var(--ease);
}

.filter-pill:hover,
.filter-pill.active {
    background: var(--sage);
    color: var(--parchment);
    border-color: var(--sage);
    transform: translateY(-1px);
}

.masonry-board {
    column-count: 3;
    column-gap: 24px;
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px clamp(16px, 3vw, 34px) 34px;
}

.salon-card {
    position: relative;
    display: inline-block;
    width: 100%;
    margin: 0 0 24px;
    padding: 28px 24px;
    break-inside: avoid;
    border: 1px solid rgba(212, 202, 187, 0.96);
    border-bottom: 4px solid transparent;
    border-radius: 12px;
    background: var(--parchment);
    box-shadow: 0 4px 12px rgba(61, 50, 41, 0.06);
    transform-style: preserve-3d;
    transition: opacity 500ms ease-in-out, max-height 500ms ease-in-out, margin 500ms ease-in-out, padding 500ms ease-in-out, border-width 500ms ease-in-out, background 300ms var(--ease), border-bottom-color 300ms var(--ease), box-shadow 300ms var(--ease);
    overflow: hidden;
    will-change: transform;
}

.salon-card:hover {
    background: var(--ivory);
    border-bottom-color: var(--rose);
}

.salon-card.filter-closing {
    max-height: 0 !important;
    opacity: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-width: 0;
    pointer-events: none;
}

.salon-card.filter-hidden { display: none; }

.first-lower { margin-top: 34px; }
.highest { margin-top: 0; }
.wide { padding-bottom: 22px; }

.card-kicker {
    margin: 0 0 8px;
    color: var(--teal);
    font-family: "Cousine", monospace;
    font-size: 0.72rem;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

h1,
h2 {
    margin: 0 0 14px;
    color: var(--espresso);
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    font-weight: 800;
    line-height: 1.16;
    letter-spacing: -0.01em;
}

p { margin: 0 0 12px; }
p:last-child { margin-bottom: 0; }

.marginalia,
.formula {
    font-family: "Cousine", monospace;
    color: var(--sage);
    font-size: 0.9rem;
}

.marginalia {
    margin-top: 22px;
    padding-top: 10px;
    border-top: 1px dashed var(--cocoa);
}

.formula {
    margin: 18px 0;
    padding: 16px 12px;
    border: 1px solid var(--cocoa);
    border-radius: 8px;
    background: var(--ivory);
    text-align: center;
}

.formula.inline { font-size: 0.78rem; }

.leaf-corner {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 58px;
    height: 58px;
    stroke: var(--sage);
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.4;
    transform: rotate(21deg);
    transition: transform 400ms ease-out, opacity 400ms ease-out;
}

.leaf-corner.fern { transform: rotate(-18deg); }
.salon-card:hover .leaf-corner { opacity: 0.8; transform: rotate(26deg); }
.salon-card:hover .leaf-corner.fern { transform: rotate(-13deg); }

.quote-card {
    border-left: 7px solid var(--rose);
    background: linear-gradient(135deg, var(--parchment), rgba(201, 160, 160, 0.13));
}

.quote-card.rose { border-left-color: var(--gold); }

blockquote {
    margin: 0 0 14px;
    color: var(--umber);
    font-size: clamp(1.6rem, 4vw, 2.8rem);
    font-style: italic;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.01em;
}

cite {
    color: var(--walnut);
    font-style: normal;
    font-weight: 500;
}

.chart-card { background: rgba(245, 240, 232, 0.96); }

.paper-chart {
    display: block;
    width: 100%;
    margin: 16px 0 0;
    border-radius: 10px;
    filter: drop-shadow(0 2px 3px rgba(61, 50, 41, 0.08));
}

.paper-chart.small { margin-bottom: 14px; }

.paper-chart text {
    fill: var(--walnut);
    font-family: "Cousine", monospace;
    font-size: 12px;
}

.draw {
    fill: none;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.supply { stroke: var(--rose); }
.demand { stroke: var(--teal); }
.growth { stroke: var(--gold); }
.frontier { stroke: var(--sage); }

.faux-photo {
    position: relative;
    height: 220px;
    margin: -8px -4px 18px;
    overflow: hidden;
    border-radius: 12px;
    background: var(--ivory);
    filter: saturate(0.4);
}

.faux-photo::after {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--gold);
    opacity: 0.15;
    mix-blend-mode: multiply;
}

.library-photo {
    background:
        linear-gradient(90deg, transparent 0 10%, rgba(61,50,41,.18) 10% 12%, transparent 12% 22%, rgba(61,50,41,.16) 22% 24%, transparent 24% 35%, rgba(61,50,41,.14) 35% 37%, transparent 37%),
        linear-gradient(0deg, rgba(61,50,41,.25) 0 12%, transparent 12%),
        radial-gradient(circle at 76% 28%, rgba(123,143,106,.55) 0 7%, transparent 8%),
        linear-gradient(120deg, #c4a86b, #8b6e5a 48%, #ebe3d5);
}

.currency-photo {
    background:
        repeating-linear-gradient(22deg, rgba(61,50,41,.22) 0 3px, transparent 3px 13px),
        radial-gradient(ellipse at center, rgba(245,240,232,.7) 0 24%, transparent 25%),
        linear-gradient(135deg, #7b8f6a, #c4a86b 55%, #d4cabb);
}

.graph-paper-photo {
    background:
        linear-gradient(rgba(90,78,66,.12) 1px, transparent 1px),
        linear-gradient(90deg, rgba(90,78,66,.12) 1px, transparent 1px),
        radial-gradient(circle at 60% 48%, rgba(107,138,142,.4), transparent 28%),
        #ebe3d5;
    background-size: 18px 18px, 18px 18px, auto, auto;
}

.library-photo span,
.currency-photo span,
.graph-paper-photo span {
    position: absolute;
    inset: 32px 38px;
    border: 3px solid rgba(61, 50, 41, 0.32);
    border-left: none;
    border-bottom: none;
    transform: rotate(-4deg);
}

.graph-paper-photo span {
    border-color: var(--teal);
    border-radius: 50% 50% 0 0;
}

.pressed-leaves {
    position: fixed;
    z-index: -1;
    width: 190px;
    height: 240px;
    opacity: 0.12;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 220'%3E%3Cg fill='none' stroke='%237b8f6a' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M83 210C74 150 78 80 105 10'/%3E%3Cpath d='M80 170c-28-4-48-18-61-42'/%3E%3Cpath d='M82 143c-24-16-38-39-42-68'/%3E%3Cpath d='M87 111c24-17 43-23 61-18'/%3E%3Cpath d='M80 182c26 1 46 12 60 31'/%3E%3C/g%3E%3C/svg%3E") center/contain no-repeat;
}

.leaves-a { top: 150px; left: 3%; transform: rotate(-14deg); }
.leaves-b { right: 4%; bottom: 6%; transform: rotate(18deg); }

.footer-card {
    min-height: 250px;
    background: linear-gradient(135deg, var(--ivory), var(--parchment));
}

.footer-watermark {
    position: absolute;
    right: -18px;
    bottom: -34px;
    width: 210px;
    height: 210px;
    opacity: 0.06;
    fill: none;
    stroke: var(--sage);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@media (max-width: 1199px) {
    .masonry-board { column-count: 2; }
}

@media (max-width: 767px) {
    .top-ribbon {
        align-items: flex-start;
        flex-direction: column;
        padding: 8px 14px 10px;
    }
    .topic-filter { justify-content: flex-start; }
    .masonry-board {
        column-count: 1;
        padding-top: 18px;
    }
    .first-lower { margin-top: 0; }
    .salon-card { padding: 24px 20px; }
}

@media (max-width: 480px) {
    .filter-pill { font-size: 0.72rem; padding: 5px 10px; }
    .faux-photo { height: 180px; }
}
