/* The public landing page ("/", Home.razor only). Loaded through HeadContent, so /app and /admin never download it.
   Everything hangs off .landing and its own --landing-* tokens: nothing here touches the cabinet's tokens (app.css) or the
   administrator's Fluent variables (admin.css). Ported from the proof-of-concept web app, without Bootstrap. */

:root {
    --landing-page-bg: #F8FAFC;
    --landing-card: #FFFFFF;
    --landing-border: rgba(16, 185, 129, 0.18);
    --landing-heading: #0F172A;
    --landing-fg: #1E293B;
    --landing-muted: #64748B;
    --landing-emerald: #059669;
    --landing-glow-1: rgba(52, 211, 153, 0.07);
    --landing-glow-2: rgba(16, 185, 129, 0.04);
    --landing-store-bg: #F1F5F9;
    --landing-divider: rgba(16, 185, 129, 0.22);
    --landing-badge-bg: rgba(16, 185, 129, 0.10);
    --landing-badge-border: rgba(16, 185, 129, 0.22);
    --landing-shimmer-base: #0D9488;
    --landing-shimmer-sweep: #34D399;
}

/* System dark — only when no explicit choice (the "theme" cookie writes data-theme on <html>) overrides it. */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --landing-page-bg: #0B1120;
        --landing-card: rgba(22, 32, 50, 0.70);
        --landing-border: rgba(94, 234, 212, 0.10);
        --landing-heading: #F1F5F9;
        --landing-fg: #E2E8F0;
        --landing-muted: #94A3B8;
        --landing-emerald: #5EEAD4;
        --landing-glow-1: rgba(94, 234, 212, 0.11);
        --landing-glow-2: rgba(52, 211, 153, 0.07);
        --landing-store-bg: rgba(22, 32, 50, 0.90);
        --landing-divider: rgba(94, 234, 212, 0.30);
        --landing-badge-bg: rgba(94, 234, 212, 0.12);
        --landing-badge-border: rgba(94, 234, 212, 0.22);
        --landing-shimmer-base: #5EEAD4;
        --landing-shimmer-sweep: #FFFFFF;
    }
}

:root[data-theme="dark"] {
    --landing-page-bg: #0B1120;
    --landing-card: rgba(22, 32, 50, 0.70);
    --landing-border: rgba(94, 234, 212, 0.10);
    --landing-heading: #F1F5F9;
    --landing-fg: #E2E8F0;
    --landing-muted: #94A3B8;
    --landing-emerald: #5EEAD4;
    --landing-glow-1: rgba(94, 234, 212, 0.11);
    --landing-glow-2: rgba(52, 211, 153, 0.07);
    --landing-store-bg: rgba(22, 32, 50, 0.90);
    --landing-divider: rgba(94, 234, 212, 0.30);
    --landing-badge-bg: rgba(94, 234, 212, 0.12);
    --landing-badge-border: rgba(94, 234, 212, 0.22);
    --landing-shimmer-base: #5EEAD4;
    --landing-shimmer-sweep: #FFFFFF;
}

/* The page behind the landing is its own ground, edge to edge (same trick as body:has(.app-header) in app.css). */
body:has(.landing) {
    margin: 0;
    background: var(--landing-page-bg);
}

.landing {
    position: relative;
    min-height: 100vh;
    overflow-x: clip;
    background: var(--landing-page-bg);
    color: var(--landing-fg);
    font-family: var(--font);
    line-height: 1.5;
}

.landing *, .landing *::before, .landing *::after {
    box-sizing: border-box;
}

/* :where() keeps these resets at zero specificity, so every .landing__* margin below wins over them. */
:where(.landing) :is(h1, h2, h3, p) {
    margin: 0;
}

:where(.landing) a {
    color: inherit;
}

/* Ambient glow behind everything. */
.landing__scene {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse 80% 70% at 50% 55%, var(--landing-glow-1) 0%, transparent 70%),
        radial-gradient(ellipse 60% 60% at 50% 55%, var(--landing-glow-2) 0%, transparent 60%);
}

.landing__section {
    position: relative;
    z-index: 1;
    padding-block: 4rem;
    padding-inline: 1rem;
}

.landing__container {
    max-width: 72rem;
    margin-inline: auto;
}

.landing__head {
    text-align: center;
    margin-block-end: 3rem;
}

.landing__head h2 {
    font-size: clamp(1.6rem, 5vw, 2.2rem);
    font-weight: 700;
    color: var(--landing-heading);
}

.landing__sub {
    max-width: 34rem;
    margin: 0.75rem auto 0;
    color: var(--landing-muted);
}

.landing__divider {
    height: 1px;
    max-width: 56rem;
    margin: 0 auto;
    border: none;
    background: linear-gradient(90deg, transparent, var(--landing-divider), transparent);
}

.landing__tagline {
    margin-block-end: 0.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--landing-emerald);
}

/* Hero */
.landing__hero {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5rem 1rem 4rem;
    text-align: center;
}

.landing__hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    animation: landing-fade-up 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
}

.landing__shield {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 7rem;
    height: 7rem;
    border-radius: 50%;
    animation: landing-glow-pulse 3s ease-in-out infinite;
}

.landing__shield img {
    position: relative;
    width: 5rem;
    height: auto;
    filter: drop-shadow(0 0 18px rgba(94, 234, 212, 0.55)) drop-shadow(0 0 40px rgba(94, 234, 212, 0.25));
    transition: filter 0.4s ease;
}

.landing__shield:hover img {
    filter: drop-shadow(0 0 28px rgba(94, 234, 212, 0.75)) drop-shadow(0 0 56px rgba(94, 234, 212, 0.35));
}

.landing__ring, .landing__ring--outer {
    position: absolute;
    inset: -14px;
    border-radius: 50%;
    background: rgba(94, 234, 212, 0.15);
    animation: landing-pulse-ring 2.4s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.landing__ring--outer {
    inset: -28px;
    background: rgba(94, 234, 212, 0.07);
    animation-delay: 0.8s;
}

.landing__wordmark {
    font-size: clamp(3.5rem, 14vw, 6rem);
    font-weight: 800;
    line-height: 1;
}

.landing__shimmer {
    display: inline-block;
    background-image: linear-gradient(90deg, var(--landing-shimmer-base) 0%, var(--landing-shimmer-base) 30%, var(--landing-shimmer-sweep) 50%, var(--landing-shimmer-base) 70%, var(--landing-shimmer-base) 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: landing-shimmer 3s linear infinite;
}

.landing__lead {
    max-width: 36rem;
    font-size: 1.15rem;
    color: var(--landing-muted);
}

.landing__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

/* Buttons */
.landing__btn {
    display: inline-block;
    padding: 0.9rem 2.5rem;
    border-radius: 0.75rem;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    transition: box-shadow 0.3s ease, transform 0.2s ease, filter 0.3s ease, background 0.3s ease;
}

.landing a.landing__btn--outline {
    border: 1px solid color-mix(in srgb, var(--landing-emerald) 45%, transparent);
    color: var(--landing-emerald);
    font-weight: 600;
}

.landing a.landing__btn--outline:hover {
    background: color-mix(in srgb, var(--landing-emerald) 8%, transparent);
    box-shadow: 0 0 16px 4px color-mix(in srgb, var(--landing-emerald) 20%, transparent);
    transform: translateY(-2px);
}

/* Feature cards */
.landing__grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
}

.landing__card {
    height: 100%;
    padding: 1.75rem;
    border: 1px solid var(--landing-border);
    border-radius: 1rem;
    background: var(--landing-card);
    backdrop-filter: blur(8px);
    transition: border-color 0.35s ease, box-shadow 0.35s ease, transform 0.3s ease;
}

.landing__card:hover {
    border-color: color-mix(in srgb, var(--landing-emerald) 40%, transparent);
    box-shadow: 0 0 32px color-mix(in srgb, var(--landing-emerald) 10%, transparent), 0 8px 32px rgba(0, 0, 0, 0.12);
    transform: translateY(-6px);
}

.landing__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    margin-block-end: 1.25rem;
    border: 1px solid color-mix(in srgb, var(--landing-emerald) 25%, transparent);
    border-radius: 0.75rem;
    background: linear-gradient(135deg, color-mix(in srgb, var(--landing-emerald) 15%, transparent), color-mix(in srgb, var(--landing-emerald) 6%, transparent));
    color: var(--landing-emerald);
    transition: border-color 0.3s ease;
}

.landing__card:hover .landing__icon {
    border-color: color-mix(in srgb, var(--landing-emerald) 45%, transparent);
}

.landing__card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--landing-heading);
}

.landing__card p {
    margin-block-start: 0.5rem;
    font-size: 0.9rem;
    line-height: 1.65;
    color: var(--landing-muted);
}

/* Start block: the closing call to action. */
.landing__start {
    text-align: center;
}

.landing__start .landing__shield-small {
    display: block;
    width: 5rem;
    height: auto;
    margin: 0 auto 1.5rem;
    filter: drop-shadow(0 0 18px rgba(94, 234, 212, 0.45));
    animation: landing-float 6s ease-in-out infinite;
}

.landing__start h2 {
    margin-block-end: 0.75rem;
    font-size: clamp(1.6rem, 5vw, 2.2rem);
    font-weight: 700;
    color: var(--landing-heading);
}

.landing__badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem 2rem;
    margin-block-start: 2rem;
    font-size: 0.8rem;
    color: var(--landing-muted);
}

/* Scroll reveal: hidden only once landing.js has run, so without JavaScript everything stays visible. */
.landing--js .landing__reveal {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.landing--js .landing__reveal.landing__reveal--visible {
    opacity: 1;
    transform: none;
}

@keyframes landing-pulse-ring {
    0%, 100% { transform: scale(1); opacity: 0.35; }
    50% { transform: scale(1.22); opacity: 0.08; }
}

@keyframes landing-fade-up {
    0% { opacity: 0; transform: translateY(28px) scale(0.96); }
    100% { opacity: 1; transform: none; }
}

@keyframes landing-shimmer {
    0% { background-position: 0% 0; }
    100% { background-position: 200% 0; }
}

@keyframes landing-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

@keyframes landing-glow-pulse {
    0%, 100% { box-shadow: 0 0 24px 4px rgba(94, 234, 212, 0.25); }
    50% { box-shadow: 0 0 48px 12px rgba(94, 234, 212, 0.12); }
}

@media (prefers-reduced-motion: reduce) {
    .landing *, .landing *::before, .landing *::after {
        animation: none !important;
        transition: none !important;
    }

    .landing--js .landing__reveal {
        opacity: 1;
        transform: none;
    }
}

.landing__actions--spaced {
    margin-block: 1.5rem;
}

/* Header: the brand on one side, the language drop-down on the other (logical properties, so Hebrew mirrors it). */
.landing__header {
    position: absolute;
    inset-block-start: 0;
    inset-inline: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
}

.landing a.landing__brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--landing-heading);
    text-decoration: none;
}

.landing__langmenu {
    position: relative;
}

.landing__langmenu summary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.9rem;
    border: 1px solid var(--landing-border);
    border-radius: 0.75rem;
    background: var(--landing-store-bg);
    color: var(--landing-heading);
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.landing__langmenu summary::-webkit-details-marker {
    display: none;
}

.landing__langmenu summary::after {
    content: "";
    width: 0.45rem;
    height: 0.45rem;
    border-inline-end: 2px solid currentColor;
    border-block-end: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.2s ease;
}

.landing__langmenu[open] summary::after {
    transform: rotate(-135deg) translateY(-2px);
}

.landing__langmenu summary:hover,
.landing__langmenu summary:focus-visible {
    border-color: color-mix(in srgb, var(--landing-emerald) 50%, transparent);
}

.landing__langlist {
    position: absolute;
    inset-inline-end: 0;
    inset-block-start: calc(100% + 0.4rem);
    z-index: 6;
    display: flex;
    flex-direction: column;
    min-width: 10rem;
    padding: 0.35rem;
    border: 1px solid var(--landing-border);
    border-radius: 0.75rem;
    background: var(--landing-page-bg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}

.landing__langlist button {
    padding: 0.55rem 0.8rem;
    border: none;
    border-radius: 0.5rem;
    background: transparent;
    color: var(--landing-heading);
    font: inherit;
    text-align: start;
    cursor: pointer;
}

.landing__langlist button:hover,
.landing__langlist button:focus-visible {
    background: color-mix(in srgb, var(--landing-emerald) 12%, transparent);
}

.landing__langlist button[aria-current="true"] {
    font-weight: 700;
    color: var(--landing-emerald);
}

/* Store badges: the page's main action. Black with a light edge on both themes (a black badge on the dark page needs the edge to be seen),
   52 px tall, so a thumb hits it; the glow on hover is the site's own emerald. Logical properties, so Hebrew mirrors them. */
.landing__stores {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

.landing a.landing__store {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.7rem;
    min-width: 11rem;
    min-height: 3.25rem;
    padding: 0.4rem 1.25rem 0.4rem 1rem;
    padding-inline: 1rem 1.25rem;
    border: 1px solid #A6A6A6;
    border-radius: 0.75rem;
    background: #000000;
    color: #FFFFFF;
    text-decoration: none;
    transition: box-shadow 0.3s ease, transform 0.2s ease, border-color 0.3s ease;
}

.landing a.landing__store:hover {
    border-color: var(--landing-emerald);
    box-shadow: 0 0 20px 3px color-mix(in srgb, var(--landing-emerald) 35%, transparent);
    transform: translateY(-2px);
}

.landing a.landing__store:focus-visible {
    outline: 2px solid var(--landing-emerald);
    outline-offset: 3px;
}

.landing__store-glyph {
    flex: none;
}

.landing__store-text {
    display: flex;
    flex-direction: column;
    text-align: start;
}

.landing__store-text small {
    font-size: 0.7rem;
    line-height: 1.15;
    opacity: 0.85;
}

.landing__store-text strong {
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.01em;
}

@media (max-width: 26rem) {
    .landing__stores {
        flex-direction: column;
        align-items: stretch;
        width: min(100%, 17rem);
    }
}

/* Header: the web cabinet stays one quiet link for the people who already use it. */
.landing__header-end {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.landing a.landing__weblink {
    padding: 0.7rem 0.25rem;
    color: var(--landing-muted);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
}

.landing a.landing__weblink:hover,
.landing a.landing__weblink:focus-visible {
    color: var(--landing-heading);
    text-decoration: underline;
}
