/* Ycontacts — site styles.
   Colour tokens are the app's own (DESIGN-SYSTEM.md); hex lives only in this file. */

/* ---------- Themes ---------- */

:root,
[data-theme='stone'] {
  --bg: #f4f4f2; --surface: #ffffff; --surface-2: #ecece9;
  --text: #1c1917; --muted: #6b6560; --faint: #a19a93;
  --line: rgba(28,25,23,.09); --line-strong: rgba(28,25,23,.17);
  --accent: #3d3f8a; --on-accent: #ffffff; --accent-soft: rgba(61,63,138,.09);
  --glass: rgba(255,255,255,.8);
  --shadow: 0 10px 30px -12px rgba(28,25,23,.28), 0 1px 2px rgba(28,25,23,.06);
  --stage-hi: #fbfbf9; --grid-line: rgba(61,63,138,.11); --dust: #6b6560;
  color-scheme: light;
}

[data-theme='graphite'] {
  --bg: #1c1c1e; --surface: #242427; --surface-2: #2d2d31;
  --text: #ececee; --muted: #a3a3ab; --faint: #6c6c74;
  --line: rgba(236,236,238,.08); --line-strong: rgba(236,236,238,.16);
  --accent: #a3a5e8; --on-accent: #15152a; --accent-soft: rgba(163,165,232,.13);
  --glass: rgba(36,36,39,.82);
  --shadow: 0 12px 32px -12px rgba(0,0,0,.6), 0 1px 2px rgba(0,0,0,.4);
  --stage-hi: #26262a; --grid-line: rgba(163,165,232,.12); --dust: #a3a3ab;
  color-scheme: dark;
}

/* Sage — the app's green palette */
[data-theme='sage'] {
  --bg: #eef3ee; --surface: #f9fbf8; --surface-2: #e2eae2;
  --text: #17211b; --muted: #5c6b60; --faint: #94a398;
  --line: rgba(23,33,27,.1); --line-strong: rgba(23,33,27,.18);
  --accent: #2c6a4e; --on-accent: #ffffff; --accent-soft: rgba(44,106,78,.11);
  --glass: rgba(249,251,248,.8);
  --shadow: 0 10px 30px -12px rgba(23,33,27,.26), 0 1px 2px rgba(23,33,27,.06);
  --stage-hi: #f7faf6; --grid-line: rgba(44,106,78,.12); --dust: #5c6b60;
  color-scheme: light;
}

/* Indigo — the site's bright theme: the brand accent becomes the room, saffron takes the accent */
[data-theme='indigo'] {
  --bg: #25277a; --surface: #2e3091; --surface-2: #3739a3;
  --text: #f4f4ff; --muted: #c4c5f0; --faint: #8f91d8;
  --line: rgba(244,244,255,.14); --line-strong: rgba(244,244,255,.26);
  --accent: #f5c84c; --on-accent: #1d1d4f; --accent-soft: rgba(245,200,76,.16);
  --glass: rgba(46,48,145,.78);
  --shadow: 0 14px 34px -12px rgba(8,8,40,.6), 0 1px 2px rgba(8,8,40,.3);
  --stage-hi: #3134a6; --grid-line: rgba(244,244,255,.10); --dust: #c4c5f0;
  color-scheme: dark;
}

:root {
  --brand-whatsapp: #25d366; --brand-telegram: #229ed9; --brand-viber: #7360f2;
  --brand-instagram: #e1306c; --brand-linkedin: #0a66c2;
  --r-s: 6px; --r-m: 10px; --r-l: 14px;
  --font-sans: 'Geist', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, monospace;
  --font-serif: 'Instrument Serif', 'Cormorant Garamond', Georgia, serif;
  --gutter: clamp(16px, 4vw, 44px);
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 16px; top: -48px; z-index: 100;
  padding: 10px 14px; border-radius: var(--r-s);
  background: var(--accent); color: var(--on-accent); font-weight: 500;
}
.skip:focus { top: 16px; }

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

.hero { position: relative; height: 560vh; }
.stage {
  position: sticky; top: 0;
  height: 100vh; height: 100svh;
  height: var(--stage-h, 100svh); /* phones: locked to the full screen by hero.js, see there */
  overflow: hidden;
  isolation: isolate;
  background: radial-gradient(90% 70% at 50% 42%, var(--stage-hi) 0%, var(--bg) 70%);
}
.px {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 20;
}

/* soft light behind the headline only */
.veil {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse 28% 22% at 50% 46%, color-mix(in srgb, var(--stage-hi) 85%, transparent) 35%, transparent 85%);
}

/* Faint accent grid. The frame holds the mask and never moves; the lines live on their
   own GPU layer and only slide (transform), so nothing is repainted while scrolling. */
.grid {
  position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  --cell: 56px;
  -webkit-mask-image: radial-gradient(ellipse 36% 64% at 50% 48%, #000 25%, transparent 80%);
          mask-image: radial-gradient(ellipse 36% 64% at 50% 48%, #000 25%, transparent 80%);
}
.grid__lines {
  position: absolute; left: 0; right: 0;
  top: calc(-2 * var(--cell)); height: calc(100% + 4 * var(--cell));
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: var(--cell) var(--cell);
  background-position: calc(50% - var(--cell) / 2) calc(46% + 2 * var(--cell) - var(--cell) / 2);
  will-change: transform;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
}

/* ---------- Floating contacts ---------- */

.air { position: absolute; inset: 0; z-index: 1; transition: opacity .5s ease-out; }
.is-final .air { opacity: .2; }
.float {
  position: absolute; left: 0; top: 0;
  will-change: transform;
  display: flex; align-items: center; gap: 8px;
}
.float img {
  display: block; border-radius: 50%; object-fit: cover;
  box-shadow: var(--shadow), inset 0 0 0 1px var(--line);
}
.float--org img { border-radius: 26%; }
.float.is-flip { flex-direction: row-reverse; }
.pill {
  display: grid; gap: 1px;
  padding: 8px 12px 8px 10px;
  background: var(--glass);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  box-shadow: var(--shadow);
  white-space: nowrap;
}
.pill b { font: 500 13px/1.3 var(--font-sans); }
.pill span { font-size: 11px; color: var(--muted); }
/* one network per contact, as its own chip — where the chat or profile opens */
.badge {
  flex: none;
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--c); color: #fff;
  box-shadow: var(--shadow);
}
.badge svg { width: 18px; height: 18px; }

/* ---------- First screen: two lines around the network ---------- */

.line {
  position: absolute; left: 50%; z-index: 30; transform: translate(-50%, 0);
  width: min(620px, calc(100% - 32px));
  display: grid; justify-items: center; gap: 10px; text-align: center;
  padding: 14px 18px;
  /* a soft pool of background colour so passing avatars never cut through the words */
  background: radial-gradient(ellipse 70% 80% at 50% 50%, color-mix(in srgb, var(--bg) 88%, transparent) 30%, transparent 75%);
}
.line--top { top: clamp(76px, 10.5vh, 108px); }
.line--bottom { bottom: clamp(76px, 10vh, 100px); }
.line__title { margin: 0; font: italic 400 clamp(24px, 2.8vw, 34px)/1.15 var(--font-serif); color: var(--text); text-wrap: balance; }
.line__text { margin: 0; font-size: 14px; color: var(--muted); text-wrap: balance; max-width: 440px; }
.float.is-linked img { box-shadow: var(--shadow), 0 0 0 3px var(--accent); }
.float img { transition: box-shadow .35s ease-out; }
@media (max-width: 720px) {
  .line--top { top: 88px; }
  .line--bottom { bottom: calc(88px + var(--bar-gap, 0px)); transition: bottom .3s ease-out; } /* clear of the scroll cue and the browser bar */
  .line__text { font-size: 13px; }
}

/* ---------- Header ---------- */

.bar {
  position: absolute; left: 0; right: 0; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 22px var(--gutter) 44px;
  background: linear-gradient(180deg, var(--bg) 35%, color-mix(in srgb, var(--bg) 0%, transparent));
}
.word { font: 500 16px/1 var(--font-sans); letter-spacing: -.02em; }
/* the Ycontacts mark stands in for the letter Y: its bottom sits on the baseline of "contacts" */
.word__mark { display: inline-block; height: 16px; width: auto; margin-right: 1px; overflow: visible; }
.word__dots { fill: var(--accent); }
.word em { font: italic 400 21px/1 var(--font-serif); letter-spacing: 0; }
.bar nav { display: flex; align-items: center; gap: 16px; font-size: 13px; color: var(--muted); }
.bar nav { margin-left: auto; }
.bar__cta { order: 3; } /* narrow screens: the button closes the row on the right */
/* wide screens: the main action sits in the middle of the header */
@media (min-width: 1280px) {
  .bar__cta { order: 0; position: absolute; left: 50%; transform: translateX(-50%); }
}

/* ---------- Dropdowns: language + appearance ---------- */

.dd { position: relative; }
.dd__btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 10px 0 12px;
  border: 1px solid var(--line); border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  color: var(--text); font: 500 13px/1 var(--font-sans); cursor: pointer;
  transition: border-color .2s ease-out, background-color .2s ease-out;
}
.dd__btn:hover { border-color: var(--line-strong); }
.dd__btn[aria-expanded='true'] { border-color: var(--line-strong); background: var(--surface); }
.dd__btn .chev { width: 14px; height: 14px; color: var(--muted); transition: transform .2s ease-out; }
.dd__btn[aria-expanded='true'] .chev { transform: rotate(180deg); }
.dd__code { font: 500 11px/1 var(--font-mono); letter-spacing: .06em; }
.dot {
  width: 12px; height: 12px; border-radius: 50%; flex: none;
  background: var(--sw); box-shadow: 0 0 0 1px var(--line-strong); /* ring keeps it visible on its own theme */
}
.dd__menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60;
  min-width: 196px; padding: 6px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r-m);
  box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transform: translateY(-4px) scale(.98); transform-origin: top right;
  transition: opacity .16s ease-out, transform .16s ease-out, visibility 0s linear .16s;
}
.dd__menu.is-open { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.dd__title {
  padding: 8px 10px 6px;
  font: 400 10px/1 var(--font-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--faint);
}
.dd__item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  height: 36px; padding: 0 10px; border: 0; border-radius: var(--r-s);
  background: transparent; color: var(--text); font: 400 13px/1 var(--font-sans);
  text-align: left; cursor: pointer;
}
.dd__item:hover, .dd__item:focus-visible { background: var(--accent-soft); outline: none; }
.dd__item .check { margin-left: auto; width: 14px; height: 14px; color: var(--accent); opacity: 0; }
.dd__item[aria-current='true'] .check, .dd__item[aria-pressed='true'] .check { opacity: 1; }
.dd__item small { margin-left: 2px; color: var(--faint); font: 400 11px/1 var(--font-mono); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 18px;
  border-radius: var(--r-s);
  font: 500 14px/1 var(--font-sans);
  transition: background-color .2s ease-out, border-color .2s ease-out, color .2s ease-out;
}
.btn svg { width: 16px; height: 16px; }
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--text)); }
.btn--ghost { border: 1px solid var(--line-strong); color: var(--text); }
.btn--ghost:hover { border-color: var(--muted); }
.bar .btn { height: 36px; padding: 0 14px; font-size: 13px; }

/* ---------- Final CTA (appears under the last phrase) ---------- */

.cta {
  position: absolute; left: 50%; top: 64%;
  transform: translate(-50%, 12px);
  width: min(560px, calc(100% - 32px));
  display: grid; justify-items: center; gap: 22px;
  text-align: center;
  opacity: 0; visibility: hidden;
  z-index: 30;
  transition: opacity .25s ease-out, transform .25s ease-out, visibility 0s linear .25s;
}
.cta.is-on { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition-delay: 0s; }
.cta__lead { margin: 0; font-size: 16px; color: var(--muted); text-wrap: balance; }
.cta__row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.cta__fact { margin: 0; font-family: var(--font-mono); font-size: 11px; letter-spacing: .02em; color: var(--faint); }

/* ---------- Scroll cue + meta ---------- */

.cue {
  position: absolute; left: 50%; bottom: calc(28px + var(--bar-gap, 0px)); transform: translateX(-50%);
  display: grid; justify-items: center; gap: 10px;
  font: 400 10px/1 var(--font-mono); letter-spacing: .24em; text-transform: uppercase;
  color: var(--faint);
  z-index: 30;
  transition: opacity .25s ease-out, bottom .3s ease-out;
}
.cue i { display: block; width: 1px; height: 36px; background: var(--line-strong); overflow: hidden; position: relative; }
.cue i::after {
  content: ''; position: absolute; left: 0; top: -40%; width: 1px; height: 40%;
  background: var(--text);
  animation: cue 1.8s cubic-bezier(.6,0,.2,1) infinite;
}
@keyframes cue { to { top: 100%; } }
.meta {
  position: absolute; right: var(--gutter); bottom: 30px; z-index: 40;
  font: 400 10px/1.7 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--faint); text-align: right;
}

/* ---------- Header links ---------- */

.nav__link { padding: 8px 6px; color: var(--muted); font-size: 13px; transition: color .2s ease-out; }
.nav__link:hover { color: var(--text); }
@media (max-width: 900px) { .nav__link { display: none; } } /* on small screens they live in the footer */

/* ---------- Sections below the hero ---------- */

.sec {
  max-width: 1120px; margin: 0 auto;
  padding: clamp(72px, 12vw, 136px) var(--gutter);
  display: grid; gap: clamp(32px, 5vw, 56px);
  scroll-margin-top: 16px;
}
.sec + .sec { border-top: 1px solid var(--line); }
.sec__head { display: grid; gap: 14px; align-content: start; max-width: 640px; }
.eyebrow { margin: 0; font: 400 11px/1 var(--font-mono); letter-spacing: .18em; text-transform: uppercase; color: var(--faint); }
.sec h2 {
  margin: 0; font: italic 400 clamp(34px, 5vw, 52px)/1.08 var(--font-serif); letter-spacing: -.01em;
  text-wrap: balance;
}
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 48px; }
/* open list, not boxes: a hairline on top, the dot field shows between the items */
.card { display: grid; gap: 8px; align-content: start; padding-block: 22px 26px; border-top: 1px solid var(--line-strong); }
.card h3 { margin: 0; font: 500 17px/1.3 var(--font-sans); letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; }
/* the icon sits in front of the title, in the accent colour, no box */
.card__mini { flex: none; display: inline-grid; place-items: center; width: 18px; height: 18px; color: var(--accent); }
.card__mini svg { width: 18px; height: 18px; }
.card p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.55; max-width: 46ch; }
.row h3 { margin: 0; font: 500 16px/1.35 var(--font-sans); letter-spacing: -.01em; }
.row p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.card__icon {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-m);
  background: var(--accent-soft); color: var(--accent);
}
.card__icon svg { width: 18px; height: 18px; }
.sec--split { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.rows { list-style: none; margin: 0; padding: 0; display: grid; }
.row { display: grid; grid-template-columns: 36px 1fr; gap: 16px; padding: 24px 0; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; padding-top: 0; }
.row div { display: grid; gap: 8px; }
.more { display: inline-flex; align-items: center; gap: 6px; width: fit-content; color: var(--text); font-weight: 500; border-bottom: 1px solid var(--line-strong); padding-bottom: 2px; }
.more svg { width: 14px; height: 14px; }
.more:hover { border-color: var(--text); }
@media (max-width: 820px) {
  .cards, .sec--split { grid-template-columns: 1fr; }
}

/* Pixels below the hero (field.js): a dust field behind the sections, a figure under the
   Security and About headings. The field sits under everything. */
.field { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.figure { display: block; width: 100%; max-width: 360px; aspect-ratio: 1 / 1; margin-top: 18px; touch-action: pan-y; }
@media (max-width: 820px) { .figure { max-width: 260px; margin-top: 6px; } }

/* About */
.about { display: grid; gap: 36px; }
.about__text { display: grid; gap: 18px; }
.about__text p { margin: 0; font-size: 17px; line-height: 1.65; color: var(--text); text-wrap: pretty; }
.about__text p + p { color: var(--muted); }
.principles { list-style: none; margin: 0; padding: 0; display: grid; }
.principles li { display: grid; grid-template-columns: 36px 1fr; gap: 16px; padding: 20px 0; border-top: 1px solid var(--line); }
.principles div { display: grid; gap: 6px; }
.principles h3 { margin: 0; font: 500 16px/1.35 var(--font-sans); }
.principles p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.num { font: 400 12px/1.6 var(--font-mono); color: var(--accent); padding-top: 2px; }
.sign { margin: 0; font: italic 400 22px/1.3 var(--font-serif); color: var(--muted); }

/* ---------- Footer ---------- */

.foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
  padding: 28px var(--gutter);
  border-top: 1px solid var(--line);
  font-size: 13px; color: var(--muted);
}
.foot nav { display: flex; flex-wrap: wrap; gap: 20px; }
.foot a:hover { color: var(--text); }
.foot .langs { display: flex; gap: 14px; }
.foot .langs a[aria-current='true'] { color: var(--text); }

/* ---------- Small screens ---------- */

@media (max-width: 720px) {
  .grid {
    --cell: 40px;
    -webkit-mask-image: radial-gradient(ellipse 62% 64% at 50% 48%, #000 25%, transparent 80%);
            mask-image: radial-gradient(ellipse 62% 64% at 50% 48%, #000 25%, transparent 80%);
  }
  .dd--theme .dd__label { display: none; } /* phones: the dot says it */
  .bar nav { gap: 10px; }
  .meta { display: none; }
  .pill b { font-size: 12px; }
}
@media (max-width: 720px) {
  .cta { top: 40%; gap: 18px; } /* the last word sits higher on phones (yNarrow) */
  .cta__lead { font-size: 15px; margin-bottom: 8px; } /* a little more air before the buttons */
}
@media (max-width: 420px) {
  .bar { gap: 10px; }
  .bar nav { gap: 6px; }
  .dd__btn { padding: 0 8px 0 10px; gap: 6px; }
  .bar .btn { padding: 0 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; transition-duration: .01ms !important;
  }
}
