/* aiice.dev — McBling rhinestone terminal
   2005-era pastel cabochon notebook, single column.
   Motion vocabulary: ripple only. */

/* ==========================================================
   1. Tokens
   ========================================================== */
:root {
    /* paper + ink */
    --paper: #FBF7FF;
    --ink: #3A2E4D;

    /* pastel accents (OKLCH L*=85, C*=18 family) */
    --rose: #F2D8E8;
    --peri: #D7E5FB;
    --mint: #E6F4D9;
    --butter: #FFF1C7;
    --white: #FFFFFF;

    /* sizing */
    --col-w: min(640px, 92vw);
    --grid-step: 8px;

    /* type */
    --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
    --font-ui: 'Space Grotesk', 'JetBrains Mono', sans-serif;

    /* motion */
    --ripple-d: 540ms;
    --ripple-stagger: 90ms;
    --ease: cubic-bezier(0.2, 0.8, 0.2, 1);

    /* wordmark sparkle scale (used by inline svg) */
    --spark-scale: 1;
}

@property --spark-scale {
    syntax: '<number>';
    inherits: true;
    initial-value: 1;
}

/* ==========================================================
   2. Reset (lean)
   ========================================================== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
ul { list-style: none; margin: 0; padding: 0; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

/* ==========================================================
   3. Page
   ========================================================== */
html {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-mono);
    font-feature-settings: 'liga' 0, 'calt' 0;
    -webkit-font-smoothing: antialiased;
    text-rendering: geometricPrecision;
}

body {
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* 8px grid layer behind everything, hidden until grid reveal */
.grid-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    background-image:
        linear-gradient(to right, rgba(58, 46, 77, 0.04) 0.5px, transparent 0.5px),
        linear-gradient(to bottom, rgba(58, 46, 77, 0.04) 0.5px, transparent 0.5px);
    background-size: 8px 8px;
    transition: opacity 1.4s var(--ease);
}

.grid-layer.revealed {
    opacity: 1;
}

/* the central reveal ripple */
.grid-layer::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50vh;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border-radius: 50%;
    border: 1.5px solid var(--rose);
    opacity: 0;
    pointer-events: none;
}

.grid-layer.revealed::before {
    animation: grid-reveal-ripple 1.4s var(--ease) forwards;
}

@keyframes grid-reveal-ripple {
    0%   { opacity: 0.9; transform: scale(0); }
    40%  { opacity: 0.7; }
    100% { opacity: 0; transform: scale(180); }
}

/* ==========================================================
   4. Column
   ========================================================== */
.column {
    position: relative;
    z-index: 1;
    width: var(--col-w);
    margin: 0 auto;
    padding: 96px 0 32px;
}

/* every entry stacks; no card, no hero break */
.entry {
    position: relative;
    padding: 32px 0 32px;
    scroll-margin-top: 24px;
}

.entry-path {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 500;
    opacity: 0.45;
    letter-spacing: 0.02em;
    margin-bottom: 16px;
    color: var(--ink);
}

.entry-h {
    font-family: var(--font-mono);
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin: 0 0 24px;
}

.body {
    font-family: var(--font-mono);
    font-size: 15px;
    font-weight: 400;
    line-height: 1.7;
    margin: 0 0 16px;
    color: var(--ink);
}

/* slanted-mono marginalia (inline variant) */
.marg {
    font-style: italic;
    font-variation-settings: 'slnt' -10, 'wght' 300;
    font-size: 13px;
    letter-spacing: 0.01em;
    opacity: 0.7;
    display: inline;
    padding-left: 4px;
}

/* ==========================================================
   5. Hairlines (rhinestone dividers)
   ========================================================== */
.hairline {
    position: relative;
    z-index: 1;
    width: var(--col-w);
    margin: 16px auto;
    height: 12px;
    border-top: 1px dashed rgba(58, 46, 77, 0.18);
    border-top-style: dashed;
}

.hairline-gem {
    position: absolute;
    left: 50%;
    top: -3px;
    width: 6px;
    height: 6px;
    margin-left: -3px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 30% 30%, #FFFFFF 0%, #FFFFFF 35%, transparent 60%),
        var(--gem, var(--rose));
    box-shadow:
        inset 0 0 0 0.5px rgba(58, 46, 77, 0.3),
        0 0 6px 0 rgba(255, 255, 255, 0.6);
}

/* ==========================================================
   6. Section 00 — wordmark
   ========================================================== */
.wordmark {
    font-family: var(--font-mono);
    font-size: clamp(56px, 11vw, 132px);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1;
    margin: 8px 0 16px;
    color: var(--ink);
    display: inline-flex;
    align-items: baseline;
    gap: 0;
}

.wm-i {
    display: inline-block;
    width: 0.42em;
    height: 0.72em;
    position: relative;
    margin: 0 0.02em;
    transform: translateY(0.04em);
}

.wm-cab {
    position: absolute;
    inset: auto 0 0 0;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
}

.wm-i[data-wm-i="1"] .wm-cab { fill: url(#cab-rose); animation: wm-sparkle 7s infinite; }
.wm-i[data-wm-i="2"] .wm-cab { fill: url(#cab-peri); animation: wm-sparkle 7s infinite 3.5s; }

/* sparkle: 240ms scaling shimmer of the highlight, every 7s */
@keyframes wm-sparkle {
    0%, 96%   { --spark-scale: 1; transform: scale(1); filter: brightness(1); }
    97%       { transform: scale(1.06); filter: brightness(1.25); }
    98%       { transform: scale(1.04); filter: brightness(1.18); }
    100%      { transform: scale(1); filter: brightness(1); }
}

/* specular crescent rotates 12deg on hover (220ms) */
.wm-i:hover .cab-specular,
.cab-host:hover .cab-specular {
    transform-origin: center;
    transform: rotate(12deg);
    transition: transform 220ms var(--ease);
}

.timestamp {
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.04em;
    opacity: 0.55;
    text-transform: lowercase;
    margin: 0 0 8px;
}

.empty-space { height: 80px; }

/* ==========================================================
   7. Section 01 — mesh swatch (today's mood)
   ========================================================== */
.mesh-swatch-wrap {
    float: right;
    margin: 0 0 12px 16px;
    width: 64px;
    text-align: right;
    position: relative;
    z-index: 2;
}

.mesh-swatch {
    width: 64px;
    height: 64px;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    box-shadow:
        inset 0 0 0 0.5px rgba(58, 46, 77, 0.18),
        0 0 0 1px rgba(58, 46, 77, 0.04);
}

.mesh-swatch-inner {
    width: 200%;
    height: 200%;
    position: absolute;
    top: -50%;
    left: -50%;
    background:
        conic-gradient(
            from 15deg at 30% 35%,
            var(--rose),
            var(--peri),
            var(--mint),
            var(--butter),
            var(--rose)
        );
    filter: blur(8px) saturate(1.05);
    animation: mesh-drift 32s linear infinite;
}

@keyframes mesh-drift {
    0%   { transform: rotate(0deg) scale(1.1); }
    50%  { transform: rotate(180deg) scale(1.15); }
    100% { transform: rotate(360deg) scale(1.1); }
}

.mesh-swatch-label {
    display: inline-block;
    margin-top: 4px;
    font-family: var(--font-mono);
    font-size: 9px;
    font-style: italic;
    font-variation-settings: 'slnt' -10, 'wght' 300;
    letter-spacing: 0.02em;
    opacity: 0.6;
}

/* ==========================================================
   8. Section 02 — loss curve plot
   ========================================================== */
.plot-wrap {
    margin: 24px 0 8px;
    position: relative;
}

.loss-plot {
    width: 100%;
    height: auto;
    display: block;
}

.plot-label {
    font-family: var(--font-ui);
    font-size: 8px;
    font-weight: 500;
    fill: var(--ink);
    fill-opacity: 0.55;
}

.plot-marker {
    transition: transform 200ms var(--ease);
    transform-origin: center;
    transform-box: fill-box;
}

.plot-marker:hover { transform: scale(1.25); }

/* loss path animated by JS via a clip-path mask using ripple radius */
.loss-clip-mask {
    transition: r 1100ms var(--ease);
}

.plot-margin {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 16px;
}

.marg-line {
    font-family: var(--font-mono);
    font-size: 13px;
    font-style: italic;
    font-variation-settings: 'slnt' -10, 'wght' 300;
    letter-spacing: 0.01em;
    opacity: 0.7;
    display: flex;
    align-items: center;
    gap: 8px;
}

.marg-gem,
.inline-gem {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex: 0 0 6px;
    background:
        radial-gradient(circle at 30% 30%, #FFFFFF 0%, #FFFFFF 35%, transparent 60%),
        var(--gem, var(--rose));
    box-shadow:
        inset 0 0 0 0.5px rgba(58, 46, 77, 0.3),
        0 0 4px 0 rgba(255, 255, 255, 0.5);
    vertical-align: middle;
}

.inline-gem { margin: 0 2px; }

/* path-in animation by SVG dash trick */
@keyframes loss-path-in {
    0%   { stroke-dashoffset: 1200; opacity: 0.6; }
    100% { stroke-dashoffset: 0; opacity: 1; }
}

.loss-plot.path-in #loss-base {
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
    animation: loss-path-in 1100ms var(--ease) forwards;
}

.loss-plot.path-in #loss-bead {
    opacity: 0;
    animation: loss-bead-in 540ms var(--ease) 900ms forwards;
}

@keyframes loss-bead-in {
    0%   { opacity: 0; }
    100% { opacity: 0.6; }
}

.loss-plot.path-in .loss-ripple-origin {
    animation: loss-origin-ripple 1100ms var(--ease) forwards;
}

@keyframes loss-origin-ripple {
    0%   { r: 0; opacity: 0.8; }
    100% { r: 280; opacity: 0; }
}

/* ==========================================================
   9. Section 03 — ripple pad
   ========================================================== */
.ripple-pad-wrap {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
    position: relative;
}

.ripple-pad {
    width: 120px;
    height: 120px;
    border-radius: 16px;
    position: relative;
    overflow: visible;
    background:
        radial-gradient(circle at 30% 28%, var(--white) 0%, var(--rose) 18%, var(--peri) 60%, var(--mint) 100%);
    box-shadow:
        inset 0 0 0 0.5px rgba(58, 46, 77, 0.3),
        inset 0 -6px 10px -4px rgba(58, 46, 77, 0.08),
        inset 0 8px 10px -4px rgba(255, 255, 255, 0.6),
        0 6px 22px -10px rgba(58, 46, 77, 0.25);
    transition: transform 180ms var(--ease);
    cursor: pointer;
}

.ripple-pad:hover { transform: translateY(-1px); }
.ripple-pad:active { transform: translateY(1px); }

.ripple-pad-gem {
    position: absolute;
    top: 18px;
    left: 18px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 30% 30%, var(--white) 0%, var(--white) 35%, transparent 65%),
        var(--rose);
    box-shadow:
        inset 0 0 0 0.5px rgba(58, 46, 77, 0.3),
        0 0 8px 0 rgba(255, 255, 255, 0.8);
}

.ripple-pad-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    color: var(--ink);
    opacity: 0.7;
    letter-spacing: 0.03em;
}

.ripple-counter {
    font-family: var(--font-ui);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.04em;
    opacity: 0.55;
}

/* Ripple ring (injected by JS) */
.ripple-ring {
    position: absolute;
    pointer-events: none;
    border-radius: 50%;
    border-style: solid;
    border-width: 1.5px;
    opacity: 0.9;
    transform: translate(-50%, -50%) scale(0);
    will-change: transform, opacity;
}

.ripple-ring.go {
    animation: ripple-expand var(--ripple-d) var(--ease) forwards;
}

@keyframes ripple-expand {
    0%   { transform: translate(-50%, -50%) scale(0); opacity: 0.95; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

.jolt-target {
    transition: transform 260ms var(--ease);
}

.jolt-target.jolt {
    animation: jolt 260ms var(--ease);
}

@keyframes jolt {
    0%   { transform: translateY(0); }
    35%  { transform: translateY(-4px); }
    100% { transform: translateY(0); }
}

/* ==========================================================
   10. Section 04 — grid lines (heading reveal moment) — uses page-level layer
   ========================================================== */

/* ==========================================================
   11. Section 05 — mood strip
   ========================================================== */
.mood-strip-wrap {
    margin: 24px 0 8px;
    position: relative;
}

.mood-strip {
    width: 100%;
    height: 220px;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    box-shadow:
        inset 0 0 0 0.5px rgba(58, 46, 77, 0.18),
        0 0 0 1px rgba(58, 46, 77, 0.04);
}

.mood-strip-inner {
    position: absolute;
    inset: -10%;
    /* base conic seeded by JS via inline style; this is the fallback */
    background:
        conic-gradient(
            from 35deg at 20% 30%,
            var(--rose) 0%,
            var(--peri) 25%,
            var(--mint) 50%,
            var(--butter) 75%,
            var(--rose) 100%
        );
    filter: blur(20px) saturate(1.05);
    transform: scale(1.1);
}

.mood-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    padding: 0 4px;
}

.mood-label {
    font-family: var(--font-ui);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.05em;
    opacity: 0.7;
    text-transform: lowercase;
}

.mood-label[data-mood="tired"]   { color: #735c8a; }
.mood-label[data-mood="hopeful"] { color: #735c8a; }
.mood-label[data-mood="pissy"]   { color: #735c8a; }
.mood-label[data-mood="flow"]    { color: #735c8a; }
.mood-label[data-mood="done"]    { color: #735c8a; }

.mood-seed {
    display: block;
    margin-top: 8px;
    font-family: var(--font-mono);
    font-size: 9px;
    font-style: italic;
    font-variation-settings: 'slnt' -10, 'wght' 300;
    letter-spacing: 0.02em;
    opacity: 0.55;
    text-align: right;
}

/* ==========================================================
   12. Section 06 — changelog
   ========================================================== */
.changelog {
    margin: 16px 0 0;
}

.changelog-row {
    display: grid;
    grid-template-columns: 16px 64px 1fr;
    align-items: center;
    gap: 12px;
    padding: 10px 4px;
    border-bottom: 1px dashed rgba(58, 46, 77, 0.1);
    position: relative;
    overflow: visible;
    cursor: default;
}

.changelog-row:last-child { border-bottom: 0; }

.changelog-gem {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 30% 30%, #FFFFFF 0%, #FFFFFF 35%, transparent 60%),
        var(--gem, var(--rose));
    box-shadow:
        inset 0 0 0 0.5px rgba(58, 46, 77, 0.3),
        0 0 4px 0 rgba(255, 255, 255, 0.5);
    margin-left: 6px;
    transition: width 180ms var(--ease), height 180ms var(--ease), box-shadow 180ms var(--ease);
}

.changelog-ver {
    font-family: var(--font-ui);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.04em;
    padding: 3px 8px;
    border-radius: 999px;
    border: 0.5px solid rgba(58, 46, 77, 0.25);
    background: rgba(255, 255, 255, 0.5);
    text-align: center;
}

.changelog-note {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 400;
    color: var(--ink);
    transition: transform 180ms var(--ease);
}

.changelog-row:hover .changelog-gem {
    width: 8px;
    height: 8px;
    box-shadow:
        inset 0 0 0 0.5px rgba(58, 46, 77, 0.35),
        0 0 8px 1px rgba(255, 255, 255, 0.8);
}

.changelog-row:hover .changelog-note {
    transform: translateX(1px);
}

/* ==========================================================
   13. Section 07 — now playing status frame
   ========================================================== */
.status-frame {
    margin: 16px 0 8px;
    padding: 18px 18px 16px 22px;
    border: 1px dashed rgba(58, 46, 77, 0.25);
    border-radius: 6px;
    position: relative;
    background: rgba(255, 255, 255, 0.25);
}

.status-corner-gem {
    position: absolute;
    top: -4px;
    left: -4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 30% 30%, #FFFFFF 0%, #FFFFFF 35%, transparent 60%),
        var(--rose);
    box-shadow:
        inset 0 0 0 0.5px rgba(58, 46, 77, 0.3),
        0 0 6px 0 rgba(255, 255, 255, 0.6);
}

.status-line {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.6;
    color: var(--ink);
    margin: 2px 0;
}

.status-key {
    font-variation-settings: 'wght' 600;
    opacity: 0.85;
}

.status-val {
    opacity: 0.7;
}

/* ==========================================================
   14. Section 08 — coda
   ========================================================== */
.coda {
    font-family: var(--font-mono);
    font-size: 14px;
    font-style: italic;
    font-variation-settings: 'slnt' -10, 'wght' 300;
    letter-spacing: 0.01em;
    opacity: 0.75;
    margin: 16px 0 0;
}

.coda-bleed {
    height: 80px;
    margin-top: 16px;
    background-image:
        linear-gradient(to right, rgba(58, 46, 77, 0.06) 0.5px, transparent 0.5px),
        linear-gradient(to bottom, rgba(58, 46, 77, 0.06) 0.5px, transparent 0.5px);
    background-size: 8px 8px;
    opacity: 0.85;
}

/* ==========================================================
   15. Reduced motion
   ========================================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }

    .ripple-ring.go {
        animation: ripple-flash 120ms linear forwards !important;
    }

    @keyframes ripple-flash {
        0%   { opacity: 0.6; }
        100% { opacity: 0; }
    }

    .mesh-swatch-inner,
    .mood-strip-inner {
        animation: none !important;
    }
}

/* ==========================================================
   16. Small screens
   ========================================================== */
@media (max-width: 480px) {
    .column {
        padding: 64px 0 24px;
    }
    .mesh-swatch-wrap {
        float: none;
        margin: 0 0 12px 0;
    }
    .changelog-row {
        grid-template-columns: 16px 56px 1fr;
        gap: 8px;
    }
    .mood-strip {
        height: 180px;
    }
    .status-line {
        font-size: 10.5px;
    }
}
