/* ===========================================================================
   Wish Link
   ---------------------------------------------------------------------------
   One component set, twenty-four occasion identities. Every occasion supplies four HSL triples
   (--wl-primary, --wl-accent, --wl-bg, --wl-deep) as inline custom properties
   on .wl-scope, and everything below derives from them.

   Colours are stored as bare triples ("350 85% 55%") rather than finished
   colours so tints can be mixed with hsl(var(--wl-primary) / 0.12) without
   needing a second variable for every opacity step.
   =========================================================================== */

.wl-scope {
    --wl-primary-c: hsl(var(--wl-primary));
    --wl-accent-c:  hsl(var(--wl-accent));
    --wl-bg-c:      hsl(var(--wl-bg));
    --wl-deep-c:    hsl(var(--wl-deep));
    --wl-radius: 1rem;
    --wl-shadow: 0 10px 40px -10px hsl(var(--wl-primary) / .30);
    --wl-shadow-sm: 0 4px 20px -4px hsl(var(--wl-deep) / .15);
    --wl-gradient: linear-gradient(135deg,
                    hsl(var(--wl-primary)) 0%,
                    hsl(var(--wl-accent)) 100%);

    background: var(--wl-bg-c);
    color: var(--wl-deep-c);
}

/* --------------------------------------------------------------------- hero */

.wl-hero {
    background: linear-gradient(180deg,
                hsl(var(--wl-bg)) 0%,
                hsl(var(--wl-primary) / .10) 100%);
    padding: 3.5rem 1rem 3rem;
    text-align: center;
}

.wl-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .35rem 1rem;
    border-radius: 999px;
    background: hsl(var(--wl-primary) / .12);
    color: var(--wl-primary-c);
    font-size: .85rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
}

.wl-title {
    font-size: clamp(2rem, 5vw, 3.25rem);
    font-weight: 800;
    line-height: 1.1;
    color: var(--wl-deep-c);
    margin-bottom: .85rem;
}

.wl-title em {
    font-style: normal;
    color: var(--wl-primary-c);
}

.wl-sub {
    font-size: clamp(1rem, 2vw, 1.15rem);
    color: hsl(var(--wl-deep) / .72);
    max-width: 34rem;
    margin: 0 auto 1.75rem;
}

/* ------------------------------------------------------------------ buttons */

.wl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .85rem 1.9rem;
    border: none;
    border-radius: 999px;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}

.wl-btn-primary {
    background: var(--wl-gradient);
    color: #fff;
    box-shadow: var(--wl-shadow);
}

.wl-btn-primary:hover,
.wl-btn-primary:focus-visible {
    transform: translateY(-2px);
    color: #fff;
}

.wl-btn-ghost {
    background: #fff;
    color: var(--wl-primary-c);
    border: 2px solid hsl(var(--wl-primary) / .35);
}

.wl-btn-ghost:hover { color: var(--wl-deep-c); }

.wl-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* -------------------------------------------------------------------- cards */

.wl-card {
    background: #fff;
    border-radius: var(--wl-radius);
    box-shadow: var(--wl-shadow-sm);
    border: 1px solid hsl(var(--wl-primary) / .12);
    padding: 1.75rem;
}

/* Occasion grid on the hub */
.wl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}

.wl-occasion {
    display: block;
    text-align: center;
    text-decoration: none;
    padding: 1.5rem 1rem;
    border-radius: var(--wl-radius);
    background: #fff;
    border: 2px solid transparent;
    box-shadow: var(--wl-shadow-sm);
    transition: transform .18s ease, border-color .18s ease;
}

.wl-occasion:hover,
.wl-occasion:focus-visible {
    transform: translateY(-4px);
    border-color: var(--wl-o-primary, var(--wl-primary-c));
}

.wl-occasion-emoji { font-size: 2.25rem; display: block; margin-bottom: .5rem; }

.wl-occasion-name {
    font-weight: 700;
    color: var(--wl-o-primary, var(--wl-deep-c));
    display: block;
}

.wl-occasion-tag {
    font-size: .82rem;
    color: hsl(var(--wl-deep) / .6);
    display: block;
    margin-top: .25rem;
    line-height: 1.35;
}

/* -------------------------------------------------------------------- steps */

.wl-steps { counter-reset: wl-step; display: grid; gap: 1rem; }

.wl-step {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    background: #fff;
    border-radius: var(--wl-radius);
    padding: 1.25rem;
    box-shadow: var(--wl-shadow-sm);
}

.wl-step::before {
    counter-increment: wl-step;
    content: counter(wl-step);
    flex: 0 0 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: var(--wl-gradient);
    color: #fff;
    font-weight: 800;
    display: grid;
    place-items: center;
}

/* -------------------------------------------------------------------- forms */

.wl-field { margin-bottom: 1.25rem; }

.wl-label {
    display: block;
    font-weight: 600;
    margin-bottom: .4rem;
    color: var(--wl-deep-c);
}

.wl-input,
.wl-textarea {
    width: 100%;
    padding: .85rem 1rem;
    border-radius: .75rem;
    border: 2px solid hsl(var(--wl-primary) / .18);
    background: hsl(var(--wl-primary) / .04);
    color: var(--wl-deep-c);
    font-size: 1rem;
    font-family: inherit;
}

.wl-input:focus,
.wl-textarea:focus {
    outline: none;
    border-color: var(--wl-primary-c);
    background: #fff;
    box-shadow: 0 0 0 4px hsl(var(--wl-primary) / .12);
}

.wl-textarea { min-height: 9rem; resize: vertical; line-height: 1.6; }

.wl-hint { font-size: .85rem; color: hsl(var(--wl-deep) / .6); margin-top: .35rem; }

/* Theme picker */
.wl-themes { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .75rem; }

.wl-theme input { position: absolute; opacity: 0; pointer-events: none; }

.wl-theme span {
    display: block;
    padding: .9rem .75rem;
    text-align: center;
    border-radius: .75rem;
    border: 2px solid hsl(var(--wl-primary) / .18);
    background: #fff;
    cursor: pointer;
    font-weight: 600;
    font-size: .92rem;
    transition: border-color .15s ease, background .15s ease;
}

.wl-theme input:checked + span {
    border-color: var(--wl-primary-c);
    background: hsl(var(--wl-primary) / .08);
}

/* Keyboard users must still be able to see which option has focus. */
.wl-theme input:focus-visible + span {
    box-shadow: 0 0 0 4px hsl(var(--wl-primary) / .2);
}

/* ------------------------------------------------------------ recipient page */

.wl-stage {
    min-height: 100vh;
    min-height: 100dvh;          /* dvh avoids the mobile URL-bar jump */
    display: grid;
    place-items: center;
    padding: 1.25rem;
    background: radial-gradient(circle at 50% 0%,
                hsl(var(--wl-primary) / .16) 0%,
                hsl(var(--wl-bg)) 60%);
}

.wl-envelope {
    width: min(92vw, 30rem);
    text-align: center;
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
}

.wl-envelope-body {
    background: var(--wl-gradient);
    border-radius: var(--wl-radius);
    padding: 3.5rem 2rem;
    box-shadow: var(--wl-shadow);
    color: #fff;
    transition: transform .35s ease;
}

.wl-envelope:hover .wl-envelope-body { transform: translateY(-6px) scale(1.02); }

.wl-seal {
    width: 4.5rem;
    height: 4.5rem;
    margin: 0 auto 1.25rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, .22);
    display: grid;
    place-items: center;
    font-size: 2rem;
}

.wl-reveal {
    width: min(94vw, 34rem);
    background: #fff;
    border-radius: var(--wl-radius);
    box-shadow: var(--wl-shadow);
    padding: 2.25rem 1.75rem;
    text-align: center;
}

.wl-reveal-to {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--wl-primary-c);
    margin-bottom: .25rem;
}

.wl-reveal-from { color: hsl(var(--wl-deep) / .6); margin-bottom: 1.5rem; }

.wl-reveal-message {
    font-size: 1.1rem;
    line-height: 1.75;
    color: var(--wl-deep-c);
    white-space: pre-wrap;      /* keep the sender's line breaks */
    text-align: left;
    margin-bottom: 1.75rem;
}

.wl-question {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--wl-deep-c);
    margin-bottom: 1.25rem;
}

/* Reaction row */
.wl-reactions { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; }

.wl-reaction {
    font-size: 1.6rem;
    line-height: 1;
    padding: .6rem .75rem;
    border-radius: .75rem;
    border: 2px solid hsl(var(--wl-primary) / .18);
    background: #fff;
    cursor: pointer;
    transition: transform .15s ease, border-color .15s ease;
}

.wl-reaction:hover { transform: scale(1.12); border-color: var(--wl-primary-c); }
.wl-reaction.is-selected { border-color: var(--wl-primary-c); background: hsl(var(--wl-primary) / .1); }

/* The "no" button drifts away from the pointer. Pure decoration — the form
   still submits fine by keyboard, and it is disabled entirely for anyone who
   has asked for reduced motion. */
.wl-dodge { transition: transform .22s ease; }

/* ------------------------------------------------------------------ reveals */

@keyframes wl-fade-up {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: none; }
}

@keyframes wl-curtain-left  { to { transform: translateX(-105%); } }
@keyframes wl-curtain-right { to { transform: translateX(105%); } }

@keyframes wl-burst {
    0%   { opacity: 0; transform: scale(.7); }
    60%  { opacity: 1; transform: scale(1.06); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes wl-float {
    0%   { opacity: 0; transform: translateY(0) rotate(0deg); }
    12%  { opacity: 1; }
    100% { opacity: 0; transform: translateY(-85vh) rotate(320deg); }
}

.wl-anim-fade   { animation: wl-fade-up .7s ease both; }
.wl-anim-burst  { animation: wl-burst .6s cubic-bezier(.3, 1.4, .5, 1) both; }

.wl-curtain { position: fixed; inset: 0; z-index: 20; pointer-events: none; }
.wl-curtain > div {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50%;
    background: var(--wl-gradient);
}
.wl-curtain > div:first-child { left: 0;  animation: wl-curtain-left  .9s ease forwards; }
.wl-curtain > div:last-child  { right: 0; animation: wl-curtain-right .9s ease forwards; }

/* Floating particles during the reveal */
.wl-particles { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 5; }
.wl-particle {
    position: absolute;
    bottom: -2rem;
    font-size: 1.5rem;
    animation: wl-float linear forwards;
}

/* Respect the OS-level motion preference. Everything still renders, it just
   arrives instantly instead of animating. */
@media (prefers-reduced-motion: reduce) {
    .wl-anim-fade,
    .wl-anim-burst,
    .wl-curtain > div,
    .wl-particle {
        animation: none !important;
    }
    .wl-curtain { display: none; }
    .wl-particles { display: none; }
    .wl-dodge { transition: none; }
    .wl-envelope:hover .wl-envelope-body { transform: none; }
}

/* ------------------------------------------------------------------- shares */

.wl-linkbox {
    display: flex;
    gap: .5rem;
    align-items: stretch;
    flex-wrap: wrap;
}

.wl-linkbox input {
    flex: 1 1 14rem;
    min-width: 0;               /* lets the input shrink inside the flex row */
    padding: .8rem 1rem;
    border-radius: .75rem;
    border: 2px dashed hsl(var(--wl-primary) / .35);
    background: hsl(var(--wl-primary) / .05);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .95rem;
    color: var(--wl-deep-c);
}

.wl-share-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }

.wl-chip {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .6rem 1.1rem;
    border-radius: 999px;
    background: hsl(var(--wl-primary) / .1);
    color: var(--wl-primary-c);
    font-weight: 600;
    text-decoration: none;
    font-size: .92rem;
}

.wl-chip:hover { background: hsl(var(--wl-primary) / .18); color: var(--wl-deep-c); }

/* Browser-recovered creator library ------------------------------------ */
.wl-creator-library { min-height: 100vh; padding-bottom: 5rem; background: linear-gradient(145deg, #fff, hsl(var(--wl-bg)) 62%, hsl(var(--wl-primary) / .12)); }
.wl-library-hero { padding: clamp(3.5rem, 8vw, 7rem) max(1rem, calc((100% - 1040px)/2)) 3rem; }
.wl-library-hero .wl-back-link { display: table; margin-bottom: 2rem; color: hsl(var(--wl-deep) / .64); font-size: .78rem; font-weight: 800; text-decoration: none; }
.wl-library-hero h1 { max-width: 760px; margin: .25rem 0 .8rem; color: var(--wl-deep-c); font-size: clamp(3rem, 8vw, 6rem); font-weight: 800; line-height: .9; letter-spacing: -.055em; }
.wl-library-hero p { max-width: 620px; color: hsl(var(--wl-deep) / .64); line-height: 1.7; }
.wl-library-grid { width: min(calc(100% - 2rem), 1040px); margin: 0 auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.wl-library-card { position: relative; padding: clamp(1.5rem, 4vw, 2.4rem); display: grid; gap: 1.35rem; background: rgba(255,255,255,.92); border: 1px solid hsl(var(--wl-primary) / .12); box-shadow: 0 26px 60px -48px hsl(var(--wl-deep) / .65); }
.wl-library-index { position: absolute; top: 1.1rem; right: 1.2rem; color: hsl(var(--wl-primary) / .2); font-size: 2.35rem; font-weight: 800; line-height: 1; }
.wl-library-card small { color: var(--wl-primary-c); font-size: .62rem; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.wl-library-card h2 { margin: .4rem 0 .2rem; color: var(--wl-deep-c); font-size: 2rem; font-weight: 800; }
.wl-library-card p { margin: 0; color: hsl(var(--wl-deep) / .54); font-size: .78rem; }
.wl-library-card dl { margin: 0; padding: 1rem 0; display: grid; grid-template-columns: repeat(2, 1fr); border-block: 1px solid hsl(var(--wl-primary) / .12); }
.wl-library-card dl div { text-align: center; }
.wl-library-card dt { color: hsl(var(--wl-deep) / .48); font-size: .61rem; letter-spacing: .08em; text-transform: uppercase; }
.wl-library-card dd { margin: .2rem 0 0; color: var(--wl-primary-c); font-size: 1.75rem; font-weight: 800; line-height: 1; }
.wl-library-new { margin-top: 2rem; text-align: center; }
.wl-library-new a { color: var(--wl-primary-c); font-weight: 800; }

/* --------------------------------------------------------------------- misc */

.wl-section { padding: 3rem 0; }
.wl-section-title { font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 800; margin-bottom: 1.5rem; color: var(--wl-deep-c); }

.wl-note {
    background: hsl(var(--wl-accent) / .12);
    border-left: 4px solid var(--wl-accent-c);
    border-radius: .5rem;
    padding: 1rem 1.25rem;
    color: var(--wl-deep-c);
}

.wl-muted { color: hsl(var(--wl-deep) / .62); }

@media (max-width: 575.98px) {
    .wl-hero { padding: 2.5rem 1rem 2rem; }
    .wl-card { padding: 1.25rem; }
    .wl-reveal { padding: 1.75rem 1.25rem; }
    .wl-library-grid { grid-template-columns: 1fr; }
}
