/* ============================================================
   gur.al -- v2
   Swiss + sunset-warm, full-bleed, kinetic-animated, tilt-3D,
   data-viz, floating-elements, luxurious.

   Palette:
     #FFD7A1  apricot dawn
     #F4815B  persimmon
     #C56A3A  copper
     #F5E6D2  linen
     #4A1E3C  wine
     #1A0E1C  currant (ink)
     #FBF6EE  cream ink

   Type:
     Big Shoulders Display 400/800  -- display / kinetic
     Inter 400/500/700              -- headings + body
     JetBrains Mono 400             -- data / labels
   ============================================================ */

:root {
    --c-apricot: #FFD7A1;
    --c-persimmon: #F4815B;
    --c-copper: #C56A3A;
    --c-linen: #F5E6D2;
    --c-wine: #4A1E3C;
    --c-currant: #1A0E1C;
    --c-cream: #FBF6EE;

    --shadow-soft: 0 18px 40px rgba(26, 14, 28, 0.18);
    --shadow-tile: 0 22px 60px rgba(26, 14, 28, 0.22);

    --grid-cols: 12;
    --gutter: clamp(16px, 1.4vw, 28px);
    --pad-x: clamp(24px, 4vw, 80px);

    --font-display: "Big Shoulders Display", "Inter", sans-serif;
    --font-text: "Inter", system-ui, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

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

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

body {
    font-family: var(--font-text);
    color: var(--c-currant);
    background: var(--c-cream);
    overflow-x: hidden;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

.mono {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* ----- cursor halo ---------------------------------------- */
.cursor-halo {
    position: fixed;
    top: 0;
    left: 0;
    width: 480px;
    height: 480px;
    margin-top: -240px;
    margin-left: -240px;
    border-radius: 50%;
    background: radial-gradient(circle at center, rgba(244, 129, 91, 0.42) 0%, rgba(244, 129, 91, 0.10) 38%, rgba(244, 129, 91, 0) 70%);
    pointer-events: none;
    z-index: 1;
    transform: translate3d(50vw, 50vh, 0);
    mix-blend-mode: multiply;
    transition: opacity 600ms ease;
    opacity: 0.85;
}

@media (max-width: 720px) {
    .cursor-halo { display: none; }
}

/* ----- page scaffolding ----------------------------------- */
.page {
    position: relative;
    z-index: 2;
    scroll-snap-type: y proximity;
}

.section {
    position: relative;
    width: 100vw;
    min-height: 100svh;
    padding: clamp(32px, 5vh, 64px) var(--pad-x);
    overflow: hidden;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
}

.section-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    color: var(--c-currant);
    opacity: 0.85;
    padding-bottom: clamp(20px, 3vh, 40px);
}
.section-meta .meta-code,
.section-meta .meta-time {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.section-meta--copper { color: var(--c-currant); }
.section-meta--linen  { color: var(--c-currant); }
.section-meta--wine   { color: var(--c-cream); opacity: 0.9; }

/* ----- horizon rule (the structural device) --------------- */
.horizon-rule {
    position: relative;
    width: 100%;
    height: 1px;
    background: var(--c-currant);
    margin-top: auto;
}
.horizon-rule--inverse { background: var(--c-currant); }
.horizon-rule--currant { background: var(--c-currant); }
.horizon-rule--cream { background: var(--c-cream); }
.horizon-rule--top { margin-top: 0; margin-bottom: auto; }

.ticks {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    pointer-events: none;
}
.ticks::before,
.ticks::after { content: none; }
.ticks > span {
    position: relative;
    height: 8px;
    border-left: 1px solid currentColor;
    color: inherit;
    opacity: 0.8;
}
.horizon-rule--cream .ticks > span { color: var(--c-cream); }
.horizon-rule .ticks > span:last-child {
    border-right: 1px solid currentColor;
}

/* ============================================================
   SECTION 01 -- HORIZON
============================================================ */
.section--horizon {
    color: var(--c-currant);
    background: var(--c-wine); /* base; gradient overlay reveals on load */
    isolation: isolate;
}

.horizon-sky {
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg,
        var(--c-apricot) 0%,
        #FBA77B 28%,
        var(--c-persimmon) 50%,
        #8E3349 78%,
        var(--c-wine) 100%);
    transform: translateY(0);
    will-change: transform;
}

.section--horizon .section-meta { color: var(--c-currant); }

.hero {
    flex: 1;
    display: grid;
    grid-template-columns: 5fr 7fr;
    gap: var(--gutter);
    align-items: center;
    padding: clamp(20px, 4vh, 60px) 0;
}

.hero-left {
    align-self: end;
    max-width: 36ch;
}

.hero-eyebrow {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--c-currant);
    margin-bottom: 8px;
}
.hero-eyebrow--ko {
    font-family: var(--font-text);
    text-transform: none;
    letter-spacing: 0.02em;
    font-size: 13px;
    color: var(--c-currant);
    opacity: 0.72;
    margin-bottom: 28px;
}

.hero-lede {
    font-family: var(--font-text);
    font-weight: 500;
    font-size: clamp(15px, 1.3vw, 18px);
    line-height: 1.55;
    color: var(--c-currant);
}

.hero-right {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.hero-mark {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(96px, 18vw, 320px);
    line-height: 0.84;
    letter-spacing: -0.03em;
    color: var(--c-currant);
    display: inline-flex;
    align-items: flex-end;
    perspective: 1200px;
}

.kglyph {
    display: inline-block;
    transform-origin: 50% 70%;
    will-change: transform;
    animation: kfloat var(--kdur, 4s) ease-in-out infinite;
    animation-delay: var(--kdelay, 0s);
}
.kglyph--dot {
    color: var(--c-persimmon);
    margin: 0 0.04em 0.06em;
}
.kglyph--big {
    color: var(--c-cream);
    font-size: clamp(96px, 22vw, 280px);
    font-weight: 800;
    line-height: 1;
}

@keyframes kfloat {
    0%   { transform: translateY(0) rotate(0deg) scale(1); }
    50%  { transform: translateY(var(--ky, -6px)) rotate(var(--krot, 1.4deg)) scale(var(--kscl, 1.02)); }
    100% { transform: translateY(0) rotate(0deg) scale(1); }
}

.hero-foot {
    display: flex;
    gap: clamp(20px, 3vw, 56px);
    flex-wrap: wrap;
    padding: 18px 0 8px;
    color: var(--c-currant);
    opacity: 0.78;
}

.scroll-cue {
    position: absolute;
    right: var(--pad-x);
    bottom: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--c-currant);
    opacity: 0.7;
}
.scroll-cue .scroll-line {
    width: 56px;
    height: 1px;
    background: var(--c-currant);
    position: relative;
    overflow: hidden;
}
.scroll-cue .scroll-line::after {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--c-persimmon);
    transform: translateX(-100%);
    animation: scrollLine 2.6s ease-in-out infinite;
}
@keyframes scrollLine {
    0%   { transform: translateX(-100%); }
    50%  { transform: translateX(0); }
    100% { transform: translateX(120%); }
}

/* hero entry choreography */
.hero-eyebrow,
.hero-eyebrow--ko,
.hero-lede,
.hero-foot,
.scroll-cue {
    opacity: 0;
    transform: translateY(14px);
    animation: heroFadeUp 900ms ease-out forwards;
    animation-delay: 1100ms;
}
.hero-eyebrow--ko { animation-delay: 1180ms; }
.hero-lede { animation-delay: 1300ms; }
.hero-foot { animation-delay: 1500ms; opacity: 0.78; }
.scroll-cue { animation-delay: 1700ms; opacity: 0.7; }

@keyframes heroFadeUp {
    to { opacity: 1; transform: translateY(0); }
}
.hero-foot.is-loaded { opacity: 0.78; }

.hero-mark .kglyph {
    opacity: 0;
    transform: translateY(40px);
    animation:
        glyphDrop 700ms cubic-bezier(.2,.8,.2,1.05) forwards,
        kfloat var(--kdur, 4s) ease-in-out infinite;
    animation-delay: var(--kdelay, 0s), calc(var(--kdelay, 0s) + 700ms);
}
@keyframes glyphDrop {
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   SECTION 02 -- INDEX
============================================================ */
.section--index {
    background: var(--c-copper);
    color: var(--c-currant);
}

.index-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: clamp(24px, 4vh, 56px);
}

.index-head {
    max-width: 60ch;
}
.section-title {
    font-family: var(--font-text);
    font-weight: 700;
    font-size: clamp(28px, 4vw, 64px);
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--c-currant);
    margin-bottom: 12px;
}
.section-title--dark { color: var(--c-currant); }
.section-lede {
    font-size: clamp(15px, 1.1vw, 17px);
    color: var(--c-currant);
    opacity: 0.78;
    max-width: 52ch;
}
.section-lede--dark { color: var(--c-currant); }

.channels {
    display: grid;
    grid-template-columns: 1fr;
    border-top: 1px solid var(--c-currant);
}

.channel {
    display: grid;
    grid-template-columns: 1fr 4fr 6fr 3fr 2fr;
    align-items: center;
    gap: var(--gutter);
    padding: clamp(14px, 2vh, 22px) 0;
    border-bottom: 1px solid var(--c-currant);
    transform: perspective(1200px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
    transition: transform 320ms ease-out, background 240ms ease;
    will-change: transform;
    cursor: default;
}
.channel:hover {
    background: rgba(26, 14, 28, 0.06);
}

.channel-code {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--c-currant);
    opacity: 0.85;
}

.channel-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(20px, 2.4vw, 36px);
    line-height: 1;
    letter-spacing: -0.01em;
    color: var(--c-currant);
}

.channel-line {
    font-family: var(--font-text);
    font-size: clamp(13px, 1vw, 15px);
    color: var(--c-currant);
    opacity: 0.78;
}

.channel-spark {
    height: 26px;
    width: 100%;
    display: flex;
    align-items: flex-end;
    gap: 2px;
}
.channel-spark .bar {
    flex: 1;
    background: var(--c-currant);
    height: 30%;
    opacity: 0.85;
    transform-origin: bottom;
    transition: height 120ms linear;
}

.channel-amp {
    text-align: right;
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.08em;
    color: var(--c-currant);
    opacity: 0.85;
}

@media (max-width: 880px) {
    .channel {
        grid-template-columns: 1fr 4fr 3fr;
    }
    .channel-line, .channel-amp { display: none; }
}

/* ============================================================
   SECTION 03 -- FLOAT
============================================================ */
.section--float {
    background: var(--c-linen);
    color: var(--c-currant);
    min-height: 120svh;
}

.float-head {
    max-width: 64ch;
    padding-bottom: clamp(20px, 3vh, 40px);
}

.float-stage {
    position: relative;
    flex: 1;
    width: 100%;
    min-height: 60svh;
    overflow: hidden;
    border-top: 1px solid rgba(26, 14, 28, 0.18);
    border-bottom: 1px solid rgba(26, 14, 28, 0.18);
}

.tile {
    position: absolute;
    width: clamp(180px, 18vw, 260px);
    aspect-ratio: 4 / 5;
    background: linear-gradient(160deg, rgba(255, 215, 161, 0.55), rgba(244, 129, 91, 0.30));
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(26, 14, 28, 0.22);
    border-radius: 4px;
    box-shadow: var(--shadow-tile);
    color: var(--c-currant);
    padding: clamp(14px, 1.4vw, 22px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transform-origin: 50% 50%;
    transition: transform 320ms ease-out;
    will-change: transform;
}
.tile-syllable {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(64px, 7vw, 120px);
    line-height: 0.9;
    color: var(--c-currant);
    letter-spacing: -0.02em;
}
.tile-romaja {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--c-currant);
    opacity: 0.78;
}
.tile-meaning {
    font-family: var(--font-text);
    font-size: clamp(13px, 1vw, 15px);
    color: var(--c-currant);
    opacity: 0.85;
    line-height: 1.45;
}
.tile-code {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--c-currant);
    opacity: 0.6;
}

/* ============================================================
   SECTION 04 -- METER
============================================================ */
.section--meter {
    background: var(--c-wine);
    color: var(--c-cream);
}

.section--meter .section-meta { color: var(--c-cream); opacity: 0.9; }

.meter-head {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: clamp(12px, 2vh, 24px);
    color: var(--c-cream);
    padding-bottom: clamp(20px, 4vh, 60px);
}
.meter-eyebrow {
    color: var(--c-apricot);
    opacity: 0.92;
}

.meter-numerals {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(96px, 22vw, 280px);
    line-height: 0.88;
    letter-spacing: -0.03em;
    color: var(--c-cream);
    display: inline-flex;
    perspective: 1200px;
    animation: meterBreath 4.4s ease-in-out infinite;
}
@keyframes meterBreath {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.018); }
}

.meter-caption {
    color: var(--c-cream);
    opacity: 0.78;
    max-width: 48ch;
    font-size: clamp(15px, 1.1vw, 17px);
}

.meter-bars {
    display: grid;
    grid-template-columns: repeat(64, 1fr);
    gap: 3px;
    width: 100%;
    height: clamp(120px, 22vh, 220px);
    align-items: flex-end;
    padding-top: 12px;
}
.meter-bars .bar {
    background: var(--c-persimmon);
    width: 100%;
    height: 12%;
    transform-origin: bottom;
    border-radius: 1px;
    opacity: 0.92;
    transition: height 80ms linear;
}

@media (max-width: 720px) {
    .meter-bars { grid-template-columns: repeat(32, 1fr); }
}

/* ============================================================
   SECTION 05 -- EDGE (footer)
============================================================ */
.section--edge {
    background: var(--c-currant);
    color: var(--c-cream);
    min-height: 60vh;
    justify-content: space-between;
}

.section--edge .horizon-rule { background: var(--c-cream); }
.section--edge .ticks > span { color: var(--c-cream); }

.edge-grid {
    display: grid;
    grid-template-columns: 3fr 3fr 6fr;
    gap: var(--gutter);
    padding-top: clamp(40px, 6vh, 80px);
    flex: 1;
    align-items: end;
    padding-bottom: clamp(24px, 3vh, 40px);
}

.edge-title {
    color: var(--c-apricot);
    margin-bottom: 14px;
}
.edge-list li { padding: 4px 0; }
.edge-list a {
    color: var(--c-cream);
    opacity: 0.78;
    transition: opacity 220ms ease, color 220ms ease;
    border-bottom: 1px solid transparent;
    padding-bottom: 1px;
}
.edge-list a:hover {
    opacity: 1;
    color: var(--c-apricot);
    border-bottom-color: var(--c-apricot);
}

.edge-col--mark { text-align: right; }
.edge-mark {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(56px, 9vw, 140px);
    line-height: 0.9;
    letter-spacing: -0.03em;
    color: var(--c-cream);
}
.edge-coords { color: var(--c-apricot); opacity: 0.85; margin-top: 12px; }
.edge-rights { color: var(--c-cream); opacity: 0.55; margin-top: 6px; }

@media (max-width: 880px) {
    .hero { grid-template-columns: 1fr; gap: 24px; padding: 24px 0; }
    .hero-right { justify-content: flex-start; }
    .edge-grid { grid-template-columns: 1fr; gap: 28px; }
    .edge-col--mark { text-align: left; }
}

/* ----- entry: horizon line draw on load ------------------- */
.section--horizon .horizon-rule {
    transform-origin: 50% 50%;
    transform: scaleX(0);
    animation: hrDraw 1100ms cubic-bezier(.22,.85,.2,1) 350ms forwards;
}
@keyframes hrDraw { to { transform: scaleX(1); } }

/* fade-in for sky overlay (already tinted at base wine) */
.horizon-sky {
    opacity: 0;
    animation: skyBloom 1400ms ease-out 180ms forwards;
}
@keyframes skyBloom { to { opacity: 1; } }

/* keep cursor halo soft on dark sections by leveraging mix-blend on light grounds */
.section--meter ~ * .cursor-halo,
body:has(.section--meter:hover) .cursor-halo { /* future-proof */ }

/* small typographic flourish on hover for tiles + channels */
.channel:hover .channel-name { color: var(--c-currant); }
.tile:hover .tile-syllable { color: var(--c-wine); }
