/* JimmySea | A Universe Between Us
   Light "paper star chart": warm paper, navy ink, a gold star for Jimmy, a sea-blue star for Sea. */

:root {
    --paper: #fbf8f1;
    --paper-2: #f3eee3;
    --card: #ffffff;
    --ink: #1f2a44;
    --muted: #626d86;
    --gold: #d99a25;
    --gold-soft: #ffe6ad;
    --sea: #3f87d3;
    --sea-soft: #d4e8fb;
    --line: #1f2a4420;
    --shadow: 0 18px 50px #1f2a4416;

    --display: 'Instrument Serif', Georgia, serif;
    --body: 'Manrope', system-ui, sans-serif;
    --ease: cubic-bezier(.2, .8, .2, 1);
}

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

html { scroll-behavior: smooth; scroll-padding-top: 76px; }

body {
    background:
        linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 64px 64px,
        linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 64px 64px,
        var(--paper);
    background-blend-mode: normal;
    color: var(--ink);
    font-family: var(--body);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}
/* fade the grid so it stays a whisper */
body::before {
    content: "";
    position: fixed; inset: 0;
    background: var(--paper);
    opacity: .9;
    z-index: -1;
}

img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--sea); outline-offset: 3px; border-radius: 8px; }

.skip { position: fixed; top: -60px; left: 14px; z-index: 100; background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 10px; text-decoration: none; transition: top .2s; }
.skip:focus { top: 12px; }

.progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 60; background: linear-gradient(90deg, var(--gold), var(--sea)); }

main, .foot { position: relative; z-index: 1; }

/* ---------- Header ---------- */
.top {
    position: sticky; top: 0; z-index: 50;
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 7%;
    background: #fbf8f1d9;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
    transition: border-color .3s;
}
.top.is-scrolled { border-color: var(--line); }
.top__logo { font-family: var(--display); font-size: 25px; color: var(--ink); text-decoration: none; }
.top__logo span { color: var(--gold); }
.top__nav { display: flex; gap: 6px; }
.top__nav a {
    padding: 7px 14px; border-radius: 30px;
    color: var(--muted); font-size: 14px; font-weight: 500; text-decoration: none;
    transition: background .25s, color .25s;
}
.top__nav a:hover, .top__nav a.is-active { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }

/* ---------- Shared ---------- */
.kicker { color: var(--sea); font-size: 14px; font-weight: 700; margin-bottom: 10px; }
.head { text-align: center; margin-bottom: 48px; }
.head h2, .about h2, .note h2 {
    font-family: var(--display); font-weight: 400;
    font-size: clamp(38px, 5.4vw, 64px); line-height: 1.08; letter-spacing: -.01em;
}
.head p:not(.kicker) { margin: 14px auto 0; color: var(--muted); max-width: 46ch; }

.btn {
    display: inline-block; padding: 14px 26px; border-radius: 40px;
    font-size: 15px; font-weight: 600; text-decoration: none; border: 1px solid transparent;
    transition: transform .25s var(--ease), box-shadow .25s, background .25s;
}
.btn:hover { transform: translateY(-3px); box-shadow: 0 12px 26px #1f2a4426; }
.btn:active { transform: scale(.97); }
.btn--ink { background: var(--ink); color: var(--paper); }
.btn--ghost { background: var(--card); border-color: var(--line); color: var(--ink); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

.reveal { opacity: 0; translate: 0 28px; transition: opacity .8s var(--ease), translate .8s var(--ease); }
.reveal.is-visible { opacity: 1; translate: 0 0; }
.no-js .reveal { opacity: 1; translate: 0 0; }

/* ---------- Shooting stars ---------- */
.shooting-layer { position: fixed; inset: 0; z-index: 40; pointer-events: none; overflow: hidden; }
.shoot {
    position: absolute; top: var(--top); left: var(--left);
    width: 150px; height: 3px; border-radius: 3px;
    background: linear-gradient(90deg, transparent, var(--gold) 70%, #fff3c9);
    box-shadow: 0 0 14px 2px #ffd98a99;
    transform: rotate(28deg); opacity: 0;
    animation: shoot 1.4s ease-in forwards;
}
.shoot--sea { background: linear-gradient(90deg, transparent, var(--sea) 70%, #e6f3ff); box-shadow: 0 0 14px 2px #8fc8ff99; }
@keyframes shoot {
    0%   { opacity: 0; transform: translate(0, 0) rotate(28deg); }
    15%  { opacity: 1; }
    100% { opacity: 0; transform: translate(520px, 280px) rotate(28deg); }
}

/* ---------- Hero ---------- */
.hero {
    position: relative; isolation: isolate; overflow: hidden;
    min-height: calc(100svh - 70px);
    padding: 40px 7% 90px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
}
.hero__sun, .hero__sea { position: absolute; z-index: -1; border-radius: 50%; filter: blur(70px); opacity: .75; }
.hero__sun { width: 46vw; max-width: 560px; aspect-ratio: 1; top: -10%; left: -8%; background: var(--gold-soft); animation: drift 14s ease-in-out infinite alternate; }
.hero__sea { width: 50vw; max-width: 620px; aspect-ratio: 1; bottom: -14%; right: -10%; background: var(--sea-soft); animation: drift 18s ease-in-out infinite alternate-reverse; }
@keyframes drift { to { transform: translate(40px, 30px) scale(1.08); } }

.portrait { position: relative; width: clamp(190px, 25vw, 270px); aspect-ratio: 1; animation: rise 1.1s var(--ease) both; }
.portrait__photo {
    position: absolute; inset: 12px; border-radius: 50%; overflow: hidden;
    background: linear-gradient(130deg, var(--gold-soft), var(--sea-soft));
    box-shadow: 0 0 0 6px var(--card), var(--shadow);
}
.portrait__photo img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
.portrait__fallback { position: absolute; inset: 0; display: grid; place-items: center; font-size: 84px; color: #ffffffcc; }
.portrait.has-image .portrait__fallback { display: none; }
.portrait.no-photo img { display: none; }

.portrait__orbit {
    position: absolute; inset: -14px; border-radius: 50%;
    border: 1.5px dashed #1f2a4433;
    animation: spin 26s linear infinite;
}
.portrait__orbit i {
    position: absolute; width: 16px; height: 16px; border-radius: 50%;
}
.portrait__orbit i:nth-child(1) { top: -8px; left: calc(50% - 8px); background: var(--gold); box-shadow: 0 0 14px var(--gold); }
.portrait__orbit i:nth-child(2) { bottom: -8px; left: calc(50% - 8px); background: var(--sea); box-shadow: 0 0 14px var(--sea); }
@keyframes spin { to { transform: rotate(360deg); } }

.names {
    margin-top: 38px; display: flex; align-items: baseline; justify-content: center; gap: .18em;
    font-family: var(--display); font-weight: 400;
    font-size: clamp(64px, 13.5vw, 170px); line-height: 1; letter-spacing: -.02em;
    animation: rise 1.1s var(--ease) .12s both;
}
.names__jimmy { color: var(--gold); }
.names__sea { color: var(--sea); font-style: italic; }
.names__amp { font-size: .4em; color: var(--muted); font-style: italic; }

.hero__lead { max-width: 46ch; margin-top: 24px; color: var(--muted); font-size: 18px; animation: rise 1.1s var(--ease) .24s both; }
.hero__actions { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; animation: rise 1.1s var(--ease) .36s both; }

.facts {
    list-style: none; display: flex; gap: 40px; flex-wrap: wrap; justify-content: center;
    margin-top: 48px; padding-top: 26px; border-top: 1px solid var(--line);
    animation: rise 1.1s var(--ease) .48s both;
}
.facts li { display: flex; flex-direction: column; }
.facts strong { font-family: var(--display); font-weight: 400; font-size: 36px; line-height: 1.1; }
.facts span { color: var(--muted); font-size: 13px; }

@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

/* ---------- About ---------- */
.about { padding: 110px 7%; background: var(--paper-2); border-block: 1px solid var(--line); }
.about__grid { max-width: 1050px; margin: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 70px; align-items: center; }
.about__copy p { color: var(--muted); font-size: 17px; margin-bottom: 18px; max-width: 52ch; }
.about__label { color: var(--ink) !important; font-weight: 700; font-size: 14px !important; margin: 26px 0 12px !important; }
.pairs { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; }
.pairs li { padding: 8px 16px; border-radius: 30px; background: var(--card); border: 1px solid var(--line); font-size: 14px; font-weight: 600; }
.pairs li:nth-child(odd)  { box-shadow: inset 3px 0 0 var(--gold); }
.pairs li:nth-child(even) { box-shadow: inset 3px 0 0 var(--sea); }

/* ---------- Constellation ---------- */
.stories { padding: 120px 7% 60px; }

.chart {
    max-width: 1020px; margin: 0 auto; padding: 36px 36px 40px;
    background: var(--card); border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow);
    background-image:
        linear-gradient(#1f2a4410 1px, transparent 1px),
        linear-gradient(90deg, #1f2a4410 1px, transparent 1px);
    background-size: 40px 40px;
}

.map { position: relative; aspect-ratio: 2 / 1; margin: 0 20px 24px; }
.map__lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.map__lines polyline { fill: none; stroke: #1f2a4466; stroke-width: 1.4; stroke-dasharray: 5 6; vector-effect: non-scaling-stroke; }
.map.pre polyline { stroke-dasharray: 2000; stroke-dashoffset: 2000; }
.map.draw polyline { stroke-dasharray: 2000; stroke-dashoffset: 2000; animation: drawLine 2.6s ease-out forwards; }
@keyframes drawLine { to { stroke-dashoffset: 0; } }

.star {
    position: absolute; left: var(--x); top: var(--y);
    width: 46px; height: 46px; transform: translate(-50%, -50%);
    background: none; border: none; border-radius: 50%;
}
.star::before {
    content: "✦"; position: absolute; inset: 0; display: grid; place-items: center;
    font-size: 28px; color: var(--gold);
    text-shadow: 0 0 0 #0000, 0 3px 12px #d99a2566;
    transition: transform .3s var(--ease), color .3s;
}
.star:nth-of-type(even)::before { color: var(--sea); text-shadow: 0 3px 12px #3f87d366; }
.star--soon::before { content: "✧"; }
.star:hover::before { transform: scale(1.3) rotate(20deg); }
.star[aria-pressed="true"]::before { transform: scale(1.65) rotate(45deg); color: var(--ink); }
.star[aria-pressed="true"]::after {
    content: ""; position: absolute; inset: 4px; border-radius: 50%;
    border: 1.5px solid var(--ink); opacity: .25; animation: ping 1.8s ease-out infinite;
}
@keyframes ping { from { transform: scale(.7); opacity: .5; } to { transform: scale(1.5); opacity: 0; } }

.star span {
    position: absolute; top: calc(100% + 0px); left: 50%; transform: translateX(-50%);
    width: max-content; max-width: 130px; text-align: center;
    font-size: 12.5px; font-weight: 600; line-height: 1.3; color: var(--muted); transition: color .25s;
}
.star:hover span, .star[aria-pressed="true"] span { color: var(--ink); }

.panel { max-width: 640px; margin: 0 auto; padding: 28px 32px; background: var(--paper); border: 1px solid var(--line); border-radius: 20px; }
.panel.swap { animation: swap .5s var(--ease); }
@keyframes swap { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.panel__meta { color: var(--gold); font-size: 14px; font-weight: 700; }
.panel h3 { font-family: var(--display); font-weight: 400; font-size: 40px; line-height: 1.12; margin: 4px 0 10px; }
.panel > p:not(.panel__meta) { color: var(--muted); }
.panel__tag { display: inline-block; margin-top: 16px; padding: 5px 14px; border-radius: 30px; background: var(--sea-soft); color: #25609f; font-size: 13px; font-weight: 700; }

.fine { max-width: 56ch; margin: 30px auto 0; text-align: center; color: var(--muted); font-size: 13px; }

/* ---------- Wishes ---------- */
.wishes { padding: 100px 7% 110px; }
.wishes__grid { max-width: 1060px; margin: auto; display: grid; grid-template-columns: 1fr 1.1fr; gap: 30px; }

.wish-form { padding: 32px; background: var(--card); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); }
.wish-form label { display: block; font-weight: 700; margin-bottom: 10px; }
.wish-form textarea {
    width: 100%; resize: none; padding: 15px 17px; border-radius: 16px;
    border: 1px solid var(--line); background: var(--paper); line-height: 1.6; transition: border-color .25s, box-shadow .25s;
}
.wish-form textarea:focus { outline: none; border-color: var(--sea); box-shadow: 0 0 0 4px #3f87d322; }
.wish-form__meta { display: flex; justify-content: space-between; gap: 12px; margin: 8px 0 18px; font-size: 13px; color: var(--muted); }
.wish-form__error { color: #c0392b; font-weight: 700; }
.wish-line { margin-top: 20px; min-height: 28px; color: var(--muted); font-size: 14px; }
.wish-line strong { color: var(--ink); }

.wish-sky {
    position: relative; min-height: 360px; border-radius: 24px; overflow: hidden; box-shadow: var(--shadow);
    background:
        radial-gradient(circle at 18% 20%, #ffe9b8, transparent 42%),
        radial-gradient(circle at 85% 80%, #c6e0fa, transparent 48%),
        linear-gradient(180deg, #e8f2fd, #fdf4e2);
    border: 1px solid var(--line);
}
.wish-sky__empty { position: absolute; inset: 0; display: grid; place-items: center; padding: 30px; text-align: center; color: var(--muted); font-family: var(--display); font-style: italic; font-size: 21px; }
.wish-sky__clear { position: absolute; bottom: 14px; right: 14px; z-index: 3; padding: 7px 14px; border-radius: 30px; border: 1px solid var(--line); background: #ffffffb3; font-size: 12px; font-weight: 600; }

.wish-star {
    position: absolute; z-index: 1; width: 36px; height: 36px; border: none; background: none;
    color: var(--gold); font-size: 26px; line-height: 1;
    transform: translate(-50%, -50%);
    filter: drop-shadow(0 2px 8px #d99a2577);
    animation: starIn .7s var(--ease) both;
}
.wish-star:nth-of-type(even) { color: var(--sea); filter: drop-shadow(0 2px 8px #3f87d377); }
.wish-star.static { animation: none; }
.wish-star:hover, .wish-star:focus-visible, .wish-star.is-open { z-index: 4; }
.wish-star__text {
    position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%) translateY(6px);
    width: max-content; max-width: 210px; padding: 10px 14px; border-radius: 14px;
    background: var(--ink); color: var(--paper); font-family: var(--body); font-size: 13px; line-height: 1.45; text-align: left;
    box-shadow: 0 10px 26px #1f2a4440; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.wish-star:hover .wish-star__text, .wish-star:focus-visible .wish-star__text, .wish-star.is-open .wish-star__text { opacity: 1; transform: translateX(-50%) translateY(0); }
@keyframes starIn { from { opacity: 0; transform: translate(-50%, -50%) scale(0) rotate(-90deg); } to { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0); } }

/* ---------- Gallery ---------- */
.gallery { padding: 100px 7%; background: var(--paper-2); border-block: 1px solid var(--line); }
.frames { max-width: 1000px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1.25fr 1fr; gap: 24px; align-items: end; }
.frame { margin: 0; }
.frame__open { display: block; width: 100%; background: none; border: none; text-align: center; }
.frame__img {
    position: relative; display: block; overflow: hidden; aspect-ratio: 3 / 4;
    border-radius: 999px 999px 16px 16px; background: linear-gradient(160deg, var(--gold-soft), var(--sea-soft));
    border: 6px solid var(--card); box-shadow: var(--shadow); transition: transform .4s var(--ease);
}
.frame--both .frame__img { aspect-ratio: 3 / 3.6; border-radius: 16px; }
.frame:hover .frame__img { transform: translateY(-8px) rotate(-1deg); }
.frame__img::after { content: attr(data-initial); position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-size: 70px; color: #ffffffcc; }
.frame__img img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
.has-image::after { display: none; }
.no-photo img { display: none; }
.frame figcaption, .frame__open figcaption { margin-top: 14px; font-weight: 600; font-size: 15px; }
.frame--jimmy figcaption { color: #a8710c; }
.frame--sea figcaption { color: #25609f; }

.lightbox { margin: auto; width: min(92vw, 540px); border: none; border-radius: 26px; padding: 14px; background: var(--card); color: var(--ink); box-shadow: 0 40px 100px #1f2a4466; overflow: visible; }
.lightbox::backdrop { background: #1f2a4499; backdrop-filter: blur(5px); }
.lightbox[open] { animation: pop .45s var(--ease); }
@keyframes pop { from { opacity: 0; transform: scale(.92) translateY(20px); } to { opacity: 1; transform: none; } }
.lightbox__photo { position: relative; overflow: hidden; border-radius: 18px; min-height: 260px; background: linear-gradient(160deg, var(--gold-soft), var(--sea-soft)); }
.lightbox__photo::after { content: attr(data-initial); position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-size: 80px; color: #ffffffcc; }
.lightbox__photo img { position: relative; z-index: 1; width: 100%; max-height: 64vh; object-fit: cover; }
.lightbox__cap { padding: 16px 8px 6px; }
.lightbox__cap h3 { font-family: var(--display); font-weight: 400; font-size: 28px; }
.lightbox__cap p { color: var(--muted); }
.lightbox__close { position: absolute; top: -14px; right: -14px; z-index: 3; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow); font-size: 22px; line-height: 1; }

/* ---------- Note ---------- */
.note { padding: 120px 7%; }
.note__card {
    position: relative; max-width: 700px; margin: 0 auto; padding: 56px 50px; text-align: center;
    background: var(--card); border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow);
}
.note__card::before, .note__card::after {
    content: ""; position: absolute; inset: 10px; border-radius: 20px; border: 1px dashed #1f2a4422; pointer-events: none;
}
.note__star { font-size: 38px; background: linear-gradient(120deg, var(--gold), var(--sea)); -webkit-background-clip: text; background-clip: text; color: transparent; margin-bottom: 6px; }
.note__card h2 { margin-bottom: 18px; }
.note__card p:not(.kicker) { color: var(--muted); font-size: 17px; margin-bottom: 16px; }
.note__card .btn { margin-top: 14px; }
.surprise { margin-top: 24px; padding: 22px 24px; border-radius: 18px; background: var(--paper); font-family: var(--display); font-style: italic; font-size: 21px; line-height: 1.6; }
.surprise:not([hidden]) { animation: swap .6s var(--ease); }

/* ---------- Footer ---------- */
.foot { padding: 50px 7% 60px; text-align: center; color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); background: var(--paper-2); }
.foot__title { font-family: var(--display); font-size: 28px; color: var(--ink); margin-bottom: 4px; }
.foot a { display: inline-block; margin-top: 16px; color: var(--ink); font-weight: 600; text-decoration: none; padding: 8px 18px; border-radius: 30px; border: 1px solid var(--line); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .about__grid, .wishes__grid { grid-template-columns: 1fr; gap: 36px; }
}

@media (max-width: 760px) {
    .top { padding: 12px 5%; }
    .top__logo { font-size: 21px; }
    .top__nav a { padding: 6px 10px; font-size: 13px; }
    .top__nav a:first-child { display: none; }

    .about, .gallery { padding: 80px 6%; }
    .stories { padding: 80px 5% 40px; }
    .wishes, .note { padding: 80px 6%; }

    .chart { padding: 22px 12px 24px; }
    .map { aspect-ratio: 4 / 5; margin: 0 8px 26px; }
    .star span { max-width: 90px; font-size: 11.5px; }
    .panel { padding: 22px; }
    .panel h3 { font-size: 32px; }

    .frames { grid-template-columns: 1fr 1fr; }
    .frame--both { grid-column: 1 / -1; order: -1; }
    .note__card { padding: 40px 24px; }
    .facts { gap: 26px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
    .reveal { opacity: 1; translate: none; }
}
/* ---------- Photo credit ---------- */
.credit {
    display: block;
    margin-bottom: 8px;
    font-size: 11.5px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--muted);
    text-align: center;
}

.credit--hero { margin: 0 0 16px; position: relative; z-index: 1; }
.credit--lightbox { margin: 4px 6px 10px; text-align: left; }

/* footer note */
.foot__note { max-width: 56ch; margin: 12px auto 0; font-size: 13px; }
.foot a.foot__mail {
    display: inline;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    color: var(--sea);
    text-decoration: underline;
}