
/* ---------- Custom Fonts ---------- */
@font-face {
    font-family: 'Take Me To Tuscany';
    src: url('./fonts/Take Me To Tuscany Regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Halfre';
    src: url('./fonts/halfre.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Dofleur';
    src: url('./fonts/DOFLEUR.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

/* ---------- Theme Variables ---------- */
:root {
    --maroon: #3a0d0d;
    --maroon-deep: #2a0808;

    /* Soft silver */
    --sand: #b8b1aa;
    --ink: #38100d;

    --bg: linear-gradient(
        160deg,
        #3a0d0d 0%,
        #2c0a0a 50%,
        #170505 100%
    );

    --glow: rgba(184, 177, 170, .13);
    --spark-glow: rgba(184, 177, 170, .25);
    --dot: rgba(0, 0, 0, .3);

    --panel-bg: var(--sand);
    --panel-border: rgba(56, 16, 13, .45);
    --soft-border: rgba(184, 177, 170, .45);
    --button-bg: var(--ink);
    --button-text: var(--sand);

    --script: 'Take Me To Tuscany', cursive;
    --serif: 'Cormorant Garamond', Georgia, serif;
    --sans: 'Jost', system-ui, sans-serif;
    --halfre: 'Halfre', serif;
    --dofleur: 'Dofleur', serif;
    --arabic: 'Amiri', 'Aref Ruqaa', serif;

    --ease: cubic-bezier(.22,.7,.2,1);
}

/* ---------- Burgundy and Black Theme ---------- */
body.theme-black {
    --maroon: #4a101c;
    --maroon-deep: #26070e;

    /* Black text */
    --sand: #080505;
    --ink: #080505;

    /* Rich burgundy background */
    --bg: radial-gradient(
        ellipse at center,
        #641c2b 0%,
        #4a101c 65%,
        #26070e 100%
    );

    /* Dark details */
    --glow: rgba(0, 0, 0, .2);
    --spark-glow: rgba(0, 0, 0, .35);
    --dot: rgba(0, 0, 0, .7);

    /* Panels */
    --panel-bg: #b9a99a;
    --panel-border: rgba(0, 0, 0, .55);
    --soft-border: rgba(0, 0, 0, .4);

    /* Buttons */
    --button-bg: #080505;
    --button-text: #a65a66;
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    background: var(--bg);
    color: var(--sand);
    font-family: var(--sans);
    text-align: center;
    overflow-x: hidden;
    min-height: 100vh;
    transition: background 1s ease, color 1s ease;
    isolation: isolate;
}

.js:not(.opened) body {
    overflow: hidden;
    height: 100vh;
}

/* ---------- Theme Switch ---------- */
.theme-toggle {
    position: fixed;
    top: 22px;
    right: 20px;
    z-index: 100;

    display: flex;
    align-items: center;
    gap: 9px;

    padding: 9px 12px;
    border: 1px solid var(--soft-border);
    border-radius: 30px;
    background: rgba(0, 0, 0, .2);

    color: var(--sand);
    font-family: var(--halfre);
    font-size: .6rem;
    letter-spacing: .12em;

    cursor: pointer;
    transition: border-color .5s, color .5s, background .5s;
}

.theme-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--sand);
    box-shadow: 0 0 7px var(--spark-glow);
    transition: background .5s, box-shadow .5s;
}

.theme-toggle:hover {
    background: rgba(0, 0, 0, .35);
}

.theme-toggle:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 4px;
}

/* ---------- General Typography ---------- */
.eyebrow {
    font-family: var(--halfre);
    font-size: .75rem;
    letter-spacing: .05em;
    text-transform: uppercase;
    line-height: 1.5;
    text-wrap: balance;
}

.arabic {
    font-family: var(--arabic);
    direction: rtl;
    line-height: 2.1;
}

/* ---------- Reusable Ornament ---------- */
.orn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: currentColor;
    opacity: .7;
    margin: 22px auto;
    width: min(220px, 70%);
}

.orn::before,
.orn::after {
    content: "";
    flex: 1;
    height: 1px;
    background: currentColor;
    opacity: .5;
}

.orn svg {
    width: 16px;
    height: 16px;
    flex: none;
}

/* ---------- Cover (Tap to Open) ---------- */
.cover {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: var(--bg);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    transition: opacity 1.1s var(--ease), transform 1.4s var(--ease), visibility 0s 1.4s;
    isolation: isolate;
}

.cover::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;

    background-image: radial-gradient(
        var(--dot) 1px,
        transparent 1.5px
    );

    background-size: 9px 9px;

    mask-image: radial-gradient(
        ellipse at center,
        transparent 30%,
        rgba(0, 0, 0, .3) 60%,
        black 100%
    );

    -webkit-mask-image: radial-gradient(
        ellipse at center,
        transparent 30%,
        rgba(0, 0, 0, .3) 60%,
        black 100%
    );
}

/* ---------- Cover Monogram ---------- */
.cover-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    position: relative;
    z-index: 1;
}

.cover .mono {
    position: relative;
    width: 260px;
    height: 260px;
    font-family: var(--script);
    font-weight: 400;
    line-height: 1;

    opacity: 0;
    animation:
        monogramEnter 2s ease-out forwards,
        float 5s ease-in-out 2s infinite alternate;

    isolation: isolate;
    filter: drop-shadow(0 0 12px var(--spark-glow));
}

@keyframes monogramEnter {
    from {
        opacity: 0;
        transform: translateY(-35px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Soft light behind initials */
.cover .mono::before {
    content: "";
    position: absolute;
    inset: 15%;
    z-index: -1;
    border-radius: 50%;
    background: var(--glow);
    filter: blur(45px);
    animation: softGlow 5s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes softGlow {
    from {
        opacity: .35;
        transform: scale(.85);
    }

    to {
        opacity: .85;
        transform: scale(1.15);
    }
}

.initial-a,
.initial-m {
    position: absolute;
    font-size: 9rem;
    white-space: nowrap;
}

.initial-a {
    top: 0;
    left: 22%;
    transform: translateX(-50%);
}

.initial-m {
    bottom: 0;
    left: 60%;
    transform: translateX(-50%);
}

.initial-amp {
    position: absolute;
    top: 30%;
    left: 45%;
    font-size: 4.2rem;
    z-index: 2;
}

/* Cover subtitle */
.cover-subtitle {
    font-family: var(--halfre);
    font-size: .75rem;
    letter-spacing: .12em;
    margin-top: 28px;
    color: var(--sand);

    opacity: 0;
    animation: subtitleEnter 1.8s ease-out forwards;
    animation-delay: .8s;
}

@keyframes subtitleEnter {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.js .cover {
    display: flex;
}

/* ---------- Open Invitation Button ---------- */
.cover .open {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 42px;
    padding: 12px 30px;
    border: none;
    background: transparent;
    color: var(--sand);
    font-family: var(--halfre);
    font-size: .65rem;
    letter-spacing: .2em;
    cursor: pointer;

    position: relative;
    top: 58px;

    opacity: 0;
    animation: openFade 2s ease forwards;
    animation-delay: 2.5s;
}

@keyframes openFade {
    to {
        opacity: .65;
    }
}

.cover .open:hover {
    opacity: .7;
}

.open-line {
    display: block;
    width: 55px;
    height: 1px;
    background: var(--sand);
    transform-origin: center;
    animation: linePulse 4s ease-in-out infinite;
}

@keyframes linePulse {
    0%, 100% {
        opacity: .35;
        transform: scaleX(.7);
    }

    50% {
        opacity: 1;
        transform: scaleX(1.2);
    }
}

/* ---------- Cover Sparkles ---------- */
.cover .spark {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 50%;
    border-radius: 50%;
    background: var(--sand);
    box-shadow: 0 0 4px 2px var(--spark-glow);
    pointer-events: none;
    animation: sparkle 4s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% {
        opacity: .1;
        transform: scale(.5);
    }

    50% {
        opacity: .9;
        transform: scale(1.4);
    }
}

@keyframes float {
    to {
        transform: translateY(-8px);
    }
}

/* ---------- Cover Opening Animation ---------- */
.cover {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.opened .cover {
    opacity: 0;
    transform: scale(1.08);
    visibility: hidden;
    pointer-events: none;
}

/* ---------- Hero ---------- */
.hero {
    position: relative;
    height: 100svh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 32px;
    overflow: hidden;
}

.hero-inner {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    height: 100%;
    min-height: 0;
    padding: 0 20px;
    margin: auto;
    text-align: center;
}

/* ---------- Page-wide dot texture ---------- */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;

    background-image: radial-gradient(
        var(--dot) 1px,
        transparent 1.5px
    );

    background-size: 9px 9px;

    mask-image: radial-gradient(
        ellipse at center,
        transparent 30%,
        rgba(0, 0, 0, .3) 60%,
        black 100%
    );

    -webkit-mask-image: radial-gradient(
        ellipse at center,
        transparent 30%,
        rgba(0, 0, 0, .3) 60%,
        black 100%
    );
}

/* Bismillah */
.bismillah {
    position: absolute;
    top: 9%;
    left: 0;
    right: 0;
    text-align: center;
    font-family: 'Aref Ruqaa', serif;
    font-size: 1.3rem;
    line-height: 1.5;
    direction: rtl;
}

/* Invitation message */
.hero .eyebrow {
    position: absolute;
    top: 22%;
    left: 0;
    right: 0;
    text-align: center;
}

/* Couple's names */
.names {
    position: absolute;
    top: 50%;
    left: 50%;
    translate: -50% -50%;
    font-family: var(--script);
    font-weight: 400;
    line-height: .9;
    font-size: clamp(3.8rem, 21vw, 6.5rem);
    margin: 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.names span {
    display: block;
}

.names .amp {
    font-size: .80em;
    line-height: 1;
    margin: -.18em 0;
    position: relative;
    left: .65em;
    top: .13em;
    z-index: 2;
}

/* Date */
.date {
    position: absolute;
    bottom: 12%;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 9px;
    text-align: center;
}

.date-main {
    font-family: var(--dofleur);
    font-size: .7rem;
    letter-spacing: .08em;
}

.date-extra {
    font-family: var(--halfre);
    font-size: .75rem;
    letter-spacing: .04em;
    line-height: 1.5;
}

.date-extra + .date-extra {
    margin-top: -10px;
}

/* Soft breathing glow behind the names */
.hero::before {
    content: "";
    position: absolute;
    width: 120vmin;
    height: 120vmin;
    max-width: 900px;
    max-height: 900px;
    left: 50%;
    top: 50%;
    margin: -60vmin 0 0 -60vmin;
    background: radial-gradient(circle, var(--glow), transparent 62%);
    animation: breathe 8s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes breathe {
    from {
        transform: scale(.9);
        opacity: .5;
    }

    to {
        transform: scale(1.08);
        opacity: 1;
    }
}

/* ---------- Flowing Curly Border ---------- */
.frame {
    position: absolute;
    inset: -15px;
    width: calc(100% + 30px);
    height: calc(100% + 30px);
    pointer-events: none;

    opacity: 0;
    filter: blur(.35px);
    animation: frameIn 2s var(--ease) .3s forwards;
    animation-play-state: paused;
}

.opened .frame {
    animation-play-state: running;
}

.frame-border {
    fill: none;
    stroke: var(--sand);
    stroke-width: 1.6;
    stroke-opacity: .85;
    stroke-linejoin: round;
    stroke-linecap: round;
    stroke-dasharray: 1 0;
}

.frame::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    filter: blur(5px);
}

@keyframes frameIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ---------- Scroll Hint ---------- */
.scroll-hint {
    position: absolute;
    right: 7%;
    bottom: 28px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--sand);
    font-family: var(--halfre);
    font-size: .65rem;
    letter-spacing: .2em;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1s ease, visibility 1s ease;
}

.scroll-hint.visible {
    opacity: .65;
    visibility: visible;
    animation: arrowPulse 3s ease-in-out infinite;
}

@keyframes arrowPulse {
    0%, 100% {
        transform: translateY(-2px);
    }

    50% {
        transform: translateY(3px);
    }
}

/* ---------- Sparkles ---------- */
.spark {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: .8;
    border-radius: 50%;
    background: var(--sand);
    box-shadow: 0 0 3px 1px var(--spark-glow);
    pointer-events: none;
    animation: twinkle 4s ease-in-out infinite;
}

@keyframes twinkle {
    0%, 100% {
        opacity: 0;
        transform: scale(.5);
    }

    50% {
        opacity: .7;
        transform: scale(1.4);
    }
}

/* ---------- Entrance Animations ---------- */
.rise {
    opacity: 0;
    animation: rise 1.3s var(--ease) forwards;
    animation-delay: calc(var(--i, 0)*.25s + .35s);
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.js .rise {
    animation-play-state: paused;
}

.opened .rise {
    animation-play-state: running;
}

/* ---------- Sections ---------- */
.wrap {
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
    padding: 0 20px;
}

.block {
    padding: 56px 0;
}

.verse {
    font-size: 1.65rem;
}

.trans {
    font-family: var(--serif);
    font-style: italic;
    font-size: 1.2rem;
    line-height: 1.7;
    margin-top: 6px;
    opacity: .9;
}

.cite {
    font-size: .68rem;
    letter-spacing: .26em;
    text-transform: uppercase;
    opacity: .6;
    margin-top: 14px;
}

/* ---------- Invitation Panel ---------- */
.panel {
    background: linear-gradient(
        145deg,
        #c5beb6 0%,
        #b8b1aa 50%,
        #a49b93 100%
    );

    color: var(--ink);
    border-radius: 28px;
    padding: 44px 24px;
    position: relative;

    border: 1px solid rgba(255, 245, 225, .18);

    box-shadow:
        0 22px 50px rgba(0, 0, 0, .35),
        inset 0 1px 0 rgba(255, 255, 255, .25),
        inset 0 -1px 0 rgba(56, 16, 13, .12);

    transition: background .6s ease, color .6s ease;
}

.panel::before {
    content: "";
    position: absolute;
    inset: 9px;
    border: 1.5px dotted var(--panel-border);
    border-radius: 20px;
    pointer-events: none;
}

.panel h2 {
    font-family: var(--script);
    font-weight: 400;
    font-size: 2.8rem;
    line-height: 1.1;
}

/* ---------- Date Display ---------- */
.bigdate {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    text-align: left;
}

.bigdate .n {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 600;
    font-size: 5.6rem;
    line-height: 1;
}

.bigdate .t {
    text-align: left;
    font-family: var(--serif);
    font-style: italic;
    font-size: 1.5rem;
    line-height: 1.3;
    padding-left: 0;
    border-left: 1px solid var(--panel-border);
}

.bigdate .date-text {
    display: inline-block;
    transform: translateX(12px);
}

/* ---------- Venue ---------- */
.venue {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 600;
    font-size: 1.6rem;
    line-height: 1.3;
}

/* ---------- Countdown ---------- */

.countdown {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
}

.unit b {
    width: 68px;
    height: 68px;
    border: 1px solid var(--soft-border);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: var(--serif);
    font-style: italic;
    font-weight: 600;
    font-size: 1.65rem;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.unit b.pop {
    animation: pop .5s var(--ease);
}

@keyframes pop {
    from {
        opacity: .2;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.unit small {
    display: block;
    margin-top: 0;
    font-size: .65rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    opacity: .7;
}

.married {
    display: none;
    font-family: var(--script);
    font-size: 3rem;
    line-height: 1.15;
    margin-top: 18px;
}

.is-over .countdown {
    display: none;
}

.is-over .married {
    display: block;
}

/* Mobile */
@media (max-width: 480px) {
    .countdown {
        gap: 14px;
    }

    .unit b {
        width: 58px;
        height: 58px;
        font-size: 1.4rem;
    }

    .unit small {
        font-size: .58rem;
    }
}

/* ---------- Action Buttons ---------- */
.actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 26px;
}

.btn {
    appearance: none;
    border: 1.5px solid var(--ink);
    background: var(--button-bg);
    color: var(--button-text);
    font: 500 .76rem var(--sans);
    letter-spacing: .18em;
    text-transform: uppercase;
    text-decoration: none;
    padding: 16px 22px;
    border-radius: 999px;
    cursor: pointer;
    transition: transform .35s var(--ease), background .35s, color .35s;
}

.btn.ghost {
    background: transparent;
    color: var(--ink);
}

.btn:hover {
    transform: translateY(-2px);
}

.btn:active {
    transform: scale(.97);
}

.btn.ghost:hover {
    background: var(--ink);
    color: var(--button-text);
}

.btn:focus-visible,
.open:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}

/* ---------- Dua ---------- */
.dua {
    border: 1px dotted var(--soft-border);
    border-radius: 24px;
    padding: 30px 20px;
    background: rgba(20,2,2,.25);
    margin-top: 18px;
}

.dua .arabic {
    font-size: 1.55rem;
}

/* ---------- Footer ---------- */
footer {
    padding: 30px 20px 64px;
}

footer .script {
    font-family: var(--script);
    font-size: 2.6rem;
}

.footer-amp {
    font-size: .90em;
    display: inline-block;
    vertical-align: middle;
    margin-right: 6px;
    transform: translateY(-3px);
}

/* ---------- Scroll Reveals ---------- */
.reveal {
    opacity: 0;
    transform: translateY(32px) scale(.985);
    transition: opacity 1.1s var(--ease), transform 1.1s var(--ease);
    will-change: transform, opacity;
}

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

/* ---------- Desktop ---------- */
@media (min-width: 700px) {
    .actions {
        flex-direction: row;
        justify-content: center;
    }

    .hero-inner,
    .wrap {
        max-width: 520px;
    }
}

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

    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }

    .rise,
    .reveal,
    .frame {
        opacity: 1;
        transform: none;
    }

    .spark {
        display: none;
    }
}

button,
a,
.btn {
    -webkit-tap-highlight-color: transparent;
}

button:focus,
a:focus,
.btn:focus {
    outline: none;
}

/* ---------- Dress Code ---------- */
.dress-code {
    padding: 17px 0 23px;
}

.dress-content {
    text-align: center;
    width: 100%;
    max-width: 650px;
    margin: 0 auto;
}

.dress-content .eyebrow {
    margin-bottom: 25px;
}

.dress-colours {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 38px;
    flex-wrap: wrap;
}

.dress-colour {
    display: flex;
    align-items: center;
    gap: 9px;
    font-family: var(--sans);
    font-size: .7rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--sand);
}

.colour-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    flex-shrink: 0;
}

.colour-dot.burgundy {
    background: #662c37;
}

.colour-dot.grey {
    background: #aeb0b9;
}

.colour-dot.black {
    background: #111111;
    border: 1px solid #444444;
}

@media (max-width: 480px) {
    .dress-colours {
        gap: 18px;
    }

    .dress-colour {
        font-size: .62rem;
        gap: 7px;
    }

    .colour-dot {
        width: 9px;
        height: 9px;
    }
}

@media (max-width: 768px) {
    .dress-content.reveal {
        opacity: 1;
        transform: none;
    }
}

/* ---------- Countdown & Dress Code Headings ---------- */
#countdownBox .eyebrow,
.dress-content .eyebrow {
    font-family: 'Dolfleur', serif;
    font-size: 1rem;
    font-weight: normal;
    letter-spacing: normal;
    text-transform: none;
}