/* =========================================================
   Patinova Texture — landing page
   Builds on the tokens, nav, footer and .cta-button in style.css.
   Initial "hidden" states exist ONLY under html.lp-anim, which a head
   script adds when motion is allowed and landing.js removes if GSAP
   fails to load — so content is never stuck invisible.
   ========================================================= */

.lp { background: var(--color-bg); }
.lp a.logo { text-decoration: none; }

.lp-wrap {
    width: min(1180px, 100% - 2 * clamp(1.25rem, 5vw, 3rem));
    margin-inline: auto;
}

.lp-eyebrow {
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--color-accent);
}
html[dir="rtl"] .lp-eyebrow { letter-spacing: 0; }

.lp-h2 {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(2rem, 4.4vw, 3.4rem);
    line-height: 1.1;
    letter-spacing: -0.015em;
    color: var(--color-heading);
    margin-top: 0.7rem;
}

.lp-lead {
    font-size: clamp(1.02rem, 1.4vw, 1.18rem);
    line-height: 1.7;
    color: var(--color-text-muted);
    max-width: 52ch;
    margin-top: 1.1rem;
}

.lp .lp-dark :focus-visible,
.lp-dark :focus-visible { outline: 2px solid var(--color-accent-bright); outline-offset: 3px; }
.lp a:focus-visible, .lp button:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; }

/* ---------------- Hero ---------------- */
.lp-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    align-items: center;
    padding: clamp(6.5rem, 12vh, 8rem) 0 clamp(4.5rem, 9vh, 6rem);
    background: var(--color-bg-deep);
    color: var(--color-text-on-dark);
}

.lp-hero::before { /* paper-grain texture */
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: 0.09;
    mix-blend-mode: overlay;
    pointer-events: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

.lp-orb {
    position: absolute;
    z-index: -2;
    border-radius: 50%;
    filter: blur(70px);
    pointer-events: none;
}
.lp-orb-jade  { width: 46vw; height: 46vw; max-width: 640px; max-height: 640px; inset-inline-end: -8%; top: -12%; background: radial-gradient(circle, rgba(79,196,140,0.34), transparent 68%); }
.lp-orb-lapis { width: 52vw; height: 52vw; max-width: 720px; max-height: 720px; inset-inline-start: -14%; bottom: -26%; background: radial-gradient(circle, rgba(44,91,138,0.5), transparent 68%); }

.lp-hero-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    align-items: center;
    gap: clamp(2rem, 6vw, 5rem);
}

.lp-hero .lp-eyebrow { color: var(--color-accent-bright); }

.lp-title {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(2.9rem, 7.2vw, 6.1rem);
    line-height: 1.02;
    letter-spacing: -0.025em;
    color: var(--color-text-on-dark);
    margin: 1.1rem 0 1.5rem;
}
html[lang="fa"] .lp-title { line-height: 1.25; letter-spacing: 0; }
.lp-title .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.14em; margin-bottom: -0.14em; }
.lp-title .wi { display: inline-block; will-change: transform; }

.lp-hero-sub {
    font-size: clamp(1.05rem, 1.5vw, 1.25rem);
    line-height: 1.65;
    color: var(--color-text-on-dark-muted);
    max-width: 46ch;
}

.lp-hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 2.1rem; align-items: center; }

.lp-btn-ghost {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    padding: 0.95rem 2rem;
    border: 1.5px solid rgba(234, 245, 239, 0.32);
    border-radius: var(--radius-pill);
    color: var(--color-text-on-dark);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}
.lp-btn-ghost:hover { background: rgba(234, 245, 239, 0.1); border-color: rgba(234, 245, 239, 0.6); transform: translateY(-2px); }

.lp-hero-art { justify-self: center; margin: 0; max-width: 100%; }
.lp-hero-mat {
    padding: 0.65rem;
    border-radius: 20px;
    background: rgba(234, 245, 239, 0.07);
    border: 1px solid rgba(234, 245, 239, 0.16);
    box-shadow: var(--shadow-xl);
}
/* ---- Patina torch: dusty base photo + vivid twin uncovered by a cursor-following light ---- */
.lp-torch { position: relative; overflow: hidden; border-radius: 13px; touch-action: pan-y; isolation: isolate; }
.lp-torch-base {
    display: block;
    height: clamp(340px, 66vh, 620px);
    width: auto;
    max-width: 100%;
    filter: grayscale(0.88) sepia(0.15) brightness(0.46) contrast(0.85);
}
.lp-torch-reveal { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.lp-torch-reveal img { display: block; width: 100%; height: 100%; object-fit: contain; filter: saturate(1.45) contrast(1.1) brightness(1.2); }
.lp-torch-glow {
    position: absolute; left: 0; top: 0; z-index: 2; width: 420px; height: 420px; border-radius: 50%;
    pointer-events: none; mix-blend-mode: screen; will-change: transform;
    background: radial-gradient(circle, rgba(244, 205, 120, 0.3), transparent 62%);
    transform: translate3d(-999px, -999px, 0);
    display: none;
}
/* JS adds .is-live; before that (no JS) the vivid layer just shows in full */
.lp-torch.is-live .lp-torch-glow { display: block; }
.lp-torch.is-live .lp-torch-reveal {
    -webkit-mask-image: radial-gradient(circle calc(var(--tr, 150) * 1px) at calc(var(--tx, -400) * 1px) calc(var(--ty, -400) * 1px), #000 0 var(--core, 50%), transparent 100%);
            mask-image: radial-gradient(circle calc(var(--tr, 150) * 1px) at calc(var(--tx, -400) * 1px) calc(var(--ty, -400) * 1px), #000 0 var(--core, 50%), transparent 100%);
}
@media (hover: hover) and (pointer: fine) { .lp-torch.is-live { cursor: none; } }
.lp-torch-hint { margin-top: 0.4rem; font-size: 0.8rem; color: var(--color-text-on-dark-muted); text-align: center; }
.lp-hero-art figcaption {
    margin-top: 0.9rem;
    font-size: 0.85rem;
    color: var(--color-text-on-dark-muted);
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}
.lp-hero-art figcaption a { color: var(--color-text-on-dark); text-decoration: none; border-bottom: 1px solid rgba(234, 245, 239, 0.35); }
.lp-hero-art figcaption a:hover { border-color: var(--color-accent-bright); color: var(--color-accent-bright); }

.lp-scroll {
    position: absolute;
    inset-inline-start: 50%;
    bottom: 1.4rem;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--color-text-on-dark-muted);
    text-decoration: none;
}
html[dir="rtl"] .lp-scroll { transform: translateX(50%); letter-spacing: 0; }
.lp-scroll i { display: block; width: 1px; height: 38px; background: linear-gradient(var(--color-accent-bright), transparent); transform-origin: top; animation: lp-cue 2.2s ease-in-out infinite; }
@keyframes lp-cue { 0% { transform: scaleY(0); } 45% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* ---------------- Marquee ---------------- */
.lp-marquee { overflow: hidden; background: var(--color-surface); border-block: 1px solid var(--color-border); padding: 1.15rem 0; }
.lp-marquee-track { display: flex; width: max-content; animation: lp-marquee 42s linear infinite; }
.lp-marquee:hover .lp-marquee-track { animation-play-state: paused; }
.lp-marquee-group { display: flex; flex-shrink: 0; }
.lp-marquee-group span {
    font-family: var(--font-display);
    font-style: italic;
    font-size: clamp(1.25rem, 2.4vw, 1.7rem);
    color: var(--color-heading);
    padding-inline: 1.6rem;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 3.2rem;
}
.lp-marquee-group span::after { content: ''; width: 7px; height: 7px; background: var(--color-accent); transform: rotate(45deg); flex: none; }
html[lang="fa"] .lp-marquee-group span { font-style: normal; }
@keyframes lp-marquee { to { transform: translateX(-50%); } }
@keyframes lp-marquee-rtl { to { transform: translateX(50%); } }
html[dir="rtl"] .lp-marquee-track { animation-name: lp-marquee-rtl; }

/* ---------------- Craft ---------------- */
.lp-craft { padding: clamp(4.5rem, 10vw, 8rem) 0; }
.lp-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1rem, 2.4vw, 1.75rem); margin-top: clamp(2.5rem, 5vw, 4rem); }
.lp-step {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: clamp(1.6rem, 3vw, 2.3rem);
    box-shadow: var(--shadow-xs);
    transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}
.lp-step:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); border-color: var(--color-border-strong); }
.lp-step-num { font-family: var(--font-display); font-size: 3.2rem; line-height: 1; color: var(--color-accent-light); font-weight: 500; }
.lp-step-line { display: block; height: 2px; width: 56px; margin: 1.2rem 0; background: var(--color-accent); transform-origin: left center; }
html[dir="rtl"] .lp-step-line { transform-origin: right center; }
.lp-step h3 { font-family: var(--font-display); font-size: 1.5rem; font-weight: 500; color: var(--color-heading); margin-bottom: 0.6rem; }
.lp-step p { color: var(--color-text-muted); line-height: 1.7; }

/* ---------------- Showcase ---------------- */
.lp-showcase { padding: clamp(4rem, 9vw, 7rem) 0; background: var(--color-bg-alt); }
.lp-showcase-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.lp-arrows { display: flex; gap: 0.6rem; }
.lp-arrow {
    width: 48px; height: 48px; border-radius: 50%;
    border: 1.5px solid var(--color-border-strong);
    background: var(--color-surface);
    color: var(--color-heading);
    display: grid; place-items: center;
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease, opacity 0.25s ease;
}
.lp-arrow:hover:not(:disabled) { background: var(--color-heading); color: var(--color-text-on-dark); transform: translateY(-2px); }
.lp-arrow:disabled { opacity: 0.35; cursor: default; }
html[dir="rtl"] .lp-arrow svg { transform: scaleX(-1); }

.lp-track {
    display: flex;
    gap: clamp(1rem, 2vw, 1.75rem);
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    padding: 2.2rem max(clamp(1.25rem, 5vw, 3rem), calc((100vw - 1180px) / 2)) 1.5rem;
    scroll-padding-inline: max(clamp(1.25rem, 5vw, 3rem), calc((100vw - 1180px) / 2));
    overscroll-behavior-x: contain;
}
.lp-track::-webkit-scrollbar { display: none; }
.lp-card { flex: 0 0 auto; scroll-snap-align: start; display: block; text-decoration: none; color: inherit; transition: transform 0.4s ease; }
.lp-card:hover { transform: translateY(-8px); }
.lp-card-media {
    height: clamp(300px, 54vh, 520px);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.4s ease;
}
.lp-card:hover .lp-card-media { box-shadow: var(--shadow-lg); }
.lp-card-media { position: relative; background: var(--color-border); }
.lp-card-media > img { height: 100%; width: auto; display: block; }

/* Side-to-side photo scrub: extra photos are stacked over the cover, each shown whole (contain, never cropped) */
.lp-card-media .lp-extra {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: contain; background: var(--color-border);
    opacity: 0; transition: opacity 0.18s ease;
}
.lp-card-media .lp-extra.is-on { opacity: 1; }
.lp-ticks { position: absolute; inset-inline: 12px; bottom: 10px; display: none; gap: 4px; z-index: 3; pointer-events: none; }
.lp-ticks i { flex: 1; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.5); box-shadow: 0 0 0 1px rgba(14, 38, 32, 0.18); transition: background 0.18s ease; }
.lp-ticks i.on { background: #fff; }
.lp-pill {
    position: absolute; left: 0; top: 0; z-index: 4; width: 46px; height: 46px; border-radius: 50%;
    display: none; align-items: center; justify-content: center; gap: 2px; color: #fff; pointer-events: none;
    background: rgba(255, 255, 255, 0.22); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.4); box-shadow: var(--shadow-md);
    opacity: 0; transition: opacity 0.2s ease; will-change: transform;
}
.lp-pill.on { opacity: 1; }
@media (hover: hover) and (pointer: fine) {
    .lp-card.has-photos .lp-card-media { cursor: none; }
    .lp-card.has-photos .lp-pill { display: flex; }
    .lp-card.has-photos .lp-ticks { display: flex; }
}
.lp-show-hint { margin-top: 0.6rem; font-size: 0.95rem; }
.lp-card-info { margin-top: 1rem; }
.lp-card-info h3 { font-family: var(--font-display); font-weight: 500; font-size: 1.25rem; color: var(--color-heading); }
.lp-card-info span { font-size: 0.74rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--color-lapis); }
html[dir="rtl"] .lp-card-info span { letter-spacing: 0; }
.lp-progress { height: 3px; background: var(--color-border-strong); border-radius: 3px; overflow: hidden; margin-top: 0.5rem; }
.lp-progress span { display: block; height: 100%; width: 100%; background: var(--color-accent); transform: scaleX(0.2); transform-origin: left center; }
html[dir="rtl"] .lp-progress span { transform-origin: right center; }

/* ---------------- Stats ---------------- */
.lp-stats { background: var(--color-bg-deep); color: var(--color-text-on-dark); padding: clamp(3.5rem, 8vw, 6rem) 0; }
.lp-stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; }
.lp-stat { padding: 0.5rem 1rem; }
.lp-stat + .lp-stat { border-inline-start: 1px solid rgba(234, 245, 239, 0.14); }
.lp-stat strong { display: block; font-family: var(--font-display); font-weight: 500; font-size: clamp(3rem, 8vw, 5.5rem); line-height: 1; color: var(--color-accent-bright); font-variant-numeric: tabular-nums; }
.lp-stat span { display: block; margin-top: 0.7rem; color: var(--color-text-on-dark-muted); font-size: 0.98rem; }

/* ---------------- Macro / look closer ---------------- */
.lp-macro { padding: clamp(4.5rem, 10vw, 8rem) 0; }
.lp-macro-grid { display: grid; grid-template-columns: 0.8fr 1.2fr; align-items: center; gap: clamp(2rem, 6vw, 5.5rem); }
.lp-macro-media { justify-self: center; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--color-border); background: var(--color-surface); box-shadow: var(--shadow-md); }
.lp-macro-media img { display: block; height: clamp(360px, 72vh, 640px); width: auto; max-width: 100%; }
.lp-points { list-style: none; margin-top: 1.8rem; display: grid; gap: 1rem; }
.lp-points li { display: flex; gap: 0.9rem; align-items: flex-start; color: var(--color-text); line-height: 1.6; }
.lp-points li::before { content: ''; flex: none; margin-top: 0.55rem; width: 8px; height: 8px; background: var(--color-accent); transform: rotate(45deg); }

/* ---------------- Final CTA ---------------- */
.lp-cta {
    position: relative; isolation: isolate; overflow: hidden; text-align: center;
    padding: clamp(5rem, 11vw, 9rem) 0;
    background: linear-gradient(160deg, var(--color-bg-deep) 0%, var(--color-lapis-dark) 100%);
    color: var(--color-text-on-dark);
}
.lp-cta::before { content: ''; position: absolute; inset: 0; z-index: -1; background: radial-gradient(60% 70% at 50% 0%, rgba(79,196,140,0.22), transparent 70%); }
.lp-cta .lp-h2 { color: var(--color-text-on-dark); max-width: 18ch; margin-inline: auto; }
.lp-cta .lp-lead { color: var(--color-text-on-dark-muted); margin-inline: auto; }
.lp-cta .lp-hero-actions { justify-content: center; }

/* ---------------- Animation gate (initial states) ---------------- */
html.lp-anim .lp-title { visibility: hidden; }

/* ---------------- Responsive ---------------- */
@media (max-width: 900px) {
    .lp-hero-grid { grid-template-columns: 1fr; text-align: start; }
    .lp-hero-art { order: 2; }
    .lp-torch-base { height: clamp(300px, 52vh, 460px); }
    .lp-steps { grid-template-columns: 1fr; }
    .lp-macro-grid { grid-template-columns: 1fr; }
    .lp-scroll { display: none; }
}
@media (max-width: 560px) {
    .lp-stats-grid { grid-template-columns: 1fr; gap: 1.6rem; }
    .lp-stat + .lp-stat { border-inline-start: 0; border-top: 1px solid rgba(234, 245, 239, 0.14); padding-top: 1.6rem; }
    .lp-hero-actions .cta-button, .lp-hero-actions .lp-btn-ghost { width: 100%; justify-content: center; text-align: center; }
    .lp-showcase-head { align-items: flex-start; }
}

/* ---------------- Reduced motion: final readable state, no looping motion ---------------- */
@media (prefers-reduced-motion: reduce) {
    .lp-marquee-track { animation: none; width: auto; flex-wrap: wrap; justify-content: center; }
    .lp-marquee-group[aria-hidden="true"] { display: none; }
    .lp-marquee-group { flex-wrap: wrap; justify-content: center; row-gap: 0.6rem; }
    .lp-scroll i { animation: none; }
    /* no torch: show the finished, vivid photo and skip the "move your cursor" hint */
    .lp-torch.is-live .lp-torch-reveal { -webkit-mask-image: none; mask-image: none; }
    .lp-torch-glow, .lp-torch-hint { display: none !important; }
    .lp-card-media .lp-extra, .lp-ticks i { transition: none; }
    .lp-card, .lp-step, .lp-card-media, .lp-btn-ghost { transition: none; }
    .lp-card:hover, .lp-step:hover { transform: none; }
}
