/* CubeXpert landing — dependency-free, mobile-first */
:root {
  --ink: #12151a;
  --ink-2: #1b1f26;
  --ink-3: #262b34;
  --paper: #f5f6f8;
  --card: #ffffff;
  --line: #e2e5ea;
  --text: #1a1e24;
  --muted: #5a6370;
  --on-dark: #eef1f5;
  --on-dark-muted: #aeb6c2;
  --red: #e5484d;
  --green: #2fa36b;
  --blue: #3b82f6;
  --yellow: #f5c518;
  --orange: #f2711c;
  --white: #f4f4f4;
  --accent: #f5c518;
  --link: #1f5fd1;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .08);
  --max: 1120px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--paper); line-height: 1.6; font-size: 17px; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-underline-offset: 2px; }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(2.1rem, 6vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 4vw, 2.3rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* header */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(18, 21, 26, .92); backdrop-filter: saturate(150%) blur(10px); -webkit-backdrop-filter: saturate(150%) blur(10px); border-bottom: 1px solid rgba(255,255,255,.06); }
.site-header .wrap { display: flex; align-items: center; gap: 16px; min-height: 62px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 800; font-size: 1.1rem; letter-spacing: -.01em; }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav a { color: var(--on-dark-muted); text-decoration: none; padding: 10px 12px; border-radius: 10px; font-size: .95rem; font-weight: 600; }
.nav a:hover, .nav a[aria-current="page"] { color: #fff; background: rgba(255,255,255,.07); }
.nav .nav-cta { background: var(--accent); color: var(--ink); margin-left: 6px; }
.nav .nav-cta:hover { background: #ffd43b; color: var(--ink); }
@media (max-width: 720px) { .nav a:not(.nav-cta):not(.nav-keep) { display: none; } }

/* buttons + badges */
.store-buttons { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.store-badge { display: inline-block; border-radius: 12px; line-height: 0; transition: transform .15s ease; }
.store-badge:hover { transform: translateY(-2px); }
.store-badge img { height: 54px; width: auto; }
.availability { margin-top: 12px; font-size: .9rem; color: var(--on-dark-muted); }
.light .availability { color: var(--muted); }

/* hero */
.hero { background: radial-gradient(1200px 500px at 85% -10%, rgba(59,130,246,.22), transparent 60%), radial-gradient(900px 500px at -10% 110%, rgba(245,197,24,.12), transparent 60%), var(--ink); color: var(--on-dark); padding: 48px 0 56px; overflow: hidden; }
.hero .wrap { display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) { .hero .wrap { grid-template-columns: 1.1fr .9fr; } .hero { padding: 72px 0 80px; } }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .85rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin-bottom: 14px; }
.hero h1 { color: #fff; }
.hero .lede { font-size: clamp(1.05rem, 2.4vw, 1.25rem); color: var(--on-dark-muted); max-width: 36em; margin-bottom: 26px; }
.proof { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 26px 0 0; padding: 0; list-style: none; font-size: .92rem; color: var(--on-dark-muted); }
.proof strong { color: #fff; }
.hero-shots { position: relative; display: flex; justify-content: center; align-items: flex-start; gap: 16px; }
.hero-shots img { width: min(46%, 250px); border-radius: 22px; box-shadow: 0 20px 50px rgba(0,0,0,.45); aspect-ratio: 1242 / 2208; object-fit: contain; background: #2e3236; }
.hero-shots img:nth-child(2) { margin-top: 48px; }

/* stickers (decorative cube motif) */
.stickers { display: inline-grid; grid-template-columns: repeat(3, 10px); gap: 3px; }
.stickers i { width: 10px; height: 10px; border-radius: 3px; display: block; }
.s-r { background: var(--red); } .s-g { background: var(--green); } .s-b { background: var(--blue); } .s-y { background: var(--yellow); } .s-o { background: var(--orange); } .s-w { background: var(--white); }

/* sections */
section { padding: 64px 0; }
.section-head { max-width: 720px; margin-bottom: 32px; }
.section-head p { color: var(--muted); font-size: 1.08rem; }
.dark { background: var(--ink); color: var(--on-dark); }
.dark .section-head p, .dark p { color: var(--on-dark-muted); }
.dark h2, .dark h3 { color: #fff; }

.grid { display: grid; gap: 18px; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.card h3 { margin-bottom: .35em; }
.card p { color: var(--muted); margin: 0; }
.feature .icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 14px; font-size: 1.35rem; }
.icon.i-r { background: #fde8e8; } .icon.i-g { background: #e2f5ea; } .icon.i-b { background: #e4eefe; } .icon.i-y { background: #fdf6d6; } .icon.i-o { background: #fdeadb; } .icon.i-k { background: #eceef2; }

/* steps */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 18px; }
@media (min-width: 860px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.steps li { counter-increment: step; background: var(--ink-2); border: 1px solid var(--ink-3); border-radius: var(--radius); padding: 24px; }
.steps li::before { content: counter(step); display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--accent); color: var(--ink); font-weight: 800; margin-bottom: 12px; }
.steps h3 { color: #fff; }

/* screenshots */
.shots { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 240px); gap: 18px; overflow-x: auto; padding: 4px 4px 18px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.shots figure { margin: 0; scroll-snap-align: start; }
.shots img { width: 100%; aspect-ratio: 1242 / 2208; object-fit: contain; border-radius: 20px; background: #2e3236; box-shadow: var(--shadow); }
.shots figcaption { font-size: .9rem; color: var(--muted); margin-top: 10px; text-align: center; }

/* guides cards */
.guide-card { display: flex; flex-direction: column; text-decoration: none; color: inherit; transition: transform .15s ease, box-shadow .15s ease; }
.guide-card:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(16,24,40,.14); }
.guide-card .tag { align-self: flex-start; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 4px 10px; border-radius: 99px; background: #eef2f7; color: #3a4553; margin-bottom: 12px; }
.guide-card h3 { color: var(--text); }
.guide-card .more { margin-top: auto; padding-top: 14px; color: var(--link); font-weight: 700; font-size: .95rem; }

/* faq */
.faq { display: grid; gap: 12px; max-width: 820px; }
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 0 20px; }
.faq summary { cursor: pointer; font-weight: 700; padding: 18px 28px 18px 0; position: relative; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: 14px; font-size: 1.4rem; color: var(--muted); }
.faq details[open] summary::after { content: "–"; }
.faq details > div { padding-bottom: 18px; color: var(--muted); }
.faq details > div p:last-child { margin: 0; }

/* cta band */
.cta-band { text-align: center; }
.cta-band .store-buttons { justify-content: center; }
.cta-band .icon-big { width: 88px; height: 88px; border-radius: 22px; margin: 0 auto 18px; box-shadow: 0 10px 30px rgba(0,0,0,.4); }

/* article */
.breadcrumbs { font-size: .9rem; color: var(--muted); margin: 26px 0 8px; }
.breadcrumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumbs li + li::before { content: "/"; margin-right: 6px; color: #a0a8b3; }
.article-wrap { display: grid; gap: 40px; padding-bottom: 64px; }
@media (min-width: 1000px) { .article-wrap { grid-template-columns: minmax(0, 1fr) 300px; } }
.article { min-width: 0; max-width: 760px; }
.article header { margin-bottom: 24px; }
.article .meta { color: var(--muted); font-size: .92rem; }
.article h2, .article h3, section[id] { scroll-margin-top: 76px; }
.article h2 { margin-top: 1.8em; font-size: clamp(1.4rem, 3.4vw, 1.8rem); }
.article h3 { margin-top: 1.5em; }
.article ul, .article ol { padding-left: 1.3em; }
.article li { margin-bottom: .45em; }
.article table { width: 100%; border-collapse: collapse; margin: 0 0 1.4em; font-size: .95rem; }
.table-scroll { overflow-x: auto; margin-bottom: 1.4em; }
.table-scroll table { margin: 0; }
.article td code.alg { white-space: normal; }
@media (max-width: 640px) {
  .table-scroll thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table-scroll table, .table-scroll tbody, .table-scroll tr, .table-scroll td { display: block; width: 100%; }
  .table-scroll tr { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin-bottom: 10px; }
  .table-scroll td { border: 0; padding: 4px 0; }
  .table-scroll td::before { content: attr(data-label); display: block; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
  .table-scroll td[data-label=""]::before { display: none; }
}
.article th, .article td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.article th { background: #eef1f5; font-weight: 700; }
.article blockquote { margin: 1.4em 0; padding: 14px 18px; border-left: 4px solid var(--accent); background: #fffbea; border-radius: 0 12px 12px 0; }
.article blockquote p:last-child { margin: 0; }
code, .alg { font-family: var(--mono); font-size: .92em; background: #eceff4; color: #12151a; padding: .12em .45em; border-radius: 6px; white-space: nowrap; }
.alg-block { display: block; white-space: normal; font-family: var(--mono); font-size: 1.05rem; background: var(--ink); color: #fff; padding: 14px 18px; border-radius: 12px; margin: 0 0 1.2em; letter-spacing: .02em; word-spacing: .2em; overflow-x: auto; }
.inline-cta { display: grid; gap: 14px; grid-template-columns: 64px 1fr; align-items: center; background: var(--ink); color: var(--on-dark); border-radius: var(--radius); padding: 20px; margin: 2em 0; }
.inline-cta img.app-icon { width: 64px; height: 64px; border-radius: 16px; }
.inline-cta strong { color: #fff; display: block; font-size: 1.05rem; }
.inline-cta p { margin: 0; color: var(--on-dark-muted); font-size: .95rem; }
.inline-cta .store-buttons { grid-column: 1 / -1; }
.inline-cta .store-badge img { height: 46px; }
.aside { display: grid; gap: 18px; align-content: start; }
@media (min-width: 1000px) { .aside { position: sticky; top: 84px; } }
.aside .card h2 { font-size: 1.1rem; }
.aside ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.aside .store-badge img { height: 44px; }
.related { margin-top: 40px; }

/* footer */
.site-footer { background: var(--ink); color: var(--on-dark-muted); padding: 48px 0 32px; font-size: .95rem; }
.site-footer a { color: var(--on-dark); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-grid { display: grid; gap: 28px; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.site-footer h2 { font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: #fff; margin-bottom: 12px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.legal { border-top: 1px solid var(--ink-3); margin-top: 32px; padding-top: 20px; font-size: .82rem; }

/* simple pages */
.page { padding: 40px 0 64px; }
.page .article { max-width: 780px; }
.notfound { text-align: center; padding: 96px 0; }
