/* Nyx website. Follows the visitor's appearance; one indigo tint; system type. */

:root {
  color-scheme: light dark;
  --page: #ffffff;
  --band: #f5f5f7;
  --ink: #1d1d1f;
  --ink-2: #6e6e73;
  --line: rgb(0 0 0 / 0.1);
  --tint: #5856d6;
  --tint-fill: #5856d6;
  --tint-ink: #ffffff;
  --tint-soft: rgb(88 86 214 / 0.1);
  --button-2-ink: #5856d6;
  --button-2-bg: rgb(88 86 214 / 0.1);
  --raise: 0 18px 50px -18px rgb(0 0 0 / 0.28), 0 2px 6px rgb(0 0 0 / 0.06);
  --raise-sm: 0 6px 18px -8px rgb(0 0 0 / 0.25);
  --radius: 18px;
  --wrap: 1080px;
  --gutter: clamp(16px, 4vw, 32px);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #000000;
    --band: #161617;
    --ink: #f5f5f7;
    --ink-2: #a1a1a6;
    --line: rgb(255 255 255 / 0.14);
    --tint: #7d7aff;
    --tint-fill: #5e5ce6;
    --tint-ink: #ffffff;
    --tint-soft: rgb(125 122 255 / 0.16);
    --button-2-ink: #f5f5f7;
    --button-2-bg: rgb(255 255 255 / 0.12);
    --raise: 0 18px 50px -18px rgb(0 0 0 / 0.9), 0 0 0 1px rgb(255 255 255 / 0.08);
    --raise-sm: 0 6px 18px -8px rgb(0 0 0 / 0.8), 0 0 0 1px rgb(255 255 255 / 0.08);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 17px/1.5 var(--font);
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--tint-fill); color: var(--tint-ink); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--tint); text-decoration: none; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--tint); outline-offset: 3px; border-radius: 6px; }
code {
  font: 0.86em/1.4 var(--mono);
  padding: 0.1em 0.38em;
  border-radius: 6px;
  background: var(--band);
  letter-spacing: 0;
}
.band code { background: var(--page); }

h1, h2, h3 { margin: 0; font-weight: 600; text-wrap: balance; }
h1 { font-size: clamp(42px, 7.2vw, 80px); line-height: 1.04; letter-spacing: -0.035em; }
h2 { font-size: clamp(32px, 4.8vw, 56px); line-height: 1.07; letter-spacing: -0.03em; }
h3 { font-size: 19px; line-height: 1.3; letter-spacing: -0.015em; }
p { margin: 0; }
.lede { font-size: clamp(19px, 2vw, 22px); line-height: 1.45; color: var(--ink-2); max-width: 40em; text-wrap: pretty; }

.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }

.skip { position: absolute; left: -999px; top: 8px; z-index: 20; background: var(--tint-fill); color: var(--tint-ink); padding: 8px 14px; border-radius: 999px; }
.skip:focus { left: 12px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--page) 80%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 52px; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); font-weight: 600; font-size: 18px; letter-spacing: -0.02em; }
.brand:hover { text-decoration: none; }
.brand img { border-radius: 7px; }
.nav { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 28px); font-size: 14px; }
.nav a { color: var(--ink-2); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); text-decoration: none; }
.nav .nav-cta { color: var(--tint-ink); background: var(--tint-fill); padding: 4px 13px; border-radius: 999px; font-weight: 500; }
.nav .nav-cta:hover { color: var(--tint-ink); filter: brightness(1.08); }
@media (max-width: 760px) { .nav .wide { display: none; } }
@media (max-width: 520px) { .nav .mid { display: none; } }

/* Buttons */
.actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px 28px; margin-top: 30px; }
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 22px; border-radius: 999px;
  font-size: 17px; font-weight: 500; letter-spacing: -0.01em;
  color: var(--button-2-ink); background: var(--button-2-bg);
  transition: filter 0.2s var(--ease), transform 0.2s var(--ease);
}
.button:hover { text-decoration: none; filter: brightness(1.06); }
.button:active { transform: scale(0.98); }
.button.primary { color: var(--tint-ink); background: var(--tint-fill); }
.link-arrow { font-size: 17px; display: inline-flex; align-items: center; gap: 4px; }
.link-arrow::after { content: ""; width: 7px; height: 7px; border: solid currentColor; border-width: 1.6px 1.6px 0 0; transform: rotate(45deg); margin-left: 2px; transition: transform 0.2s var(--ease); }
.link-arrow:hover::after { transform: translateX(3px) rotate(45deg); }

/* Hero */
.hero { padding: clamp(56px, 9vw, 104px) 0 clamp(56px, 8vw, 96px); text-align: center; overflow: hidden; }
.hero h1 { max-width: 13em; margin: 0 auto; }
.hero .lede { margin: 22px auto 0; max-width: 34em; }

/* Before/after viewer */
.compare { margin: clamp(44px, 6vw, 72px) auto 0; padding: 0 var(--gutter); max-width: calc(1080px + 2 * var(--gutter)); }
.compare-frame {
  --pos: 40%;
  --lean: 6%;
  /* atan(2 x lean x width / height) for the 16:10 frame; compare.js keeps it exact. */
  --tilt: -10.87deg;
  position: relative; aspect-ratio: 16 / 10; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--raise); background: var(--band);
  cursor: ew-resize; touch-action: pan-y; user-select: none; -webkit-user-select: none;
}
.compare-frame picture, .compare-frame img { position: absolute; inset: 0; width: 100%; height: 100%; }
.compare-frame img { object-fit: cover; pointer-events: none; }
.compare-nyx { clip-path: polygon(calc(var(--pos) + var(--lean)) 0, 100% 0, 100% 100%, calc(var(--pos) - var(--lean)) 100%); }
.compare-seam {
  position: absolute; top: -2%; bottom: -2%; left: var(--pos); width: 2px; margin-left: -1px;
  background: #ffffff; box-shadow: 0 0 0 1px rgb(0 0 0 / 0.12), 0 0 18px rgb(0 0 0 / 0.25);
  transform: skewX(var(--tilt));
}
.compare-handle {
  position: absolute; top: 50%; left: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px;
  display: grid; place-items: center; border-radius: 50%;
  background: #ffffff; color: #1d1d1f; box-shadow: var(--raise-sm), 0 0 0 1px rgb(0 0 0 / 0.08);
  transform: skewX(calc(-1 * var(--tilt)));
  transition: transform 0.25s var(--ease);
}
.compare-handle svg { width: 20px; height: 20px; }
.compare-frame.is-dragging .compare-handle { transform: skewX(calc(-1 * var(--tilt))) scale(1.08); }
.compare-frame:has(.compare-range:focus-visible) .compare-handle { outline: 2px solid var(--tint); outline-offset: 3px; }
.compare-tag {
  position: absolute; top: 14px; padding: 4px 11px; border-radius: 999px;
  font-size: 13px; font-weight: 500; letter-spacing: -0.005em;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.18);
}
/* Each label is colored for the half of the picture it sits on, in either appearance. */
.compare-tag-light { left: 14px; color: #ffffff; background: rgb(29 29 31 / 0.78); }
.compare-tag-nyx { right: 14px; color: #1d1d1f; background: rgb(255 255 255 / 0.9); }
.compare-range {
  position: absolute; left: 0; bottom: 0; width: 100%; height: 100%; margin: 0;
  opacity: 0; pointer-events: none;
}
@media (max-width: 640px) {
  /* Phone captures of each site (2:3), so the proof is readable at phone size. */
  .compare-frame { aspect-ratio: 2 / 3; --tilt: -4.57deg; }
  /* Bottom corners on phones: the top of a phone capture is the site's own header. */
  .compare-tag { top: auto; bottom: 10px; font-size: 12px; }
  .compare-tag-light { left: 10px; }
  .compare-tag-nyx { right: 10px; }
}
.compare figcaption { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: 26px; }
.compare-caption { color: var(--ink-2); font-size: 15px; min-height: 1.5em; }

.segmented {
  display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--band);
  box-shadow: inset 0 0 0 1px var(--line);
}
.segmented button {
  font: inherit; font-size: 14px; font-weight: 500; letter-spacing: -0.01em;
  color: var(--ink-2); background: transparent; border: 0; border-radius: 999px;
  min-height: 32px; padding: 0 16px; cursor: pointer;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}
.segmented button:hover { color: var(--ink); }
.segmented button[aria-checked="true"] { color: var(--ink); background: var(--page); box-shadow: 0 1px 3px rgb(0 0 0 / 0.14), 0 0 0 0.5px rgb(0 0 0 / 0.06); }

/* Sections */
.section, .band { padding: clamp(80px, 11vw, 136px) 0; }
/* Two sections on the same ground share one gap, not two. */
.section + .section { padding-top: 0; }
.band { background: var(--band); }
.section h2, .band h2 { max-width: 16em; }
.section > .wrap > .lede, .band > .wrap > .lede { margin-top: 20px; }

/* Lucide icons label a point, a fact or an install card: one size, one stroke, in the tint. */
.icon { display: block; width: 28px; height: 28px; margin-bottom: 14px; color: var(--tint); fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.icon-lead { width: 44px; height: 44px; margin: 0 auto 20px; stroke-width: 1.5; }
.points { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 40px; margin-top: clamp(48px, 6vw, 72px); }
.point { padding-top: 22px; border-top: 1px solid var(--line); }
.point p, .fact p { margin-top: 8px; color: var(--ink-2); }

/* Theme gallery */
.themes { list-style: none; margin: clamp(48px, 6vw, 64px) 0 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; }
.theme-group { min-width: 0; }
.theme-group-name { font-size: 15px; font-weight: 600; color: var(--ink-2); letter-spacing: -0.005em; margin-bottom: 14px; }
.theme-row { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, 1fr); gap: 18px; }
.theme { display: flex; flex-direction: column; gap: 9px; }
.theme-page {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px;
  aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden;
  background: var(--t-bg); color: var(--t-fg);
  box-shadow: var(--raise-sm), inset 0 0 0 1px var(--line);
  padding: 12% 13%;
}
.theme-aa { font-size: clamp(22px, 2.6vw, 30px); font-weight: 600; letter-spacing: -0.03em; line-height: 1; }
.theme-line { font-size: 11px; line-height: 1.3; opacity: 0.8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.theme-name { font-size: 14px; color: var(--ink); letter-spacing: -0.005em; }
@media (max-width: 900px) {
  /* A row per collection that scrolls sideways, edge to edge. */
  .theme-row {
    display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
    margin: 0 calc(-1 * var(--gutter)); padding: 4px var(--gutter) 14px; scroll-padding: 0 var(--gutter);
    scrollbar-width: none;
  }
  .theme-row::-webkit-scrollbar { display: none; }
  .theme { flex: 0 0 clamp(108px, 30vw, 150px); scroll-snap-align: start; }
}

/* Split: text beside the product shot */
.split .wrap { display: grid; grid-template-columns: 1fr minmax(0, 400px); gap: clamp(40px, 7vw, 96px); align-items: center; }
.split-text .lede { margin-top: 20px; }
.split-shot img { width: 100%; max-width: 400px; margin-left: auto; border-radius: 14px; box-shadow: var(--raise); }
.ticks { list-style: none; margin: 32px 0 0; padding: 0; display: grid; gap: 14px; }
.ticks li { position: relative; padding-left: 30px; }
.ticks li::before {
  content: ""; position: absolute; left: 4px; top: 0.42em; width: 12px; height: 7px;
  border: solid var(--tint); border-width: 0 0 2px 2px; transform: rotate(-45deg);
}
@media (max-width: 820px) {
  .split .wrap { grid-template-columns: 1fr; }
  .split-shot img { margin: 0 auto; }
}

.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 32px; margin-top: clamp(48px, 6vw, 72px); }
.fact { padding-top: 22px; border-top: 1px solid var(--line); }
@media (max-width: 900px) { .facts { grid-template-columns: repeat(2, 1fr); gap: 36px 32px; } }
@media (max-width: 700px) { .points { grid-template-columns: 1fr; gap: 28px; } }
@media (max-width: 520px) { .facts { grid-template-columns: 1fr; gap: 28px; } }

/* Privacy */
.privacy .wrap { text-align: center; display: flex; flex-direction: column; align-items: center; }
.privacy h2 { margin: 0 auto; }
.privacy .lede { margin: 20px auto 26px; max-width: 34em; }

/* Install */
.install-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-top: clamp(44px, 6vw, 64px); }
.install-item {
  display: flex; flex-direction: column; align-items: flex-start;
  padding: clamp(24px, 3.4vw, 36px); border-radius: var(--radius); background: var(--page);
}
.install-item ol { margin: 16px 0 28px; padding-left: 1.2em; color: var(--ink-2); display: grid; gap: 8px; }
.install-item ol li::marker { color: var(--ink-2); }
.install-item .button { margin-top: auto; }
@media (max-width: 760px) { .install-grid { grid-template-columns: 1fr; } }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0 40px; font-size: 13px; color: var(--ink-2); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.site-footer a { color: var(--ink-2); }
.site-footer a:hover { color: var(--ink); }

/* Documents: privacy policy, support and 404 */
.doc { max-width: calc(680px + 2 * var(--gutter)); margin: 0 auto; padding: clamp(56px, 8vw, 96px) var(--gutter) clamp(72px, 9vw, 112px); }
.doc h1 { font-size: clamp(36px, 5.4vw, 52px); letter-spacing: -0.032em; }
.doc .meta { margin-top: 10px; color: var(--ink-2); font-size: 15px; }
.doc .summary { margin-top: 28px; padding: 20px 22px; border-radius: 14px; background: var(--band); font-size: 19px; line-height: 1.45; }
.doc h2 { font-size: 24px; letter-spacing: -0.02em; margin: 44px 0 10px; }
.doc h3 { margin: 28px 0 8px; }
.doc p, .doc li { line-height: 1.6; }
.doc p + p { margin-top: 12px; }
.doc ol, .doc ul { padding-left: 1.3em; display: grid; gap: 6px; margin: 12px 0 0; }
.doc ol + p, .doc ul + p { margin-top: 16px; }
.doc .path { font-weight: 500; white-space: nowrap; }
.doc details { border-top: 1px solid var(--line); padding: 16px 0; }
.doc details:last-of-type { border-bottom: 1px solid var(--line); }
.doc summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.doc summary::-webkit-details-marker { display: none; }
.doc summary::after { content: ""; flex: none; width: 8px; height: 8px; margin-right: 4px; border: solid var(--ink-2); border-width: 0 1.6px 1.6px 0; transform: rotate(45deg) translateY(-2px); transition: transform 0.2s var(--ease); }
.doc details[open] summary::after { transform: rotate(225deg) translateY(-2px); }
.doc details > :not(summary) { margin-top: 10px; }
