/* Landing menu (central/partials/landing-menu.blade.php).
   Side tiles that open into pills on scroll, a hover dropdown, and a menu
   panel with inline sub-menus. Colours come from the homepage's scale
   (--h-*, landing-home.css), falling back to the landing's teal. */

.landing-v2 {
    --lp-ink: var(--h-ink, var(--dark, #0c1222));
    --lp-accent: var(--h-600, var(--primary, #0d9488));
    --lp-accent-strong: var(--h-700, var(--primary-dark, #0f766e));
    --lp-accent-soft: var(--h-50, var(--primary-bg, #ecfdf5));
    /* Sign Up Free is the page's own button: brand green with navy text */
    --lp-cta: var(--h-400, var(--primary-dark, #0f766e));
    --lp-cta-hover: var(--h-300, var(--primary-dark, #0f766e));
    --lp-cta-ink: var(--h-950, #fff);
    --lp-hover-fill: rgba(12, 18, 34, .04);
    --lp-card: #fff;
    --lp-line: rgba(12, 18, 34, .07);
    --lp-ring: rgba(255, 255, 255, .6);
    --lp-ring-on-dark: rgba(255, 255, 255, .12);
    --lp-shadow: 0 14px 34px -14px rgba(12, 18, 34, .3);
    /* Rio's text colours (2026-10-13): green text on a light surface is green-600 (4.88 on
       white); text on the green panel and the dark hero is pale mint. Mint at 72% would be
       4.3 on this green, below AA, so the panel keeps the 100% role. */
    --lp-green-text: var(--h-600, #16823f);
    --lp-on-accent: var(--h-on-dark, #fff);
    --lp-on-accent-line: rgba(255, 255, 255, .38);
    --lp-on-accent-tint: rgba(255, 255, 255, .08);
    --lp-on-accent-rule: rgba(255, 255, 255, .2);
    --lp-ease: cubic-bezier(.22, 1, .36, 1);

    --lp-top: 26px;   /* inside the hero card (top 8px on phones, 16px wider), floating clear of its edge */
    --lp-tile: 52px;
    --lp-tile-radius: 17px;

    /* The rails sit on the page's content edge, the homepage column
       (.h-footer__inner: 1280px max, 32px padding; 16px on phones) */
    --lp-gutter: 16px;
}

@media (min-width: 640px) {
    .landing-v2 { --lp-gutter: max(32px, calc(50% - 608px)); }
}

@media (min-width: 992px) {
    .landing-v2 {
        --lp-top: 34px;
        --lp-tile: 64px;
        --lp-tile-radius: 20px;
    }
}

.landing-v2 [id^="feature-"] {
    scroll-margin-top: 7rem;
}

/* ── Centre wordmark: part of the page, scrolls away ───────────────── */
.lp-brand {
    position: absolute;
    top: var(--lp-top);
    left: 50%;
    z-index: 1020;
    display: flex;
    align-items: center;
    gap: 10px;
    height: var(--lp-tile);
    transform: translateX(-50%);
    color: var(--lp-ink);
    text-decoration: none;
    white-space: nowrap;
}

.lp-brand:hover { color: var(--lp-ink); }

/* Over a dark hero ([data-home-dark-hero]): the dark-mode logo and a light
   name; without a dark-mode logo, the logo is drawn white */
.lp-brand .lp-brand__logo--dark { display: none; }
.lp-brand.is-on-dark,
.lp-brand.is-on-dark:hover { color: var(--lp-on-accent); }
.lp-brand.is-on-dark.lp-brand--has-dark .lp-brand__logo { display: none; }
.lp-brand.is-on-dark .lp-brand__logo.lp-brand__logo--dark { display: block; }
.lp-brand.is-on-dark:not(.lp-brand--has-dark) .lp-brand__logo { filter: brightness(0) invert(1); }

.lp-brand img {
    display: block;
    height: 34px;
    width: auto;
}

.lp-brand__letter {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--lp-accent-strong);
    color: var(--lp-on-accent);
    font-weight: 700;
}

.lp-brand__name {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -.01em;
}

@media (max-width: 399.98px) {
    .lp-brand { gap: 8px; }
    .lp-brand img { height: 30px; }
    .lp-brand__name { font-size: 1.05rem; }
}

/* No room for both between the tiles; the logo carries the name */
@media (max-width: 359.98px) {
    .lp-brand img + .lp-brand__name { display: none; }
}

@media (min-width: 992px) {
    .lp-brand img { height: 44px; }
    .lp-brand__name { font-size: 1.4rem; }
}

/* ── Fixed side rails ──────────────────────────────────────────────── */
.lp-menu__side {
    position: fixed;
    top: var(--lp-top);
    z-index: 1030;
    display: flex;
    align-items: center;
}

.lp-menu__side--start { inset-inline-start: var(--lp-gutter); z-index: 1028; }
.lp-menu__side--end   { inset-inline-end: var(--lp-gutter); }

/* The tile: logo on the left, menu button on the right */
.lp-tile {
    position: relative;
    z-index: 3;
    display: grid;
    place-items: center;
    flex: none;
    width: var(--lp-tile);
    height: var(--lp-tile);
    padding: 0;
    border: 1px solid var(--lp-line);
    border-radius: var(--lp-tile-radius);
    background: var(--lp-card);
    box-shadow: 0 0 0 5px var(--lp-ring), var(--lp-shadow);
    color: var(--lp-ink);
    text-decoration: none;
    cursor: pointer;
    transition: transform .2s var(--lp-ease);
}

.lp-tile img {
    width: 68%;
    height: 68%;
    object-fit: contain;
}

.lp-tile__letter {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--lp-green-text);
}

.lp-tile:active { transform: scale(.96); }

/* Over a dark hero the light ring would read as a grey frame */
.lp-tile.is-on-dark {
    border-color: transparent;
    box-shadow: 0 0 0 5px var(--lp-ring-on-dark), var(--lp-shadow);
}

.lp-tile:focus-visible,
.lp-link:focus-visible,
.lp-cta:focus-visible,
.lp-drop__card a:focus-visible {
    outline: 2px solid var(--lp-accent-strong);
    outline-offset: 3px;
}

/* Menu button: three bars that turn into a cross */
.lp-burger {
    gap: 3px;
    align-content: center;
}

.lp-burger__bar {
    display: block;
    width: 54%;
    height: 7px;
    border-radius: 3px;
    background: var(--lp-ink);
    transition: transform .35s var(--lp-ease), opacity .2s ease;
}

.lp-burger__bar:nth-child(1) { background: var(--lp-accent); }
.lp-burger__bar:nth-child(2) { background: var(--lp-accent-strong); }

@media (max-width: 991.98px) {
    .lp-burger { gap: 3px; }
    .lp-burger__bar { height: 6px; }
}

.lp-menu.is-panel-open .lp-burger__bar:nth-child(1) { transform: translateY(10px) rotate(45deg); }
.lp-menu.is-panel-open .lp-burger__bar:nth-child(2) { transform: rotate(-45deg); }
.lp-menu.is-panel-open .lp-burger__bar:nth-child(3) { transform: translateY(-10px) scaleX(.2); opacity: 0; }

@media (max-width: 991.98px) {
    .lp-menu.is-panel-open .lp-burger__bar:nth-child(1) { transform: translateY(9px) rotate(45deg); }
    .lp-menu.is-panel-open .lp-burger__bar:nth-child(3) { transform: translateY(-9px) scaleX(.2); }
}

/* ── Pills: closed into the tile at the top, open on scroll ───────── */
.lp-pill {
    position: relative;
    z-index: 1;
    display: none;
    align-items: center;
    gap: 6px;
    height: calc(var(--lp-tile) - 4px);
    visibility: hidden;
    transition: visibility 0s linear .5s;
}

/* The pill's surface; only it is clipped, so the dropdown can hang below */
.lp-pill::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    border: 1px solid var(--lp-line);
    border-radius: 22px;
    background: var(--lp-card);
    box-shadow: var(--lp-shadow);
    transition: clip-path .5s var(--lp-ease);
}

@media (min-width: 992px) {
    .lp-pill { display: flex; }
}

.lp-pill--start {
    margin-inline-start: calc(var(--lp-tile) / -2);
    padding-inline: calc(var(--lp-tile) / 2 + 18px) 22px;
}

.lp-pill--end {
    margin-inline-end: calc(var(--lp-tile) / -2);
    padding-inline: 10px calc(var(--lp-tile) / 2 + 10px);
}

.lp-pill--start::before { clip-path: inset(0 100% 0 0 round 22px); }
.lp-pill--end::before   { clip-path: inset(0 0 0 100% round 22px); }
[dir="rtl"] .lp-pill--start::before { clip-path: inset(0 0 0 100% round 22px); }
[dir="rtl"] .lp-pill--end::before   { clip-path: inset(0 100% 0 0 round 22px); }

.lp-menu.is-scrolled:not(.is-panel-open) .lp-pill,
.lp-menu.is-scrolled .lp-pill--start {
    visibility: visible;
    transition: visibility 0s;
}

/* Open: the clip reaches past the pill so its shadow shows */
.lp-menu.is-scrolled:not(.is-panel-open) .lp-pill::before,
.lp-menu.is-scrolled .lp-pill--start::before {
    clip-path: inset(-40px -40px -60px -40px round 22px);
    transition: clip-path .55s var(--lp-ease);
}

.lp-pill > * {
    opacity: 0;
    transform: translateX(-8px);
    transition: opacity .2s ease, transform .35s var(--lp-ease);
}

.lp-pill--end > * { transform: translateX(8px); }

.lp-menu.is-scrolled:not(.is-panel-open) .lp-pill > *,
.lp-menu.is-scrolled .lp-pill--start > * {
    opacity: 1;
    transform: none;
    transition-delay: .12s;
}

.lp-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 0;
    border-radius: 10px;
    background: none;
    color: var(--lp-ink);
    font-size: .8125rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: color .15s ease;
}

.lp-link:hover,
.lp-link[aria-current="page"],
.lp-drop.is-open .lp-drop__trigger {
    color: var(--lp-green-text);
}

.lp-link__icon {
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    background: var(--lp-ink);
    color: var(--lp-on-accent);
    font-size: .7rem;
}

.lp-drop__trigger .bi-plus-lg {
    font-size: .85rem;
    -webkit-text-stroke: .6px currentColor;
    transition: transform .25s var(--lp-ease);
}

.lp-drop.is-open .lp-drop__trigger .bi-plus-lg { transform: rotate(90deg); }

.lp-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: calc(var(--lp-tile) - 18px);
    padding: 0 22px;
    border-radius: 999px;
    background: var(--lp-cta);
    box-shadow: 0 6px 14px -9px var(--lp-accent-strong);
    color: var(--lp-cta-ink);
    font-size: .8125rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: transform .2s var(--lp-ease), box-shadow .2s ease, background-color .15s ease;
}

.lp-cta:hover {
    background: var(--lp-cta-hover);
    color: var(--lp-cta-ink);
    transform: translateY(-1px);
    box-shadow: 0 10px 20px -10px var(--lp-accent-strong);
}

/* ── Hover dropdown ────────────────────────────────────────────────── */
.lp-drop { position: relative; }

.lp-drop__card {
    position: absolute;
    top: calc(100% + 22px);
    inset-inline-start: -18px;
    min-width: 200px;
    padding: 8px 0;
    border: 1px solid var(--lp-card);
    border-radius: 14px;
    background: var(--lp-accent-soft);
    box-shadow: 0 20px 44px -20px rgba(12, 18, 34, .35);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-6px) scale(.98);
    transform-origin: top center;
    transition:
        opacity .18s ease,
        transform .25s var(--lp-ease),
        visibility 0s linear .25s;
}

/* Keeps the card open while the pointer crosses the gap */
.lp-drop__card::before {
    content: "";
    position: absolute;
    inset: -24px 0 auto;
    height: 24px;
}

.lp-drop.is-open .lp-drop__card {
    visibility: visible;
    opacity: 1;
    transform: none;
    transition-delay: 0s;
}

.lp-drop__card a {
    display: block;
    padding: 11px 28px;
    color: var(--lp-ink);
    font-size: .8125rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: color .15s ease, background-color .15s ease;
}

.lp-drop__card a:hover {
    background: var(--lp-hover-fill);
    color: var(--lp-green-text);
}

/* ── Menu panel ────────────────────────────────────────────────────── */
.lp-panel {
    position: fixed;
    top: calc(var(--lp-top) + 6px);
    inset-inline-end: calc(var(--lp-gutter) + 4px);
    z-index: 1029;
    width: calc(100% - 2 * var(--lp-gutter) - 4px);
    max-width: 330px;
    overflow: clip;
    padding: 22px 20px 20px;
    border-radius: 28px;
    background: var(--lp-accent-strong);
    box-shadow: 0 30px 70px -24px rgba(12, 18, 34, .55);
    color: var(--lp-on-accent);
    isolation: isolate;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px) scale(.92);
    transform-origin: top right;
    transition:
        opacity .18s ease,
        transform .3s var(--lp-ease),
        visibility 0s linear .3s;
}

[dir="rtl"] .lp-panel { transform-origin: top left; }

/* The brand mark, faint, as the panel's pattern */
.lp-panel::before {
    content: "";
    position: absolute;
    inset: -40%;
    z-index: -1;
    background-image: var(--lp-mark, none);
    background-size: 46px;
    background-repeat: space;
    opacity: .05;
    filter: grayscale(1) brightness(2.4);
    transform: rotate(-18deg);
    pointer-events: none;
}

.lp-menu.is-panel-open .lp-panel {
    visibility: visible;
    opacity: 1;
    transform: none;
    transition-delay: 0s;
}

.lp-panel__head {
    display: flex;
    align-items: center;
    min-height: 30px;
    padding-inline-end: calc(var(--lp-tile) - 10px);
    padding-bottom: 14px;
    border-bottom: 1px solid var(--lp-on-accent-rule);
}

.lp-panel__logo {
    display: block;
    height: 28px;
    width: auto;
    max-width: 100%;
}

.lp-panel__name {
    font-size: 1.05rem;
    font-weight: 700;
}

.lp-panel__rule {
    margin: 14px 0;
    border: 0;
    border-top: 1px solid var(--lp-on-accent-rule);
    opacity: 1;
}

/* Views share one grid cell, so the panel keeps its height between them.
   Only a screen too short for the menu scrolls it, with no visible bar;
   the 4px of padding keeps focus rings inside the clip. */
.lp-panel__views {
    display: grid;
    max-height: calc(100dvh - var(--lp-top) - 130px);
    margin: 10px -4px -4px;
    padding: 4px;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: none;
}

.lp-panel__views::-webkit-scrollbar { display: none; }

.lp-panel__view {
    grid-area: 1 / 1;
    min-width: 0;
    transition: opacity .2s ease, transform .3s var(--lp-ease), visibility 0s;
}

.lp-panel__view:not(.is-active) {
    visibility: hidden;
    opacity: 0;
    transform: translateX(28px);
    transition: opacity .15s ease, transform .3s var(--lp-ease), visibility 0s linear .3s;
}

.lp-panel__view[data-menu-view="main"]:not(.is-active) { transform: translateX(-28px); }
[dir="rtl"] .lp-panel__view:not(.is-active) { transform: translateX(-28px); }
[dir="rtl"] .lp-panel__view[data-menu-view="main"]:not(.is-active) { transform: translateX(28px); }

/* Two buttons share a row in equal halves while both labels fit;
   a label too long for half takes a line of its own */
.lp-panel__row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.lp-panel__row > .lp-btn {
    flex: 1 1 0;
    min-width: max-content;
    white-space: nowrap;
}

.lp-panel__list {
    display: grid;
    gap: 10px;
}

.lp-panel__list--two { grid-template-columns: 1fr 1fr; }
.lp-panel__list form { margin: 0; }

.lp-panel__title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 1rem;
    font-weight: 700;
}

.lp-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid var(--lp-on-accent-line);
    border-radius: 9px;
    background: transparent;
    color: var(--lp-on-accent);
    font-size: .8125rem;
    font-weight: 600;
    text-align: start;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.lp-btn:hover,
.lp-btn[aria-current="page"] {
    background: var(--lp-on-accent-tint);
    border-color: var(--lp-on-accent);
    color: var(--lp-on-accent);
}

.lp-btn i { font-size: .8rem; }

[dir="rtl"] .lp-btn .bi-chevron-right,
[dir="rtl"] .lp-back .bi-chevron-left {
    display: inline-block;
    transform: scaleX(-1);
}

.lp-btn--solid,
.lp-btn--solid:hover {
    border-color: var(--lp-card);
    background: var(--lp-card);
    color: var(--lp-ink);
}

.lp-btn--solid:hover { background: var(--lp-accent-soft); }

.lp-btn--glass { background: var(--lp-on-accent-tint); }

.lp-btn__flag {
    width: 18px;
    height: 12px;
    border-radius: 2px;
    object-fit: cover;
}

.lp-btn:focus-visible,
.lp-back:focus-visible,
.lp-contact:focus-visible {
    outline: 2px solid var(--lp-on-accent);
    outline-offset: 2px;
}

.lp-back {
    display: grid;
    place-items: center;
    flex: none;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 9px;
    background: var(--lp-card);
    color: var(--lp-ink);
    cursor: pointer;
}

.lp-panel__contact {
    display: grid;
    gap: 12px;
}

.lp-contact {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--lp-on-accent);
    font-size: .8125rem;
    font-weight: 500;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.lp-contact:hover { color: var(--lp-on-accent); text-decoration: underline; }

.lp-contact__icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--lp-on-accent-rule);
    font-size: .7rem;
}

/* Phones: a smaller card that floats beside the logo tile, never over it
   (17px = the tile's 5px ring, an 8px gap and the panel's 4px inset) */
@media (max-width: 575.98px) {
    .lp-panel {
        width: min(288px, calc(100% - 2 * var(--lp-gutter) - var(--lp-tile) - 17px));
        max-width: none;
        padding: 16px 14px 14px;
        border-radius: 24px;
    }
    .lp-panel__head { min-height: 26px; padding-bottom: 12px; }
    .lp-panel__logo { height: 22px; }
    .lp-panel__views { margin-top: 6px; max-height: calc(100dvh - var(--lp-top) - 112px); }
    .lp-panel__rule { margin: 11px 0; }
    .lp-panel__row,
    .lp-panel__list { gap: 8px; }
    .lp-panel__title { font-size: .9rem; }
    .lp-btn { min-height: 32px; padding: 0 11px; border-radius: 8px; font-size: .75rem; }
    .lp-back { width: 28px; height: 28px; border-radius: 8px; }
    .lp-contact { font-size: .75rem; }
    .lp-contact__icon { width: 24px; height: 24px; }
}

@media (prefers-reduced-motion: reduce) {
    .lp-menu *,
    .lp-menu *::before {
        transition-duration: .01ms !important;
        transition-delay: 0s !important;
    }
}
