/* Snapline website. Colours and type follow BRAND.md. Fonts are served from this site (no third-party requests). */

@font-face { font-family: "Outfit"; src: url("/assets/fonts/Outfit-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Outfit"; src: url("/assets/fonts/Outfit-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/assets/fonts/GeistMono-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }

/* The selection in the hero grows from its corner on load; these must be registered to animate. */
@property --w { syntax: "<percentage>"; inherits: true; initial-value: 0%; }
@property --h { syntax: "<percentage>"; inherits: true; initial-value: 0%; }

/* Light and dark follow the system unless the theme switch sets data-theme="light" or "dark" on <html> (see theme.js).
   Each colour is light-dark(light value, dark value); color-scheme picks which one applies. */
:root {
  color-scheme: light dark;
  --paper: light-dark(#f6f5fb, #0c0819);
  --ink: light-dark(#0c0819, #f3f1fa);
  --muted: light-dark(#565170, #a9a3c2);
  --rule: light-dark(#dcd8ea, #2a2340);
  --surface: light-dark(#fff, #17112b);
  --kbd-border: light-dark(#cfcae0, #3a3352);
  --link: light-dark(#4c1ab8, #a78bfa);
  --code-bg: light-dark(#0c0819, #17112b);
  --violet: #7c3aed;
  --violet-deep: #4c1ab8;
  --cyan: #22d3ee;
  --sans: "Outfit", system-ui, -apple-system, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", monospace;
  --page: 72rem;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.125rem/1.6 var(--sans);
  text-rendering: optimizeLegibility;
}

a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 2px solid var(--violet); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { font-weight: 700; line-height: 1.1; margin: 0; letter-spacing: -0.02em; text-wrap: balance; }
p { margin: 0 0 1em; text-wrap: pretty; }

kbd, code { font-family: var(--mono); font-size: 0.85em; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--ink); color: var(--paper); padding: 0.5rem 0.75rem; z-index: 10; }

.wrap { width: min(100% - 2.5rem, var(--page)); margin-inline: auto; }

/* Header */

.site-header { padding-block: 1.5rem; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.35rem; letter-spacing: -0.03em; }
.brand img { width: 2.25rem; height: 2.25rem; }

.site-nav { display: flex; gap: 1.5rem; font-size: 1rem; }
.site-nav a { color: var(--ink); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--link); text-decoration: underline; }

.header-end { display: flex; align-items: center; gap: 1.5rem; }

/* Theme switch: System / Light / Dark. */
.theme { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--rule); border-radius: 999px; }
.theme button {
  display: grid; place-items: center; width: 1.9rem; height: 1.9rem; padding: 0;
  border: 0; border-radius: 999px; background: none; color: var(--muted); cursor: pointer;
}
.theme button:hover { color: var(--ink); }
.theme button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(12, 8, 25, 0.18); }
.theme svg { width: 1rem; height: 1rem; }

@media (max-width: 30rem) {
  .site-header .wrap { flex-wrap: wrap; row-gap: 0.75rem; }
  .header-end { gap: 1rem; flex-wrap: wrap; row-gap: 0.75rem; }
  .site-nav { gap: 1rem; }
}

/* Hero */

.hero { padding-block: clamp(2rem, 6vw, 5rem) clamp(3rem, 8vw, 6rem); }
.hero .wrap { display: grid; gap: clamp(2.5rem, 5vw, 4rem); align-items: center; }

@media (min-width: 60rem) {
  .hero .wrap { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
}

.hero h1 { font-size: clamp(2.75rem, 6.2vw, 4.75rem); letter-spacing: -0.045em; line-height: 0.98; margin-bottom: 1.5rem; }
.hero h1 span { display: block; }

.lede { font-size: 1.25rem; color: var(--muted); max-width: 32ch; }

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }

.button {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.8rem 1.3rem; border-radius: 0.6rem;
  font-weight: 700; font-size: 1rem; text-decoration: none;
  border: 1.5px solid var(--ink); color: var(--ink);
}
.button:hover { background: var(--surface); text-decoration: none; }
.button.primary { background: var(--violet); border-color: var(--violet); color: #fff; }
.button.primary:hover { background: var(--violet-deep); border-color: var(--violet-deep); }

.fineprint { font-size: 0.95rem; color: var(--muted); margin-top: 1rem; }

/* The hero "screen": a frozen desktop with a live selection, like Snapline's overlay. */

.demo { margin: 0; }

.screen {
  --x: 12%; --y: 16%; --w: 70%; --h: 62%;
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 0.9rem;
  background:
    radial-gradient(120% 90% at 0% 0%, #5b2bd0 0%, transparent 60%),
    radial-gradient(100% 100% at 100% 100%, #1fb8d6 0%, transparent 55%),
    #2a1e66;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 30px 60px -30px rgba(44, 20, 120, 0.55);
  container-type: inline-size;
  cursor: crosshair;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.window {
  position: absolute; left: 16%; top: 21%; width: 62%;
  background: #fff; border-radius: 1.4cqw; overflow: hidden;
  box-shadow: 0 2cqw 5cqw rgba(12, 8, 25, 0.35);
  font-size: clamp(9px, 2.05cqw, 15px); line-height: 1.55; color: #0c0819;   /* a light-mode app window in both themes */
}
.window-bar { display: flex; gap: 0.45em; align-items: center; padding: 0.7em 0.9em; background: #f1eff7; border-bottom: 1px solid #e4e1ee; }
.window-bar i { width: 0.75em; height: 0.75em; border-radius: 50%; background: #cfcbdc; }
.window-bar b { margin-left: 0.6em; font-weight: 400; color: #565170; }
.window-body { padding: 0.9em 1.1em 1.1em; }
.window-body p { margin: 0 0 0.35em; }

.redact {
  font: inherit; color: inherit; padding: 0 0.15em; margin: 0; border: 0; border-radius: 2px;
  background: #000; color: transparent; cursor: pointer;
}
.redact[aria-pressed="true"] { background: transparent; color: #0c0819; outline: 1.5px dashed #eab308; outline-offset: 1px; }
.redact.mono { font-family: var(--mono); font-size: 0.92em; }

.selection {
  position: absolute;
  left: var(--x); top: var(--y); width: var(--w); height: var(--h);
  border: 1px solid var(--cyan);
  box-shadow: 0 0 0 200vmax rgba(12, 8, 25, 0.55);
  pointer-events: none;
  animation: draw 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) 0.25s backwards;
}
.screen.touched .selection { animation: none; }

@keyframes draw { from { --w: 0%; --h: 0%; } }

.handle { position: absolute; width: 9px; height: 9px; margin: -5px 0 0 -5px; border-radius: 50%; background: #fff; border: 2px solid var(--violet); }
.handle:nth-child(1) { left: 0; top: 0; }
.handle:nth-child(2) { left: 50%; top: 0; }
.handle:nth-child(3) { left: 100%; top: 0; }
.handle:nth-child(4) { left: 100%; top: 50%; }
.handle:nth-child(5) { left: 100%; top: 100%; }
.handle:nth-child(6) { left: 50%; top: 100%; }
.handle:nth-child(7) { left: 0; top: 100%; }
.handle:nth-child(8) { left: 0; top: 50%; }

.size {
  position: absolute; left: -1px; bottom: calc(100% + 6px);
  padding: 2px 6px; border-radius: 4px;
  background: var(--violet); color: #fff;
  font: 400 clamp(9px, 1.6cqw, 12px)/1.4 var(--mono); white-space: nowrap;
}
.screen.badge-inside .size { bottom: auto; top: 6px; left: 6px; }

.tools {
  position: absolute; top: var(--y); left: calc(var(--x) + var(--w) + 8px);
  display: grid; gap: 2px; padding: 4px; border-radius: 8px;
  background: rgba(250, 249, 255, 0.96); box-shadow: 0 4px 14px rgba(12, 8, 25, 0.3);
  pointer-events: none;
  animation: appear 0.3s ease-out 0.95s backwards;
}
.tools svg { display: block; width: clamp(14px, 2.6cqw, 20px); height: clamp(14px, 2.6cqw, 20px); padding: 3px; box-sizing: content-box; color: #0c0819; }
.tools svg.on { background: var(--violet); color: #fff; border-radius: 5px; }
.screen.tools-inside .tools { left: auto; right: calc(100% - var(--x) - var(--w) + 8px); }
.screen.dragging .tools, .screen.dragging .handle { visibility: hidden; }
.screen.touched .tools { animation: none; }

@keyframes appear { from { opacity: 0; } }

.demo figcaption { margin-top: 0.9rem; font-size: 0.95rem; color: var(--muted); }

/* Sections */

.section { padding-block: clamp(3.5rem, 8vw, 6rem); border-top: 1px solid var(--rule); }
.section h2 { font-size: clamp(2rem, 4vw, 2.75rem); letter-spacing: -0.035em; margin-bottom: 1rem; max-width: 20ch; }
.section .intro { color: var(--muted); max-width: 52ch; }
/* The Get section has one block per system (Mac, Windows, Linux). */
.section .wrap + .wrap { margin-top: clamp(3.5rem, 8vw, 6rem); }

@media (min-width: 60rem) {
  .split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 4rem; align-items: start; }
}

/* Keyboard shortcuts double as the feature list. */

.keys { margin: 2rem 0 0; display: grid; }
.keys > div { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 1.25rem; padding-block: 1rem; border-bottom: 1px solid var(--rule); }
.keys > div:first-child { border-top: 1px solid var(--rule); }
.keys dt { white-space: nowrap; }
.keys dd { margin: 0; }
.keys dd strong { font-weight: 700; }
.keys dd span { color: var(--muted); }

kbd {
  display: inline-block; min-width: 1.9em; padding: 0.2em 0.45em; margin-right: 0.15em;
  border: 1px solid var(--kbd-border); border-bottom-width: 2px; border-radius: 0.4em;
  background: var(--surface); text-align: center; line-height: 1.3; color: var(--ink);
}

@media (max-width: 30rem) {
  .keys > div { grid-template-columns: 1fr; gap: 0.35rem; }
}

/* Lists */

.plain { list-style: none; padding: 0; margin: 1.5rem 0 0; }
.plain li { padding-left: 1.4rem; position: relative; margin-bottom: 0.75rem; max-width: 60ch; }
.plain li::before { content: ""; position: absolute; left: 0; top: 0.6em; width: 0.55rem; height: 0.55rem; border-left: 2px solid var(--cyan); border-top: 2px solid var(--cyan); }

.note { margin-top: 1.5rem; color: var(--muted); max-width: 60ch; }

/* Build steps */

.steps { counter-reset: step; list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: 1.75rem; }
.steps > li { counter-increment: step; display: grid; grid-template-columns: 2.25rem minmax(0, 1fr); gap: 1rem; }
.steps > li::before {
  content: counter(step); width: 2.25rem; height: 2.25rem; border-radius: 50%;
  display: grid; place-items: center; background: var(--ink); color: var(--paper); font-weight: 700;
}
.steps p { margin: 0.35rem 0 0.75rem; }

.code { position: relative; }
.code pre {
  margin: 0; padding: 1rem 5.5rem 1rem 1.1rem; white-space: pre-wrap; overflow-wrap: anywhere;
  background: var(--code-bg); color: #ece9f7; border-radius: 0.6rem;
  border: 1px solid light-dark(transparent, #2a2340);
  font: 400 0.9rem/1.6 var(--mono);
}
.copy {
  position: absolute; top: 0.6rem; right: 0.6rem;
  padding: 0.35rem 0.7rem; border-radius: 0.4rem; border: 1px solid #3a3352;
  background: #1c1530; color: #fff; font: 700 0.85rem var(--sans); cursor: pointer;
}
.copy:hover { background: #2b2246; }

/* Footer */

.site-footer { border-top: 1px solid var(--rule); padding-block: 2.5rem 3rem; font-size: 0.95rem; color: var(--muted); }
.site-footer .wrap { display: grid; gap: 1.25rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.site-footer p { margin: 0; max-width: 70ch; }

/* Policy pages */

.doc { padding-block: clamp(2rem, 5vw, 4rem) clamp(3rem, 7vw, 5rem); }
.doc .wrap { max-width: 44rem; }
.doc h1 { font-size: clamp(2.5rem, 5vw, 3.5rem); letter-spacing: -0.04em; margin-bottom: 0.75rem; }
.doc .updated { color: var(--muted); margin-bottom: 2.5rem; }
/* Changelog: the release date under each version. */
.doc .date { color: var(--muted); margin: -0.5rem 0 0.75rem; }
.doc h2 { font-size: 1.5rem; letter-spacing: -0.02em; margin: 2.5rem 0 0.75rem; }
.doc ul { padding-left: 1.25rem; margin: 0 0 1em; }
.doc li { margin-bottom: 0.4rem; }
.doc .summary { margin-bottom: 1.75rem; background: var(--surface); border-left: 3px solid var(--cyan); padding: 1rem 1.25rem; border-radius: 0 0.5rem 0.5rem 0; }
.doc .summary p:last-child { margin-bottom: 0; }

@media (prefers-reduced-motion: reduce) {
  .selection, .tools { animation: none; }
}
