:root {
  --paper: #f5f2e9;
  --paper-dim: rgba(245, 242, 233, 0.72);
  --paper-faint: rgba(245, 242, 233, 0.55);
  --accent: #bcdcee;
  --ink: #07131f;
  --line: rgba(245, 242, 233, 0.16);
  --sans: "Stack Sans Text", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  background: var(--ink);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: clamp(1.5rem, 3vh, 2.5rem);
  padding: clamp(1.25rem, 3.2vw, 2.75rem) clamp(1.25rem, 5vw, 5rem);
  font-family: var(--sans);
  color: var(--paper);
  background: var(--ink);
  overflow-x: hidden;
  isolation: isolate;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 20;
  padding: 0.75rem 1.1rem;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 0.2s var(--ease);
}

.skip-link:focus-visible {
  transform: translateY(0);
}

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: var(--ink);
}

.backdrop__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.backdrop__veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 85% 75% at 50% 45%, rgba(4, 13, 24, 0.62) 0%, rgba(4, 13, 24, 0.36) 58%, rgba(4, 13, 24, 0.62) 100%),
    linear-gradient(180deg, rgba(4, 13, 24, 0.55) 0%, rgba(4, 13, 24, 0.12) 30%, rgba(4, 13, 24, 0.18) 60%, rgba(4, 13, 24, 0.82) 100%);
}

.backdrop__grain {
  position: absolute;
  inset: 0;
  opacity: 0.14;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200' viewBox='0 0 200 200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

.site-header,
.hero,
.footer {
  position: relative;
  z-index: 1;
}

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

.logo {
  display: block;
  width: auto;
  height: clamp(2.75rem, 4.5vw, 3.5rem);
}

.analytics-toggle {
  position: fixed;
  z-index: 3;
  inset-block-start: max(1.5rem, env(safe-area-inset-top));
  inset-inline-end: max(1.5rem, env(safe-area-inset-right));
  padding: 0.55rem 0.8rem;
  border: 1px solid color-mix(in srgb, var(--paper) 16%, transparent);
  border-radius: 0.55rem;
  background: color-mix(in srgb, var(--ink) 55%, transparent);
  color: color-mix(in srgb, var(--paper) 58%, transparent);
  font: inherit;
  font-size: 0.78rem;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background-color 220ms cubic-bezier(0.2, 0.7, 0.2, 1), color 220ms cubic-bezier(0.2, 0.7, 0.2, 1), border-color 220ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.analytics-toggle:hover,
.analytics-toggle:focus-visible {
  border-color: color-mix(in srgb, var(--paper) 30%, transparent);
  background: color-mix(in srgb, var(--paper) 8%, transparent);
  color: var(--paper);
}

.analytics-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.analytics-toggle[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  color: color-mix(in srgb, var(--accent) 82%, var(--paper));
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding-block: clamp(1rem, 4vh, 3rem);
  text-align: left;
}

.hero__copy {
  max-width: 44ch;
  margin: 0;
  font-size: clamp(0.9rem, 0.25vw + 0.86rem, 1rem);
  line-height: 1.7;
  color: #fff;
  font-size-adjust: from-font;
  text-wrap: pretty;
  animation: rise 0.9s 0.1s var(--ease) both;
}

.hero__try {
  margin: 1rem 0 0;
  font-size: 0.88rem;
  color: var(--paper-dim);
  animation: rise 0.9s 0.18s var(--ease) both;
}

.hero__note {
  margin: 0.4rem 0 0;
  font-size: 0.8rem;
  color: var(--paper-faint);
  animation: rise 0.9s 0.24s var(--ease) both;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--line);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--paper-faint);
  animation: rise 0.9s 0.22s var(--ease) both;
}

.hero__try a,
.footer a {
  position: relative;
  color: inherit;
  text-decoration: none;
  transition: color 0.3s ease;
}

.hero__try a::after,
.footer a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 1px;
  background: currentColor;
  transition: width 0.3s ease;
}

.hero__try a:hover::after,
.footer a:hover::after {
  width: 100%;
}

.hero__try a:hover,
.footer a:hover {
  color: var(--paper);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(1.1rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 720px) {
  body {
    gap: 1.25rem;
  }

  .footer {
    flex-wrap: wrap;
    row-gap: 0.75rem;
  }
}

@media (max-width: 420px) {
  .hero__copy {
    max-width: 34ch;
  }
}

@media (prefers-reduced-motion: reduce) {
  .analytics-toggle,
  .hero__copy,
  .hero__try,
  .hero__note,
  .footer {
    animation: none;
  }
}
