:root {
    --color-bg: #f7f4ee;
    --color-surface: #ffffff;
    --color-text: #292722;
    --color-muted: #77736c;
    --color-accent: #9c8165;
    --color-accent-strong: #73583f;
    --color-accent-light: #e9dfd3;
    --color-sage: #8f9988;
    --color-sage-soft: #eef2ed;
    --color-clay: #c9a18c;
    --color-border: rgba(41, 39, 34, 0.12);
    --font-heading: "Noto Serif Armenian", Georgia, serif;
    --font-body: "Noto Sans Armenian", Arial, sans-serif;
    --container: 1120px;
}

body {
    overflow-x: hidden;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.7;
    letter-spacing: 0;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
}

:focus-visible {
    outline: 3px solid rgba(143, 153, 136, 0.75);
    outline-offset: 3px;
}

.skip-link {
    position: fixed;
    left: max(16px, env(safe-area-inset-left));
    top: max(16px, env(safe-area-inset-top));
    z-index: 20;
    transform: translateY(-140%);
    border-radius: 8px;
    background: var(--color-surface);
    color: var(--color-text);
    padding: 12px 16px;
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(41, 39, 34, 0.14);
}

.skip-link:focus {
    transform: translateY(0);
}

.hero {
    position: relative;
    min-height: calc(100svh - 28px);
    overflow: hidden;
    isolation: isolate;
    background: var(--color-text);
}

.hero__media,
.hero__media img,
.hero__shade {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.hero__media img {
    object-fit: cover;
    object-position: center 34%;
}

.hero__shade {
    z-index: 1;
    background:
        linear-gradient(180deg, rgba(16, 14, 12, 0.35) 0%, rgba(16, 14, 12, 0.18) 43%, rgba(16, 14, 12, 0.68) 100%),
        linear-gradient(90deg, rgba(16, 14, 12, 0.36), rgba(16, 14, 12, 0.04) 46%, rgba(16, 14, 12, 0.35));
}

.hero__content {
    position: relative;
    z-index: 2;
    display: grid;
    align-content: end;
    justify-items: center;
    width: min(100%, 920px);
    min-height: calc(100svh - 28px);
    margin: 0 auto;
    padding: max(32px, env(safe-area-inset-top)) 22px max(34px, env(safe-area-inset-bottom));
    color: #fffaf4;
    text-align: center;
}

.hero__kicker,
.section__kicker {
    color: var(--color-accent-strong);
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: 0;
}

.hero__kicker {
    color: #f0e5d7;
}

.hero h1 {
    margin-top: 10px;
    font-family: var(--font-heading);
    font-size: clamp(3rem, 3.85rem, 4.15rem);
    font-weight: 700;
    line-height: 1.08;
    text-wrap: balance;
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.42);
}

.hero__date {
    margin-top: 16px;
    border-top: 1px solid rgba(255, 250, 244, 0.46);
    border-bottom: 1px solid rgba(255, 250, 244, 0.46);
    padding: 9px 22px;
    color: #fffaf4;
    font-size: 1.1rem;
    font-weight: 700;
}

.hero__text {
    width: min(100%, 560px);
    margin-top: 18px;
    color: rgba(255, 250, 244, 0.92);
    font-size: 1.05rem;
}

.scroll-cue {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    margin-top: 22px;
    border: 1px solid rgba(255, 250, 244, 0.48);
    border-radius: 50%;
    text-decoration: none;
}

.scroll-cue span {
    width: 9px;
    height: 9px;
    border-right: 2px solid #fffaf4;
    border-bottom: 2px solid #fffaf4;
    transform: rotate(45deg);
}

.section {
    padding: 78px 0;
}

.section__inner {
    width: min(calc(100% - 36px), var(--container));
    margin: 0 auto;
}

.section__inner--narrow {
    width: min(calc(100% - 36px), 760px);
    text-align: center;
}

.section h2 {
    margin-top: 10px;
    font-family: var(--font-heading);
    font-size: clamp(2rem, 2.55rem, 2.7rem);
    font-weight: 700;
    line-height: 1.18;
    text-wrap: balance;
}

.section h3 {
    font-family: var(--font-heading);
    font-size: 1.12rem;
    line-height: 1.35;
}

.section p {
    overflow-wrap: anywhere;
}

.section__inner--narrow > p:last-child,
.date-panel p,
.story-copy p,
.location-copy p,
.rsvp-copy p,
.section--final p {
    margin-top: 18px;
    color: var(--color-muted);
}

.section--intro,
.section--program,
.section--final {
    background: var(--color-bg);
}

.section--date,
.section--story,
.section--rsvp {
    background: var(--color-surface);
}

.section--countdown {
    background: var(--color-sage-soft);
}

.section--sage {
    background: #f3f5f0;
}

.date-layout,
.story-layout,
.location-layout,
.rsvp-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
    gap: 48px;
    align-items: center;
}

.date-panel,
.story-copy,
.location-copy,
.rsvp-copy {
    min-width: 0;
}

.calendar-block {
    display: grid;
    place-items: center;
    justify-self: center;
    width: min(100%, 300px);
    aspect-ratio: 1;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(143, 153, 136, 0.16), rgba(255, 255, 255, 0.9)),
        var(--color-surface);
    color: var(--color-text);
    text-align: center;
}

.calendar-block span {
    align-self: end;
    color: var(--color-accent-strong);
    font-weight: 700;
}

.calendar-block strong {
    align-self: center;
    font-family: var(--font-heading);
    font-size: 5rem;
    line-height: 0.95;
}

.calendar-block small {
    align-self: start;
    color: var(--color-muted);
    font-size: 0.95rem;
}

.countdown {
    display: grid;
    grid-template-columns: repeat(4, minmax(68px, 1fr));
    gap: 12px;
    width: min(100%, 640px);
    margin: 32px auto 0;
}

.countdown__item {
    display: grid;
    place-items: center;
    min-height: 104px;
    border: 1px solid rgba(143, 153, 136, 0.34);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.76);
    padding: 12px 8px;
}

.countdown__item span {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.countdown__item small {
    margin-top: 6px;
    color: var(--color-muted);
    font-size: 0.88rem;
}

.countdown__done {
    margin-top: 22px;
    color: var(--color-accent-strong);
    text-align: center;
    font-weight: 700;
}

.story-copy p + p {
    margin-top: 14px;
}

.story-photo,
.location-image {
    overflow: hidden;
    border-radius: 8px;
    background: var(--color-accent-light);
}

.story-photo {
    aspect-ratio: 4 / 5;
}

.story-photo img,
.location-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.section-heading {
    width: min(100%, 680px);
    margin: 0 auto 32px;
    text-align: center;
}

.program-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.program-card,
.form-shell {
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface);
}

.program-card {
    display: grid;
    align-content: start;
    min-height: 256px;
    padding: 24px;
}

.program-card time {
    color: var(--color-accent-strong);
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1;
}

.program-card h3 {
    margin-top: 18px;
    color: var(--color-text);
}

.program-card p {
    margin-top: 10px;
    color: var(--color-muted);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    width: fit-content;
    max-width: 100%;
    margin-top: 22px;
    border: 1px solid var(--color-accent);
    border-radius: 8px;
    background: var(--color-accent);
    color: #ffffff;
    padding: 12px 18px;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
    text-decoration: none;
    transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.button:hover {
    background: var(--color-accent-strong);
    border-color: var(--color-accent-strong);
}

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

.button--ghost {
    align-self: end;
    background: transparent;
    color: var(--color-accent-strong);
}

.button--ghost:hover {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: #ffffff;
}

.location-layout {
    grid-template-columns: minmax(260px, 0.95fr) minmax(0, 1.05fr);
}

.location-layout--reverse {
    grid-template-columns: minmax(0, 1.05fr) minmax(260px, 0.95fr);
}

.location-layout--reverse .location-image {
    order: 2;
}

.location-image {
    aspect-ratio: 4 / 3;
}

.form-shell {
    padding: 24px;
}

.form-field + .form-field,
.form-field + .honeypot,
.honeypot + .form-message {
    margin-top: 18px;
}

label,
legend {
    display: block;
    color: var(--color-text);
    font-weight: 700;
    line-height: 1.4;
}

input,
textarea {
    width: 100%;
    min-height: 48px;
    margin-top: 8px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: #fffdfa;
    color: var(--color-text);
    padding: 12px 14px;
}

textarea {
    min-height: 116px;
}

input[aria-invalid="true"],
textarea[aria-invalid="true"] {
    border-color: #b34e4e;
}

.radio-line {
    display: flex;
    align-items: center;
    min-height: 48px;
    margin-top: 8px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: #fffdfa;
    padding: 10px 12px;
    cursor: pointer;
}

.radio-line input {
    flex: 0 0 auto;
    width: 22px;
    min-height: 22px;
    height: 22px;
    margin: 0 12px 0 0;
    accent-color: var(--color-accent);
}

.radio-line span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.field-error {
    min-height: 1.35em;
    margin-top: 6px;
    color: #a14242;
    font-size: 0.9rem;
    line-height: 1.35;
}

.form-message {
    min-height: 1.5em;
    margin-top: 14px;
    color: #a14242;
    font-weight: 700;
}

.button--submit {
    width: 100%;
    margin-top: 16px;
}

.button--submit:disabled {
    cursor: progress;
    opacity: 0.72;
}

.honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.rsvp-success {
    border: 1px solid rgba(143, 153, 136, 0.35);
    border-radius: 8px;
    background: var(--color-sage-soft);
    padding: 26px;
    text-align: center;
}

.rsvp-success h3 {
    font-size: 1.45rem;
}

.rsvp-success p {
    margin-top: 10px;
    color: var(--color-muted);
}

.section--final {
    padding-bottom: max(64px, env(safe-area-inset-bottom));
}

.has-js .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 520ms ease, transform 520ms ease;
}

.has-js .reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 900px) {
    .date-layout,
    .story-layout,
    .location-layout,
    .location-layout--reverse,
    .rsvp-layout {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .location-layout--reverse .location-image {
        order: 0;
    }

    .program-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .hero {
        min-height: calc(100svh - 22px);
    }

    .hero__content {
        min-height: calc(100svh - 22px);
        padding-right: max(18px, env(safe-area-inset-right));
        padding-left: max(18px, env(safe-area-inset-left));
    }

    .hero h1 {
        font-size: clamp(2.7rem, 3.05rem, 3.2rem);
    }

    .hero__text {
        font-size: 1rem;
    }

    .section {
        padding: 58px 0;
    }

    .section__inner {
        width: min(calc(100% - 28px), var(--container));
    }

    .section h2 {
        font-size: clamp(1.82rem, 2.05rem, 2.2rem);
    }

    .calendar-block {
        width: min(100%, 252px);
    }

    .calendar-block strong {
        font-size: 4.35rem;
    }

    .countdown {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .countdown__item {
        min-height: 92px;
    }

    .program-card,
    .form-shell {
        padding: 18px;
    }
}

@media (max-width: 340px) {
    .section__inner {
        width: min(calc(100% - 24px), var(--container));
    }

    .hero h1 {
        font-size: clamp(2.45rem, 2.65rem, 2.8rem);
    }

    .hero__date {
        padding-right: 16px;
        padding-left: 16px;
    }
}

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

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }

    .has-js .reveal {
        opacity: 1;
        transform: none;
    }
}
