/* ============================================================
   SyncOn Cloud — syncon.cloud front page
   Brand tokens match FrontPageSync/assets/colors_and_type.css
   Mobile first: base styles are the phone layout; min-width
   queries add the tablet and desktop layouts. Type is in rem so
   it follows the visitor's browser text-size setting.
   ============================================================ */

/* Montserrat, self-hosted (SIL OFL). One variable file, weights 500–800, latin. */
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url("fonts/montserrat-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;
}

:root {
  --ink:     #0B0B10;
  --line:    #2A2A34;
  --fg:      #FFFFFF;
  --fg-2:    #B5B5BF;
  --fg-3:    #8A8A96;

  --orange:  #F39237;
  --magenta: #D1006F;
  --purple:  #7B3FC7;
  --live:    #3DDC8E;   /* brighter cut of brand success #2BA66A, for a light on dark */

  --font: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --beat: 2.4s;

  --gutter: clamp(20px, 5vw, 72px);
  --max: 1240px;
  --tap: 44px;          /* smallest touch target */
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--fg);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
p, h1, h2, h3 { margin: 0; }
img, svg { max-width: 100%; }

.page { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; }
main { flex: 1; }
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

a:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 4px;
  border-radius: 6px;
}

/* ── Top ─────────────────────────────────────────────── */
.top { position: relative; z-index: 2; }
.top-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-top: 14px; padding-bottom: 14px;
}
.brand {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: var(--tap);
  color: var(--fg); text-decoration: none;
}
.brand picture { display: block; }
.brand .logo { display: block; height: 26px; width: auto; }
.brand .word { font-weight: 500; font-size: 1.25rem; line-height: 1; letter-spacing: -0.01em; color: var(--fg-3); }
/* ── Hero ────────────────────────────────────────────── */
.hero {
  position: relative;
  isolation: isolate;
  padding-top: clamp(48px, 11vh, 132px);
  padding-bottom: clamp(32px, 6vh, 64px);
}
/* monitor paper: a faint grid only around the trace */
.hero::before {
  content: "";
  position: absolute; inset: -80px 0 0 0;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 40px 40px;
  -webkit-mask-image: radial-gradient(52% 62% at 74% 58%, #000 0%, transparent 72%);
          mask-image: radial-gradient(52% 62% at 74% 58%, #000 0%, transparent 72%);
  z-index: -2;
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute; inset: -80px 0 0 0;
  background:
    radial-gradient(38% 46% at 80% 62%, rgba(209,0,111,.10) 0%, transparent 70%),
    radial-gradient(30% 40% at 62% 70%, rgba(243,146,55,.07) 0%, transparent 70%);
  z-index: -3;
  pointer-events: none;
}

.trace {
  position: absolute; left: 0; top: 0;
  width: 100%; height: 100%;
  max-width: none;
  overflow: visible;
  z-index: -1;
  pointer-events: none;
}
.trace-line,
.trace-glint {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.trace-line  { stroke: url(#traceInk); }
.trace-glint { stroke: url(#glintInk); opacity: .9; }

.headline {
  font-weight: 800;
  /* rem floor and ceiling follow the browser text size; vw does the fluid part */
  font-size: clamp(2.875rem, 1rem + 9vw, 8.5rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
  max-width: 8.4em;
  text-wrap: balance;
}

/* The full stop is the live light */
.live-dot {
  position: relative;
  display: inline-block;
  width: 0.19em;
  height: 0.19em;
  margin-left: 0.06em;
  border-radius: 50%;
  vertical-align: baseline;
  background: var(--live);
  box-shadow: 0 0 0.22em rgba(61,220,142,.55);
  transition: background-color 500ms var(--ease), box-shadow 500ms var(--ease);
}
.live-dot::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 2px solid var(--live);
  opacity: 0;
}
/* With JS, the light starts off and switches on once the page is ready */
@media (scripting: enabled) {
  html:not(.is-live) .live-dot { background: #3A3A45; box-shadow: none; }
}
.is-live .live-dot::after { animation: beat var(--beat) var(--ease) infinite; }
@keyframes beat {
  0%        { transform: scale(1);   opacity: .85; }
  70%, 100% { transform: scale(3.4); opacity: 0; }
}

.lede {
  margin-top: clamp(28px, 4.5vh, 48px);
  max-width: 34em;
  font-size: clamp(1.0625rem, 0.95rem + 0.35vw, 1.25rem);
  line-height: 1.65;
  color: var(--fg-2);
}

/* ── Promises: the app's life, build → release → live ── */
.promises { padding: clamp(16px, 3vh, 32px) 0 clamp(48px, 9vh, 104px); }
/* Lay this section out only when it nears the screen: keeps the first paint light */
.promises { content-visibility: auto; contain-intrinsic-size: auto 1600px; }
.promise-list {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
}
.step--orange  { --accent: var(--orange); }
.step--magenta { --accent: var(--magenta); }
.step--purple  { --accent: var(--purple); }

.step {
  display: flex; flex-direction: column; gap: 12px;
  container-type: inline-size;    /* the card lays itself out by its own width */
}
.stage {
  position: relative;
  z-index: 1;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding-right: 14px;
  background: var(--ink);           /* masks the rail behind the words */
  color: color-mix(in srgb, var(--accent) 62%, #fff);   /* brand hue, lifted to pass 4.5:1 on ink */
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25rem;
}
.stage::before {
  content: "";
  flex: none;
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: var(--ink);
}

/* The rail only exists when the three stages sit side by side */
.promise-list::before,
.promise-list::after { content: none; }

.promise {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 10px 10px 28px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(180deg, #15151D 0%, #101016 100%);
}
/* each card keeps its stage colour as a lit edge along the top */
.promise::before {
  content: "";
  position: absolute; top: -1px; left: 28px; right: 28px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.promise .art {
  aspect-ratio: 240 / 140;
  margin-bottom: 24px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.04);
  background:
    radial-gradient(70% 90% at 50% 60%, color-mix(in srgb, var(--accent) 14%, transparent) 0%, transparent 70%),
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px) 0 0 / 20px 20px,
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px) 0 0 / 20px 20px,
    #0E0E14;
  overflow: hidden;
}
.promise .art svg { display: block; width: 100%; height: 100%; }

.promise-copy { padding: 0 16px; }
.promise h3 {
  margin: 0 0 8px;
  text-wrap: balance;
  font-weight: 700;
  font-size: 1.125rem;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--fg);
}
.promise p { color: var(--fg-2); font-size: 0.97rem; line-height: 1.6; max-width: 40ch; }

/* A wide single card (tablets): drawing beside the words, not a tall poster */
@container (min-width: 34rem) {
  .promise {
    flex-direction: row;
    align-items: center;
    gap: 28px;
    padding: 10px 28px 10px 10px;
  }
  .promise .art { flex: 0 0 46%; margin-bottom: 0; }
  .promise-copy { padding: 0; }
}

/* ── Film ────────────────────────────────────────────── */
.film { margin: clamp(32px, 5vh, 56px) 0 0; }
.film video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #000;
}
.film video:focus-visible { outline: 2px solid var(--fg); outline-offset: 4px; }
.film figcaption {
  margin-top: 14px;
  max-width: 60ch;
  color: var(--fg-3);
  font-size: 0.875rem;
  line-height: 1.55;
}

/* ── Monthly measured numbers (filled by tools/build_stats.py) ── */
.stats { padding: 0 0 clamp(48px, 9vh, 104px); }
.stats-title { font-size: 1rem; font-weight: 600; color: var(--fg-2); margin: 0 0 16px; }
.stats-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 12px 40px;
  border-top: 1px solid var(--line); padding-top: 20px;
}
.stats-list li { color: var(--fg-2); font-size: 1rem; line-height: 1.4; }
.stats-list strong { display: block; color: var(--fg); font-size: clamp(2rem, 1.4rem + 2vw, 3rem); font-weight: 800; letter-spacing: -0.03em; }
.stats-list li:first-child strong::after {
  content: ""; display: inline-block; width: .18em; height: .18em; margin-left: .06em;
  border-radius: 50%; background: var(--live); box-shadow: 0 0 .22em rgba(61,220,142,.55);
}
.stats-note { margin-top: 14px; color: var(--fg-3); font-size: 0.8125rem; }

/* ── 404 ─────────────────────────────────────────────── */
.notfound { flex: 1; }
.notfound-title {
  font-weight: 800;
  font-size: clamp(2.25rem, 1rem + 5vw, 4.5rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  max-width: 12em;
  text-wrap: balance;
}
.notfound-link { margin-top: 28px; }
.notfound-link a {
  display: inline-block;
  padding: 12px 0;
  color: var(--fg);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--live);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

/* ── Footer ──────────────────────────────────────────── */
.foot { border-top: 1px solid var(--line); }
.foot-row {
  display: flex; flex-direction: column; gap: 8px 32px;
  padding-top: 24px; padding-bottom: 32px;
  color: var(--fg-3);
  font-size: 0.8125rem;
  font-weight: 500;
}
/* SyncOn's own social profiles: text links, as on syncon.ae; each one a full tap target */
.social-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 22px; }
.social-list a {
  display: inline-flex; align-items: center;
  min-height: var(--tap);
  color: var(--fg-2);
  font-size: 0.875rem; font-weight: 600;
  text-decoration: none;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}
@media (hover: hover) {
  .social-list a:hover { color: var(--fg); text-decoration: underline; text-decoration-color: var(--live); }
}

/* ── Large phones and up (560px) ─────────────────────── */
@media (min-width: 35em) {
  .top-row { padding-top: 20px; padding-bottom: 20px; }
  .brand { gap: 10px; }
  .brand .logo { height: 32px; }
  .brand .word { font-size: 1.5625rem; }
  .foot-row { flex-direction: row; flex-wrap: wrap; justify-content: space-between; align-items: center; }
}

/* ── Desktop (1024px): three stages side by side on one rail ── */
@media (min-width: 64em) {
  .promise-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(16px, 2vw, 24px);
  }
  .step { gap: 18px; }
  .promise-list::before {
    content: "";
    position: absolute; top: 9px; left: 6px; right: 14px; height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--orange) 0%, var(--magenta) 45%, var(--purple) 85%, var(--live) 100%);
    opacity: .8;
  }
  .promise-list::after {
    content: "";
    position: absolute; top: 4px; right: 0; width: 12px; height: 12px;
    border-radius: 50%;
    background: var(--live);
    box-shadow: 0 0 0 4px rgba(61,220,142,.14), 0 0 14px rgba(61,220,142,.55);
  }
}

/* ── Phone held sideways: size the headline by height so the intro stays in view ── */
@media (orientation: landscape) and (max-height: 32em) {
  .hero { padding-top: 24px; }
  .headline { font-size: clamp(2.875rem, 1rem + 12vh, 5rem); }
  .lede { margin-top: 20px; }
}

/* ── Preferences ─────────────────────────────────────── */
@media (prefers-contrast: more) {
  :root { --fg-2: #DCDCE4; --fg-3: #B5B5BF; --line: #55555F; }
}
@media (prefers-reduced-motion: reduce) {
  .is-live .live-dot::after { animation: none; }
  .live-dot { transition: none; }
}
