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

:root {
    --bg: #08080c;
    --surface: #101018;
    --card: #111119;
    --border: #1e1e2e;
    --border-subtle: #161622;
    --gold: #c9a96e;
    --coral: #e63946;
    --coral-dim: rgba(230, 57, 70, 0.08);
    --coral-glow: rgba(230, 57, 70, 0.15);
    --teal: #4ecdc4;
    --text: #e8e4de;
    --muted: #6b6b7b;
    --paper: #d8d2c4;
    --paper-dark: #c4bdae;
    --paper-shadow: #b5ad9d;
    --ink: #1a1714;
    --ink-muted: #5c564c;
    --font-display: 'Syne', sans-serif;
    --font-body: 'IBM Plex Mono', monospace;
}

/* Hidden SVG filter defs */
.sr-only {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    overflow: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 30%;
    left: 50%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(230,57,70,0.04) 0%, transparent 70%);
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 0;
}

/* ========== BACK LINK ========== */
.back-link {
    position: fixed;
    top: 2rem;
    left: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-body);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.3s ease;
    z-index: 100;
}
.back-link:hover { color: var(--gold); }
.back-link svg { transition: transform 0.3s ease; }
.back-link:hover svg { transform: translateX(-4px); }

/* ========== PROJECT LABEL ========== */
.project-label {
    font-family: var(--font-body);
    font-size: 0.65rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--coral);
    margin-top: 1rem;
    margin-bottom: 3rem;
    opacity: 0;
    animation: fadeIn 0.6s ease forwards 0.2s;
    position: relative;
    z-index: 1;
}

/* ========== HERO ========== */
.center-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 70vh;
    gap: 3rem;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.8s ease forwards 0.3s;
    position: relative;
    z-index: 1;
}

.hero-text h1 {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.05;
    margin-bottom: 1rem;
}

.accent { color: var(--coral); }

.hero-text p {
    font-size: 0.9rem;
    color: var(--muted);
    font-weight: 300;
}

/* ========== SUBSCRIBE BTN ========== */
.subscribe-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2.5rem;
    background: transparent;
    border: 1.5px solid var(--coral);
    border-radius: 50px;
    color: var(--coral);
    font-family: var(--font-body);
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.subscribe-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--coral);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 0;
    border-radius: 50px;
}

.subscribe-btn:hover::before { transform: scaleX(1); }

.subscribe-btn:hover {
    color: white;
    border-color: var(--coral);
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(230, 57, 70, 0.25);
}

.subscribe-btn > * { position: relative; z-index: 1; }

.btn-icon {
    display: flex;
    transition: transform 0.3s ease;
}

.subscribe-btn:hover .btn-icon {
    transform: translateX(3px) translateY(-2px);
}

/* ========== OVERLAY ========== */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 8, 12, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

/* ========== PAPER PLANE ========== */
.plane {
    position: fixed;
    width: 48px;
    height: 48px;
    z-index: 2000;
    pointer-events: none;
    opacity: 0;
    filter: drop-shadow(0 4px 20px rgba(230, 57, 70, 0.6));
    will-change: transform, opacity;
}

.plane svg { width: 100%; height: 100%; }

/* ==============================================================
   MODAL  -  Crumpled paper with rough torn edges
   ============================================================== */
.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 470px;
    max-width: 92vw;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    will-change: transform, opacity;
    /* No background/border here, the paper-sheet child handles it */
}

.modal.open {
    opacity: 1;
    pointer-events: auto;
}

/* ---------- Paper sheet ---------- */
.paper-sheet {
    position: relative;
    padding: 3rem 2.6rem 2.4rem;
    text-align: center;

    /* Paper color and crumple texture */
    background:
        /* Subtle crumple noise via repeating gradients */
        repeating-conic-gradient(
            rgba(0,0,0,0.015) 0% 25%,
            transparent 0% 50%
        ) 0 0 / 60px 60px,
        /* Diagonal crease marks */
        linear-gradient(137deg, transparent 30%, rgba(0,0,0,0.03) 30.5%, transparent 31%),
        linear-gradient(223deg, transparent 55%, rgba(0,0,0,0.025) 55.5%, transparent 56%),
        linear-gradient(47deg, transparent 70%, rgba(0,0,0,0.02) 70.5%, transparent 71%),
        /* Base warm paper */
        linear-gradient(175deg, #ddd7c8 0%, #d2cbbe 40%, #cac3b3 100%);
    color: var(--ink);

    /* Torn/rough edges via SVG filter */
    filter: url(#paper-rough);

    /* Irregular border via clip-path polygon (ragged) */
    clip-path: polygon(
        1% 2%, 4% 0.5%, 8% 1.5%, 14% 0%, 20% 1%, 26% 0.3%,
        33% 1.8%, 40% 0%, 47% 0.8%, 54% 0.2%, 61% 1.5%, 68% 0%,
        74% 0.6%, 80% 1.2%, 86% 0%, 92% 0.8%, 96% 0.2%, 100% 1.5%,
        99.5% 6%, 100% 12%, 99% 18%, 100% 25%, 99.5% 32%, 100% 40%,
        99% 47%, 100% 54%, 99.5% 62%, 100% 69%, 99% 76%, 100% 83%,
        99.5% 90%, 100% 96%, 99% 100%,
        96% 99%, 90% 100%, 84% 98.5%, 78% 100%, 72% 99%,
        66% 100%, 60% 98.8%, 53% 100%, 46% 99.2%, 40% 100%,
        34% 98.5%, 28% 100%, 22% 99%, 16% 100%, 10% 98.5%,
        5% 100%, 2% 99%, 0% 98%,
        0.5% 92%, 0% 86%, 1% 80%, 0% 74%, 0.5% 68%,
        0% 62%, 1% 56%, 0% 50%, 0.5% 44%, 0% 38%,
        1% 32%, 0% 26%, 0.5% 20%, 0% 14%, 1% 8%
    );

    /* Paper shadow */
    box-shadow:
        3px 5px 15px rgba(0,0,0,0.4),
        1px 2px 4px rgba(0,0,0,0.2);
}

/* Drop shadow on the wrapper since clip-path clips box-shadow */
.modal::before {
    content: '';
    position: absolute;
    inset: 4px;
    background: rgba(0,0,0,0.3);
    filter: blur(20px);
    z-index: -1;
    border-radius: 4px;
}

/* ---------- Fold lines ---------- */
.fold-line {
    position: absolute;
    pointer-events: none;
    z-index: 2;
}

.fold-h {
    top: 48%;
    left: 3%;
    right: 3%;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(0,0,0,0.06) 10%,
        rgba(0,0,0,0.09) 30%,
        rgba(0,0,0,0.05) 50%,
        rgba(0,0,0,0.08) 70%,
        rgba(0,0,0,0.06) 90%,
        transparent 100%
    );
}

/* Light highlight just below the fold */
.fold-h::after {
    content: '';
    position: absolute;
    top: 1px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255,255,255,0.15) 20%,
        rgba(255,255,255,0.2) 50%,
        rgba(255,255,255,0.15) 80%,
        transparent 100%
    );
}

.fold-v {
    left: 46%;
    top: 3%;
    bottom: 3%;
    width: 1px;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(0,0,0,0.04) 15%,
        rgba(0,0,0,0.06) 40%,
        rgba(0,0,0,0.04) 60%,
        rgba(0,0,0,0.06) 85%,
        transparent 100%
    );
}

.fold-v::after {
    content: '';
    position: absolute;
    left: 1px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(255,255,255,0.12) 20%,
        rgba(255,255,255,0.18) 50%,
        rgba(255,255,255,0.12) 80%,
        transparent 100%
    );
}

/* ========== CLOSE BUTTON ========== */
.modal-close {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--ink-muted);
    cursor: pointer;
    transition: all 0.25s ease;
    z-index: 5;
    border-radius: 50%;
}

.modal-close:hover {
    color: var(--coral);
    background: rgba(230, 57, 70, 0.1);
}

/* ========== MODAL CONTENT (on paper) ========== */
.modal-envelope {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(230, 57, 70, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.4rem;
    color: var(--coral);
}

.modal-label {
    display: block;
    font-size: 0.58rem;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: var(--coral);
    margin-bottom: 0.7rem;
    font-weight: 500;
}

.paper-sheet h2 {
    font-family: var(--font-display);
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: 0.6rem;
    color: var(--ink);
}

.modal-desc {
    font-size: 0.76rem;
    color: var(--ink-muted);
    line-height: 1.75;
    margin-bottom: 1.8rem;
    max-width: 310px;
    margin-left: auto;
    margin-right: auto;
}

/* ========== EMAIL FORM ========== */
.email-form { margin-bottom: 0; }

.input-group { text-align: left; }

.input-label {
    display: block;
    font-size: 0.62rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--ink-muted);
    margin-bottom: 0.5rem;
    padding-left: 0.1rem;
}

.input-wrap {
    display: flex;
    border: 1.5px solid rgba(26, 23, 20, 0.15);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.35s ease;
    background: rgba(255, 255, 255, 0.35);
}

.input-wrap:focus-within {
    border-color: var(--coral);
    box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.1);
    background: rgba(255, 255, 255, 0.5);
}

.input-wrap input {
    flex: 1;
    padding: 0.9rem 1.1rem;
    background: transparent;
    border: none;
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 0.78rem;
    outline: none;
    min-width: 0;
}

.input-wrap input::placeholder { color: var(--ink-muted); opacity: 0.5; }

.send-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.9rem 1.3rem;
    background: var(--coral);
    border: none;
    color: white;
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    filter: url(#paper-rough-sm);
}

.send-btn:hover {
    background: #c5303d;
    padding-right: 1.5rem;
}

.send-btn svg { transition: transform 0.3s ease; }
.send-btn:hover svg { transform: translateX(3px); }

.privacy {
    display: block;
    margin-top: 1rem;
    font-size: 0.6rem;
    color: var(--ink-muted);
    letter-spacing: 0.04em;
    opacity: 0.6;
    text-align: center;
}

/* ========== SUCCESS STATE ========== */
.success-state {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2rem 0;
    min-height: 200px;
}

.success-state.visible { display: flex; }

.success-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(78, 205, 196, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2a9d8f;
}

.success-state h3 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 800;
    color: #2a9d8f;
    letter-spacing: -0.02em;
}

.success-state p {
    margin-bottom: 0;
    font-size: 0.76rem;
    color: var(--ink-muted);
    max-width: 250px;
    line-height: 1.6;
}

/* ========== ANIMATIONS ========== */
@keyframes fadeIn { to { opacity: 1; } }
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .back-link { position: static; margin-bottom: 1rem; }
    body { padding: 1.5rem; overflow: auto; }
    .modal { max-width: 95vw; }
    .paper-sheet { padding: 2rem 1.5rem; }
    .fold-v { display: none; }
}
