/* Zinelora website: telegram.org's clarity, Apple-style motion, the messenger's own colours. */
:root {
  --bg: #ffffff; --bg-2: #f4f6f9; --card: #ffffff; --text: #0f1419; --text-2: #5d6d7e; --line: rgba(15, 20, 25, .08);
  --accent: #3390ec; --accent-2: #2a7fd4; --grad: linear-gradient(135deg, #7b5cff 0%, #3390ec 55%, #14b8e6 100%);
  --dark: #17212b; --dark-2: #1e2c3a; --shadow: 0 30px 60px -20px rgba(18, 38, 63, .25), 0 12px 24px -12px rgba(18, 38, 63, .18);
  --ease: cubic-bezier(.2, .8, .2, 1); --r: 22px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f151c; --bg-2: #17212b; --card: #1c2733; --text: #f2f5f8; --text-2: #93a3b5; --line: rgba(255, 255, 255, .08); --shadow: 0 30px 60px -20px rgba(0, 0, 0, .6); color-scheme: dark; }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: var(--accent); text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3 { letter-spacing: -.02em; line-height: 1.12; margin: 0; }
.muted { color: var(--text-2); } .small { font-size: 14px; }

/* ---------- header ---------- */
.nav { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 20px; height: 60px; padding: 0 max(20px, calc((100vw - 1160px) / 2)); background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: saturate(1.8) blur(20px); -webkit-backdrop-filter: saturate(1.8) blur(20px); border-bottom: 1px solid transparent; transition: border-color .3s; }
.nav.scrolled { border-bottom-color: var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; color: var(--text); }
.links { display: flex; gap: 26px; margin-left: 18px; }
.links a { color: var(--text-2); font-size: 15px; transition: color .2s; }
.links a:hover { color: var(--text); }
.nav-r { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.lang { border: 0; background: var(--bg-2); color: var(--text-2); font-weight: 600; font-size: 13px; padding: 6px 10px; border-radius: 10px; cursor: pointer; }
@media (max-width: 820px) { .links { display: none; } }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; border-radius: 14px; padding: 12px 22px; font-weight: 600; color: #fff; background: var(--accent); border: 0; cursor: pointer; transition: transform .2s var(--ease), background .2s, box-shadow .2s; box-shadow: 0 8px 20px -8px rgba(51, 144, 236, .6); }
.btn:hover { background: var(--accent-2); transform: translateY(-1px); }
.btn:active { transform: scale(.97); }
.btn.small { padding: 8px 16px; font-size: 15px; border-radius: 12px; }
.btn.big { padding: 16px 30px; font-size: 18px; border-radius: 16px; }
.btn.ghost { background: var(--bg-2); color: var(--accent); box-shadow: none; }
.btn.ghost:hover { background: color-mix(in srgb, var(--accent) 12%, var(--bg-2)); }
.btn .ico svg { width: 22px; height: 22px; fill: currentColor; display: block; }

/* ---------- hero ---------- */
.hero { position: relative; text-align: center; padding: 72px 20px 0; overflow: hidden; }
.hero::before { content: ''; position: absolute; inset: -20% -10% auto; height: 760px; background: radial-gradient(60% 50% at 50% 30%, color-mix(in srgb, #3390ec 22%, transparent), transparent 70%), radial-gradient(40% 40% at 25% 20%, color-mix(in srgb, #7b5cff 16%, transparent), transparent 70%), radial-gradient(40% 40% at 78% 25%, color-mix(in srgb, #14b8e6 16%, transparent), transparent 70%); z-index: -1; animation: aura 14s ease-in-out infinite alternate; }
@keyframes aura { to { transform: translateY(30px) scale(1.06); filter: hue-rotate(-12deg); } }
.hero-logo { margin: 0 auto 22px; filter: drop-shadow(0 18px 30px rgba(51, 144, 236, .35)); animation: float 6s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-8px); } }
.hero h1 { font-size: clamp(48px, 9vw, 84px); font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: clamp(19px, 2.4vw, 24px); color: var(--text-2); margin: 16px auto 30px; max-width: 640px; }
.cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 16px; }

/* 3D phones */
.stage { position: relative; height: 640px; margin-top: 60px; perspective: 1600px; }
.phone { position: absolute; left: 50%; width: 300px; aspect-ratio: 390 / 844; border-radius: 46px; padding: 11px; background: linear-gradient(145deg, #2a3442, #0d1117); box-shadow: var(--shadow), inset 0 0 0 1.5px rgba(255, 255, 255, .14); transform-style: preserve-3d; }
.phone img { width: 100%; height: 100%; object-fit: cover; object-position: top; border-radius: 36px; }
.phone .island { position: absolute; top: 20px; left: 50%; width: 90px; height: 26px; margin-left: -45px; border-radius: 20px; background: #05070a; z-index: 2; }
.stage .main { margin-left: -150px; z-index: 3; transform: translateY(var(--lift, 0px)) rotateX(var(--rx, 8deg)); transition: transform .1s linear; }
.stage .side { width: 260px; top: 80px; z-index: 1; opacity: .92; }
.stage .side img { filter: saturate(.95); }
.stage .left { margin-left: -430px; transform: translateX(var(--spread, 0px)) rotateY(24deg) rotateZ(-4deg); }
.stage .right { margin-left: 170px; transform: translateX(calc(var(--spread, 0px) * -1)) rotateY(-24deg) rotateZ(4deg); }
.stage::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 180px; background: linear-gradient(transparent, var(--bg)); z-index: 4; }
@media (max-width: 760px) { .stage { height: 520px; } .stage .side { display: none; } .phone { width: 250px; } .stage .main { margin-left: -125px; } }

/* ---------- sections ---------- */
.sec { padding: 110px 20px; max-width: 1160px; margin: 0 auto; text-align: center; }
.sec h2 { font-size: clamp(34px, 5vw, 52px); font-weight: 800; }
.sec .sub { color: var(--text-2); font-size: 20px; max-width: 640px; margin: 16px auto 0; }
.sec.narrow { max-width: 760px; text-align: left; }
.sec.narrow h2 { text-align: center; margin-bottom: 30px; }

/* apps */
.apps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-top: 50px; }
@media (max-width: 1000px) { .apps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .apps { grid-template-columns: 1fr; } }
.app { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 24px 20px 20px; border-radius: var(--r); background: var(--bg-2); color: var(--text); text-align: left; transition: transform .35s var(--ease), box-shadow .35s var(--ease), background .3s; }
.app svg { width: 34px; height: 34px; fill: var(--accent); margin-bottom: 12px; transition: transform .4s var(--ease); }
.app b { font-size: 19px; }
.app span { color: var(--text-2); font-size: 14.5px; line-height: 1.4; }
.app em { margin-top: 10px; font-style: normal; font-size: 12px; font-weight: 700; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); padding: 3px 9px; border-radius: 8px; }
.app:hover { transform: translateY(-6px); box-shadow: var(--shadow); background: var(--card); }
.app:hover svg { transform: scale(1.12) rotate(-4deg); }
.app.mine { background: var(--grad); color: #fff; }
.app.mine svg { fill: #fff; } .app.mine span { color: rgba(255, 255, 255, .85); } .app.mine em { color: #fff; background: rgba(255, 255, 255, .2); }
.app.mine::after { content: attr(data-mine); position: absolute; top: 14px; right: 14px; font-size: 11px; font-weight: 700; background: rgba(255, 255, 255, .25); padding: 2px 8px; border-radius: 8px; }

/* features grid */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 46px 34px; margin-top: 64px; text-align: center; }
@media (max-width: 900px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .grid { grid-template-columns: 1fr; } }
.fi { width: 84px; height: 84px; margin: 0 auto 18px; border-radius: 28px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 14%, transparent); transition: transform .5s var(--ease); }
.fi svg { width: 40px; height: 40px; fill: var(--c); }
.feat:hover .fi { transform: translateY(-6px) rotate(-6deg) scale(1.06); }
.feat h3 { font-size: 21px; margin-bottom: 8px; }
.feat p { color: var(--text-2); font-size: 15.5px; margin: 0; }

/* Apple-style sticky showcase */
.showcase { height: 300vh; position: relative; }
.sc-sticky { position: sticky; top: 60px; height: calc(100vh - 60px); display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 40px; max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.sc-text { position: relative; height: 260px; }
.sc-step { position: absolute; inset: 0; opacity: 0; transform: translateY(30px); transition: opacity .6s var(--ease), transform .6s var(--ease); pointer-events: none; }
.sc-step.on { opacity: 1; transform: none; pointer-events: auto; }
.sc-step h2 { font-size: clamp(32px, 4.4vw, 50px); font-weight: 800; }
.sc-step p { color: var(--text-2); font-size: 20px; margin-top: 16px; max-width: 460px; }
.sc-phone { display: flex; justify-content: center; perspective: 1400px; }
.sc-phone .phone { position: relative; left: auto; width: 320px; }
.sc-phone .tilt { transform: rotateY(var(--ry, -14deg)) rotateX(6deg); transition: transform .2s linear; }
.sc-phone img { position: absolute; inset: 11px; width: calc(100% - 22px); height: calc(100% - 22px); opacity: 0; transform: scale(1.04); transition: opacity .6s var(--ease), transform .8s var(--ease); }
.sc-phone img.on { opacity: 1; transform: none; }
@media (max-width: 860px) { .showcase { height: auto; } .sc-sticky { position: static; height: auto; grid-template-columns: 1fr; padding: 60px 20px; text-align: center; } .sc-text { height: auto; } .sc-step { position: static; opacity: 1; transform: none; margin-bottom: 30px; } .sc-step p { margin: 12px auto 0; } .sc-phone img:not([data-step="0"]) { display: none; } .sc-phone img[data-step="0"] { opacity: 1; } }

/* security */
.sec.dark { max-width: none; background: var(--dark); color: #fff; border-radius: 40px; margin: 40px 16px; }
.sec-in { max-width: 1000px; margin: 0 auto; }
.sec.dark .sub { color: #9fb1c4; }
.lock { width: 96px; height: 96px; margin: 0 auto 26px; border-radius: 30px; display: grid; place-items: center; background: var(--grad); box-shadow: 0 20px 50px -10px rgba(51, 144, 236, .6); animation: float 6s ease-in-out infinite; }
.lock svg { width: 46px; height: 46px; fill: #fff; }
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 50px 0 34px; text-align: left; }
@media (max-width: 900px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .cards { grid-template-columns: 1fr; } }
.card { padding: 22px; border-radius: var(--r); background: var(--dark-2); border: 1px solid rgba(255, 255, 255, .06); display: flex; flex-direction: column; gap: 6px; transition: transform .35s var(--ease), border-color .3s; }
.card:hover { transform: translateY(-4px); border-color: rgba(106, 179, 243, .4); }
.card span { color: #9fb1c4; font-size: 15px; }
.link { color: #6ab3f3; font-weight: 600; }

/* faq */
details { border-bottom: 1px solid var(--line); padding: 4px 0; }
summary { list-style: none; cursor: pointer; padding: 18px 40px 18px 0; font-size: 19px; font-weight: 600; position: relative; }
summary::-webkit-details-marker { display: none; }
summary::after { content: ''; position: absolute; right: 6px; top: 50%; width: 10px; height: 10px; border-right: 2px solid var(--text-2); border-bottom: 2px solid var(--text-2); transform: translateY(-70%) rotate(45deg); transition: transform .3s var(--ease); }
details[open] summary::after { transform: translateY(-30%) rotate(225deg); }
details p { margin: 0 0 18px; color: var(--text-2); animation: reveal-in .4s var(--ease); }

/* footer */
footer { border-top: 1px solid var(--line); margin-top: 40px; }
.foot { max-width: 1160px; margin: 0 auto; padding: 34px 20px 50px; display: flex; flex-wrap: wrap; align-items: center; gap: 18px 30px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.foot nav a { color: var(--text-2); font-size: 15px; }
.foot nav a:hover { color: var(--text); }
.foot p { margin: 0 0 0 auto; }

/* scroll reveal */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }
@keyframes reveal-in { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } .reveal { opacity: 1; transform: none; } }

/* legal pages share the header */
.glow { display: none; }

/* ---------- inside: exploded 3D phone (explode.js) ---------- */
.inside { position: relative; height: 320vh; }
.in-sticky { position: sticky; top: 60px; height: calc(100vh - 60px); overflow: hidden; }
.in-head { position: absolute; top: 4vh; left: 0; right: 0; z-index: 2; text-align: center; padding: 0 20px; pointer-events: none; }
.in-head h2 { font-size: clamp(30px, 4.6vw, 52px); font-weight: 800; margin: 0; }
.in-head .sub { color: var(--text-2); font-size: 18px; max-width: 560px; margin: 10px auto 0; }
#inside-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.in-labels { position: absolute; inset: 0; pointer-events: none; }
.in-label { position: absolute; left: 0; top: 0; width: 0; height: 0; opacity: 0; transition: opacity .4s var(--ease); }
.in-label.on { opacity: 1; }
.in-label i { position: absolute; left: -5px; top: -5px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent); }
.in-label b, .in-label span { position: absolute; left: 16px; width: 210px; }
.in-label b { top: -26px; font-size: 15px; }
.in-label span { top: -4px; font-size: 13px; line-height: 1.35; color: var(--text-2); }
.in-label b, .in-label span { background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); padding: 2px 8px; border-radius: 8px; }
.in-label.left b, .in-label.left span { left: auto; right: 16px; text-align: right; }
.in-count { position: absolute; bottom: 3vh; left: 0; right: 0; text-align: center; margin: 0; }
#inside-count { font-weight: 800; color: var(--accent); font-size: 20px; }
/* no WebGL / not loaded yet: the parts become a plain feature list */
.inside:not(.ready) { height: auto; }
.inside:not(.ready) .in-sticky { position: static; height: auto; padding: 110px 20px 40px; }
.inside:not(.ready) .in-head { position: static; }
.inside:not(.ready) #inside-canvas, .inside:not(.ready) .in-count { display: none; }
.inside:not(.ready) .in-labels { position: static; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; max-width: 1160px; margin: 30px auto 0; }
.inside:not(.ready) .in-label { position: static; width: auto; height: auto; opacity: 1; padding: 16px 18px; border-radius: var(--r); background: var(--bg-2); text-align: left; }
.inside:not(.ready) .in-label i { display: none; }
.inside:not(.ready) .in-label b, .inside:not(.ready) .in-label span { position: static; display: block; width: auto; background: none; padding: 0; backdrop-filter: none; text-align: left; }
/* phones: short captions so they don't cover the model */
@media (max-width: 700px) {
  .in-label span { display: none; }
  .in-label b { width: 140px; font-size: 13px; top: -12px; }
  .in-head .sub { font-size: 15px; }
}
#inside-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
#inside-lines g { transition: opacity .4s var(--ease); }
#inside-lines line { stroke: color-mix(in srgb, var(--accent) 55%, transparent); stroke-width: 1.2; stroke-dasharray: 3 4; }
#inside-lines circle { fill: var(--accent); stroke: var(--bg); stroke-width: 2; }
.in-label i { display: none; }
.in-label b, .in-label span { width: 220px; }
.in-label.left b, .in-label.left span { right: 10px; }
.in-label:not(.left) b, .in-label:not(.left) span { left: 10px; }
.in-label { transition: opacity .4s var(--ease), transform .25s linear; }
.in-label.solo b, .in-label.solo span { left: 0; right: auto; width: 220px; text-align: center; }
.in-label.solo b { top: -46px; }
.in-label.solo span { display: block; top: -22px; }
.inside:not(.ready) #inside-lines { display: none; }
