/* NIDots site: the app's dark theme (Ui.kt) and dot-matrix look. */
@font-face { font-family: "Roboto"; src: url("fonts/Roboto.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "DroidMono"; src: url("fonts/DroidSansMono.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@property --r { syntax: "<length>"; inherits: false; initial-value: 0px; }

:root {
  --bg: #000; --card: #111112; --line: #232325; --fg: #fff; --dim: #8a8a8e; --ghost: #242426; --red: #d71921;
  --wbg: #1b1b1d; --wbtn: #2c2c2f;
  --mono: "DroidMono", ui-monospace, monospace;
  --pad: clamp(20px, 5vw, 72px);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--fg); font: 400 18px/1.5 "Roboto", system-ui, sans-serif; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
body.loading { overflow: hidden; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.label { font: 400 13px/1 var(--mono); letter-spacing: .32em; text-transform: uppercase; color: var(--dim); margin: 0 0 22px; }
h2 { font-weight: 400; font-size: clamp(36px, 5.2vw, 76px); line-height: 1.08; letter-spacing: -.01em; margin: 0 0 24px; }
.dot { display: inline-block; width: .17em; height: .17em; border-radius: 50%; background: var(--red); margin-left: .12em; vertical-align: .05em; }
p { color: var(--dim); margin: 0 0 18px; max-width: 34em; }

/* ---- buttons ------------------------------------------------------------------------------------ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; padding: 0 30px; border-radius: 999px;
  font: 400 14px/1 var(--mono); letter-spacing: .22em; text-transform: uppercase; border: 1.5px solid var(--line); background: var(--bg); color: var(--fg);
  cursor: pointer; transition: transform .25s cubic-bezier(.2, .9, .3, 1.3), background .2s, border-color .2s; }
.btn:hover { transform: translateY(-2px); border-color: #45454a; }
.btn:active { transform: scale(.97); }
.btn-white { background: var(--fg); color: #000; border-color: var(--fg); }
.btn-white:hover { border-color: var(--fg); }
.btn-outline { background: transparent; }
.btn-sm { min-height: 42px; padding: 0 20px; font-size: 12px; }
.btn-lg { min-height: 68px; padding: 0 40px; font-size: 15px; }

/* ---- start screen ------------------------------------------------------------------------------------ */
#loader { position: fixed; inset: 0; z-index: 50; background: var(--bg); display: grid; place-items: center; transition: opacity .6s ease; }
#loader canvas { width: 100vw; height: 100vh; }
#loader.out { opacity: 0; pointer-events: none; }

/* ---- header -------------------------------------------------------------------------------------- */
.top { position: fixed; top: 0; left: 0; right: 0; z-index: 20; display: flex; align-items: center; gap: 28px; padding: 18px var(--pad);
  transition: background .3s, padding .3s, border-color .3s; border-bottom: 1px solid transparent; }
.top.solid { background: rgba(0, 0, 0, .82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); padding-top: 12px; padding-bottom: 12px; border-color: var(--line); }
.logo { font-size: 26px; letter-spacing: -.01em; }
.logo i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--red); margin-left: 3px; }
.nav { display: flex; gap: 26px; margin-left: auto; font: 400 12px/1 var(--mono); letter-spacing: .24em; text-transform: uppercase; color: var(--dim); }
.nav a { position: relative; padding: 8px 0; transition: color .2s; }
.nav a:hover, .nav a.on { color: var(--fg); }
.nav a.on::after { content: ""; position: absolute; left: 50%; bottom: -4px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--red); }

/* ---- hero ------------------------------------------------------------------------------------------ */
.hero { position: relative; min-height: 100svh; display: flex; align-items: flex-end; padding: 0 var(--pad) clamp(70px, 12vh, 130px); }
#field { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-copy { position: relative; max-width: 640px; opacity: 0; transform: translateY(24px); transition: opacity .8s .2s, transform .8s .2s cubic-bezier(.2, .8, .2, 1); }
body.ready .hero-copy { opacity: 1; transform: none; }
.lead { font-size: clamp(20px, 2.1vw, 26px); color: var(--fg); line-height: 1.4; }
.actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }
.scroll-hint { position: absolute; right: var(--pad); bottom: clamp(70px, 12vh, 130px); display: grid; gap: 8px; padding: 10px; }
.scroll-hint i { width: 7px; height: 7px; border-radius: 50%; background: var(--fg); opacity: .25; animation: hint 1.6s infinite; }
.scroll-hint i:nth-child(2) { animation-delay: .2s; } .scroll-hint i:nth-child(3) { animation-delay: .4s; }
@keyframes hint { 0%, 100% { opacity: .2; transform: none; } 40% { opacity: 1; transform: translateY(4px); } }

/* ---- blocks ---------------------------------------------------------------------------------------- */
.block { position: relative; padding: clamp(90px, 14vh, 170px) var(--pad); overflow-x: clip; }
.nowrap { white-space: nowrap; }
.block::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background: radial-gradient(circle, rgba(255, 255, 255, .06) 1.4px, transparent 1.6px) 0 0 / 32px 32px; mask-image: linear-gradient(transparent, #000 20%, #000 80%, transparent); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 110px); align-items: center; }
.split.reverse .stage { order: -1; }
.copy.wide { max-width: 980px; }
.copy.center { text-align: center; margin: 0 auto; }
.copy.center p { margin-left: auto; margin-right: auto; }
.facts { list-style: none; padding: 0; margin: 34px 0 0; display: grid; gap: 16px; font: 400 14px/1.5 var(--mono); letter-spacing: .06em; color: var(--dim); }
.facts li { display: grid; grid-template-columns: 46px 1fr; align-items: baseline; }
.facts b { color: var(--fg); font-weight: 400; font-size: 22px; }

/* Halftone reveal: content shows through dots that grow until they merge. */
[data-reveal] { --r: 0px; -webkit-mask-image: radial-gradient(circle, #000 var(--r), transparent calc(var(--r) + .5px)); mask-image: radial-gradient(circle, #000 var(--r), transparent calc(var(--r) + .5px));
  -webkit-mask-size: 16px 16px; mask-size: 16px 16px; transition: --r 1s cubic-bezier(.4, 0, .2, 1) var(--d, 0s); }
[data-reveal].in { --r: 13px; }
[data-reveal].done { -webkit-mask-image: none; mask-image: none; }

/* ---- phones and the orbit -------------------------------------------------------------------------- */
.stage { position: relative; display: grid; place-items: center; min-height: 640px; }
.phone { position: relative; width: min(330px, 72vw); aspect-ratio: 1080 / 2400; border-radius: 46px; border: 1.5px solid var(--line); overflow: hidden; background: #000;
  box-shadow: 0 40px 120px rgba(255, 255, 255, .04); }
.phone img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; }
.phone img.on { opacity: 1; }
.phone img.in { opacity: 1; z-index: 2; --r: 0px; -webkit-mask-image: radial-gradient(circle, #000 var(--r), transparent calc(var(--r) + .5px));
  mask-image: radial-gradient(circle, #000 var(--r), transparent calc(var(--r) + .5px)); -webkit-mask-size: 18px 18px; mask-size: 18px 18px; animation: halftone .7s cubic-bezier(.4, 0, .2, 1) forwards; }
@keyframes halftone { to { --r: 14px; } }
/* Plugin cards as in the film: letter in a circle (red dot on built-ins), name, mono tag.
   site.js moves them along a tilted ellipse; cards behind the phone are smaller and dimmer. */
.phone { z-index: 2; }
.orbit { position: absolute; inset: 0; pointer-events: none; }
.pcard { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 14px; width: 220px; padding: 14px 18px; border-radius: 26px;
  background: var(--card); border: 1px solid var(--line); will-change: transform, opacity; }
.pcard .pl { position: relative; width: 40px; height: 40px; flex: none; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; font-size: 17px; }
.pcard.own .pl::after { content: ""; position: absolute; right: 1px; top: 1px; width: 7px; height: 7px; border-radius: 50%; background: var(--red); }
.pcard b { display: block; font-weight: 400; font-size: 17px; line-height: 1.2; white-space: nowrap; }
.pcard small { display: block; font: 400 10px/1 var(--mono); letter-spacing: .26em; color: var(--dim); margin-top: 6px; }

/* ---- catalog cards ---------------------------------------------------------------------------------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(290px, 100%), 1fr)); gap: 16px; margin-top: 50px; }
.card { position: relative; padding: 26px; border-radius: 28px; background: var(--card); border: 1px solid var(--line); min-height: 220px; display: flex; flex-direction: column; overflow: hidden;
  transition: transform .35s cubic-bezier(.2, .9, .3, 1.2), border-color .3s; }
.card:hover { transform: translateY(-4px); border-color: #3a3a3e; }
.card canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.card .head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.card .letter { position: relative; width: 46px; height: 46px; flex: none; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; font-size: 20px; }
.card .letter.own::after { content: ""; position: absolute; right: 2px; top: 2px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.card h3 { font-weight: 400; font-size: 22px; margin: 0; line-height: 1.2; }
.card .tag { font: 400 11px/1 var(--mono); letter-spacing: .26em; color: var(--dim); margin-top: 6px; }
.card p { font-size: 15px; margin: 0; }
.card .ver { margin-top: auto; padding-top: 18px; font: 400 12px/1 var(--mono); letter-spacing: .2em; color: var(--dim); }
.card.mine { border-color: rgba(215, 25, 33, .7); }
.card.mine .letter, .card.mine .tag { color: var(--red); }

/* ---- assistant ------------------------------------------------------------------------------------- */
.quote { font-size: clamp(30px, 3.6vw, 52px); line-height: 1.15; color: var(--fg); min-height: 2.35em; margin: 8px 0 18px; }
.quote .cursor { display: inline-block; width: .06em; height: .9em; background: var(--fg); vertical-align: -.08em; margin-left: .04em; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.voice { display: block; width: min(520px, 100%); height: 46px; margin-bottom: 18px; }
.route { display: flex; flex-wrap: wrap; gap: 10px; min-height: 48px; margin-bottom: 26px; }
.route span { display: inline-flex; align-items: center; gap: 10px; padding: 11px 18px; border-radius: 999px; border: 1.5px solid var(--red); font: 400 13px/1 var(--mono); letter-spacing: .1em;
  animation: chip .45s cubic-bezier(.2, .9, .3, 1.4) both; }
.route span b { font-weight: 400; color: var(--dim); }
@keyframes chip { from { opacity: 0; transform: scale(.6); } }

/* ---- widgets ---------------------------------------------------------------------------------------- */
.widgets { display: grid; grid-template-columns: repeat(2, minmax(0, 210px)); gap: 18px; justify-content: center; }
.w { position: relative; aspect-ratio: 1; border-radius: 40px; background: var(--wbg); padding: 20px; display: flex; flex-direction: column; border: 0; color: var(--fg); text-align: left; font: inherit; }
.w-head { display: flex; justify-content: space-between; font: 400 11px/1 var(--mono); letter-spacing: .14em; color: #7a7a7e; white-space: nowrap; overflow: hidden; }
.w canvas[data-num] { width: 100%; height: 66px; margin: 12px 0 4px; }
.w-sub { font: 400 11px/1 var(--mono); letter-spacing: .12em; color: #7a7a7e; }
.w-btns { margin-top: auto; display: flex; gap: 6px; }
.w-btns button { flex: 1; height: 40px; border-radius: 20px; border: 0; background: var(--wbtn); color: var(--fg); font: 400 15px/1 "Roboto", sans-serif; cursor: pointer; transition: transform .15s; }
.w-btns button:active { transform: scale(.92); }
.w-btns .pri { background: var(--fg); color: #000; }
.w-btns .round { flex: none; width: 40px; }
.w-voice { cursor: pointer; align-items: center; justify-content: center; }
.w-voice canvas { width: 100%; height: 70%; }
.w-say { font: 400 11px/1 var(--mono); letter-spacing: .16em; color: #7a7a7e; }

/* ---- film ------------------------------------------------------------------------------------------ */
.film { position: relative; max-width: 1180px; margin: 50px auto 0; border-radius: 28px; overflow: hidden; border: 1px solid var(--line); background: #000; aspect-ratio: 16 / 9; }
.film video { width: 100%; height: 100%; display: block; }
.play { position: absolute; inset: 0; margin: auto; width: 108px; height: 108px; border-radius: 50%; border: 0; background: var(--fg); cursor: pointer; transition: transform .3s cubic-bezier(.2, .9, .3, 1.4), opacity .3s; }
.play i { position: absolute; left: 42px; top: 34px; border-left: 34px solid #000; border-top: 20px solid transparent; border-bottom: 20px solid transparent; }
.play:hover { transform: scale(1.08); }
.film.playing .play { opacity: 0; pointer-events: none; }

/* ---- developer code ---------------------------------------------------------------------------------- */
.code { margin: 0; padding: 30px 34px; border-radius: 28px; background: var(--card); border: 1px solid var(--line); font: 400 15px/1.75 var(--mono); color: #c9c9cc; overflow-x: auto; min-height: 380px; }
.code .k { color: var(--fg); } .code .t { color: var(--red); } .code .c { color: var(--dim); }

/* ---- download ------------------------------------------------------------------------------------------ */
.download { display: grid; place-items: center; text-align: center; min-height: 90svh; overflow: hidden; }
#ring { position: absolute; inset: 0; width: 100%; height: 100%; }
.dl-copy { position: relative; display: grid; justify-items: center; }
.dl-copy p { margin-left: auto; margin-right: auto; }
.dl-copy .meta { font: 400 13px/1 var(--mono); letter-spacing: .2em; text-transform: uppercase; margin-top: 24px; }
.dl-copy .note { font-size: 15px; max-width: 30em; }

/* ---- footer ---------------------------------------------------------------------------------------------- */
.foot { display: flex; justify-content: space-between; align-items: center; padding: 34px var(--pad) calc(34px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); color: var(--dim); font-size: 14px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--fg); font-size: 20px; font-weight: 400; letter-spacing: .01em; }

/* ---- smaller screens ----------------------------------------------------------------------------------------- */
@media (max-width: 960px) {
  .split { grid-template-columns: 1fr; }
  /* Text first, so the phrase and its result are on screen before the phone. */
  .split.reverse .stage { order: 2; }
  .stage { min-height: 560px; }
  .nav { display: none; }
  .top .btn { margin-left: auto; }
}
@media (max-width: 700px) {
  .block { padding-top: 64px; padding-bottom: 64px; }
  .split { gap: 34px; }
  .stage { min-height: 0; display: grid; place-items: center; }
  .orbit-stage { padding: 40px 0; }
  .phone { width: min(240px, 62vw); border-radius: 34px; }
  .pcard { width: 168px; gap: 10px; padding: 10px 14px; border-radius: 22px; }
  .pcard .pl { width: 32px; height: 32px; font-size: 14px; }
  .pcard b { font-size: 14px; }
  .pcard small { font-size: 9px; }
  .facts { margin-top: 24px; }
  .cards { margin-top: 34px; }
  .quote { min-height: 2.4em; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .hero { padding-bottom: 96px; }
  .scroll-hint { display: none; }
  .actions .btn { flex: 1 1 100%; }
  .quote { font-size: 28px; }
  .widgets { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .w { border-radius: 30px; padding: 14px; }
  .w canvas[data-num] { height: 48px; margin: 10px 0 2px; }
  .w-btns button { height: 34px; font-size: 13px; }
  .w-btns .round { width: 34px; }
  .code { font-size: 12px; padding: 22px; }
  .play { width: 76px; height: 76px; }
  .play i { left: 29px; top: 23px; border-left-width: 24px; border-top-width: 15px; border-bottom-width: 15px; }
  .foot { flex-direction: column; gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .orbit, .orbit span, .scroll-hint i { animation: none; }
  [data-reveal] { transition: none; }
}
