/* Moonstone — style */

:root {
    --bg: #0c0b09;
    --bg-soft: #14120f;
    --ink: #efeae1;
    --muted: #a49c8e;
    --line: rgba(239, 234, 225, 0.16);
    --accent: #e7b45c;
    --accent-ink: #171310;
    --error: #e2926b;
    --serif: "Monda", sans-serif;
    --sans: "IBM Plex Sans", sans-serif;
    --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

a {
    color: inherit;
    text-decoration: none;
}

h1, h2, h3 {
    margin: 0;
    font-family: var(--serif);
    font-weight: 500;
    line-height: 1.08;
    letter-spacing: 0.01em;
}

p {
    margin: 0;
}

.container {
    width: min(1120px, 92vw);
    margin-inline: auto;
}

.lead {
    font-size: 1.05rem;
    line-height: 1.75;
}

.lead strong {
    font-weight: 600;
    color: var(--ink);
}

.soft {
    color: var(--muted);
}

/* ---------- Header ---------- */

.site-header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem clamp(1.25rem, 4vw, 3rem);
    transition: background 0.4s var(--ease), padding 0.4s var(--ease), border-color 0.4s var(--ease);
    border-bottom: 1px solid transparent;
}

.site-header.is-scrolled {
    background: rgba(12, 11, 9, 0.82);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    padding-block: 1rem;
    border-bottom-color: var(--line);
}

.wordmark {
    font-family: var(--serif);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.42em;
    text-transform: uppercase;
}

.site-header-right {
    display: flex;
    align-items: center;
    gap: 1.6rem;
}

.nav-link {
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--muted);
    transition: color 0.3s var(--ease);
}

.nav-link:hover {
    color: var(--ink);
}

.lang-switch {
    display: inline-flex;
    align-items: center;
}

.lang-switch a {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    color: var(--muted);
    transition: color 0.3s var(--ease);
}

.lang-switch a:hover {
    color: var(--ink);
}

.lang-switch a.is-active {
    color: var(--accent);
}

.lang-sep {
    margin: 0 0.4rem;
    font-size: 0.7rem;
    color: var(--muted);
    opacity: 0.45;
}

/* ---------- Kicker ---------- */

.kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    margin: 0 0 1.6rem;
    font-family: var(--serif);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--muted);
}

.ring {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid var(--accent);
    box-shadow: 0 0 12px rgba(231, 180, 92, 0.45);
}

/* ---------- Hero ---------- */

.hero {
    position: relative;
    min-height: 100svh;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    padding-bottom: clamp(4rem, 9vh, 7rem);
}

.hero-bg {
    position: absolute;
    inset: -14% 0 0 0;
    background-size: cover;
    background-position: center;
    will-change: transform;
}

.hero-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
            rgba(12, 11, 9, 0.35) 0%,
            rgba(12, 11, 9, 0.55) 45%,
            var(--bg) 100%);
}

.hero-content {
    position: relative;
    z-index: 1;
    width: min(1120px, 92vw);
    margin-inline: auto;
    max-width: 640px;
}

.hero-title {
    font-size: clamp(2.6rem, 6.2vw, 4.6rem);
    margin-bottom: 1.4rem;
}

.hero-lead {
    font-size: clamp(1rem, 1.5vw, 1.15rem);
    line-height: 1.7;
    margin-bottom: 1.1rem;
}

.hero-note {
    color: var(--muted);
    font-size: 0.95rem;
    margin-bottom: 2.2rem;
}

.hero-note strong {
    color: var(--ink);
    font-weight: 600;
}

/* ---------- Form ---------- */

.join-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.9rem;
}

.join-input {
    flex: 1 1 260px;
    padding: 0.85rem 0.1rem;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    color: var(--ink);
    font-family: var(--sans);
    font-size: 1rem;
    font-weight: 400;
    transition: border-color 0.3s var(--ease);
}

.join-input::placeholder {
    color: var(--muted);
}

.join-input:focus {
    outline: none;
    border-bottom-color: var(--accent);
}

.btn {
    appearance: none;
    padding: 1rem 1.9rem;
    background: transparent;
    border: 1px solid var(--ink);
    border-radius: 0;
    color: var(--ink);
    font-family: var(--serif);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease), transform 0.2s var(--ease);
}

.btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
}

.btn:active {
    transform: translateY(1px);
}

.btn:disabled {
    opacity: 0.6;
    cursor: wait;
}

.form-msg {
    margin-top: 1.1rem;
    font-size: 0.88rem;
    color: var(--accent);
}

.form-msg.is-error {
    color: var(--error);
}

.form-code {
    margin-top: 1.9rem;
    text-align: left;
}

.form-code-label {
    display: block;
    margin-bottom: 0.6rem;
    font-family: var(--serif);
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--muted);
}

.form-code-value {
    display: inline-block;
    padding: 0.9rem 1.4rem;
    border: 1px solid var(--accent);
    font-family: var(--serif);
    font-size: clamp(1.5rem, 3.4vw, 2rem);
    letter-spacing: 0.5em;
    text-indent: 0.5em;
    color: var(--accent);
}

.join .form-code {
    text-align: center;
}

/* ---------- Story ---------- */

.story {
    padding: clamp(5rem, 12vh, 9rem) 0;
}

.story-inner {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: clamp(2.5rem, 6vw, 6rem);
    align-items: start;
}

.story-copy {
    position: sticky;
    top: 7rem;
}

.story-copy h2 {
    font-size: clamp(2rem, 4vw, 3.2rem);
    margin-bottom: 1.6rem;
}

.story-copy .lead {
    margin-bottom: 1.2rem;
}

.story-gallery {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
}

.gitem {
    position: relative;
    margin: 0;
    overflow: hidden;
    background: var(--bg-soft);
}

.gitem img {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    transform: scale(1.02);
    transition: transform 1.2s var(--ease);
}

.gitem:hover img {
    transform: scale(1.07);
}

.gitem--wide {
    grid-column: 1 / -1;
}

.gitem--wide img {
    aspect-ratio: 16 / 10;
}

.gnum {
    position: absolute;
    top: 1rem;
    left: 1.1rem;
    z-index: 2;
    font-family: var(--serif);
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.3em;
    color: var(--ink);
    mix-blend-mode: difference;
}

/* ---------- Join / CTA ---------- */

.join {
    position: relative;
    padding: clamp(6rem, 14vh, 10rem) 0;
    text-align: center;
    isolation: isolate;
    overflow: hidden;
}

.join-bg {
    position: absolute;
    inset: 0;
    z-index: -1;
    background-size: cover;
    background-position: center;
}

.join-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
            var(--bg) 0%,
            rgba(12, 11, 9, 0.72) 28%,
            rgba(12, 11, 9, 0.72) 72%,
            var(--bg) 100%);
}

.join-content {
    width: min(620px, 90vw);
    margin-inline: auto;
}

.join h2 {
    font-size: clamp(2.1rem, 4.5vw, 3.4rem);
    margin-bottom: 1.4rem;
}

.join .lead {
    margin-bottom: 1rem;
}

.join-note {
    color: var(--muted);
    font-size: 0.95rem;
    margin-bottom: 2.4rem;
}

.join .join-form {
    justify-content: center;
}

.join .form-msg {
    margin-inline: auto;
}

/* ---------- Footer ---------- */

.site-footer {
    padding: 5rem 1.5rem 3rem;
    text-align: center;
    border-top: 1px solid var(--line);
}

.footer-wordmark {
    margin: 0 0 1rem;
    font-family: var(--serif);
    font-size: clamp(1.6rem, 3.4vw, 2.4rem);
    letter-spacing: 0.5em;
    text-indent: 0.5em;
    text-transform: uppercase;
}

.footer-tagline {
    font-family: var(--sans);
    font-size: 1.05rem;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.footer-contact {
    margin-top: 1.6rem;
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    color: var(--muted);
}

.footer-contact a {
    border-bottom: 1px solid rgba(239, 234, 225, 0.2);
    transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}

.footer-contact a:hover {
    color: var(--ink);
    border-bottom-color: var(--ink);
}

.footer-made {
    margin-top: 1.6rem;
    font-family: var(--serif);
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.4em;
    text-indent: 0.4em;
    text-transform: uppercase;
    color: var(--muted);
    opacity: 0.7;
}

/* ---------- Reveal on scroll ---------- */

.reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}

.reveal.is-visible {
    opacity: 1;
    transform: none;
}

.story-copy .reveal:nth-child(2) { transition-delay: 0.08s; }
.story-copy .reveal:nth-child(3) { transition-delay: 0.16s; }
.story-copy .reveal:nth-child(4) { transition-delay: 0.24s; }

.story-gallery .reveal:nth-child(2) { transition-delay: 0.12s; }
.story-gallery .reveal:nth-child(3) { transition-delay: 0.24s; }

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
    .story-inner {
        grid-template-columns: 1fr;
    }

    .story-copy {
        position: static;
    }

    .hero {
        align-items: center;
    }
}

@media (max-width: 560px) {
    .story-gallery {
        grid-template-columns: 1fr;
    }

    .join-form .btn {
        flex: 1 1 100%;
    }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .hero-bg,
    .gitem img {
        transition: none;
    }
}
