/* Cayo Invest — landing. Self-contained: no external fonts or scripts (GSAP and three.js are vendored in vendor/). */
/* Marcellus (SIL Open Font License), served from this site: headings and the brand */
@font-face { font-family: "Marcellus"; font-style: normal; font-weight: 400; font-display: swap; src: url(assets/fonts/marcellus-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Marcellus"; font-style: normal; font-weight: 400; font-display: swap; src: url(assets/fonts/marcellus-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
:root {
  --display: "Marcellus", "Trajan Pro", "Palatino Linotype", Georgia, serif;
  --bg: #0b0e13; --bg-2: #10151c; --panel: #141a23; --border: #232c3a;
  --text: #e8edf4; --muted: #9aa7b8; --accent: #3b82f6; --accent-ink: #ffffff;
  --up: #16c784; --warn: #f5a623;
  --radius: 12px; --pad: clamp(16px, 4vw, 40px); --max: 1180px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", Consolas, "SF Mono", Menlo, monospace;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f8fb; --bg-2: #eef2f7; --panel: #ffffff; --border: #d8dfe9;
    --text: #131a24; --muted: #55627a; --accent: #1d5fd6; --up: #066b49; --warn: #9a5b00;
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.15; margin: 0; text-wrap: balance; letter-spacing: .005em; }
h1 { font-size: clamp(34px, 5.2vw, 58px); }
h2 { font-size: clamp(28px, 3.6vw, 42px); }
h3 { font-size: 24px; }
p { margin: 0; text-wrap: pretty; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--panel); padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }

/* top bar */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 20px; padding: 12px var(--pad); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-family: var(--display); font-weight: 400; font-size: 20px; letter-spacing: .05em; white-space: nowrap; }
.brand img { border-radius: 6px; }
.top-nav { display: flex; gap: 22px; margin-left: auto; }
.top-nav a { color: var(--muted); text-decoration: none; font-size: 15px; }
.top-nav a:hover { color: var(--text); }
.top-tools { display: flex; gap: 8px; }
.chip { font: 600 13px/1 var(--font); color: var(--text); background: var(--panel); border: 1px solid var(--border); border-radius: 999px; padding: 8px 12px; cursor: pointer; text-decoration: none; }
.chip:hover { border-color: var(--accent); }
@media (max-width: 760px) { .top-nav { display: none; } .top-tools { margin-left: auto; } }

main > section { padding: clamp(48px, 8vw, 96px) var(--pad); }
main > section > * { max-width: var(--max); margin-left: auto; margin-right: auto; }

/* hero */
.hero { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(24px, 4vw, 56px); align-items: center; max-width: calc(var(--max) + 2 * var(--pad)); margin: 0 auto; }
.hero > * { max-width: none; margin: 0; }
.eyebrow { color: var(--up); font-weight: 650; font-size: 14px; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 14px; }
.lead { color: var(--muted); font-size: clamp(17px, 1.6vw, 20px); margin-top: 18px; max-width: 56ch; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 20px; border-radius: 10px; border: 1px solid var(--border); background: var(--panel); color: var(--text); font: 650 16px/1 var(--font); text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.1); }
.fine { color: var(--muted); font-size: 14px; margin-top: 14px; }
figure { margin: 0; }
figcaption { color: var(--muted); font-size: 13px; margin-top: 10px; text-align: center; }
.hero-shot video, .maths-shot video, .shot img { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-2); box-shadow: 0 24px 60px rgba(0, 0, 0, .35); }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; } }

/* hero background (hero3d.js) and intro (pre.js + anim.js) */
body { overflow-x: clip; }
.hero { position: relative; }
.hero > :not(.hero-gl) { position: relative; z-index: 1; }
/* the mask fades the canvas at top and bottom, and dims it on the text side so the copy stays easy to read */
.hero-gl { position: absolute; top: 0; left: 50%; width: 100vw; height: 100%; transform: translateX(-50%); z-index: 0; pointer-events: none; opacity: 0; transition: opacity 1.4s ease;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 14%, #000 72%, transparent), linear-gradient(to right, rgba(0, 0, 0, .22), rgba(0, 0, 0, .3) 38%, #000 62%);
  mask-image: linear-gradient(to bottom, transparent, #000 14%, #000 72%, transparent), linear-gradient(to right, rgba(0, 0, 0, .22), rgba(0, 0, 0, .3) 38%, #000 62%);
  -webkit-mask-composite: source-in; mask-composite: intersect; }
.hero-gl.on { opacity: .85; }
@media (max-width: 900px) { .hero-gl.on { opacity: .45; } }
.anim:not(.anim-go) .hero-txt > *, .anim:not(.anim-go) .hero-shot { opacity: 0; }
.hero h1 .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .14em; margin-bottom: -.14em; }
/* the scroll line (scrollline.js): fixed, over the content and under the top bar; never takes clicks */
.scroll-line { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 15; pointer-events: none; }
.hero h1 .w > span { display: inline-block; will-change: transform; }

/* principles strip */
.strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; background: var(--bg-2); border-block: 1px solid var(--border); padding-block: 0 !important; }
.strip > div { max-width: none; margin: 0; padding: 26px 22px; border-left: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.strip > div:first-child { border-left: 0; }
.strip b { font-size: 17px; }
.strip span { color: var(--muted); font-size: 15px; line-height: 1.45; }
@media (max-width: 900px) { .strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } .strip > div:nth-child(odd) { border-left: 0; } .strip > div:nth-child(n+3) { border-top: 1px solid var(--border); } }
@media (max-width: 520px) { .strip { grid-template-columns: 1fr; } .strip > div { border-left: 0; border-top: 1px solid var(--border); } .strip > div:first-child { border-top: 0; } }

/* features */
.feats > h2 { margin-bottom: clamp(28px, 4vw, 48px); }
.feat { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(22px, 4vw, 52px); align-items: center; margin-bottom: clamp(48px, 7vw, 88px); }
.feat.rev .feat-txt { order: 2; }
.feat-txt p { color: var(--muted); margin-top: 12px; }
.feat-txt ul { margin: 16px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.feat-txt li { padding-left: 22px; position: relative; font-size: 16px; }
.feat-txt li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 8px; height: 8px; border-radius: 50%; background: var(--up); }
.shot { display: block; text-decoration: none; color: var(--muted); cursor: zoom-in; }
.shot:hover img { border-color: var(--accent); }
@media (max-width: 900px) { .feat { grid-template-columns: 1fr; } .feat.rev .feat-txt { order: 0; } }
.gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.gallery .shot img { box-shadow: none; }
.gallery span { display: block; font-size: 14px; margin-top: 8px; text-align: center; }
@media (max-width: 900px) { .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.gallery.crop { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: calc(-1 * clamp(20px, 4vw, 44px)) 0 clamp(48px, 7vw, 88px); }
.gallery.crop img { aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; }
@media (max-width: 900px) { .gallery.crop { grid-template-columns: minmax(0, 1fr); } }

/* maths */
.maths { background: var(--bg-2); border-block: 1px solid var(--border); display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
.maths > * { max-width: none; margin: 0; }
.maths-txt { justify-self: end; max-width: 560px; }
.maths-txt p { color: var(--muted); margin-top: 14px; }
.models { list-style: none; padding: 0; margin: 20px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.models li { font: 500 13px/1 var(--mono); padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); }
.honest { border-left: 3px solid var(--warn); padding-left: 14px; color: var(--text) !important; font-size: 16px; }
@media (max-width: 900px) { .maths { grid-template-columns: 1fr; } .maths-txt { justify-self: start; } }

/* install */
.install > h2 { margin-bottom: 28px; }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; min-width: 0; }
.card p { color: var(--muted); font-size: 15px; }
.card .fine { margin-top: 0; font-size: 13px; }
.card .btn { min-height: 42px; font-size: 15px; }
pre { margin: 0; width: 100%; overflow-x: auto; background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; }
code { font: 13px/1.6 var(--mono); }
.more { margin-top: 24px; color: var(--muted); font-size: 15px; }
@media (max-width: 1000px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .cards { grid-template-columns: 1fr; } }

/* source */
.source { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: start; max-width: calc(var(--max) + 2 * var(--pad)); margin: 0 auto; }
.source > * { max-width: none; margin: 0; }
.source p { color: var(--muted); margin-top: 14px; }
.clone { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.copy { min-height: 38px; font-size: 14px; padding: 0 14px; }
@media (max-width: 900px) { .source { grid-template-columns: 1fr; } }

/* faq */
.faq { border-top: 1px solid var(--border); }
.faq h2 { margin-bottom: 20px; }
.faq details { border-bottom: 1px solid var(--border); padding: 16px 0; max-width: 820px; }
.faq summary { cursor: pointer; font-weight: 650; font-size: 18px; }
.faq details p { color: var(--muted); margin-top: 10px; }

/* contact */
.contact { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: start; border-top: 1px solid var(--border); max-width: calc(var(--max) + 2 * var(--pad)); margin: 0 auto; }
.contact > * { max-width: none; margin: 0; }
.contact p { color: var(--muted); margin-top: 14px; }
.contact form { display: flex; flex-direction: column; gap: 14px; align-items: stretch; }
.contact label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
.contact input, .contact select, .contact textarea { font: inherit; font-size: 16px; color: var(--text); background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 11px 12px; min-height: 46px; width: 100%; box-sizing: border-box; }
.contact textarea { resize: vertical; min-height: 130px; }
.contact input:focus, .contact select:focus, .contact textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.contact button { align-self: flex-start; cursor: pointer; font: inherit; font-weight: 650; }
.contact button:disabled { opacity: .6; cursor: default; }
.contact .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.contact .contact-msg { margin-top: 0; }
.contact .contact-msg.ok { color: var(--up); }
.contact .contact-msg.bad { color: var(--warn); }
@media (max-width: 900px) { .contact { grid-template-columns: minmax(0, 1fr); } }

.foot { padding: 32px var(--pad) 48px; border-top: 1px solid var(--border); color: var(--muted); font-size: 14px; }
.foot p { max-width: var(--max); margin: 0 auto 8px; }

dialog#lb { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 94vh; cursor: zoom-out; }
dialog#lb::backdrop { background: rgba(0, 0, 0, .82); }
dialog#lb img { max-width: 96vw; max-height: 92vh; border-radius: 10px; }
dialog#lb button { position: fixed; top: 14px; right: 18px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .14); color: #fff; font-size: 24px; cursor: pointer; }
select.chip { padding: 7px 10px; }
select.chip option { background: var(--panel); color: var(--text); }

/* fixes: reversed feature rows keep the wide column for the image; grids never overflow */
.feat.rev { grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); }
.feat.rev .shot { order: 1; }
@media (max-width: 900px) { .hero, .feat, .feat.rev, .maths, .source { grid-template-columns: minmax(0, 1fr); } .feat.rev .shot { order: 0; } }
body { overflow-wrap: anywhere; }
main > section > *, .hero > *, .feat > * { min-width: 0; }

/* what it does / doesn't */
.does > h2 { margin-bottom: 24px; }
.does-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.does-col { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; }
.does-col h3 { margin-bottom: 12px; }
.does-col ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.does-col li { padding-left: 26px; position: relative; font-size: 16px; }
.does-col.yes li::before { content: "✓"; position: absolute; left: 2px; color: var(--up); font-weight: 700; }
.does-col.no li::before { content: "✕"; position: absolute; left: 2px; color: var(--warn); font-weight: 700; }
@media (max-width: 760px) { .does-grid { grid-template-columns: minmax(0, 1fr); } }
.foot .privacy { font-size: 13px; }
/* narrow phones: brand + language only in the top bar (GitHub is in the source section and the footer) */
.chip { white-space: nowrap; }
@media (max-width: 480px) { .top-tools a.chip { display: none; } .brand { min-width: 0; overflow: hidden; text-overflow: ellipsis; } }
