/* pixel22 — "make your dreams come true"
   Deep space. One orchestrated moment: stars → warp → nebula → the words form
   out of stardust. After that, everything stays calm and lets you write. */

:root {
    --void:   #05041A;
    --deep:   #120E3A;
    --violet: #3B2A86;
    --rose:   #FF7AC8;
    --aurora: #6FF3E9;
    --star:   #FFF6E0;
    --gold:   #FFD27A;
    --muted:  rgba(255, 246, 224, .72);
    --line:   rgba(255, 246, 224, .16);
    --error:  #FFB3D9;

    --display: 'Cinzel', 'Trajan Pro', Georgia, serif;
    --sans:    'Hanken Grotesk', 'Helvetica Neue', Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; background: var(--void); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--void);
    color: var(--star);
    font-family: var(--sans);
    font-size: 18px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
h1, h2 { font-family: var(--display); font-weight: 600; margin: 0; }
p { margin: 0; }
a { color: inherit; }
::selection { background: var(--rose); color: var(--void); }
:focus-visible { outline: 2px solid var(--aurora); outline-offset: 4px; }

/* Space layers are 100vh — on phones that's the large viewport, so they keep
   their size while the address bar slides in and out. */
.nebula-wrap,
#space {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 0;
}
#space { display: block; }
.nebula-wrap { overflow: hidden; opacity: 0; will-change: opacity, transform; }
#nebula {
    position: absolute;
    top: -8%;
    left: -8%;
    width: 116%;
    height: 116%;
    animation: nebula-drift 80s ease-in-out infinite alternate;
}
@keyframes nebula-drift {
    from { transform: scale(1) rotate(-1.6deg); }
    to   { transform: scale(1.07) rotate(1.6deg); }
}
.no-js .nebula-wrap, .intro-done .nebula-wrap { opacity: 1; }
.bar, main, .foot { position: relative; z-index: 1; }

/* ---------------------------------------------------------------- mark */
.bar {
    position: absolute;
    inset: 0 0 auto 0;
    padding: 26px clamp(20px, 4vw, 48px);
    transition: opacity 1.2s ease;
}
.mark {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-family: var(--display);
    font-size: 19px;
    letter-spacing: .14em;
    text-decoration: none;
}
.mark-star,
.sent-star {
    display: inline-block;
    background: radial-gradient(circle, #fff 0%, var(--gold) 55%, var(--rose) 100%);
    clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
}
.mark-star { width: 18px; height: 18px; }

/* ---------------------------------------------------------------- hero */
.hero {
    min-height: 100vh;
    min-height: 100svh;
    display: grid;
    place-content: center;
    justify-items: center;
    text-align: center;
    padding: 120px clamp(20px, 5vw, 64px) 96px;
}
.hero h1 {
    font-size: clamp(42px, 8.6vw, 136px);
    line-height: 1.04;
    letter-spacing: .045em;
    max-width: 12ch;
    text-shadow: 0 0 28px rgba(255, 246, 224, .35), 0 0 80px rgba(185, 140, 255, .25);
}
.word { display: inline-block; white-space: nowrap; }
.ch { display: inline-block; }

.lede {
    margin-top: 30px;
    max-width: 34em;
    font-size: clamp(18px, 1.6vw, 21px);
    color: var(--muted);
}

.cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 44px;
    padding: 18px 36px;
    border-radius: 999px;
    border: 1px solid rgba(255, 246, 224, .4);
    background: linear-gradient(120deg, rgba(111, 243, 233, .16), rgba(185, 140, 255, .18) 50%, rgba(255, 122, 200, .18));
    color: var(--star);
    font: 600 17px/1 var(--sans);
    letter-spacing: .02em;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 0 40px rgba(185, 140, 255, .22), inset 0 0 20px rgba(255, 246, 224, .06);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    transition: box-shadow .35s ease, border-color .35s ease, background .35s ease;
}
.cta:hover {
    border-color: var(--star);
    background: linear-gradient(120deg, rgba(111, 243, 233, .28), rgba(185, 140, 255, .3) 50%, rgba(255, 122, 200, .3));
    box-shadow: 0 0 60px rgba(185, 140, 255, .45), inset 0 0 24px rgba(255, 246, 224, .1);
}
.cta[disabled] { opacity: .6; cursor: progress; }

.skip {
    position: fixed;
    right: clamp(16px, 3vw, 32px);
    bottom: clamp(16px, 3vw, 28px);
    z-index: 2;
    background: none;
    border: 0;
    padding: 8px 4px;
    color: var(--muted);
    font: 500 15px var(--sans);
    border-bottom: 1px solid rgba(255, 246, 224, .3);
    cursor: pointer;
}

/* ---- the intro timeline (classes set by site.js; without JS all is visible) */
.js .intro .ch { opacity: 0; }
.js .intro .lede,
.js .intro .hero .cta,
.js .intro .bar,
.js .intro .contact,
.js .intro .foot { opacity: 0; pointer-events: none; }
.js .intro.stage-title .ch {
    animation: materialize 1.5s cubic-bezier(.2, .7, .2, 1) both;
    animation-delay: calc(var(--i) * 65ms);
}
@keyframes materialize {
    0%   { opacity: 0; filter: blur(18px); transform: translateY(.3em) scale(1.5); }
    55%  { opacity: 1; filter: blur(0); }
    100% { opacity: 1; filter: blur(0); transform: none; }
}
.lede, .hero .cta, .bar, .contact, .foot { transition: opacity 1.2s ease; }
.intro-done .skip, .no-skip .skip { display: none; }

/* ---------------------------------------------------------------- contact */
#fx {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 3;
    pointer-events: none;
}

.contact {
    min-height: 100vh;
    min-height: 100svh;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: clamp(28px, 4vw, 44px);
    padding: 96px clamp(16px, 4vw, 48px);
    text-align: center;
}
.contact-head { max-width: 64rem; }
.contact-head h2 {
    font-size: clamp(36px, 6vw, 84px);
    line-height: 1.05;
    letter-spacing: .045em;
    text-shadow: 0 0 28px rgba(255, 246, 224, .35), 0 0 80px rgba(185, 140, 255, .25);
}
.contact-sub { margin-top: 18px; color: var(--muted); transition: opacity 1s ease .9s; }

/* letters that form out of stardust when their section is reached */
.js .dust .ch { opacity: 0; }
.js .dust.is-formed .ch {
    animation: materialize 1.5s cubic-bezier(.2, .7, .2, 1) both;
    animation-delay: calc(var(--i) * 55ms);
}
.js .contact:not(.is-revealed) .contact-sub { opacity: 0; }

/* the panel rises in once the heading has formed, framed by a slowly turning ring of aurora light */
@property --spin {
    syntax: '<angle>';
    inherits: false;
    initial-value: 0deg;
}
.panel {
    position: relative;
    width: min(620px, 100%);
    padding: clamp(28px, 5vw, 52px);
    border-radius: 28px;
    background: rgba(14, 11, 46, .58);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    backdrop-filter: blur(20px) saturate(150%);
    text-align: left;
    transition: opacity 1.3s ease, transform 1.3s cubic-bezier(.2, .8, .2, 1);
}
.panel::before,
.panel::after {
    content: '';
    position: absolute;
    border-radius: inherit;
    pointer-events: none;
    background: conic-gradient(from var(--spin),
        rgba(111, 243, 233, .95), rgba(185, 140, 255, .1) 22%, rgba(255, 122, 200, .95) 45%,
        rgba(255, 210, 122, .6) 55%, rgba(185, 140, 255, .1) 75%, rgba(111, 243, 233, .95));
    animation: spin 16s linear infinite;
}
.panel::before {           /* the 1.5px ring */
    inset: 0;
    padding: 1.5px;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}
.panel::after {            /* its glow */
    inset: -2px;
    z-index: -1;
    filter: blur(28px);
    opacity: .45;
}
@keyframes spin { to { --spin: 360deg; } }

.js .contact:not(.is-revealed) .panel { opacity: 0; transform: translateY(48px) scale(.96); }
.js .contact.is-revealed .panel { transition-delay: .8s; }

.contact-form { display: grid; gap: 20px; }
.field { display: grid; gap: 8px; }
.field label { font-weight: 600; font-size: 15px; color: var(--muted); letter-spacing: .01em; }
.field input,
.field textarea {
    width: 100%;
    font: 400 18px/1.5 var(--sans);
    color: var(--star);
    background: rgba(5, 4, 26, .55);
    border: 1px solid rgba(255, 246, 224, .16);
    border-radius: 14px;
    padding: 14px 16px;
    caret-color: var(--gold);
    transition: border-color .25s ease, box-shadow .25s ease, background-color .25s ease;
}
.field textarea { resize: vertical; min-height: 140px; }
.field input:focus,
.field textarea:focus {
    outline: none;
    border-color: rgba(111, 243, 233, .8);
    background: rgba(5, 4, 26, .72);
    box-shadow: 0 0 0 4px rgba(111, 243, 233, .12), 0 0 34px rgba(111, 243, 233, .18);
}
.field input::placeholder,
.field textarea::placeholder { color: rgba(255, 246, 224, .36); }
.field.is-invalid input,
.field.is-invalid textarea { border-color: var(--error); box-shadow: 0 0 0 4px rgba(255, 179, 217, .12); }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-error { color: var(--error); font-weight: 600; font-size: 16px; }

.contact-form .send { margin-top: 10px; justify-self: start; gap: 12px; }
.send-star {
    width: 14px;
    height: 14px;
    background: radial-gradient(circle, #fff 0%, var(--gold) 55%, var(--rose) 100%);
    clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
    transition: transform .6s cubic-bezier(.2, .9, .3, 1.4);
}
.send:hover .send-star { transform: rotate(180deg) scale(1.25); }

/* sending: the panel collapses into a single point of light */
.panel.ascending { animation: collapse .85s cubic-bezier(.7, 0, .3, 1) forwards; }
@keyframes collapse {
    60%  { opacity: 1; transform: scale(.35); filter: brightness(2.2); }
    100% { opacity: 0; transform: scale(.02); filter: brightness(4); }
}
.panel.reborn { animation: reborn 1.1s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes reborn {
    from { opacity: 0; transform: scale(.85); }
    to   { opacity: 1; transform: none; }
}

.sent { text-align: center; outline: none; padding: 20px 0 8px; }
.sent-star {
    width: 56px;
    height: 56px;
    margin-bottom: 26px;
    filter: drop-shadow(0 0 18px rgba(255, 210, 122, .9));
    animation: star-in 1s cubic-bezier(.2, .9, .3, 1.3) both;
}
.sent h2 {
    font-size: clamp(28px, 4.4vw, 46px);
    line-height: 1.12;
    letter-spacing: .04em;
    text-shadow: 0 0 24px rgba(255, 246, 224, .35);
}
.sent-note { margin-top: 16px; color: var(--muted); }
@keyframes star-in {
    from { transform: scale(0) rotate(-180deg); opacity: 0; }
    to   { transform: none; opacity: 1; }
}

[hidden] { display: none !important; }

/* ---------------------------------------------------------------- footer */
.foot {
    text-align: center;
    padding: 0 20px 36px;
    font-size: 15px;
    color: rgba(255, 246, 224, .5);
}

/* ---------------------------------------------------------------- 404 */
.nf { position: relative; z-index: 1; min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 20px; text-align: center; padding: 24px; }
.nf .mark-star { width: 28px; height: 28px; }
.nf h1 { font-size: clamp(30px, 5vw, 56px); letter-spacing: .04em; }

@media (max-width: 520px) {
    body { font-size: 17px; }
    .cta { width: 100%; }
    .contact-form .send { justify-self: stretch; }
}
@media (prefers-reduced-motion: reduce) {
    #nebula { animation: none; }
    .js .intro.stage-title .ch, .js .dust.is-formed .ch { animation: none; opacity: 1; }
    .js .dust .ch { opacity: 1; }
    .sent-star, .panel::before, .panel::after, .panel.ascending, .panel.reborn { animation: none; }
    .js .contact:not(.is-revealed) .panel, .js .contact:not(.is-revealed) .contact-sub { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------- phones & touch */
a, button { -webkit-tap-highlight-color: transparent; }
@media (max-width: 760px), (hover: none) {
    .panel {
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
        background: rgba(14, 11, 46, .86);
    }
    .panel::after { animation: none; }
    .cta { -webkit-backdrop-filter: none; backdrop-filter: none; }
}
.bar {
    padding-left: max(clamp(20px, 4vw, 48px), env(safe-area-inset-left));
    padding-right: max(clamp(20px, 4vw, 48px), env(safe-area-inset-right));
    padding-top: max(26px, env(safe-area-inset-top));
}
.hero, .contact {
    padding-left: max(clamp(16px, 5vw, 64px), env(safe-area-inset-left));
    padding-right: max(clamp(16px, 5vw, 64px), env(safe-area-inset-right));
}
.skip {
    right: max(clamp(16px, 3vw, 32px), env(safe-area-inset-right));
    bottom: max(clamp(16px, 3vw, 28px), env(safe-area-inset-bottom));
}
.foot { padding-bottom: max(36px, env(safe-area-inset-bottom)); }

/* phones held sideways: size the headline by the screen's height so the whole
   first screen (headline, line, button) fits without scrolling */
@media (orientation: landscape) and (max-height: 520px) {
    .hero { padding-top: 64px; padding-bottom: 28px; }
    .hero h1 { font-size: min(8.6vw, 15.5vh); max-width: none; }
    .lede { margin-top: 12px; font-size: 16px; }
    .hero .cta { margin-top: 18px; padding: 13px 30px; width: auto; }
    .contact { padding-top: 56px; }
    .contact-head h2 { font-size: min(6vw, 13vh); }
}
