:root {
    --bg: #f7f3ee;
    --surface: #ffffff;
    --text-primary: #1c1c24;
    --text-secondary: #6b6b6b;
    --accent-sapphire: #1a3a5c;
    --accent-emerald: #1a5c3a;
    --accent-amethyst: #5c1a5c;
    --accent-ruby: #8b1a1a;
    --accent-amber: #a67c00;
    --border-light: #d4cfc7;
    --font-display: 'Josefin Sans', sans-serif;
    --font-body: 'Cormorant Garamond', serif;
    --font-mono: 'Fira Code', monospace;
    --page-padding: clamp(1rem, 4vw, 3rem);
    --grid-gap: clamp(1.5rem, 3vw, 2.5rem);
    --max-width: 1200px;
}

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

body {
    background-color: var(--bg);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: clamp(0.95rem, 1.2vw, 1.05rem);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

/* ===== HERO ===== */
.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-frame {
    position: absolute;
    top: 4vw;
    left: 4vw;
    right: 4vw;
    bottom: 4vw;
    width: calc(100% - 8vw);
    height: calc(100% - 8vw);
}

.hero-frame-rect {
    fill: none;
    stroke: var(--accent-sapphire);
    stroke-width: 1;
    stroke-dasharray: 2592;
    stroke-dashoffset: 2592;
    animation: drawFrame 1.8s ease-in-out forwards;
}

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

.hero-content {
    text-align: center;
    z-index: 1;
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(3rem, 8vw, 7rem);
    letter-spacing: 0.02em;
    color: var(--text-primary);
    opacity: 0;
    animation: fadeIn 0.8s ease forwards 0.6s;
}

.hero-subtitle {
    font-family: var(--font-body);
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1rem, 2vw, 1.3rem);
    color: var(--text-secondary);
    margin-top: 0.75rem;
    opacity: 0;
    animation: fadeIn 0.8s ease forwards 1.2s;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

.scroll-hint {
    position: absolute;
    bottom: 6vw;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    animation: fadeIn 0.8s ease forwards 2s;
}

.scroll-chevron {
    display: block;
    width: 10px;
    height: 10px;
    border-left: 1px solid var(--text-secondary);
    border-bottom: 1px solid var(--text-secondary);
    transform: rotate(-45deg);
    animation: bob 2s ease-in-out infinite;
}

@keyframes bob {
    0%, 100% { transform: rotate(-45deg) translateY(0); }
    50% { transform: rotate(-45deg) translateY(3px); }
}

/* ===== SIGIL DIVIDER ===== */
.sigil-divider {
    position: relative;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2.5rem var(--page-padding);
}

.sigil-divider hr {
    border: none;
    border-top: 1px solid var(--border-light);
}

.sigil-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    border: 1px solid var(--border-light);
    border-radius: 50%;
    background: var(--bg);
}

.sigil-h, .sigil-v {
    position: absolute;
    background: var(--border-light);
}

.sigil-h {
    width: 10px;
    height: 1px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.sigil-v {
    width: 1px;
    height: 10px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* ===== CLASSIFICATION INDEX ===== */
.classification-index {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1rem var(--page-padding) 3rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.category-pill {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text-secondary);
    padding: 0.35rem 0.85rem;
    border-left: 3px solid;
    background: var(--surface);
    border-radius: 2px;
}

/* ===== SPECIMEN GRID ===== */
.specimen-grid {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--page-padding) 5rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--grid-gap);
}

.specimen-card {
    position: relative;
    background: var(--surface);
    padding: 1.25rem;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(28,28,36,0.06);
    border-left: 3px solid var(--border-light);
    transform: scale(0.92);
    opacity: 0;
    filter: blur(1px);
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                opacity 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                filter 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.specimen-card[data-accent="#1a5c3a"] { border-left-color: var(--accent-emerald); }
.specimen-card[data-accent="#1a3a5c"] { border-left-color: var(--accent-sapphire); }
.specimen-card[data-accent="#5c1a5c"] { border-left-color: var(--accent-amethyst); }
.specimen-card[data-accent="#8b1a1a"] { border-left-color: var(--accent-ruby); }
.specimen-card[data-accent="#a67c00"] { border-left-color: var(--accent-amber); }

.specimen-card.in-view {
    transform: scale(1);
    opacity: 1;
    filter: blur(0);
}

.specimen-card.expanded {
    grid-row: span 2;
}

/* Corner Brackets */
.corner-bracket {
    position: absolute;
    width: 8px;
    height: 8px;
    pointer-events: none;
}

.corner-bracket.tl {
    top: 4px; left: 4px;
    border-top: 1px solid var(--border-light);
    border-left: 1px solid var(--border-light);
}
.corner-bracket.tr {
    top: 4px; right: 4px;
    border-top: 1px solid var(--border-light);
    border-right: 1px solid var(--border-light);
}
.corner-bracket.bl {
    bottom: 4px; left: 4px;
    border-bottom: 1px solid var(--border-light);
    border-left: 1px solid var(--border-light);
}
.corner-bracket.br {
    bottom: 4px; right: 4px;
    border-bottom: 1px solid var(--border-light);
    border-right: 1px solid var(--border-light);
}

/* Card Internals */
.card-illustration {
    width: 120px;
    height: 160px;
    margin: 0 auto 1rem;
}

.card-illustration svg {
    width: 100%;
    height: 100%;
}

.card-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.card-body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(0.95rem, 1.2vw, 1.05rem);
    line-height: 1.7;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.card-classification {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto;
}

.cat-pill {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-secondary);
    padding: 0.15rem 0.5rem;
    border: 1px solid;
    border-radius: 2px;
}

.specimen-label {
    font-family: var(--font-mono);
    font-weight: 300;
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    padding: 0.15rem 0.5rem;
    border: 1px solid var(--border-light);
}

/* ===== COLOPHON ===== */
.colophon {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem var(--page-padding) 5rem;
    text-align: center;
}

.colophon-text {
    font-family: var(--font-mono);
    font-weight: 300;
    font-size: 0.85rem;
    color: var(--text-secondary);
    letter-spacing: 0.04em;
}

.colophon-rule {
    border: none;
    border-top: 1px solid var(--border-light);
    max-width: 120px;
    margin: 1.5rem auto;
}

.colophon-sigil {
    width: 40px;
    margin: 0 auto;
}

.colophon-sigil svg {
    width: 100%;
    height: auto;
}
