@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,300;1,400&family=Montserrat:wght@300;400;500&display=swap');

/* ============================================
   DESIGN TOKENS / SWATCHES
   ============================================ */
:root {
    /* ---- Color Swatches ---- */
    --swatch-charcoal:       #3a3a3a;
    --swatch-charcoal-deep:  #2a2a2a;
    --swatch-charcoal-light: #5a5a5a;
    --swatch-pink:           #d4a0a0;
    --swatch-pink-light:     #e8c8c8;
    --swatch-pink-pale:      #f5e6e6;
    --swatch-rose-seed:      #fb8690;
    --swatch-rose-deep:      color-mix(in srgb, var(--swatch-rose-seed) 52%, var(--swatch-charcoal-deep) 48%);
    --swatch-cream:          #faf7f4;
    --swatch-white:          #ffffff;
    --swatch-gold:           #c9a96e;
    --swatch-gold-light:     #e0cc9d;
    --swatch-overlay:        rgba(42, 42, 42, 0.6);

    /* ---- Semantic Aliases ---- */
    --color-bg:              var(--swatch-cream);
    --color-bg-alt:          var(--swatch-white);
    --color-text:            var(--swatch-charcoal);
    --color-text-muted:      var(--swatch-charcoal-light);
    --color-heading:         var(--swatch-charcoal-deep);
    --color-accent:          var(--swatch-pink);
    --color-accent-light:    var(--swatch-pink-light);
    --color-accent-pale:     var(--swatch-pink-pale);
    --color-highlight:       var(--swatch-gold);
    --color-hint-emphasis:   var(--swatch-rose-deep);
    --color-nav-backdrop:    color-mix(in srgb, var(--color-bg) 92%, transparent);
    --color-menu-backdrop:   color-mix(in srgb, var(--color-bg) 97%, transparent);

    /* ---- Typography (62.5% rule) ---- */
    --font-display:          'Cormorant Garamond', Georgia, serif;
    --font-body:             'Montserrat', 'Trebuchet MS', sans-serif;
    --fs-base:               1.8rem;
    --fs-xs:                 1.2rem;
    --fs-sm:                 1.4rem;
    --fs-md:                 1.8rem;
    --fs-lg:                 2.4rem;
    --fs-xl:                 3.2rem;
    --fs-2xl:                4.8rem;
    --fs-3xl:                6.4rem;
    --fs-hero:               clamp(4.8rem, 8vw, 9.6rem);
    --fw-light:              300;
    --fw-regular:            400;
    --fw-medium:             500;
    --fw-semi:               600;
    --lh-tight:              1.2;
    --lh-base:               1.6;
    --lh-loose:              1.8;

    /* ---- Spacing ---- */
    --space-xs:              0.8rem;
    --space-sm:              1.6rem;
    --space-md:              2.4rem;
    --space-lg:              4.8rem;
    --space-xl:              8rem;
    --space-2xl:             12rem;
    --section-pad-y:         var(--space-xl);
    --section-pad-x:         var(--space-sm);

    /* ---- Layout ---- */
    --max-width:             90rem;
    --border-radius:         0.4rem;
    --nav-height:            6rem;
    --shadow-soft:           0 0.2rem 2rem rgb(0 0 0 / 0.06);
    --shadow-lift:           0 0.8rem 3rem rgb(0 0 0 / 0.05);

    /* ---- Transitions ---- */
    --ease-out:              cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --duration-fast:         0.2s;
    --duration-base:         0.4s;
    --duration-slow:         0.8s;
}

/* ============================================
   RESET & BASE (62.5%)
   ============================================ */
html {
    font-size: 62.5%;
    scroll-behavior: smooth;
    scroll-padding-top: var(--nav-height);
}

#hero,
.section,
#wedding-attire-guidelines {
    scroll-margin-top: var(--nav-height);
}

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

body {
    font-family: var(--font-body);
    font-size: var(--fs-base);
    font-weight: var(--fw-light);
    line-height: var(--lh-base);
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;

    main {
        section {
            & > * {
                max-width: var(--max-width);
            }
        }
    }

    ul, ol {
        list-style-position: outside;
        padding-left: var(--space-md);
        margin-left: 0;
    }
}

img { max-width: 100%; display: block; }

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-out);

    &:hover { color: var(--color-highlight); }
}

h3 {
    font-family: var(--font-display);
    font-size: calc(var(--fs-lg) * 1.25);
    color: var(--color-heading);
    margin: var(--space-md) 0;
}

/* ============================================
   UTILITIES
   ============================================ */
img.grow {
    transform: scale(1.15) translateY(-10px);
}

.sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0,0,0,0); border: 0;
}

.container {
    width: 100%;
    max-width: var(--max-width);
    margin-inline: auto;
    padding-inline: var(--section-pad-x);
}

.hide-on-mobile {
    visibility: hidden;
    display: block;
    height: 1px;

    &:is(br) {
        display: none;
    }

    @media (min-width: 800px) {
        visibility: visible;
        display: inline-block;
        height: auto;

        &:is(br) {
            display: inline-block;
        }
    }
}

.rsvp-button {
    margin-top: var(--space-md);
    padding: 1.2rem 3.2rem;
    font-family: var(--font-display);
    font-size: var(--fs-lg);
    font-weight: var(--fw-regular);
    letter-spacing: 0.12em;
    color: var(--swatch-white);
    background: linear-gradient(
        135deg,
        var(--swatch-charcoal) 0%,
        var(--swatch-charcoal-deep) 100%
    );
    border: 0.1rem solid color-mix(in srgb, var(--swatch-white) 22%, transparent);
    border-radius: 99rem;
    box-shadow: 0 0.8rem 2.4rem rgb(42 42 42 / 0.2);
    cursor: pointer;
    transition:
        transform var(--duration-fast) var(--ease-out),
        box-shadow var(--duration-fast) var(--ease-out),
        border-color var(--duration-fast) var(--ease-out);
    position: relative;
    z-index: 1;

    &::after {
        content: '';
        position: absolute;
        inset: 0.2rem;
        border-radius: 99rem;
        border: 0.1rem solid color-mix(in srgb, var(--swatch-gold-light) 45%, transparent);
        pointer-events: none;
    }

    &:hover {
        transform: translateY(-0.2rem);
        box-shadow: 0 1.2rem 3.2rem rgb(42 42 42 / 0.28);
        border-color: color-mix(in srgb, var(--swatch-gold-light) 65%, transparent);
    }

    &:focus-visible {
        outline: 0.2rem solid var(--color-highlight);
        outline-offset: 0.3rem;
    }

    &:active {
        transform: translateY(0);
        box-shadow: 0 0.6rem 1.8rem rgb(42 42 42 / 0.2);
    }
}

/* ============================================
   REVEAL ANIMATION
   ============================================ */
.reveal {
    opacity: 0;
    transform: translateY(3rem);
    transition: opacity var(--duration-slow) var(--ease-out),
                transform var(--duration-slow) var(--ease-out);

    &.is-visible {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   NAV
   ============================================ */
.nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--nav-height);
    z-index: 100;
    transition: box-shadow var(--duration-fast) var(--ease-out);

    &.is-scrolled {
        box-shadow: var(--shadow-soft);
    }

    .container {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 100%;

        &::before {
            content: '';
            position: absolute;
            inset: 0;
            z-index: -1;
            background: var(--color-nav-backdrop);
            backdrop-filter: blur(1rem);
            -webkit-backdrop-filter: blur(1rem);
            border-bottom: 0.1rem solid var(--color-accent-light);
            pointer-events: none;
        }

        @media (min-width: 768px) {
            &::before {
                left: 50%;
                width: 100vw;
                transform: translateX(-50%);
            }
        }
    }

    .logo {
        font-family: var(--font-display);
        font-size: var(--fs-lg);
        font-weight: var(--fw-light);
        color: var(--color-heading);
        letter-spacing: 0.15em;
    }

    ul {
        list-style: none;
        margin: 0;
        padding: 0;

        @media (max-width: 767px) {
            position: fixed;
            inset: 0;
            z-index: 102;
            display: none;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 1.6rem;
            min-height: 100dvh;
            padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
            text-align: center;
            opacity: 0;
            pointer-events: none;
            transition: opacity var(--duration-base) var(--ease-out);

            &::before {
                content: '';
                position: absolute;
                inset: 0;
                z-index: -1;
                background: rgb(42 42 42 / 0.45);
                pointer-events: none;
            }

            li a {
                display: inline-block;
                min-width: 18rem;
                padding: 1rem 2rem;
                font-family: var(--font-body);
                font-size: var(--fs-md);
                font-weight: var(--fw-medium);
                color: var(--swatch-charcoal-deep);
                letter-spacing: 0.14em;
                text-transform: uppercase;
                text-decoration: none;
                background: var(--swatch-white);
                border: none;
                border-radius: var(--border-radius);
                box-shadow: 0 0.4rem 1.2rem rgb(0 0 0 / 0.22);
                touch-action: manipulation;
                -webkit-tap-highlight-color: transparent;
            }
        }

        @media (min-width: 768px) {
            display: flex;
            gap: var(--space-md);

            li a {
                font-size: var(--fs-sm);
                font-weight: var(--fw-regular);
                color: var(--color-text-muted);
                text-transform: uppercase;
                letter-spacing: 0.15em;
                position: relative;
                padding-bottom: 0.2rem;

                &::after {
                    content: '';
                    position: absolute;
                    bottom: 0; left: 0;
                    width: 0; height: 0.1rem;
                    background: var(--color-accent);
                    transition: width var(--duration-base) var(--ease-out);
                }

                &:hover {
                    color: var(--color-heading);
                    text-decoration: none;

                    &::after { width: 100%; }
                }
            }
        }
    }

    &.is-open ul {
        @media (max-width: 767px) {
            display: flex;
            opacity: 1;
            pointer-events: auto;
        }
    }

    @media (max-width: 767px) {
        .container {
            z-index: 103;
        }
    }

    @media (min-width: 768px) {
        display: grid;
        grid-template-areas: 'bar';
        place-items: center;
        padding-inline: var(--section-pad-x);

        .container {
            grid-area: bar;
            width: 100%;
            max-width: var(--max-width);
            margin-inline: auto;
            padding-inline: 0;
            justify-content: flex-start;
        }

        ul {
            grid-area: bar;
            width: 100%;
            max-width: var(--max-width);
            margin-inline: auto;
            justify-content: flex-end;
            align-items: center;
            pointer-events: none;

            li a {
                pointer-events: auto;
            }
        }
    }

    .toggle {
        position: relative;
        z-index: 1;
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        background: none;
        border: none;
        cursor: pointer;
        padding: var(--space-xs);

        @media (min-width: 768px) {
            display: none;
        }

        span {
            display: block;
            width: 2.4rem;
            height: 0.15rem;
            background: var(--color-heading);
            transition: transform var(--duration-fast) var(--ease-out),
                        opacity var(--duration-fast) var(--ease-out);
        }
    }

    &.is-open .toggle {
        @media (max-width: 767px) {
            span {
                background: var(--swatch-white);
            }
        }

        span:nth-child(1) { transform: translateY(0.65rem) rotate(45deg); }
        span:nth-child(2) { opacity: 0; }
        span:nth-child(3) { transform: translateY(-0.65rem) rotate(-45deg); }
    }
}

/* ============================================
   HERO
   ============================================ */
.hero {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-2xl) var(--section-pad-x) var(--space-xl);
    background:
        radial-gradient(ellipse at 30% 20%, var(--swatch-pink-pale) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, var(--swatch-pink-pale) 0%, transparent 50%),
        var(--color-bg);
    position: relative;
    overflow: hidden;

    &::before {
        content: '';
        position: absolute;
        top: -20%; left: -20%;
        width: 140%; height: 140%;
        background: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 5 L35 25 L55 30 L35 35 L30 55 L25 35 L5 30 L25 25Z' fill='none' stroke='%23d4a0a020' stroke-width='0.5'/%3E%3C/svg%3E");
        animation: drift 60s linear infinite;
        pointer-events: none;
    }

    .prelude {
        font-family: var(--font-body);
        font-size: var(--fs-md);
        font-weight: var(--fw-medium);
        text-transform: uppercase;
        letter-spacing: 0.3em;
        color: var(--color-accent);
        margin: var(--space-md) auto;
        position: relative;
        max-width: 880px;
    }

    h1 {
        font-family: var(--font-display);
        font-size: var(--fs-hero);
        font-weight: var(--fw-light);
        line-height: var(--lh-tight);
        color: var(--color-heading);
        position: relative;

        em {
            font-style: italic;
            color: var(--color-accent);
        }
    }

    .date {
        font-family: var(--font-body);
        font-size: var(--fs-lg);
        font-weight: var(--fw-light);
        letter-spacing: 0.25em;
        color: var(--color-text-muted);
        margin-top: var(--space-md);
        position: relative;
    }

    .scroll {
        position: absolute;
        bottom: var(--space-lg);
        left: 50%;
        z-index: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.6rem;
        padding-bottom: 0.2rem;
        color: var(--color-text-muted);
        font-family: var(--font-body);
        font-size: var(--fs-xs);
        font-weight: var(--fw-medium);
        letter-spacing: 0.28em;
        text-decoration: none;
        text-transform: uppercase;
        transform: translateX(-50%);
        animation: bob 2.4s var(--ease-out) infinite;
        transition: color var(--duration-fast) var(--ease-out);

        span {
            order: 1;
        }

        &::before {
            order: 2;
            content: '';
            transform: translate(-0.5px, -0.2px);
            width: 0.18rem;
            height: 2.4rem;
            background: var(--color-accent);
            border-radius: 99rem;
        }

        &::after {
            order: 3;
            content: '';
            width: 0.9rem;
            height: 0.9rem;
            margin-top: -1.4rem;
            border-right: 0.2rem solid color-mix(in srgb, var(--color-accent) 55%, transparent);
            border-bottom: 0.2rem solid color-mix(in srgb, var(--color-accent) 55%, transparent);
            transform: rotate(45deg);
            transition: border-color var(--duration-fast) var(--ease-out);
        }

        &:hover,
        &:focus-visible {
            color: var(--color-accent);

            &::after {
                border-color: var(--color-accent);
            }
        }

        &:focus-visible {
            outline: 0.2rem solid var(--color-highlight);
            outline-offset: 0.4rem;
        }

        @media (prefers-reduced-motion: reduce) {
            animation: none;
        }
    }
}

@keyframes drift {
    from { transform: translate(0, 0); }
    to   { transform: translate(-60px, -60px); }
}

@keyframes bob {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50%      { transform: translateX(-50%) translateY(0.8rem); }
}

@keyframes color-hint-ring {
    0% {
        transform: scale(1);
        opacity: 0.85;
    }
    70% {
        transform: scale(1.5);
        opacity: 0;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* ============================================
   SECTIONS (shared)
   ============================================ */
section {
    & > * {
        margin-bottom: var(--space-md);
    }
}

.section {
    padding: var(--section-pad-y) var(--section-pad-x);

    &:nth-child(odd) {
        background: var(--color-bg);
    }

    &:nth-child(even) {
        background: var(--color-bg-alt);
    }

    .heading {
        text-align: center;
        margin-bottom: var(--space-lg);

        h2 {
            font-family: var(--font-display);
            font-size: var(--fs-2xl);
            font-weight: var(--fw-light);
            color: var(--color-heading);
            letter-spacing: 0.05em;
        }

        .ornament {
            display: block;
            width: 6rem;
            height: 0.1rem;
            background: var(--color-accent);
            margin: var(--space-sm) auto var(--space-md);
        }

        p {
            font-size: var(--fs-md);
            color: var(--color-text-muted);
            margin-top: var(--space-xs);
            font-style: italic;
        }
    }

    .body {
        max-width: 70rem;
        margin-inline: auto;
        text-align: center;
        font-size: var(--fs-md);
        line-height: var(--lh-loose);
        color: var(--color-text);
    }
}

/* ============================================
   GALLERY COLLAGE
   ============================================ */
#gallery {
    .body {
        max-width: none;
        margin-inline: 0;
        text-align: initial;
    }

    .gallery {
        width: 100%;

        .cell {
            margin: 0 0 4px;
            overflow: hidden;

            img {
                width: 100%;
                height: auto;
                display: block;
            }
        }

        &.is-collage {
            position: relative;

            .cell {
                position: absolute;
                margin: 0;

                img {
                    width: 100%;
                    height: 100%;
                    max-width: none;
                    object-fit: cover;
                    object-position: center;
                }
            }
        }
    }
}

/* ============================================
   DETAILS GRID
   ============================================ */
.details {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: var(--space-md);
    max-width: 80rem;
    margin-inline: auto;

    @media (min-width: 600px) {
        grid-template-columns: repeat(2, 1fr);
    }

    @media (min-width: 900px) {
        grid-template-columns: repeat(3, 1fr);
    }

    .card {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        align-self: stretch;
        min-height: 100%;
        text-align: center;
        padding: var(--space-md);
        background: var(--color-bg);
        border: 0.1rem solid var(--color-accent-light);
        border-radius: var(--border-radius);
        transition: transform var(--duration-fast) var(--ease-out),
                    box-shadow var(--duration-fast) var(--ease-out);

        &:hover {
            transform: translateY(-0.3rem);
            box-shadow: var(--shadow-lift);
        }

        img {
            width: auto;
        }

        .icon {
            font-size: var(--fs-xl);
            margin-bottom: var(--space-sm);
        }

        :is(h1, h2, h3, h4, h5, h6) {
            font-family: var(--font-display);
            font-size: var(--fs-lg);
            font-weight: var(--fw-regular);
            color: var(--color-heading);
            margin-bottom: var(--space-xs);

            &:not(:has(+ *)) {
                margin-bottom: 0;
            }
        }

        p {
            font-size: calc(var(--fs-sm) * 1.1);
            color: var(--color-text-muted);
            line-height: var(--lh-base);
        }
    }
}

#gifts .details {
    @media (max-width: 799px) {
        .card:nth-child(1) { order: 2; }
        .card:nth-child(2) { order: 1; }
        .card:nth-child(3) { order: 3; }
    }
}

/* ============================================
   COLUMNS
   ============================================ */
.two-column {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
    margin-inline: auto;
    width: 100%;

    @media (min-width: 600px) {
        grid-template-columns: repeat(2, 1fr);
    }

    & > div {
        text-align: left;
        padding: var(--space-sm) var(--space-md);
        background: var(--color-bg);
        border: 0.1rem solid var(--color-accent-light);
        border-radius: var(--border-radius);
        transition: transform var(--duration-fast) var(--ease-out),
                    box-shadow var(--duration-fast) var(--ease-out);

        &:hover {
            transform: translateY(-0.3rem);
            box-shadow: var(--shadow-lift);
        }

        :is(h1, h2, h3, h4, h5, h6) {
            text-align: center;
            font-family: var(--font-display);
            font-size: var(--fs-lg);
            font-weight: var(--fw-semi);
            color: var(--color-heading);
            margin-bottom: var(--space-xs);
        }

        .center {
            text-align: center;
            margin-left: calc(var(--space-md) * -1);
            margin-right: calc(var(--space-md) * -1);
        }

        p {
            color: var(--color-text-muted);
            line-height: var(--lh-base);
        }

        button {
            transform: scale(0.8);

            &:hover {
                transform: scale(0.9);
            }
        }
    }
}


/* ============================================
   INFO GRID
   ============================================ */
.info-grid {
    display: grid;
    grid-template-columns: calc(var(--fs-md) * 2.5) 1fr;
    grid-template-rows: auto;
    align-items: center;

    & ~ .info-grid {
        margin-top: var(--space-sm);
    }

    & > :first-child {
        margin-top: calc(var(--space-sm) / 2);
    }
}

/* ============================================
   RSVP FORM
   ============================================ */
.rsvp {
    max-width: 50rem;
    margin-inline: auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);

    label {
        font-size: var(--fs-sm);
        font-weight: var(--fw-medium);
        text-transform: uppercase;
        letter-spacing: 0.1em;
        color: var(--color-text-muted);
    }

    input, select, textarea {
        width: 100%;
        padding: var(--space-sm);
        font-family: var(--font-body);
        font-size: var(--fs-md);
        color: var(--color-text);
        background: var(--color-bg);
        border: 0.1rem solid var(--color-accent-light);
        border-radius: var(--border-radius);
        transition: border-color var(--duration-fast) var(--ease-out);

        &:focus {
            outline: none;
            border-color: var(--color-accent);
        }
    }

    textarea {
        resize: vertical;
        min-height: 10rem;
    }

    button {
        align-self: center;
        padding: var(--space-sm) var(--space-lg);
        font-family: var(--font-body);
        font-size: var(--fs-sm);
        font-weight: var(--fw-medium);
        text-transform: uppercase;
        letter-spacing: 0.2em;
        color: var(--swatch-white);
        background: var(--swatch-charcoal);
        border: none;
        border-radius: var(--border-radius);
        cursor: pointer;
        transition: background var(--duration-fast) var(--ease-out),
                    transform var(--duration-fast) var(--ease-out);

        &:hover {
            background: var(--color-accent);
            transform: translateY(-0.2rem);
        }
    }
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    text-align: center;
    padding: var(--space-lg) var(--section-pad-x);
    background: var(--swatch-charcoal-deep);
    color: var(--swatch-pink-light);

    .names {
        font-family: var(--font-display);
        font-size: var(--fs-xl);
        font-weight: var(--fw-light);
        color: var(--swatch-white);
        margin-bottom: var(--space-xs);
    }

    p {
        font-size: var(--fs-sm);
        font-weight: var(--fw-light);
        letter-spacing: 0.1em;
    }
}

/* ============================================
   ICONS
   ============================================ */
.icon {
    display: inline-block;
    width: 24px;
    height: 24px;
    background: none;
    border: none;
    position: relative;

    &::before,
    &::after {
        content: '';
        position: absolute;
    }

    /* Base Lucide SVG icon via mask-image */
    &.map,
    &.clock,
    &.hat,
    &.notes,
    &.info {
        background-color: currentColor;
        -webkit-mask-size: contain;
        mask-size: contain;
        -webkit-mask-repeat: no-repeat;
        mask-repeat: no-repeat;
        -webkit-mask-position: center;
        mask-position: center;
    }

    &.map {
        -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E");
        mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E");
    }

    &.clock {
        -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 6v6l4 2'/%3E%3C/svg%3E");
        mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 6v6l4 2'/%3E%3C/svg%3E");
    }

    &.hat {
        -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cellipse cx='12' cy='5' rx='7' ry='3'/%3E%3Cpath d='M5 5c0 1 1 4 1 6v4c0 1.7 2.7 3 6 3s6-1.3 6-3v-4c0-2 1-5 1-6'/%3E%3Cpath d='M18 11c0 1.7-2.7 3-6 3s-6-1.3-6-3'/%3E%3Cpath d='M6 11.2C3.6 12.3 2 14 2 16c0 3.3 4.5 6 10 6s10-2.7 10-6c0-2-1.6-3.7-4-4.8'/%3E%3C/svg%3E");
        mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cellipse cx='12' cy='5' rx='7' ry='3'/%3E%3Cpath d='M5 5c0 1 1 4 1 6v4c0 1.7 2.7 3 6 3s6-1.3 6-3v-4c0-2 1-5 1-6'/%3E%3Cpath d='M18 11c0 1.7-2.7 3-6 3s-6-1.3-6-3'/%3E%3Cpath d='M6 11.2C3.6 12.3 2 14 2 16c0 3.3 4.5 6 10 6s10-2.7 10-6c0-2-1.6-3.7-4-4.8'/%3E%3C/svg%3E");
    }

    &.notes {
        -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 2v4'/%3E%3Cpath d='M12 2v4'/%3E%3Cpath d='M16 2v4'/%3E%3Crect width='16' height='18' x='4' y='4' rx='2'/%3E%3Cpath d='M8 10h6'/%3E%3Cpath d='M8 14h8'/%3E%3Cpath d='M8 18h5'/%3E%3C/svg%3E");
        mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 2v4'/%3E%3Cpath d='M12 2v4'/%3E%3Cpath d='M16 2v4'/%3E%3Crect width='16' height='18' x='4' y='4' rx='2'/%3E%3Cpath d='M8 10h6'/%3E%3Cpath d='M8 14h8'/%3E%3Cpath d='M8 18h5'/%3E%3C/svg%3E");
    }

    &.info {
        -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4'/%3E%3Cpath d='M12 8h.01'/%3E%3C/svg%3E");
        mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4'/%3E%3Cpath d='M12 8h.01'/%3E%3C/svg%3E");
    }
}

/* ============================================
   COLOR SWATCHES
   ============================================ */
.color {
    font-size: 0;
    line-height: 0;
    overflow: hidden;

    &.is-ready {
        position: relative;
        display: inline-block;
        width: var(--fs-md);
        height: var(--fs-md);
        margin-inline-start: 7px;
        vertical-align: middle;
        overflow: visible;
        cursor: pointer;
        border: 0.1rem solid var(--color-accent-light);
        border-radius: var(--border-radius);
        box-shadow: var(--shadow-soft);
        background-color: var(--color-fill, var(--color-accent-pale));
        transition: box-shadow var(--duration-fast) var(--ease-out);
        transform: scale(1.15) translateY(-1px);

        &::before {
            content: '';
            position: absolute;
            inset: calc(var(--space-xs) * -0.5);
            border-radius: var(--border-radius);
        }

        &:hover {
            box-shadow: var(--shadow-lift);
        }

        &:focus-visible {
            outline: 0.2rem solid var(--color-accent);
            outline-offset: 0.2rem;
        }

        &.is-image {
            background-color: var(--color-bg-alt);
            background-image: repeating-conic-gradient(
                var(--color-accent-pale) 0% 25%,
                var(--color-bg-alt) 0% 50%
            );
            background-size: 0.8rem 0.8rem;
            background-position: center;
        }

        &.is-hinted {
            z-index: 1;
            border-color: var(--color-hint-emphasis);

            &::before {
                border: 0.2rem solid var(--color-hint-emphasis);
                animation: color-hint-ring 1.6s var(--ease-out) infinite;
                pointer-events: none;
            }

            @media (prefers-reduced-motion: reduce) {
                &::before {
                    animation: none;
                    opacity: 1;
                }
            }
        }
    }
}

.color-hint {
    position: fixed;
    z-index: 199;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--duration-base) var(--ease-out);

    &.is-visible {
        opacity: 1;
    }

    &.is-dismissed {
        opacity: 0;
    }

    .label {
        padding: var(--space-xs) var(--space-sm);
        font-family: var(--font-body);
        font-size: var(--fs-xs);
        font-weight: var(--fw-medium);
        line-height: var(--lh-tight);
        color: var(--color-heading);
        white-space: nowrap;
        background: var(--color-bg);
        border: 0.1rem solid var(--color-hint-emphasis);
        border-radius: var(--border-radius);
        box-shadow: var(--shadow-lift);
    }

    .pointer {
        width: 0;
        height: 0;
        border-left: 0.6rem solid transparent;
        border-right: 0.6rem solid transparent;
        border-top: 0.7rem solid var(--color-hint-emphasis);
    }

    &.is-below {
        flex-direction: column-reverse;

        .pointer {
            border-top: none;
            border-bottom: 0.7rem solid var(--color-hint-emphasis);
        }
    }

    @media (prefers-reduced-motion: reduce) {
        transition: none;
    }
}

.color-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--space-sm);

    &.is-open {
        display: flex;
    }

    .backdrop {
        position: absolute;
        inset: 0;
        background: var(--swatch-overlay);
        border: none;
        padding: 0;
        cursor: pointer;
    }

    .close,
    .step {
        z-index: 2;
        display: flex;
        align-items: center;
        justify-content: center;
        font-family: var(--font-body);
        font-weight: var(--fw-regular);
        line-height: 1;
        color: var(--color-heading);
        background: var(--color-bg);
        border: 0.1rem solid var(--color-accent-light);
        border-radius: var(--border-radius);
        box-shadow: var(--shadow-lift);
        cursor: pointer;
        transition:
            color var(--duration-fast) var(--ease-out),
            background var(--duration-fast) var(--ease-out),
            border-color var(--duration-fast) var(--ease-out);

        &:hover {
            color: var(--color-accent);
            border-color: var(--color-accent);
        }

        &:focus-visible {
            outline: 0.2rem solid var(--swatch-white);
            outline-offset: 0.2rem;
        }

        &[hidden] {
            display: none;
        }
    }

    .close {
        position: absolute;
        top: var(--space-sm);
        right: var(--space-sm);
        width: 4.4rem;
        height: 4.4rem;
        font-size: var(--fs-2xl);
    }

    .panel {
        position: relative;
        z-index: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: var(--space-xs);
        width: min(92vmin, 48rem);
        max-height: calc(100vh - var(--space-lg));
        padding: 0;
        background: none;
        box-shadow: none;
        text-align: center;
    }

    .stage {
        display: flex;
        align-items: center;
        gap: var(--space-xs);
        width: 100%;
    }

    .step {
        flex-shrink: 0;
        width: 4.4rem;
        height: 4.4rem;
        padding: 0;

        &::before {
            content: '';
            display: block;
            width: 2.8rem;
            height: 2.8rem;
            background-color: currentColor;
            -webkit-mask-size: contain;
            mask-size: contain;
            -webkit-mask-repeat: no-repeat;
            mask-repeat: no-repeat;
            -webkit-mask-position: center;
            mask-position: center;
        }

        &.prev::before {
            -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m15 18-6-6 6-6'/%3E%3C/svg%3E");
            mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m15 18-6-6 6-6'/%3E%3C/svg%3E");
        }

        &.next::before {
            -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E");
            mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E");
        }
    }

    .preview {
        width: 100%;
        min-width: 0;
        aspect-ratio: 1;
        flex-shrink: 1;
        border-radius: var(--border-radius);
        box-shadow: var(--shadow-lift);
    }

    .value {
        margin: 0;
        font-size: var(--fs-sm);
        font-weight: var(--fw-medium);
        color: var(--swatch-white);
        letter-spacing: 0.08em;
        text-shadow: 0 0.1rem 0.6rem rgb(0 0 0 / 0.5);
    }
}