/* ==========================================================================
   Chevermeto — Group Menus landing
   Minimal "printed menu" look: warm paper, black ink (from the logo) and a
   single embroidery red used sparingly for the shevitsa ornaments.
   ========================================================================== */

@layer reset, base, layout, components, motion;

/* --------------------------------------------------------------------------
   Reset
   -------------------------------------------------------------------------- */
@layer reset {
    html {
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }

    body, h1, h2, h3, p, ol, ul { margin: 0; }
    ol, ul { padding: 0; list-style: none; }
    img, svg { display: block; max-inline-size: 100%; }
    img { block-size: auto; }
}

/* --------------------------------------------------------------------------
   Tokens & base typography
   -------------------------------------------------------------------------- */
@layer base {
    :root {
        color-scheme: light;

        /* Palette */
        --paper: #f4eee3;
        --paper-raised: #faf6ee;
        --ink: #1a1714;
        --ink-soft: #5b5249;
        --accent: #9b2c22;               /* embroidery red */
        --line: color-mix(in oklab, var(--ink) 14%, transparent);
        --line-strong: color-mix(in oklab, var(--ink) 28%, transparent);

        /* Type */
        --font-display: "Kurale", "EB Garamond", Georgia, serif;
        --font-body: "EB Garamond", Georgia, "Times New Roman", serif;
        --tracking-caps: .22em;

        /* Space */
        --space-1: .5rem;
        --space-2: 1rem;
        --space-3: 1.5rem;
        --space-4: 2.5rem;
        --space-5: 4rem;
        --space-6: clamp(4rem, 2.5rem + 6vw, 8rem);
        --content: 72rem;

        /* Motion */
        --ease-out: cubic-bezier(.22, .61, .36, 1);

        /* Ornament sizes (multiples of the 13-unit band grid keep stitches crisp) */
        --band-unit: 2px;

        /* Fine paper grain */
        --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .36 0 0 0 0 .27 0 0 0 0 .18 0 0 0 .55 -.22'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");

        accent-color: var(--accent);
    }

    html { scroll-behavior: smooth; }

    body {
        background:
            var(--grain),
            radial-gradient(ellipse 80% 60% at 50% 0%, var(--paper-raised), transparent 70%),
            var(--paper);
        color: var(--ink);
        font-family: var(--font-body);
        font-size: 1.125rem;
        line-height: 1.55;
        -webkit-font-smoothing: antialiased;
        overflow-x: clip;
    }

    h1, h2, h3 {
        font-family: var(--font-display);
        font-weight: 400;
        line-height: 1.1;
        text-wrap: balance;
    }

    p { text-wrap: pretty; }

    a { color: inherit; }

    :focus-visible {
        outline: 2px solid var(--accent);
        outline-offset: 4px;
    }

    ::selection {
        background: var(--accent);
        color: var(--paper-raised);
    }

    .sprite { position: absolute; }
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */
@layer layout {
    .hero {
        position: relative;
        min-block-size: calc(100dvh - 2 * var(--space-4));
        display: grid;
        place-content: center;
        justify-items: center;
        gap: var(--space-3);
        padding: var(--space-4) var(--space-3);
        text-align: center;
    }

    .menus {
        max-inline-size: var(--content);
        margin-inline: auto;
        padding: var(--space-5) var(--space-3) var(--space-6);
    }

    .menu-grid {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: var(--space-5) var(--space-3);
    }

    .booking {
        max-inline-size: 40rem;
        margin-inline: auto;
        padding: 0 var(--space-3) var(--space-6);
        text-align: center;
        display: grid;
        justify-items: center;
        gap: var(--space-3);
    }

    .site-footer {
        display: grid;
        justify-items: center;
        gap: var(--space-1);
        padding: var(--space-4) var(--space-3);
        text-align: center;
        border-block-start: 1px solid var(--line);
        max-inline-size: var(--content);
        margin-inline: auto;
    }
}

/* --------------------------------------------------------------------------
   Components
   -------------------------------------------------------------------------- */
@layer components {

    /* Shared small-caps label style */
    .eyebrow,
    .kicker,
    .facts,
    .scroll-cue,
    .menu-word,
    .course,
    .price-label,
    .site-footer p:not(.cheers),
    .button {
        font-size: .78rem;
        letter-spacing: var(--tracking-caps);
        text-transform: uppercase;
    }

    /* Rosette ornaments inherit colour */
    .hero-watermark,
    .divider-rosette,
    .menu-seal { fill: currentColor; }

    /* ---- Embroidered border band ---------------------------------------- */
    /* Cross-stitch band (16×13 grid) inlined — masks are CORS-fetched, so a data URI
       keeps it working even when the page is opened straight from disk. */
    .band {
        --band: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 13' width='16' height='13' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h16v1h-16zM4 2h1v1h-1zM3 3h3v1h-3zM2 4h2v1h-2zM5 4h2v1h-2zM1 5h2v1h-2zM4 5h1v1h-1zM6 5h2v1h-2zM12 5h1v1h-1zM0 6h2v1h-2zM3 6h3v1h-3zM7 6h2v1h-2zM11 6h1v1h-1zM13 6h1v1h-1zM1 7h2v1h-2zM4 7h1v1h-1zM6 7h2v1h-2zM12 7h1v1h-1zM2 8h2v1h-2zM5 8h2v1h-2zM3 9h3v1h-3zM4 10h1v1h-1zM0 12h16v1h-16z'/%3E%3C/svg%3E");
        block-size: calc(13 * var(--band-unit));
        margin: var(--space-2) auto;
        inline-size: min(100% - 2 * var(--space-3), var(--content));
        background-color: var(--accent);
        mask: var(--band) repeat-x center / calc(16 * var(--band-unit)) 100%;
        print-color-adjust: exact;
    }

    /* ---- Hero ------------------------------------------------------------ */
    .hero-watermark {
        position: absolute;
        z-index: -1;
        inset-block-start: 50%;
        inset-inline-start: 50%;
        inline-size: min(120vmin, 58rem);
        aspect-ratio: 1;
        translate: -50% -50%;
        color: var(--ink);
        opacity: .025;
        pointer-events: none;
    }

    .eyebrow {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: .4rem .9rem;
        color: var(--ink-soft);
    }

    .dot {
        inline-size: .35rem;
        aspect-ratio: 1;
        background: var(--accent);
        rotate: 45deg;
    }

    .hero-logo {
        inline-size: min(100%, 36rem);
        margin-block: var(--space-2);
    }

    .hero-lede {
        max-inline-size: 34ch;
        font-size: clamp(1.2rem, 1rem + .8vw, 1.5rem);
        line-height: 1.45;
        color: var(--ink-soft);

        & em { color: var(--ink); }
    }

    .facts {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-items: baseline;
        gap: var(--space-1) var(--space-3);
        color: var(--ink-soft);

        & li + li::before {
            content: "";
            display: inline-block;
            inline-size: .3rem;
            aspect-ratio: 1;
            margin-inline-end: var(--space-3);
            vertical-align: .25em;
            background: var(--line-strong);
            rotate: 45deg;
        }

        & strong {
            font-family: var(--font-display);
            font-weight: 400;
            font-size: 1.6em;
            letter-spacing: 0;
            line-height: 1;
            color: var(--ink);
        }
    }

    .scroll-cue {
        display: grid;
        justify-items: center;
        gap: var(--space-2);
        margin-block-start: var(--space-3);
        padding: var(--space-1);
        text-decoration: none;
        color: var(--ink-soft);
        transition: color .3s;

        &:hover { color: var(--accent); }
    }

    .scroll-line {
        position: relative;
        inline-size: 1px;
        block-size: 3.5rem;
        background: var(--line);
        overflow: clip;

        &::after {
            content: "";
            position: absolute;
            inset: 0;
            background: currentColor;
            translate: 0 -100%;
        }
    }

    /* ---- Section heading ------------------------------------------------- */
    .section-head {
        display: grid;
        justify-items: center;
        gap: var(--space-2);
        text-align: center;
        margin-block-end: var(--space-5);

        & h2 { font-size: clamp(2.3rem, 1.6rem + 2.8vw, 3.6rem); }
    }

    .divider-rosette {
        inline-size: 2.75rem;
        aspect-ratio: 1;
        color: var(--accent);
        margin-block-end: var(--space-1);
    }

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

    .section-sub {
        max-inline-size: 36ch;
        color: var(--ink-soft);
        font-style: italic;
        font-size: 1.2rem;
    }

    /* ---- Menu card ------------------------------------------------------- */
    .menu {
        position: relative;
        flex: 1 1 18rem;
        max-inline-size: 22.5rem;
        display: flex;
        flex-direction: column;
        padding: var(--space-4) var(--space-3) var(--space-3);
        background: var(--paper-raised);
        border: 1px solid var(--line-strong);
        /* Inner hairline = classic printed-menu double rule */
        outline: 1px solid var(--line);
        outline-offset: -.5rem;
        text-align: center;
        transition:
            transform .5s var(--ease-out),
            box-shadow .5s var(--ease-out);

        &:hover {
            transform: translateY(-4px);
            box-shadow:
                0 1px 2px rgb(60 40 20 / .05),
                0 18px 36px -18px rgb(60 40 20 / .28);
        }
    }

    .menu-seal {
        position: absolute;
        inset-block-start: 0;
        inset-inline-start: 50%;
        inline-size: 2.6rem;
        aspect-ratio: 1;
        translate: -50% -50%;
        padding: .3rem;
        color: var(--accent);
        /* Cut the card border behind the seal; top half matches page, bottom the card */
        background: linear-gradient(var(--paper) 50%, var(--paper-raised) 0);
        clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
        print-color-adjust: exact;

        & use {
            transform-box: fill-box;
            transform-origin: center;
            transition: rotate .9s var(--ease-out);
        }
    }

    .menu:hover .menu-seal use { rotate: 90deg; }

    .menu-head h3 {
        display: grid;
        justify-items: center;
    }

    .menu-word { color: var(--ink-soft); }

    .menu-no {
        font-size: 3.4rem;
        line-height: 1;
    }

    .menu-tag {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: .75rem;
        margin-block-start: .35rem;
        font-style: italic;
        color: var(--ink-soft);

        &::before,
        &::after {
            content: "";
            inline-size: 1.5rem;
            block-size: 1px;
            background: var(--line-strong);
        }
    }

    .courses {
        display: grid;
        gap: var(--space-3);
        margin-block-start: var(--space-4);
        margin-block-end: var(--space-3);

        & li + li::before {
            content: "";
            display: block;
            inline-size: .3rem;
            aspect-ratio: 1;
            margin: 0 auto var(--space-3);
            background: var(--line-strong);
            rotate: 45deg;
        }
    }

    .course {
        display: block;
        margin-block-end: .3rem;
        font-size: .7rem;
        color: var(--accent);
    }

    .dish {
        font-family: var(--font-display);
        font-size: 1.35rem;
        line-height: 1.2;
    }

    .desc {
        margin-block-start: .2rem;
        font-style: italic;
        color: var(--ink-soft);
        font-size: 1.02rem;
        line-height: 1.4;
    }

    /* ---- Menu included items --------------------------------------------- */
    .menu-included {
        display: grid;
        justify-items: center;
        gap: .4rem;
        margin-block-end: var(--space-4);

        &::before {
            content: "";
            display: block;
            inline-size: .3rem;
            aspect-ratio: 1;
            margin: 0 auto var(--space-3);
            background: var(--line-strong);
            rotate: 45deg;
        }
    }

    .menu-included-list {
        display: inline-flex;
        flex-direction: column;
        align-items: flex-start;
        gap: .35rem;

        & li {
            display: inline-flex;
            align-items: center;
            gap: .55rem;
            font-size: 1.02rem;
            color: var(--ink-soft);
        }

        & svg {
            inline-size: 1.25rem;
            aspect-ratio: 1;
            fill: none;
            stroke: var(--accent);
            stroke-width: 1.25;
            stroke-linecap: round;
            stroke-linejoin: round;
            flex-shrink: 0;
        }
    }

    .price {
        display: flex;
        align-items: baseline;
        gap: .5rem;
        margin-block-start: auto;
        padding-block-start: var(--space-2);
        border-block-start: 1px solid var(--line);
        text-align: start;

        & data {
            font-family: var(--font-display);
            font-size: 2.5rem;
            line-height: 1;
        }
    }

    .price-label {
        font-size: .7rem;
        color: var(--ink-soft);
    }

    .leader {
        flex: 1;
        border-block-end: 1px dotted var(--line-strong);
        min-inline-size: 1rem;
    }

    .cur {
        font-family: var(--font-display);
        font-size: 1.4rem;
        margin-inline-start: -.25rem;
    }

    /* ---- Booking CTA ----------------------------------------------------- */
    .booking {
        & h2 { font-size: clamp(2rem, 1.5rem + 2vw, 3rem); }

        & p {
            color: var(--ink-soft);
            font-size: 1.2rem;
            max-inline-size: 38ch;
        }
    }

    .button {
        display: inline-flex;
        align-items: center;
        min-block-size: 3.25rem;
        padding-inline: 2.25rem;
        margin-block-start: var(--space-1);
        background: var(--ink);
        color: var(--paper-raised);
        border: 1px solid var(--ink);
        text-decoration: none;
        font-family: var(--font-body);
        font-weight: 500;
        font-size: .82rem;
        transition: background-color .35s var(--ease-out), border-color .35s var(--ease-out);

        &:hover {
            background: var(--accent);
            border-color: var(--accent);
        }
    }

    /* ---- Footer ---------------------------------------------------------- */
    .cheers {
        font-family: var(--font-display);
        font-size: 2rem;
        color: var(--accent);
    }

    .site-footer p:not(.cheers) {
        color: var(--ink-soft);
        font-size: .72rem;
    }

    /* ---- Small screens --------------------------------------------------- */
    @media (width < 34rem) {
        .facts {
            flex-direction: column;
            align-items: center;
            gap: .25rem;

            & li + li::before { display: none; }
        }

        .menu { padding-inline: var(--space-2); }
    }
}

/* --------------------------------------------------------------------------
   Motion — gentle and few. Everything is skipped for reduced-motion users.
   -------------------------------------------------------------------------- */
@layer motion {
    @keyframes fade-up {
        from { opacity: 0; translate: 0 16px; }
    }

    @keyframes ink-in {
        from { opacity: 0; filter: blur(6px); scale: .985; }
    }

    @keyframes stitch {
        from { clip-path: inset(0 50%); }
        to { clip-path: inset(0 0); }
    }

    @keyframes spin {
        to { rotate: 1turn; }
    }

    @keyframes cue {
        from { translate: 0 -100%; }
        to { translate: 0 100%; }
    }

    @keyframes turn-in {
        from { rotate: -90deg; opacity: 0; }
    }

    @media (prefers-reduced-motion: no-preference) {
        /* Page load: staggered fade-in of the hero */
        .reveal-load {
            animation: fade-up 1s var(--ease-out) both;
            animation-delay: calc(var(--d, 0) * 140ms + 250ms);
        }

        .hero-logo.reveal-load {
            animation-name: ink-in;
            animation-duration: 1.6s;
        }

        /* Border band "stitches" outward from the centre */
        .band { animation: stitch 1.8s var(--ease-out) both; }

        /* Barely-there watermark rotation */
        .hero-watermark { animation: spin 240s linear infinite; }

        .scroll-line::after { animation: cue 2.8s var(--ease-out) infinite; }

        /* Scroll-driven reveals (progressive enhancement; content is simply
           visible in browsers without support) */
        @supports ((animation-timeline: view()) and (animation-range: entry)) {
            .section-head > :not(.divider-rosette),
            .booking > :not(.divider-rosette),
            .menu {
                animation: fade-up linear both;
                animation-timeline: view();
                animation-range: entry 0% cover 30%;
            }

            .menu:nth-child(3n + 2) { animation-range: entry 10% cover 34%; }
            .menu:nth-child(3n) { animation-range: entry 20% cover 38%; }

            .divider-rosette {
                animation: turn-in linear both;
                animation-timeline: view();
                animation-range: entry 0% cover 45%;
            }
        }
    }

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

        .menu,
        .menu-seal use { transition: none; }

        .menu:hover { transform: none; }
    }
}

/* --------------------------------------------------------------------------
   Print — the page doubles as a printable flyer
   -------------------------------------------------------------------------- */
@media print {
    body { background: #fff; }

    .hero { min-block-size: auto; padding-block: var(--space-3); }

    .hero-watermark,
    .scroll-cue,
    .booking .button { display: none; }

    .menus { padding-block: var(--space-2); }

    .menu {
        break-inside: avoid;
        box-shadow: none;
    }
}
