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

:root {
    --blush:      #e2bfb3;
    --rose:       #b87165;
    --sage-light: #c2d0bf;
    --bark:       #7a6252;
    --charcoal:   #28201c;
    --gold:       #b59060;
    --warm-white: #fefcf9;
    --nav-h:      84px;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--warm-white);
    color: var(--charcoal);
    font-family: "Jost", sans-serif;
    font-weight: 400;
    overflow-x: hidden;
}

/* ── NAV ─────────────────────────────────────── */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    height: var(--nav-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 3rem;
    background: transparent;
    transition: transform 0.35s ease;
    --nav-fg: rgba(255, 255, 255, 0.92);
}
nav[data-section="info"]    { --nav-fg: var(--gold); }
nav[data-section="ohjelma"] { --nav-fg: var(--blush); }
nav[data-section="rsvp"]    { --nav-fg: var(--bark); }

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
    list-style: none;
}
.nav-links a {
    font-family: "Jost", sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--nav-fg);
    text-decoration: none;
    transition: color 0.5s ease, opacity 0.2s;
    white-space: nowrap;
    position: relative;
}
.nav-links a::after {
    content: "";
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 1.5px;
    background: currentColor;
    transform: scaleX(0);
    transition: transform 0.3s ease, color 0.5s ease;
}
.nav-links a:visited { color: var(--nav-fg); }
.nav-links a:hover   { opacity: 0.65; }
.nav-links a.active::after { transform: scaleX(1); }

.nav-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    text-decoration: none;
    white-space: nowrap;
    line-height: 0;
}
.nav-logo {
    height: 72px;
    width: auto;
    display: block;
    color: var(--nav-fg);
    transition: color 0.5s ease;
}

/* ── HERO ────────────────────────────────────── */
.hero-names-img {
    position: absolute;
    bottom: 3.5rem;
    right: 10vw;
    width: min(540px, 46vw);
    height: auto;
    aspect-ratio: 810 / 477;
    pointer-events: none;
    z-index: 3;
    opacity: 0;
    animation: riseIn 1.2s 0.4s ease forwards;
}
.hero-pvm-img {
    position: absolute;
    top: calc(var(--nav-h) + 2.5rem);
    left: 24vw;
    width: min(320px, 26vw);
    height: auto;
    pointer-events: none;
    z-index: 3;
    opacity: 0;
    animation: riseIn 1.2s 0.7s ease forwards;
}
.hero {
    height: 100svh;
    min-height: 640px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hero-bg {
    position: absolute;
    inset: 0;
    background: url("hero-bg.png") center center / cover no-repeat;
    animation: zoomBg 22s ease-in-out infinite alternate;
}
@keyframes zoomBg {
    from { transform: scale(1.04); }
    to   { transform: scale(1.1); }
}

@keyframes riseIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: none; }
}
.hero::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 15vh;
    background: linear-gradient(to bottom, transparent 30%, #013981 100%);
    pointer-events: none;
    z-index: 2;
}

/* ── SHARED ──────────────────────────────────── */
.section {
    padding: 6rem 2rem;
    scroll-margin-top: var(--nav-h);
}
.inner {
    max-width: 1060px;
    margin: 0 auto;
}
.inner-narrow {
    max-width: 720px;
    margin: 0 auto;
}

.eyebrow {
    font-family: "Jost", sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--rose);
    margin-bottom: 1rem;
    text-align: center;
}

h2 {
    font-family: "Playfair Display", serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(2rem, 4.5vw, 3.2rem);
    text-align: center;
    line-height: 1.15;
    color: var(--charcoal);
    margin-bottom: 2rem;
}

/* ── FADE-IN ─────────────────────────────────── */
.fi {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.85s ease, transform 0.85s ease;
}
.fi.in        { opacity: 1; transform: none; }
.fi-d1        { transition-delay: 0.1s; }
.fi-d2        { transition-delay: 0.2s; }
.fi-d3        { transition-delay: 0.3s; }
.fi-d4        { transition-delay: 0.4s; }

/* ── INFO ────────────────────────────────────── */
.info {
    background: url("uusisini.png") center / cover no-repeat;
    position: relative;
    overflow: hidden;
    isolation: isolate;
    padding-top: 8rem;
    padding-bottom: 16rem;
}

.info::before,
.info::after {
    content: "";
    position: absolute;
    bottom: 0;
    width: clamp(480px, 56vw, 860px);
    height: 160%;
    pointer-events: none;
    z-index: 1;
    filter: url('#flower-motion-blur');
}
.info::before { left: 0;  background: url("tl.png") left bottom / 100% auto no-repeat; }
.info::after  { right: 0; background: url("tr.png") right bottom / 100% auto no-repeat; }

.info-top-fade {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 12vh;
    background: linear-gradient(to bottom, #013981, transparent);
    pointer-events: none;
    z-index: 4;
}

.info .inner    { position: relative; z-index: 2; }
.info .eyebrow  { color: var(--blush); }
.info h2        { color: #fff; text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3); }

.info-tabs-wrap {
    margin-top: 3rem;
    display: grid;
    grid-template-columns: 200px 1fr;
    border: 1px solid rgba(181, 144, 96, 0.25);
    background: rgba(254, 252, 249, 0.97);
    box-shadow:
        0 12px 60px rgba(20, 14, 10, 0.3),
        0 2px 16px rgba(20, 14, 10, 0.12);
    backdrop-filter: blur(8px);
}

.info-tab-rail {
    border-right: 1px solid rgba(181, 144, 96, 0.2);
    display: flex;
    flex-direction: column;
}
.info-tab-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.15rem 1.3rem;
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
    border-bottom: 1px solid rgba(181, 144, 96, 0.15);
    transition: background 0.18s;
    position: relative;
}
.info-tab-btn:last-child { border-bottom: none; }
.info-tab-btn:hover      { background: rgba(184, 113, 101, 0.05); }
.info-tab-btn.active     { background: var(--warm-white); }
.info-tab-btn.active::after {
    content: "";
    position: absolute;
    right: -1px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--rose);
}
.info-tab-icon {
    font-size: 0.9rem;
    flex-shrink: 0;
    opacity: 0.65;
    transition: opacity 0.18s;
}
.info-tab-btn.active .info-tab-icon { opacity: 1; }
.info-tab-label {
    font-family: "Jost", sans-serif;
    font-size: 0.9rem;
    font-weight: 400;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #9a8070;
    line-height: 1.35;
    transition: color 0.18s;
}
.info-tab-btn.active .info-tab-label { color: var(--charcoal); font-weight: 500; }

.info-panels {
    background: var(--warm-white);
    position: relative;
}
.info-panel {
    display: none;
    padding: 2.2rem 2.5rem;
    animation: panelFade 0.28s ease;
}
.info-panel.active { display: block; }
@keyframes panelFade {
    from { opacity: 0; transform: translateX(6px); }
    to   { opacity: 1; transform: none; }
}

.info-panel-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 3rem;
}
.info-panel-cols.single {
    grid-template-columns: 1fr;
    max-width: 480px;
}

.info-panel p,
.info-panel li {
    font-family: "Jost", sans-serif;
    font-size: 1.2rem;
    font-weight: 400;
    line-height: 1.9;
    color: #5e4e46;
}
.info-panel ul { list-style: none; padding: 0; }
.info-panel ul li { position: relative; padding-left: 1rem; }
.info-panel ul li::before {
    content: "—";
    position: absolute;
    left: 0;
    color: var(--sage-light);
    font-size: 0.75rem;
    line-height: 2.2;
}

.info-sub {
    font-size: 0.95rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--rose);
    font-weight: 500;
    margin-top: 1.3rem;
    margin-bottom: 0.4rem;
    display: block;
}
.info-sub:first-child { margin-top: 0; }

.paikka-details p {
    font-family: "Jost", sans-serif;
    font-size: 1.1rem;
    line-height: 1.9;
    color: #5e4e46;
}
#info-paikka .info-panel-cols.single { max-width: none; }

.paikka-map-row {
    display: flex;
    gap: 0.8rem;
    align-items: stretch;
    margin-top: 1.4rem;
    height: 280px;
}
.paikka-map {
    flex: 0 0 75%;
    overflow: hidden;
    border: 1px solid rgba(181, 144, 96, 0.2);
}
.paikka-map iframe { width: 100%; height: 100%; display: block; }
.paikka-ical-btn {
    flex: 0 0 calc(25% - 0.8rem);
    margin: 0;
    padding: 0.75rem 0.5rem;
    align-self: flex-start;
}

.bank-number {
    display: inline-block;
    font-family: "Cormorant Garamond", serif;
    font-size: 1.4rem;
    letter-spacing: 0.1em;
    color: var(--bark);
    background: rgba(122, 98, 82, 0.07);
    padding: 0.2rem 0.6rem;
    margin-top: 0.35rem;
}
.contact-phone { color: var(--rose); font-weight: 400; }

/* ── MANOR PHOTOS ───────────────────────────── */
.manor-photos {
    display: grid;
    grid-template-columns: 1fr 1.2fr 1fr;
    gap: 1.5rem;
    margin: 3.5rem 0 3rem;
    align-items: center;
}
.manor-photo { margin: 0; overflow: hidden; }
.manor-photo img {
    width: 100%;
    height: 260px;
    object-fit: cover;
    display: block;
    -webkit-mask-image: radial-gradient(ellipse 82% 78% at 50% 50%, black 40%, transparent 100%);
    mask-image: radial-gradient(ellipse 82% 78% at 50% 50%, black 40%, transparent 100%);
}
.mp-1     { transform: rotate(-1.5deg) translateY(8px); }
.mp-2 img { height: 320px; }
.mp-3     { transform: rotate(1.5deg) translateY(8px); }

@media (max-width: 700px) {
    .manor-photos { grid-template-columns: 1fr; gap: 0; }
    .mp-1, .mp-3 { transform: none; }
    .manor-photo img, .mp-2 img { height: 220px; }
}

/* ── OHJELMA ─────────────────────────────────── */
.ohjelma-block {
    margin-top: 4rem;
    padding: 3rem 3rem 3.5rem;
    background: rgba(40, 32, 28, 0.94);
    backdrop-filter: blur(6px);
    scroll-margin-top: var(--nav-h);
}
.ohjelma .eyebrow { color: var(--blush); }
.ohjelma h2       { color: #faf6f1; }

.day-tabs {
    display: flex;
    margin-top: 2.5rem;
    margin-bottom: 3rem;
    border-bottom: 1px solid rgba(226, 191, 179, 0.2);
}
.day-tab {
    padding: 0.85rem 2rem;
    font-family: "Jost", sans-serif;
    font-size: 1.1rem;
    font-weight: 400;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(250, 246, 241, 0.45);
    cursor: pointer;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    background: none;
    transition: color 0.2s, border-color 0.2s;
}
.day-tab.active {
    color: var(--blush);
    border-bottom-color: var(--blush);
    font-weight: 600;
}

.day-panels { display: grid; }
.day-panel  { grid-area: 1 / 1; visibility: hidden; pointer-events: none; }
.day-panel.active { visibility: visible; pointer-events: auto; }

.timeline { position: relative; padding-left: 130px; }
.tl-item {
    position: relative;
    padding: 0 0 2.4rem 2rem;
}
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 0.44rem;
    width: 0.8rem;
    height: 0.8rem;
    border-radius: 50%;
    background: var(--rose);
    box-shadow: 0 0 0 4px rgba(184, 113, 101, 0.2);
}
.tl-time {
    position: absolute;
    left: -130px;
    top: 0;
    width: 110px;
    text-align: right;
    font-family: "Jost", sans-serif;
    font-weight: 600;
    font-size: 1.2rem;
    color: rgba(226, 191, 179, 0.85);
    letter-spacing: 0.02em;
    line-height: 1.4;
    white-space: nowrap;
}
.tl-title {
    font-family: "Playfair Display", serif;
    font-style: italic;
    font-size: 1.6rem;
    font-weight: 400;
    color: rgba(250, 246, 241, 0.95);
    margin-bottom: 0.25rem;
    line-height: 1;
}
.tl-desc {
    font-family: "Jost", sans-serif;
    font-size: 1.2rem;
    font-weight: 400;
    color: rgba(250, 246, 241, 0.7);
    line-height: 1.65;
    margin-top: 0.35rem;
}

/* ── RSVP ────────────────────────────────────── */
.rsvp {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}
.rsvp-bg {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to bottom, rgba(254, 252, 249, 1) 0%, rgba(254, 252, 249, 0.52) 40%),
        url("ilmo.jpg") center / cover no-repeat;
    filter: url('#rsvp-motion-blur');
    z-index: 0;
}
.rsvp .inner-narrow { position: relative; z-index: 2; text-align: center; }
.rsvp h2 { margin-bottom: 0.75rem; }

.btn-secondary {
    display: inline-block;
    margin-top: 1.2rem;
    padding: 0.75rem 2rem;
    border: 1px solid var(--charcoal);
    color: var(--charcoal);
    font-family: "Jost", sans-serif;
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    text-decoration: none;
    transition: all 0.25s;
    border-radius: 1px;
    cursor: pointer;
    background: transparent;
}
.btn-secondary:hover { background: var(--charcoal); color: white; }

/* ── JOTFORM ─────────────────────────────────── */
.jotform-wrap {
    background: transparent;
    overflow: hidden;
    padding: 0.5rem;
}
.jotform-wrap iframe {
    width: 100% !important;
    min-height: 600px;
    border: none !important;
}
.jotform-wrap > div {
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
}

.form-fallback {
    margin-top: 1.2rem;
    font-family: "Jost", sans-serif;
    font-size: 1rem;
    font-weight: 400;
    color: rgba(122, 98, 82, 0.5);
    text-align: center;
}
.form-fallback a {
    color: rgba(122, 98, 82, 0.65);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s;
}
.form-fallback a:hover { color: var(--rose); }

/* ── FOOTER ──────────────────────────────────── */
footer {
    background: var(--charcoal);
    padding: 4rem 2rem;
    text-align: center;
}
footer .ft-names {
    height: 72px;
    width: auto;
    display: block;
    margin: 0 auto 0.6rem;
    color: var(--blush);
}
footer p {
    font-family: "Jost", sans-serif;
    font-size: 1.1rem;
    font-weight: 400;
    color: rgba(250, 246, 241, 0.65);
    line-height: 2;
}
footer p:nth-of-type(3) { margin-top: 0.5rem; }
footer p:last-of-type   { margin-top: 1.6rem; }
.footer-rule {
    width: 40px;
    height: 1px;
    background: rgba(226, 191, 179, 0.25);
    margin: 1.5rem auto;
}

/* ── FA ICON FONT ────────────────────────────── */
@font-face {
    font-family: "FA-Solid";
    src: url("fonts/fa-solid-900.ttf") format("truetype");
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}
.fai {
    font-family: "FA-Solid";
    font-weight: 900;
    font-style: normal;
    -webkit-font-smoothing: antialiased;
    display: inline-block;
    line-height: 1;
    font-size: 1.1rem;
    color: var(--rose);
}
.fai-sm { font-size: 0.9rem; }
.fai-lg { font-size: 1.3rem; }
.fi-location::before { content: "\f3c5"; }
.fi-car::before      { content: "\f1b9"; }
.fi-dress::before    { content: "\e3b4"; }
.fi-heart::before    { content: "\f004"; }
.fi-gift::before     { content: "\f06b"; }
.fi-mic::before      { content: "\f130"; }

/* ── RESPONSIVE ──────────────────────────────── */
@media (max-width: 700px) {
    nav {
        padding: 0 1rem;
        justify-content: space-between;
        background: rgba(254, 252, 249, 0.92);
        backdrop-filter: blur(12px);
        --nav-fg: var(--charcoal);
    }
    .nav-links           { display: contents; }
    .nav-links a         { font-size: 0.8rem; letter-spacing: 0.09em; }
    .nav-center          { display: none; }

    .section             { padding: 4rem 1.2rem; }
    .ohjelma-block       { padding: 2rem 1.2rem 2.5rem; margin-top: 2.5rem; }

    .day-tabs            { margin-top: 1.5rem; margin-bottom: 2rem; }
    .day-tab             { padding: 0.7rem 1rem; font-size: 0.82rem; letter-spacing: 0.1em; flex: 1 1 auto; text-align: center; }

    .timeline            { padding-left: 96px; }
    .tl-time             { left: -96px; width: 82px; font-size: 0.85rem; line-height: 1.4; }
    .tl-title            { font-size: 1.3rem; }
    .tl-desc             { font-size: 1.05rem; }

    .info-tabs-wrap      { grid-template-columns: 1fr; }
    .info-tab-rail       { flex-direction: row; flex-wrap: wrap; border-right: none; border-bottom: 1px solid rgba(181, 144, 96, 0.2); }
    .info-tab-btn        { flex: 1 1 auto; padding: 0.8rem 0.6rem; border-bottom: none; border-right: 1px solid rgba(181, 144, 96, 0.15); justify-content: center; text-align: center; }
    .info-tab-btn:last-child { border-right: none; }
    .info-tab-label      { display: none; }
    .info-tab-icon       { font-size: 1.3rem; }
    .info-tab-btn.active::after { right: auto; left: 0; bottom: -1px; top: auto; width: 100%; height: 2px; }
    .info-panel          { padding: 1.4rem 1.2rem; }
    .info-panel p,
    .info-panel li       { font-size: 1.1rem; }
    .info-panel-cols     { grid-template-columns: 1fr; }
    .info-panel-cols > div + div { margin-top: 1.8rem; padding-top: 1.4rem; border-top: 1px solid rgba(181, 144, 96, 0.15); }
    .paikka-map-row      { flex-direction: column; min-height: unset; }
    .paikka-map iframe   { height: 220px; }
    .paikka-ical-btn     { flex: none; width: 100%; order: -1; }

    .info::before        { width: clamp(260px, 64vw, 480px); height: 100%; background-size: 100% auto; }
    .info::after         { display: none; }

    .rsvp .inner-narrow  { padding: 0 0.5rem; }

    footer               { padding: 3rem 1.2rem; }
    footer .ft-names     { height: 52px; }
    footer p             { font-size: 0.95rem; }

    .hero-names-img      { right: 4vw; bottom: 1.5rem; top: auto; left: auto; width: min(400px, 78vw); }
    .hero-pvm-img        { left: 4vw; top: calc(var(--nav-h) + 3.5rem); right: auto; bottom: auto; width: min(240px, 50vw); }
}
