:root {
    /* Interactions should be tactile and ceremonial: hovering a phrase can press a rubber-stamp mark into nearby paper */
    --gold: #DFAE36;
    --purple: #2E2459;
    --paper: #F3E6C8;
    --ink: #111827;
    --gray: #4B5563;
    --red: #B7352D;
    --teal: #147C7C;
    --display: "Fraunces", serif;
    --body: "Libre Franklin", "Inter", sans-serif;
    --quote: "Newsreader", serif;
    --stamp: "Barlow Condensed", "Inter", sans-serif;
}

* { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    background: var(--ink);
}

body {
    margin: 0;
    color: var(--ink);
    font-family: var(--body);
    overflow-x: hidden;
}

.grain {
    position: fixed;
    inset: 0;
    z-index: 20;
    pointer-events: none;
    opacity: .18;
    mix-blend-mode: multiply;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(17, 24, 39, .18) 0 1px, transparent 1px),
        radial-gradient(circle at 70% 60%, rgba(46, 36, 89, .13) 0 1px, transparent 1px),
        linear-gradient(90deg, rgba(17, 24, 39, .04) 1px, transparent 1px);
    background-size: 17px 19px, 23px 29px, 7px 100%;
}

.day-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    z-index: 40;
    background: rgba(17, 24, 39, .22);
}

.day-progress span {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #DFAE36, #147C7C, #2E2459);
}

.act-nav {
    position: fixed;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 30;
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-family: var(--stamp);
    text-transform: uppercase;
    letter-spacing: .14em;
    font-size: 15px;
}

.act-nav a {
    color: var(--paper);
    text-decoration: none;
    padding: 8px 10px;
    border-left: 3px solid rgba(243, 230, 200, .34);
    background: rgba(17, 24, 39, .22);
    transition: transform .25s ease, border-color .25s ease, color .25s ease;
}

.act-nav a.active,
.act-nav a:hover {
    color: #DFAE36;
    border-color: #DFAE36;
    transform: translateX(-8px);
}

.act {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    padding: clamp(34px, 5vw, 78px);
    display: grid;
    align-items: center;
    isolation: isolate;
}

.act::before {
    content: attr(data-time);
    position: absolute;
    left: -1vw;
    bottom: -5vw;
    z-index: -1;
    font-family: var(--display);
    font-weight: 900;
    font-size: clamp(8rem, 28vw, 29rem);
    line-height: .7;
    opacity: .08;
    letter-spacing: -.08em;
}

.act::after {
    content: "";
    position: absolute;
    inset: 24px;
    border: 1px solid currentColor;
    opacity: .18;
    pointer-events: none;
}

.act-dawn { background: linear-gradient(122deg, #F3E6C8 0%, #F3E6C8 56%, #DFAE36 135%); color: #2E2459; }
.act-noon { background: linear-gradient(110deg, #DFAE36 -22%, #F3E6C8 38%, #147C7C 150%); color: #111827; }
.act-dusk { background: linear-gradient(132deg, #B7352D -25%, #F3E6C8 42%, #2E2459 142%); color: #111827; }
.act-midnight { background: radial-gradient(circle at 78% 24%, rgba(20,124,124,.55), transparent 32%), linear-gradient(135deg, #111827 0%, #2E2459 65%, #111827 100%); color: #F3E6C8; }

.act-grid {
    position: relative;
    z-index: 5;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(330px, .72fr);
    gap: clamp(28px, 6vw, 94px);
    align-items: center;
    width: min(1240px, 94vw);
}

.act-grid.reverse { grid-template-columns: minmax(340px, .8fr) minmax(0, 1.1fr); margin-left: auto; }

.masthead-block h1 {
    margin: 0;
    font-family: var(--display);
    font-weight: 900;
    font-size: clamp(5.7rem, 15vw, 17rem);
    letter-spacing: -.105em;
    line-height: .72;
    transform: translateX(-.08em);
    text-shadow: 0 1px 0 rgba(243, 230, 200, .55);
}

.subtitle {
    width: min(690px, 80vw);
    margin: 30px 0 0;
    font-family: var(--quote);
    font-size: clamp(1.45rem, 3vw, 3.8rem);
    line-height: .96;
    color: #4B5563;
}

.stamp {
    margin: 0 0 18px;
    font-family: var(--stamp);
    font-weight: 800;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: #B7352D;
}

.agenda-card,
.ballot-panel,
.record-ledger {
    position: relative;
    padding: clamp(24px, 4vw, 48px);
    background: rgba(243, 230, 200, .78);
    border: 2px solid rgba(17, 24, 39, .62);
    box-shadow: 16px 16px 0 rgba(17, 24, 39, .12);
}

.agenda-card::before,
.ballot-panel::before,
.record-ledger::before {
    content: "";
    position: absolute;
    inset: 10px;
    border: 1px dashed rgba(17, 24, 39, .42);
    pointer-events: none;
}

.card-number {
    position: absolute;
    top: -30px;
    right: 18px;
    width: 62px;
    height: 62px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #F3E6C8;
    background: #2E2459;
    font-family: var(--display);
    font-size: 2rem;
}

h2 {
    margin: 0 0 18px;
    font-family: var(--display);
    font-weight: 850;
    font-size: clamp(2.4rem, 5vw, 6.2rem);
    line-height: .82;
    letter-spacing: -.055em;
}

p { font-size: clamp(1rem, 1.35vw, 1.25rem); line-height: 1.55; }

blockquote {
    margin: 28px 0 0;
    padding-left: 22px;
    border-left: 5px solid #DFAE36;
    font-family: var(--quote);
    font-size: 1.45rem;
    line-height: 1.15;
    color: #2E2459;
}

.ballot-clock {
    position: absolute;
    right: clamp(-130px, -5vw, -40px);
    top: clamp(34px, 9vh, 96px);
    z-index: 2;
    width: clamp(280px, 38vw, 620px);
    aspect-ratio: 1;
    border: clamp(12px, 2vw, 24px) solid rgba(46, 36, 89, .32);
    border-radius: 50%;
    background:
        conic-gradient(from -30deg, transparent 0 12deg, rgba(183, 53, 45, .8) 12deg 17deg, transparent 17deg 30deg, rgba(223, 174, 54, .55) 30deg 36deg, transparent 36deg 100%),
        radial-gradient(circle, rgba(243, 230, 200, .55) 0 31%, transparent 32%);
    animation: dialFloat 10s ease-in-out infinite;
}

.ballot-clock::before {
    content: attr(data-label);
    position: absolute;
    inset: 13%;
    border: 1px solid rgba(17, 24, 39, .35);
    border-radius: 50%;
    display: grid;
    place-items: start center;
    padding-top: 18%;
    font-family: var(--stamp);
    font-size: clamp(1.1rem, 2vw, 2rem);
    letter-spacing: .26em;
    color: #B7352D;
}

.dial-hand {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 42%;
    height: 5px;
    background: #147C7C;
    transform-origin: left center;
    transform: rotate(var(--hand-angle, -35deg));
    transition: transform .35s ease-out;
}

.dial-core {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 86px;
    height: 86px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #F3E6C8;
    color: #2E2459;
    border: 4px solid #111827;
    font-family: var(--display);
    font-weight: 900;
    font-size: 2.8rem;
}

.light-sweep {
    position: absolute;
    inset: -20% -40%;
    background: linear-gradient(100deg, transparent 35%, rgba(255,255,255,.38) 46%, transparent 58%);
    transform: translateX(-36%);
    animation: sunriseSweep 8s ease-in-out infinite alternate;
}

.paper-sheet {
    position: absolute;
    width: 210px;
    height: 300px;
    background: rgba(243, 230, 200, .55);
    border: 1px solid rgba(17, 24, 39, .18);
    box-shadow: 0 20px 60px rgba(17, 24, 39, .14);
}
.sheet-one { left: 58%; bottom: 8%; transform: rotate(-11deg); animation: paperDrift 7s ease-in-out infinite; }
.sheet-two { left: 12%; top: 8%; transform: rotate(9deg); animation: paperDrift 9s ease-in-out infinite reverse; }

.assembly-lines {
    position: absolute;
    inset: 0;
    z-index: 1;
}
.assembly-lines i {
    position: absolute;
    left: 8%;
    width: 82%;
    height: 2px;
    background: rgba(46, 36, 89, .34);
    transform: rotate(var(--r));
}
.assembly-lines i:nth-child(1) { top: 18%; --r: -14deg; }
.assembly-lines i:nth-child(2) { top: 30%; --r: 9deg; }
.assembly-lines i:nth-child(3) { top: 46%; --r: -5deg; }
.assembly-lines i:nth-child(4) { top: 58%; --r: 16deg; }
.assembly-lines i:nth-child(5) { top: 73%; --r: -9deg; }
.assembly-lines i:nth-child(6) { top: 84%; --r: 5deg; }

.compact { left: -110px; right: auto; top: 46px; border-color: rgba(20,124,124,.45); }

.type-column h2 {
    color: #2E2459;
    font-size: clamp(4.5rem, 10vw, 12rem);
    max-width: 820px;
}
.editorial-note { font-family: var(--quote); font-size: clamp(1.6rem, 2.4vw, 3rem); color: #4B5563; }

.debate-meter { display: grid; gap: 13px; margin-top: 30px; font-family: var(--stamp); text-transform: uppercase; letter-spacing: .12em; }
.debate-meter span { position: relative; padding: 10px 12px; color: #F3E6C8; background: #2E2459; overflow: hidden; }
.debate-meter span::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); background: rgba(20, 124, 124, .65); z-index: -1; }

.perforation {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: repeating-linear-gradient(to bottom, #111827 0 10px, transparent 10px 24px);
    opacity: .38;
}
.dusk-dial { right: -80px; top: auto; bottom: -160px; border-color: rgba(183, 53, 45, .44); }
.ballot-grid { grid-template-columns: minmax(360px, .78fr) minmax(0, 1fr); }
.ballot-options { display: grid; gap: 14px; margin-top: 34px; }
.ballot-option {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    border: 2px solid #111827;
    background: rgba(243, 230, 200, .5);
    color: #111827;
    font-family: var(--body);
    font-weight: 800;
    font-size: 1rem;
    text-align: left;
    transition: background .25s ease, transform .25s ease;
}
.ballot-option span { width: 24px; height: 24px; border: 2px solid #111827; border-radius: 50%; display: inline-block; }
.ballot-option.selected { background: rgba(223, 174, 54, .5); transform: translateX(10px); }
.ballot-option.selected span { background: radial-gradient(circle, #B7352D 0 45%, transparent 47%); }
.tally-field { color: #F3E6C8; align-self: end; padding-bottom: 8vh; }
.caption { font-family: var(--quote); font-size: clamp(1.6rem, 3vw, 3.4rem); line-height: 1; }
.tallies { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 22px; color: #F3E6C8; font-family: var(--display); font-size: clamp(3rem, 7vw, 7rem); letter-spacing: -.05em; }
.tallies span { transform: rotate(-9deg); text-decoration: line-through; text-decoration-color: #DFAE36; }

.record-glow { position: absolute; inset: auto 0 0 0; height: 38vh; background: linear-gradient(0deg, rgba(20,124,124,.38), transparent); }
.midnight-dial { border-color: rgba(243,230,200,.2); right: -150px; top: 8%; color: #F3E6C8; }
.record-ledger { width: min(850px, 88vw); margin-inline: auto; background: rgba(17, 24, 39, .58); border-color: rgba(243, 230, 200, .55); box-shadow: 18px 18px 0 rgba(223, 174, 54, .16); }
.record-ledger::before { border-color: rgba(243, 230, 200, .38); }
.record-ledger h2 { color: #DFAE36; }
.ledger-rows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 32px; }
.ledger-rows span { padding: 14px; border-bottom: 1px solid rgba(243,230,200,.35); font-family: var(--stamp); letter-spacing: .13em; text-transform: uppercase; }
.seal { display: inline-grid; place-items: center; width: 150px; height: 150px; margin-top: 34px; border: 5px double #DFAE36; border-radius: 50%; color: #DFAE36; font-family: var(--stamp); letter-spacing: .12em; transform: rotate(-12deg); }

.act.in-view .agenda-card,
.act.in-view .ballot-panel,
.act.in-view .record-ledger,
.act.in-view .type-column,
.act.in-view .tally-field {
    animation: enterStage .75s ease both;
}

@keyframes dialFloat { 0%,100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(18px) rotate(3deg); } }
@keyframes sunriseSweep { to { transform: translateX(32%); } }
@keyframes paperDrift { 50% { translate: 12px -18px; rotate: 3deg; } }
@keyframes enterStage { from { opacity: .25; transform: translateY(34px) rotate(-1deg); } to { opacity: 1; transform: translateY(0) rotate(0); } }

@media (max-width: 900px) {
    .act { padding: 76px 22px 48px; }
    .act-grid,
    .act-grid.reverse,
    .ballot-grid { grid-template-columns: 1fr; width: 100%; }
    .act-nav { right: 8px; font-size: 12px; }
    .ballot-clock { opacity: .36; right: -180px; width: 430px; }
    .compact { left: auto; right: -190px; }
    .masthead-block h1 { font-size: clamp(5rem, 26vw, 9rem); }
    .ledger-rows { grid-template-columns: 1fr; }
}
