/*
 * Snapd public site styles.
 * Tokens mirrored verbatim from Tiberhost/Snapd main: /tokens/*.tokens.json
 * and overlay/tokens.css. PROVISIONAL until Dan's brand lock.
 * Do not add hex outside :root. Edit /tokens first, then mirror here.
 */
:root {
  --bg: #0c0e12;
  --surface: #161a22;
  --surface-raised: #1e2430;
  --border: #2a3140;
  --text: #f2f4f7;
  --text-muted: #8b93a7;
  --accent: #ffb020;
  --accent-ink: #1a1200;

  --font-ui: "Inter", system-ui, -apple-system, sans-serif;
  --font-money: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;

  --radius-control: 8px;
  --radius-card: 12px;
  --radius-sheet: 16px;
  --radius-chip: 999px;

  --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.35);

  --type-meta: 11px;
  --type-body: 13px;
  --type-emphasis: 15px;
  --type-section: 17px;
  --type-hero: 24px;

  color-scheme: dark;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--type-emphasis);
  line-height: 1.6;
}

.wrap {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 var(--space-5);
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: calc(-1 * var(--space-6) * 2);
  padding: var(--space-2) var(--space-4);
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: var(--radius-control);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: var(--space-4);
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 2px;
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--space-1);
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  min-height: calc(var(--space-6) * 2);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text);
  font-size: var(--type-section);
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
}

/* Main */
main {
  flex: 1;
  padding: calc(var(--space-6) * 2) 0 calc(var(--space-6) * 2);
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

h1 {
  font-size: var(--type-hero);
}

h2 {
  font-size: var(--type-section);
  margin-top: calc(var(--space-6) + var(--space-4));
  margin-bottom: var(--space-3);
}

h3 {
  font-size: var(--type-emphasis);
  margin-bottom: var(--space-1);
}

p,
ul {
  margin: 0 0 var(--space-4);
}

/* Long-form (privacy) */
.doc h1 {
  margin-bottom: var(--space-2);
}

.doc .meta {
  color: var(--text-muted);
  font-size: var(--type-body);
}

.doc ul {
  padding-left: var(--space-5);
}

.doc li {
  margin-bottom: var(--space-2);
}

.doc h2 {
  margin-top: var(--space-6);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: var(--type-body);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  padding-top: var(--space-5);
  padding-bottom: var(--space-5);
}

.site-footer p {
  margin: 0;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

/* ---------- Header mark ---------- */
.wordmark img {
  display: block;
  width: var(--space-5);
  height: var(--space-5);
}

/* ---------- Home: full-bleed crossfading hero ---------- */
.home {
  position: relative;
  background: var(--bg);
}

.home main {
  padding: 0;
}

.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
}

.hero-bg {
  position: absolute;
  inset: -8%;
  z-index: -2;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--space-2);
  align-content: start;
  opacity: 0.2;
}

.hero-bg img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-card);
}

/* Very slow drift of the whole wall. No motion under reduced-motion. */
@keyframes hero-drift {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-3%, -4%, 0); }
}

@media (prefers-reduced-motion: no-preference) {
  .hero-bg {
    animation: hero-drift 60s ease-in-out infinite alternate;
  }
}

/* Vignette from the bg token: nearly solid behind the lockup, tiles show at the edges. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(
    ellipse 55% 50% at 50% 50%,
    var(--bg) 0%,
    color-mix(in srgb, var(--bg) 94%, transparent) 35%,
    color-mix(in srgb, var(--bg) 40%, transparent) 75%,
    transparent 100%
  );
}

@media (max-width: 759px) {
  .hero-bg {
    grid-template-columns: repeat(3, 1fr);
  }

  .hero-bg img:nth-child(n + 25) {
    display: none;
  }

  .hero::before {
    background: radial-gradient(
      ellipse 85% 40% at 50% 50%,
      var(--bg) 0%,
      color-mix(in srgb, var(--bg) 94%, transparent) 35%,
      color-mix(in srgb, var(--bg) 40%, transparent) 75%,
      transparent 100%
    );
  }
}

.lockup {
  margin: 0;
  padding: var(--space-6);
  line-height: 0;
}

.lockup img {
  display: block;
  width: min(384px, 72vw);
  height: auto;
}

/* Footer sits over the bottom of the image on a bg-token gradient. */
.home .site-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  border-top: 0;
  padding-top: var(--space-6);
  background: linear-gradient(
    to bottom,
    transparent,
    color-mix(in srgb, var(--bg) 92%, transparent)
  );
}

.home .site-footer .wrap {
  justify-content: center;
}
