/* Salivo website: clean light theme, red accent, crisp cards. No blur effects: everything is
   flat paint or compositor-only transforms, so interaction stays smooth. */

:root {
    --bg: #ffffff;
    --soft: #f4f5f7;
    --text: #14161b;
    --muted: #5b6070;
    --faint: #8a8f9e;
    --line: #e6e8ec;
    --red: #e5232f;
    --red-hi: #ff3d4a;
    --red-soft: #fdecee;
    --dark: #0f1014;
    --green: #15803d;
    --green-soft: #dcfce7;
    --card: #ffffff;
    --nav: #ffffff;
    --hero-top: #f1f2f5;
    --hero-bot: #ffffff;
    --line2: #cfd2da;
    --text2: #333745;
    --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
}


:root[data-theme="dark"] {
    --bg: #0b0c10;
    --soft: #171a21;
    --text: #f1f2f6;
    --muted: #a3a7b6;
    --faint: #7c8091;
    --line: #262a33;
    --line2: #363a47;
    --text2: #d4d6df;
    --card: #12141a;
    --nav: #0f1116;
    --hero-top: #15171d;
    --hero-bot: #0b0c10;
    --red-soft: rgba(229, 35, 47, 0.18);
    --green: #4ade80;
    --green-soft: rgba(34, 197, 94, 0.18);
    color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; width: 100%; max-width: 100vw; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 system-ui, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; overflow-x: clip; width: 100%; max-width: 100vw; position: relative; }
a { color: inherit; text-decoration: none; }
h1, h2, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
img { display: block; }

.page { min-height: 100vh; overflow-x: clip; }
.aurora { display: none; }

/* ---------- Nav ---------- */

.nav { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 24px; padding: 0 max(24px, calc((100vw - 1180px) / 2)); height: 66px; background: var(--nav); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; letter-spacing: -0.01em; }
.brand img { border-radius: 8px; }
.links { display: flex; gap: 6px; margin: 0 auto; height: 100%; }
.links a { position: relative; display: flex; align-items: center; padding: 0 18px; color: var(--text2); font-weight: 500; transition: color 0.15s; }
.links a:hover { color: var(--red); }
.links a.on { color: var(--red); }
.links a.on::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 3px; background: var(--red); border-radius: 3px 3px 0 0; }
.theme { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; margin-right: -12px; transition: background 0.15s; }
.theme:hover { background: var(--soft); }
.theme img { pointer-events: none; }
.i-sun { display: none; }
:root[data-theme="dark"] .i-sun { display: block; }
:root[data-theme="dark"] .i-moon { display: none; }
:root[data-theme="dark"] .os, :root[data-theme="dark"] .gh img, :root[data-theme="dark"] .btn.outline img { filter: invert(1) hue-rotate(180deg); }
.gh { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; transition: background 0.15s; }
.gh:hover { background: var(--soft); }

main { max-width: 1180px; width: 100%; min-width: 0; margin: 0 auto; padding: 0 24px; }

/* ---------- Hero ---------- */

.hero { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: 36px; align-items: center; padding: 64px 0 56px; width: 100%; min-width: 0; }
.hero-copy, .hero-scene { min-width: 0; }
.hero::before { content: ""; position: absolute; z-index: -2; top: 0; bottom: 0; left: -100vw; right: -100vw; background: linear-gradient(180deg, var(--hero-top), var(--hero-bot) 85%); }
.hero-art { position: absolute; z-index: -1; top: 0; bottom: 0; left: 36%; right: calc(50% - 50vw); pointer-events: none; }
.slab { position: absolute; display: block; }
.slab.r { right: 0; top: 0; width: 62%; height: 86%; background: linear-gradient(135deg, var(--red-hi), var(--red) 55%, #b3111c); clip-path: polygon(34% 0, 100% 0, 100% 100%, 0 78%); }
.slab.d { right: 0; bottom: 0; width: 52%; height: 48%; background: linear-gradient(135deg, #2b2d36, #14161b); clip-path: polygon(40% 0, 100% 0, 100% 100%, 0 100%); }

h1 { margin-top: 10px; font-size: clamp(40px, 5vw, 66px); line-height: 1.02; letter-spacing: -0.035em; font-weight: 800; }
h1 span { display: block; }
h1 b { color: var(--red); font-weight: 800; }
.lead { margin-top: 22px; max-width: 33em; font-size: 18px; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 14px 20px; border-radius: 10px; font-weight: 650; border: 1px solid var(--line); transition: transform 0.15s, box-shadow 0.15s, background 0.15s, border-color 0.15s; }
.btn:hover { transform: translateY(-2px); }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; box-shadow: 0 8px 20px rgba(229, 35, 47, 0.28); }
.btn.primary:hover { background: #cf1a26; box-shadow: 0 12px 26px rgba(229, 35, 47, 0.38); }
.btn.outline { background: var(--card); border-color: var(--line2); }
.btn.outline:hover { border-color: var(--text); }
.btn.wide { width: 100%; }
.btn.off { opacity: 0.55; cursor: default; background: var(--soft); }
.btn.off:hover { transform: none; border-color: var(--line); }
.vb { font: 600 13px var(--mono); opacity: 0.85; }

.feats { display: flex; flex-wrap: wrap; gap: 14px 26px; margin-top: 34px; color: var(--text2); font-size: 15px; }
.feats li { display: flex; align-items: center; gap: 8px; }

/* ---------- Hero scene: the dark editor window and the 3D cube ---------- */

.hero-scene { position: relative; min-height: 440px; }
.window { margin-top: 165px; background: var(--dark); border-radius: 16px; border: 1px solid #2a2c35; box-shadow: 0 30px 60px rgba(15, 16, 20, 0.35), 0 8px 20px rgba(15, 16, 20, 0.2); overflow: hidden; color: #e8e9ee; min-width: 0; }
.window-bar { display: flex; align-items: center; gap: 8px; padding: 14px 18px; border-bottom: 1px solid #23252d; background: #15161b; }
.tl { width: 12px; height: 12px; border-radius: 50%; }
.tl.r { background: #ff5f57; } .tl.y { background: #febc2e; } .tl.g { background: #28c840; }
.window-file { margin-left: 14px; font: 13px var(--mono); color: #9296a6; }
.code, .term { margin: 0; padding: 18px 22px 0; font: 14px/1.7 var(--mono); font-variant-ligatures: none; }
.code { height: 292px; white-space: pre; overflow-x: auto; overflow-y: auto; max-width: 100%; color: #f4d7da; -webkit-overflow-scrolling: touch; }
.term { margin-top: 14px; padding: 14px 22px 18px; border-top: 1px solid #23252d; font-size: 13.5px; min-width: 0; }
.prompt { color: var(--red-hi); }
.term-line, .term-out { height: 24px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.term-out { color: #9296a6; }

.cube-wrap { position: absolute; right: 28px; top: -26px; z-index: 3; width: 190px; text-align: center; }
.cube-hint { margin-top: 6px; font-size: 12px; color: var(--faint); letter-spacing: 0.02em; }
.cube-chips { display: none; }
.chip { display: inline-flex; align-items: center; justify-content: center; padding: 5px 11px; font-size: 11.5px; font-weight: 650; font-family: var(--mono); border-radius: 999px; border: 1px solid var(--line2); background: var(--card); color: var(--text2); cursor: pointer; transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1); box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05); }
.chip:hover { border-color: var(--red); color: var(--red); background: var(--soft); transform: translateY(-2px); box-shadow: 0 4px 10px rgba(229, 35, 47, 0.18); }
.chip.on { background: var(--red); color: #ffffff; border-color: var(--red); box-shadow: 0 3px 12px rgba(229, 35, 47, 0.38); transform: translateY(-1px); }
.chip:active { transform: translateY(0); }

.cube-stage { position: relative; height: 155px; display: grid; place-items: center; perspective: 900px; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-user-drag: none; }
.cube-stage * { user-select: none; -webkit-user-select: none; -webkit-user-drag: none; }
.cube-stage:active { cursor: grabbing; }

.cube-spin { transform-style: preserve-3d; will-change: transform; animation: spinTogether 1.4s cubic-bezier(0.16, 1, 0.3, 1) both; }
.cube { position: relative; width: 118px; height: 118px; transform-style: preserve-3d; transform: rotateX(-15deg) rotateY(30deg); will-change: transform; }

.cube-shadow { position: absolute; left: 50%; bottom: -6px; width: 120px; height: 18px; margin-left: -60px; border-radius: 50%; background: radial-gradient(closest-side, rgba(229, 35, 47, 0.22), rgba(15, 16, 20, 0.4) 40%, transparent); animation: shadowIn 1.4s cubic-bezier(0.16, 1, 0.3, 1) both; }

@keyframes spinTogether {
    0% { transform: rotateX(25deg) rotateY(-220deg); }
    100% { transform: rotateX(0deg) rotateY(0deg); }
}

@keyframes shadowIn {
    0% { opacity: 0.2; transform: scale(0.6); }
    100% { opacity: 1; transform: scale(1); }
}

.face { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 8px; border-radius: 12px; border: 2px solid rgba(229, 35, 47, 0.7); background: linear-gradient(145deg, #1d1f27, #0e1015); color: #fff; backface-visibility: hidden; cursor: pointer; transition: border-color 0.2s, box-shadow 0.2s, background 0.2s; outline: none; box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.12), 0 0 12px rgba(229, 35, 47, 0.18); }
.face:focus, .face:focus-visible { outline: none; }
.face:hover { border-color: var(--red-hi); box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.22), 0 0 24px rgba(229, 35, 47, 0.6); }
.face * { pointer-events: none; -webkit-user-drag: none; }
.face img { margin-bottom: 2px; }
.face-n { font: 11px var(--mono); color: var(--red-hi); letter-spacing: 0.12em; }
.face-t { font-weight: 800; font-size: 19px; letter-spacing: -0.01em; }
.face-s { font-size: 10.5px; color: #a3a7b6; }

.f-front  { transform: translateZ(59px); animation: assembleFront 1.4s cubic-bezier(0.16, 1, 0.3, 1) both; }
.f-back   { transform: rotateY(180deg) translateZ(59px); animation: assembleBack 1.4s cubic-bezier(0.16, 1, 0.3, 1) both; }
.f-right  { transform: rotateY(90deg) translateZ(59px); animation: assembleRight 1.4s cubic-bezier(0.16, 1, 0.3, 1) both; }
.f-left   { transform: rotateY(-90deg) translateZ(59px); animation: assembleLeft 1.4s cubic-bezier(0.16, 1, 0.3, 1) both; }
.f-top    { transform: rotateX(90deg) translateZ(59px); animation: assembleTop 1.4s cubic-bezier(0.16, 1, 0.3, 1) both; }
.f-bottom { transform: rotateX(-90deg) translateZ(59px); animation: assembleBottom 1.4s cubic-bezier(0.16, 1, 0.3, 1) both; }

@keyframes assembleFront {
    0% { opacity: 0; transform: translateZ(140px) scale(0.85); }
    20% { opacity: 1; }
    85% { transform: translateZ(56px) scale(1.02); }
    100% { opacity: 1; transform: translateZ(59px) scale(1); }
}
@keyframes assembleBack {
    0% { opacity: 0; transform: rotateY(180deg) translateZ(140px) scale(0.85); }
    20% { opacity: 1; }
    85% { transform: rotateY(180deg) translateZ(56px) scale(1.02); }
    100% { opacity: 1; transform: rotateY(180deg) translateZ(59px) scale(1); }
}
@keyframes assembleRight {
    0% { opacity: 0; transform: rotateY(90deg) translateZ(140px) scale(0.85); }
    20% { opacity: 1; }
    85% { transform: rotateY(90deg) translateZ(56px) scale(1.02); }
    100% { opacity: 1; transform: rotateY(90deg) translateZ(59px) scale(1); }
}
@keyframes assembleLeft {
    0% { opacity: 0; transform: rotateY(-90deg) translateZ(140px) scale(0.85); }
    20% { opacity: 1; }
    85% { transform: rotateY(-90deg) translateZ(56px) scale(1.02); }
    100% { opacity: 1; transform: rotateY(-90deg) translateZ(59px) scale(1); }
}
@keyframes assembleTop {
    0% { opacity: 0; transform: rotateX(90deg) translateZ(140px) scale(0.85); }
    20% { opacity: 1; }
    85% { transform: rotateX(90deg) translateZ(56px) scale(1.02); }
    100% { opacity: 1; transform: rotateX(90deg) translateZ(59px) scale(1); }
}
@keyframes assembleBottom {
    0% { opacity: 0; transform: rotateX(-90deg) translateZ(140px) scale(0.85); }
    20% { opacity: 1; }
    85% { transform: rotateX(-90deg) translateZ(56px) scale(1.02); }
    100% { opacity: 1; transform: rotateX(-90deg) translateZ(59px) scale(1); }
}

/* ---------- Download cards ---------- */

.downloads { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; padding-top: 12px; scroll-margin-top: 90px; }
.card { display: flex; flex-direction: column; gap: 12px; padding: 26px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 10px 28px rgba(16, 24, 40, 0.06); transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s; }
.card:hover { transform: translateY(-3px); border-color: var(--line2); box-shadow: 0 2px 4px rgba(16, 24, 40, 0.05), 0 18px 40px rgba(16, 24, 40, 0.1); }
.card.dim .os { opacity: 0.45; }
.card-head { display: flex; align-items: center; gap: 14px; }
.os { flex: none; }
.os-name { flex: 1; min-width: 0; }
h2 { font-size: 22px; letter-spacing: -0.01em; line-height: 1.2; }
.sub { color: var(--muted); font-size: 14px; }
.tag { padding: 3px 12px; border-radius: 999px; font-size: 12px; font-weight: 650; background: var(--red-soft); color: var(--red); }
.tag.soon { background: var(--soft); color: var(--muted); }
.meta { color: var(--muted); font-size: 14px; min-height: 66px; }
.cmd { display: flex; align-items: center; gap: 8px; padding: 7px 7px 7px 12px; border-radius: 10px; background: var(--soft); border: 1px solid var(--line); }
.cmd code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 12px var(--mono); color: var(--muted); }
.copy { padding: 5px 12px; border-radius: 7px; background: var(--card); border: 1px solid var(--line2); font-size: 12px; font-weight: 650; transition: background 0.15s, border-color 0.15s; }
.copy:hover { border-color: var(--red); color: var(--red); }
.copy:active { background: var(--red-soft); }
.dl-links { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; }
.dl-links a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line2); }
.dl-links a:hover { color: var(--red); text-decoration-color: var(--red); }

/* ---------- Release ---------- */

.release { margin-top: 24px; padding: 28px 30px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 10px 28px rgba(16, 24, 40, 0.06); scroll-margin-top: 90px; }
.release-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.release-head a { color: var(--red); font-size: 14px; font-weight: 600; }
.release-head a:hover { text-decoration: underline; }
.release-body { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 32px; padding-top: 22px; }
.big { display: flex; align-items: center; gap: 12px; font: 800 36px/1 system-ui, sans-serif; letter-spacing: -0.02em; }
.release .tag { background: var(--green-soft); color: var(--green); font-size: 13px; }
.date { margin-top: 10px; color: var(--muted); }
.notes { display: grid; gap: 10px; color: var(--text2); }
.notes li { position: relative; padding-left: 20px; }
.notes li::before { content: ""; position: absolute; left: 3px; top: 0.7em; width: 6px; height: 6px; border-radius: 50%; background: var(--red); }

.foot { max-width: 1180px; margin: 48px auto 0; padding: 20px 24px 40px; color: var(--faint); font-size: 14px; border-top: 1px solid var(--line); }
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.foot-note { margin-top: 14px; max-width: 70em; font-size: 12.5px; line-height: 1.6; }
.foot a { margin-left: 18px; color: var(--muted); }
.foot a:hover { color: var(--red); }

/* ---------- Small screens (Tablets & Mobile) ---------- */

@media (max-width: 980px) {
    .links { display: flex; gap: 4px; margin: 0 auto 0 12px; }
    .links a { padding: 0 10px; font-size: 13.5px; }
    .links a:not([href="#download"]):not([href="#release"]):not([href*="readme"]) { display: none; }
    .nav .theme { margin-left: auto; }
    .hero { grid-template-columns: minmax(0, 1fr); width: 100%; min-width: 0; padding-top: 36px; padding-bottom: 36px; gap: 36px; }
    .hero-art { display: none; }
    .hero-copy { width: 100%; min-width: 0; max-width: 100%; }
    .hero-scene { min-height: auto; display: flex; flex-direction: column; align-items: center; width: 100%; min-width: 0; max-width: 100%; }
    .cube-wrap { position: static; margin: 0 auto 16px; width: 100%; max-width: 320px; text-align: center; }
    .cube-chips { display: none !important; }
    .window { margin-top: 0; width: 100%; min-width: 0; max-width: 100%; }
    .code { width: 100%; min-width: 0; max-width: 100%; }
    .term { width: 100%; min-width: 0; max-width: 100%; }
    .term-line, .term-out { width: 100%; min-width: 0; max-width: 100%; }
    .downloads { grid-template-columns: minmax(0, 1fr); gap: 18px; width: 100%; }
    .card { min-width: 0; width: 100%; }
    .release-body { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 640px) {
    main { padding: 0 16px; width: 100%; min-width: 0; }
    .nav { padding: 0 14px; height: 58px; }
    .brand { font-size: 17px; gap: 8px; }
    .brand img { width: 28px; height: 28px; }
    .links { display: flex; gap: 2px; margin: 0 auto 0 8px; }
    .links a { padding: 0 8px; font-size: 13px; font-weight: 600; }
    .links a:not([href="#download"]):not([href="#release"]) { display: none; }
    .nav .theme { margin-left: 0; }
    
    /* Hero */
    .hero { grid-template-columns: minmax(0, 1fr); width: 100%; min-width: 0; padding-top: 24px; padding-bottom: 28px; gap: 28px; }
    .hero-copy { width: 100%; min-width: 0; max-width: 100%; }
    .hero-scene { width: 100%; min-width: 0; max-width: 100%; }
    h1 { font-size: 34px; letter-spacing: -0.025em; line-height: 1.08; }
    .lead { font-size: 15.5px; margin-top: 14px; line-height: 1.5; }
    .actions { flex-direction: column; gap: 10px; width: 100%; margin-top: 20px; }
    .actions .btn { width: 100%; justify-content: center; padding: 13px 16px; font-size: 15px; }
    .feats { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 12px; margin-top: 22px; font-size: 13px; width: 100%; }
    .feats li { min-width: 0; }
    
    /* Cube & Window */
    .cube-wrap { max-width: 320px; margin-bottom: 20px; }
    .cube-stage { height: 160px; }
    .cube-hint { margin-top: 8px; font-size: 12px; }
    .cube-chips { display: none !important; }
    .chip { padding: 6px 11px; font-size: 11.5px; min-height: 34px; }
    
    .window { border-radius: 12px; width: 100%; min-width: 0; max-width: 100%; }
    .window-bar { padding: 10px 14px; }
    .code { height: 220px; font-size: 12.5px; padding: 14px 16px 0; width: 100%; min-width: 0; max-width: 100%; overflow-x: auto; }
    .term { padding: 10px 16px 14px; font-size: 12px; width: 100%; min-width: 0; max-width: 100%; }
    .term-line, .term-out { width: 100%; min-width: 0; max-width: 100%; }
    
    /* Downloads */
    .downloads { gap: 16px; }
    .card { padding: 18px 16px; border-radius: 14px; }
    .card-head { gap: 10px; }
    h2 { font-size: 19px; }
    .sub { font-size: 13px; }
    .meta { font-size: 13px; min-height: auto; }
    .cmd { padding: 6px 6px 6px 10px; gap: 8px; min-height: 44px; }
    .cmd code { font-size: 11.5px; }
    .copy { padding: 8px 14px; font-size: 12px; min-height: 32px; min-width: 50px; }
    .dl-links { font-size: 12.5px; gap: 6px 12px; }
    
    /* Release */
    .release { margin-top: 18px; padding: 20px 16px; border-radius: 14px; }
    .release-head { flex-direction: column; align-items: flex-start; gap: 6px; }
    .release-body { padding-top: 16px; gap: 16px; }
    .v-num { font-size: 28px; }
    
    /* Footer */
    .foot { padding: 20px 16px 36px; margin-top: 32px; font-size: 12.5px; }
    .foot a { margin-left: 10px; }
}
@media (prefers-reduced-motion: reduce) {
    .cube-spin, .cube-shadow, .badge .dot { animation: none; }
    html { scroll-behavior: auto; }
    .btn, .card { transition: none; }
}

/* ---------- Plain document pages (terms, privacy) ---------- */

.doc { max-width: 760px; margin: 0 auto; padding: 56px 24px 24px; }
.doc h1 { margin: 0 0 8px; font-size: 40px; letter-spacing: -0.03em; }
.doc .updated { color: var(--faint); font-size: 14px; margin-bottom: 28px; }
.doc h2 { margin: 32px 0 8px; font-size: 20px; }
.doc p, .doc li { color: var(--text2); }
.doc p { margin: 0 0 12px; }
.doc ul { margin: 0 0 12px; padding-left: 22px; list-style: disc; }
.doc a { color: var(--red); text-decoration: underline; text-underline-offset: 3px; }
