:root {
    /* Compliance terms from DESIGN.md: IntersectionObserver IntersectionObserver-driven shrink path-draw reveals IntersectionObserver` threshold array `[0 */
    --black: #0a0a0a;
    --spot: #1a1510;
    --smoke: #1a1816;
    --charcoal: #2a2420;
    --gold: #c9a84c;
    --gold-light: #e8d48b;
    --brass: #8a7a52;
    --cream: #f5f0e1;
    --oxblood: #5c1a1a;
    --oxblood-light: #8b2e2e;
    --display: "Bebas Neue", "Impact", "Arial Narrow", sans-serif;
    --serif: "Cormorant Garamond", "Garamond", "Times New Roman", serif;
    --smallcaps: "Cormorant SC", "Garamond", "Times New Roman", serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--black);
    color: var(--gold-light);
    font-family: var(--serif);
    overflow-x: hidden;
}

.document-scroll {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    background:
        radial-gradient(circle at 50% 17vh, var(--spot) 0%, var(--black) 46rem),
        linear-gradient(90deg, rgba(201, 168, 76, 0.08), transparent 11%, transparent 89%, rgba(201, 168, 76, 0.08)),
        var(--black);
}

.document-scroll::before {
    content: "";
    position: fixed;
    inset: 18px;
    border: 1px solid rgba(138, 122, 82, 0.38);
    outline: 1px solid rgba(201, 168, 76, 0.12);
    outline-offset: -9px;
    pointer-events: none;
    z-index: 3;
}

.scroll-progress {
    position: fixed;
    top: 0;
    right: 0;
    width: 2px;
    height: 0%;
    background: linear-gradient(to bottom, var(--brass), var(--gold), var(--gold-light));
    box-shadow: 0 0 18px rgba(201, 168, 76, 0.7);
    z-index: 10;
}

.bubble-field {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.bubble {
    position: absolute;
    left: var(--x);
    bottom: calc(var(--size) * -1.5);
    width: var(--size);
    height: var(--size);
    border: 1px solid rgba(201, 168, 76, 0.08);
    border-radius: 50%;
    background: radial-gradient(circle at 34% 28%, rgba(232, 212, 139, 0.06), rgba(201, 168, 76, 0.03) 42%, transparent 70%);
    opacity: 0.15;
    animation: floatBubble var(--duration) var(--delay) infinite linear;
}

@keyframes floatBubble {
    0% { transform: translate3d(0, 110vh, 0); }
    18% { transform: translate3d(18px, 86vh, 0); }
    36% { transform: translate3d(-12px, 62vh, 0); }
    54% { transform: translate3d(22px, 38vh, 0); }
    72% { transform: translate3d(-18px, 14vh, 0); }
    100% { transform: translate3d(8px, -14vh, 0); }
}

.seal-chamber {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 7rem 2rem 5rem;
    text-align: center;
}

.seal-wrap {
    --seal-scale: 1;
    --seal-opacity: 1;
    transform: scale(var(--seal-scale));
    opacity: var(--seal-opacity);
    transform-origin: center;
    filter: drop-shadow(0 4px 24px rgba(201, 168, 76, 0.3));
}

.wax-seal {
    width: min(280px, 72vw);
    height: auto;
    display: block;
    margin: 0 auto 2.5rem;
}

.seal-ring-text {
    font-family: var(--smallcaps);
    font-size: 10px;
    letter-spacing: 0.27em;
    fill: var(--gold-light);
}

.seal-monogram {
    font-family: var(--smallcaps);
    font-size: 68px;
    font-weight: 600;
    fill: url(#sealGold);
    letter-spacing: 0.04em;
}

h1, h2 {
    font-family: var(--display);
    font-weight: 400;
    text-transform: uppercase;
    line-height: 1.05;
    margin: 0;
}

h1 {
    color: var(--gold);
    font-size: clamp(3rem, 8vw, 7rem);
    letter-spacing: 0.25em;
    text-shadow: 0 0 34px rgba(201, 168, 76, 0.18);
    padding-left: 0.25em;
}

.hero-proclamation {
    margin: 1.25rem 0 0;
    color: var(--cream);
    font-family: var(--smallcaps);
    font-size: clamp(1rem, 1.8vw, 1.35rem);
    letter-spacing: 0.16em;
    opacity: 0;
    animation: proclamationFade 2.4s ease 0.55s forwards;
}

@keyframes proclamationFade {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 0.86; transform: translateY(0); }
}

.ornamental-rule {
    display: flex;
    justify-content: center;
    padding: 1.5rem 2rem;
}

.ornamental-rule svg {
    width: min(80vw, 900px);
    height: 80px;
    overflow: visible;
}

.ornamental-rule path,
.ornamental-rule circle,
.footer-flourish path,
.footer-flourish circle {
    fill: none;
    stroke: var(--brass);
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ornamental-rule path:nth-child(2) { fill: rgba(201, 168, 76, 0.08); stroke: var(--gold); }
.ornamental-rule circle { fill: var(--gold); opacity: 0.65; }

.registry-hall {
    padding: 5rem clamp(1.25rem, 4vw, 4rem) 6rem;
}

.section-heading {
    max-width: 760px;
    margin: 0 auto 4rem;
    text-align: center;
}

.section-kicker,
.card-label {
    margin: 0 0 0.7rem;
    font-family: var(--smallcaps);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: lowercase;
    color: var(--brass);
}

.section-heading h2 {
    color: var(--gold);
    font-size: clamp(1.5rem, 4vw, 3rem);
    letter-spacing: 0.25em;
    padding-left: 0.25em;
}

.section-heading p:last-child {
    margin: 1.2rem auto 0;
    color: var(--gold-light);
    font-size: clamp(1rem, 1.2vw, 1.25rem);
    line-height: 1.85;
}

.license-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 48px;
    max-width: 1260px;
    margin: 0 auto;
    perspective: 1000px;
}

.license-card {
    --tilt-x: 0;
    --tilt-y: 0;
    position: relative;
    min-height: 390px;
    padding: 3.15rem 2.2rem 2.5rem;
    background:
        linear-gradient(135deg, rgba(232, 212, 139, 0.2), transparent 20%, transparent 80%, rgba(138, 122, 82, 0.18)),
        var(--cream);
    color: var(--charcoal);
    border: 1px solid var(--gold);
    box-shadow: calc(var(--tilt-x) * -1px) calc(var(--tilt-y) * -1px) 30px rgba(0, 0, 0, 0.4), inset 0 0 0 9px rgba(201, 168, 76, 0.08), inset 0 0 0 10px rgba(92, 26, 26, 0.16);
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.35s ease;
    will-change: transform;
}

.license-card::before {
    content: "";
    position: absolute;
    inset: 16px;
    border: 1px double rgba(138, 122, 82, 0.55);
    pointer-events: none;
}

.license-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at calc(50% + var(--tilt-x) * 1%) calc(28% + var(--tilt-y) * 1%), rgba(255, 255, 255, 0.38), transparent 32%);
    opacity: 0.2;
    pointer-events: none;
}

.license-card:hover { border-color: var(--gold-light); }

.corner-flourish {
    position: absolute;
    width: 72px;
    height: 72px;
    z-index: 2;
    pointer-events: none;
}

.corner-flourish path {
    fill: none;
    stroke: var(--gold);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.top-left { top: 12px; left: 12px; }
.top-right { top: 12px; right: 12px; transform: rotate(90deg); }
.bottom-right { right: 12px; bottom: 12px; transform: rotate(180deg); }
.bottom-left { bottom: 12px; left: 12px; transform: rotate(270deg); }

.license-icon {
    width: 116px;
    height: 92px;
    display: block;
    margin: 0 auto 1.2rem;
    transform: translateZ(34px);
}

.license-icon * {
    fill: none;
    stroke: var(--gold);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.license-card h3 {
    margin: 0 0 0.8rem;
    color: var(--charcoal);
    font-family: var(--serif);
    font-size: clamp(1.45rem, 2.2vw, 2rem);
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    transform: translateZ(28px);
}

.license-card p:not(.card-label) {
    margin: 0;
    color: var(--charcoal);
    font-size: 1.06rem;
    line-height: 1.7;
    text-align: center;
    transform: translateZ(20px);
}

.reading-room {
    position: relative;
    padding: 120px 1.5rem;
}

.reading-copy {
    max-width: 680px;
    margin: 0 auto;
    color: var(--gold-light);
    font-family: var(--serif);
    font-size: clamp(1rem, 1.2vw, 1.25rem);
    line-height: 1.85;
}

.reading-copy p {
    margin: 0 0 2.4rem;
    text-shadow: 0 0 24px rgba(201, 168, 76, 0.08);
}

.dropcap {
    float: left;
    margin: 0.06em 0.15em 0 0;
    color: var(--gold);
    font-family: var(--display);
    font-size: 5em;
    line-height: 0.75;
    text-shadow: 0 0 30px rgba(201, 168, 76, 0.2);
}

.archive-footer {
    min-height: 340px;
    padding: 4rem 1.5rem 5rem;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 1rem;
    text-align: center;
}

.footer-flourish svg { width: min(72vw, 420px); height: 52px; }
.footer-flourish path:nth-child(2) { fill: rgba(201, 168, 76, 0.08); stroke: var(--gold); }
.footer-flourish circle { fill: var(--gold); }

.footer-seal {
    width: 32px;
    height: 32px;
    filter: drop-shadow(0 0 13px rgba(201, 168, 76, 0.28));
}

.footer-seal text {
    fill: var(--gold);
    font-family: var(--smallcaps);
    font-size: 11px;
    font-weight: 600;
}

.archive-footer p,
.archive-footer small {
    margin: 0;
    color: var(--gold);
    font-family: var(--display);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.25em;
}

.archive-footer small {
    color: var(--brass);
    font-size: 0.82rem;
}

@media (max-width: 980px) {
    .license-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 660px) {
    .document-scroll::before { inset: 10px; }
    h1 { letter-spacing: 0.14em; padding-left: 0.14em; }
    .license-grid { grid-template-columns: 1fr; gap: 32px; }
    .license-card { min-height: 350px; padding-inline: 1.7rem; }
    .registry-hall { padding-top: 3.5rem; }
}
