/* maschi.si landing layout — Terminal Ember. Shared components live in style.css; tokens in tokens.css. */
#dots, #sparks { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#dots { z-index: -1; }
#sparks { z-index: 300; }
.vignette { position: fixed; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(ellipse at 50% 0%, transparent 40%, var(--bg) 95%); }
.scanlines { position: fixed; inset: 0; z-index: 50; pointer-events: none; background: repeating-linear-gradient(0deg, var(--scanline) 0 1px, transparent 1px 3px); }

/* Hero */
.hero { min-height: 100svh; display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; padding: 120px 0 72px; }
.prompt-line { color: var(--muted); font-size: 13px; margin: 0 0 28px; }
.prompt-line b { color: var(--orange); font-weight: 500; }
#title { font-family: var(--display); font-weight: 800; font-size: clamp(48px, 7.4vw, 108px); line-height: .95; letter-spacing: -.045em; margin: 0; perspective: 600px; }
#title .row { display: block; }
#title .dim { color: var(--title-dim); transition: color .4s; }
#title .dim:hover { color: var(--orange); }
#title .acc-dim { color: var(--orange-dim); }
/* The underscore after the last word blinks like the terminal caret once the intro has landed; static when paused. */
#title .title-caret { animation: blink 1s steps(1) 1.8s infinite; }
body.paused #title .title-caret { animation: none; }
.lead { max-width: 470px; color: var(--muted); margin: 30px 0 34px; font-size: 15px; }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; }
.term-wrap { perspective: 1200px; }

/* Ticker */
.ticker { border-block: 1px solid var(--line); overflow: hidden; background: var(--bg-2); }
/* Two identical sets; spacing is padding (not gap) so the -50% loop lands exactly on the second set. */
.ticker-track { display: flex; width: max-content; padding: 14px 0; color: var(--muted); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.ticker-track > span { padding-right: 48px; }
.ticker-track b { color: var(--orange); font-weight: 500; }

/* Sections */
.section { padding: 110px 0; position: relative; }
.sec-head, .flow-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 44px; }
.sec-head h2, .flow-head h2 { font-family: var(--display); font-weight: 600; font-size: clamp(30px, 4.2vw, 56px); letter-spacing: -.03em; line-height: 1.04; margin: 0; }
.sec-head p { color: var(--muted); max-width: 380px; margin: 0; }

/* Collection cards with spotlight */
.cats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.cat { --mx: 50%; --my: 50%; position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; min-height: 300px; padding: 30px 28px 28px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-lg); }
.cat::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(380px circle at var(--mx) var(--my), rgba(255, 106, 26, .16), transparent 60%); opacity: 0; transition: opacity .3s; }
.cat::after { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; background: radial-gradient(260px circle at var(--mx) var(--my), var(--orange), transparent 70%); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0; transition: opacity .3s; }
.cat:hover::before, .cat:hover::after, .cat:focus-visible::before { opacity: 1; }
.cat .path { color: var(--muted); font-size: 12px; }
.cat .count { font-family: var(--display); font-size: 76px; font-weight: 800; letter-spacing: -.05em; line-height: 1; margin: 28px 0 6px; transition: color .3s; }
.cat:hover .count { color: var(--orange); }
.cat h3 { font-family: var(--display); font-weight: 600; font-size: 24px; margin: 0 0 8px; }
.cat p { color: var(--muted); margin: 0 0 auto; }
.cat ul { list-style: none; padding: 0; margin: 24px 0 0; border-top: 1px dashed var(--line-2); }
.cat li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 12px; color: var(--muted); transition: color var(--dur-fast), padding var(--dur-fast); }
.cat li span:last-child { color: var(--line-2); }
.cat:hover li { color: var(--text); }
.cat:hover li span:last-child { color: var(--orange); }

/* Workflow: horizontal and pinned on desktop (motion.source.js), stacked on phones */
.flow { padding: 0; overflow: hidden; }
.flow-pin { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; padding: 90px 0 40px; }
.flow-progress { width: 220px; height: 2px; background: var(--line-2); position: relative; flex: none; }
.flow-progress i { position: absolute; inset: 0; background: linear-gradient(90deg, var(--orange), var(--amber)); transform: scaleX(0); transform-origin: left; }
/* Static (paused or reduced motion): a 2×2 grid inside the content width. */
.flow-track { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; width: min(1240px, calc(100% - 32px)); margin: 0 auto; }
.flow-progress { visibility: hidden; }
/* Pinned (motion.source.js adds .is-pinned on wide screens): one horizontal row. */
.flow.is-pinned .flow-track { display: flex; width: max-content; margin: 0; padding-left: max(16px, calc((100vw - 1240px) / 2)); padding-right: 16px; }
.flow.is-pinned .flow-progress { visibility: visible; }
.flow.is-pinned .step { width: min(560px, 80vw); height: min(420px, 52svh); }
.step { position: relative; overflow: hidden; flex: none; display: flex; flex-direction: column; min-height: 300px; padding: 34px; border: 1px solid var(--line-2); border-radius: var(--r-xl); background: linear-gradient(160deg, var(--panel), var(--bg)); }
.step .tag { margin: 0; }
.step h3 { font-family: var(--display); font-weight: 600; font-size: 34px; margin: 14px 0 12px; letter-spacing: -.03em; }
.step p { color: var(--muted); max-width: 360px; margin: 0; position: relative; z-index: 1; }
.step .cmd { margin-top: auto; padding-top: 14px; border-top: 1px dashed var(--line-2); font-size: 13px; color: var(--muted); position: relative; z-index: 1; }
.step .cmd b { color: var(--orange); font-weight: 500; }
.step .n { position: absolute; right: 24px; bottom: 18px; font-family: var(--display); font-weight: 800; font-size: 140px; line-height: .8; letter-spacing: -.06em; color: transparent; -webkit-text-stroke: 1px var(--line-2); }
.step.hot { border-color: var(--orange-dim); background: linear-gradient(160deg, var(--hot-bg), var(--bg)); }
.step.hot .n { -webkit-text-stroke-color: var(--orange-dim); }

/* Outro */
.outro { padding: 140px 16px 70px; text-align: center; overflow: hidden; }
.outro .big { font-family: var(--display); font-weight: 800; font-size: clamp(56px, 15vw, 240px); line-height: .85; letter-spacing: -.06em; margin: 0; white-space: nowrap; color: var(--orange); }
.outro.is-igniting .big { color: var(--outro-ink); }
.outro .big .char { display: inline-block; transition: color .35s; }
.outro .big .char.lit { color: var(--orange); }
.outro p { color: var(--muted); margin: 28px 0 34px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--muted); font-size: 12px; }
.site-footer .wrap { display: flex; justify-content: space-between; align-items: center; gap: 16px 24px; flex-wrap: wrap; }
.site-footer small { letter-spacing: .12em; font-size: 11px; }
#motion { background: none; border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 7px 12px; font-size: 12px; color: var(--muted); }
#motion:hover { border-color: var(--orange); color: var(--text); }

/* Boot overlay (created by motion.source.js once per session) */
.boot { position: fixed; inset: 0; z-index: 400; display: flex; flex-direction: column; justify-content: flex-end; padding: 32px; background: var(--bg); color: var(--muted); font-size: 13px; cursor: pointer; }
.boot .ok { color: var(--orange); }
.boot .bar { height: 2px; background: var(--line); margin-top: 18px; overflow: hidden; }
.boot .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--orange), var(--amber)); transform: scaleX(0); transform-origin: left; }

/* Lenis owns smooth scrolling when motion.bundle.js is active. */
html.lenis, html.lenis body { height: auto; }
html.lenis { scroll-behavior: auto; }
.lenis.lenis-stopped { overflow: clip; }

@media (max-width: 1050px) {
  .nav nav { display: none; }
  .prefs { margin-left: auto; }
}
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 104px; min-height: 0; }
  .cats { grid-template-columns: repeat(2, 1fr); }
  .sec-head, .flow-head { flex-direction: column; align-items: start; }
  .flow-pin { min-height: 0; padding: 90px 0 20px; }
  .flow-track { grid-template-columns: 1fr; }
  .step { min-height: 280px; }
  .flow-progress { display: none; }
  .section { padding: 80px 0; }
}
@media (max-width: 560px) {
  .nav { gap: 10px; }
  .site-header .brand { font-size: 15px; gap: 8px; }
  .site-header .brand svg { width: 24px; }
  /* Icon only on phones; font-size 0 also hides the signed-in label that status.js writes as a bare text node. */
  .site-header .private { padding: 8px 10px; gap: 0; font-size: 0; }
  .site-header .brand > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .term-body { min-height: 280px; font-size: 12px; padding: 16px; }
  .cats { grid-template-columns: 1fr; }
  .cat { padding: 24px 20px; min-height: 0; }
  .cat .count { font-size: 60px; }
  .step { padding: 26px 22px; }
  .step h3 { font-size: 28px; }
  .step .n { font-size: 100px; }
}

/* Public examples (landing #primeri) */
.samples { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.sample { display: flex; flex-direction: column; gap: 14px; min-width: 0; padding: 24px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-lg); }
.sample header { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.sample .path { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.sample-desc { margin: 0; color: var(--muted); font-size: 13px; }
.sample-body { margin: 0; padding: 14px 16px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-md); font: inherit; font-size: 12px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
.sample-body .m { color: var(--muted); }
.sample-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sample .pill { display: inline-block; border: 1px solid var(--line-2); border-radius: 99px; padding: 1px 10px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.sample .pill.ok { color: var(--amber); border-color: var(--orange-dim); }
.sample .cmd { margin-top: auto; padding-top: 14px; border-top: 1px dashed var(--line-2); font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.sample .cmd b { color: var(--orange); font-weight: 500; }
.samples-cta { margin: 36px 0 0; text-align: center; }

/* Footer links */
.legal-links { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
.legal-links a, .legal-links button { background: none; border: 0; padding: 0; font-size: 12px; color: var(--muted); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; transition: color var(--dur-fast); }
.legal-links a:hover, .legal-links button:hover { color: var(--orange); }

/* Privacy page */
.legal { padding: 120px 0 72px; max-width: 820px; }
.legal h1 { font-family: var(--display); font-weight: 800; font-size: clamp(32px, 5vw, 56px); letter-spacing: -.04em; line-height: 1.02; margin: 0 0 18px; }
.legal-lead { font-size: 15px; color: var(--muted); margin: 0 0 6px; }
.legal-updated { font-size: 12px; color: var(--muted); margin: 0 0 40px; }
.legal section { padding: 28px 0; border-top: 1px solid var(--line); }
.legal h2 { font-family: var(--display); font-weight: 600; font-size: 22px; letter-spacing: -.03em; margin: 0 0 14px; }
.legal h2::before { content: "// "; color: var(--orange); font-family: var(--mono); font-size: .6em; font-weight: 400; vertical-align: .2em; }
.legal p { margin: 0 0 12px; color: var(--muted); }
.legal a:not(.btn) { color: var(--text); border-bottom: 1px solid var(--orange-dim); transition: color var(--dur-fast); }
.legal a:not(.btn):hover { color: var(--orange); }
.legal .btn { padding: 10px 16px; }
.legal-back { margin: 12px 0 0; }
.legal-table { display: grid; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--bg-2); }
.legal-table > div { display: grid; grid-template-columns: minmax(150px, 1.1fr) 2fr 1.2fr; gap: 6px 16px; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.legal-table > div:last-child { border-bottom: 0; }
.legal-table .head { color: var(--orange); letter-spacing: .08em; text-transform: uppercase; font-size: 11px; }
.legal-table code { font-family: var(--mono); color: var(--text); overflow-wrap: anywhere; }

@media (max-width: 900px) {
  .samples { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .legal-table > div { grid-template-columns: 1fr; }
  .legal-table .head { display: none; }
}
