/* Base layer: document, typography, ambient background, shared animations.
   Fonts are preloaded from each page's <head>, not @import'ed, so they do
   not block the first paint. */

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.6 var(--font-ui);
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Ambient mesh. A fixed pseudo-element keeps the gradient anchored to the
   viewport instead of stretching with tall vault pages. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(
      52rem 38rem at 88% -8%,
      color-mix(in oklab, var(--primary) 30%, transparent),
      transparent 62%
    ),
    radial-gradient(
      44rem 32rem at 4% 4%,
      color-mix(in oklab, var(--primary-2) 22%, transparent),
      transparent 60%
    ),
    radial-gradient(
      40rem 40rem at 50% 110%,
      color-mix(in oklab, var(--accent) 14%, transparent),
      transparent 60%
    );
  opacity: 0.85;
  animation: drift 26s var(--ease) infinite alternate;
}

/* Fine grain over the mesh so large flat areas do not band. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.4;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.32'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

:root[data-theme="light"] body::after {
  opacity: 0.22;
  mix-blend-mode: multiply;
}

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(-2.5%, 2%, 0) scale(1.08);
  }
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

::selection {
  background: var(--primary-ring);
  color: var(--text);
}

::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border: 3px solid transparent;
  background-clip: content-box;
  border-radius: var(--r-pill);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
  background-clip: content-box;
}

.container {
  max-width: 1180px;
  margin: auto;
  padding: 0 24px;
}

/* --- Brand ------------------------------------------------------------- */

.brand {
  font: 700 20px var(--font-display);
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  transition: opacity var(--t-fast) var(--ease);
}

.brand:hover {
  opacity: 0.82;
}

.brand-mark {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 11px;
  background: linear-gradient(140deg, var(--primary), var(--primary-2));
  display: grid;
  place-items: center;
  box-shadow: var(--glow);
  position: relative;
  overflow: hidden;
}

.brand-mark::after {
  content: "";
  width: 15px;
  height: 11px;
  border-radius: 3px;
  background: #fff;
  position: relative;
  top: 3px;
}

/* Shackle of the padlock mark. */
.brand-mark::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 50%;
  transform: translateX(-50%);
  width: 11px;
  height: 8px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
}

/* --- Small type -------------------------------------------------------- */

.eyebrow {
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--primary-2);
  margin: 0;
}

.muted {
  color: var(--muted);
}

.mono {
  font-family: var(--font-mono);
  font-variant-ligatures: none;
  letter-spacing: 0.01em;
}

.skip {
  position: absolute;
  left: -10000px;
}

.skip:focus {
  left: 12px;
  top: 12px;
  z-index: 200;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 10px 14px;
}

/* --- Landing ----------------------------------------------------------- */

.landing-header {
  padding-top: 26px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.landing-main {
  min-height: 80vh;
  display: grid;
  /* minmax(0, …) lets the section shrink below its children's max-content
     width, which is what forced a horizontal scrollbar on phones. */
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  text-align: center;
  padding: 40px 0 80px;
}

.hero-title {
  font-size: clamp(40px, 7.5vw, 76px);
  font-weight: 700;
  max-width: 15ch;
  margin: 18px auto 0;
}

.hero-title em {
  font-style: normal;
  background: linear-gradient(100deg, var(--primary-2), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-copy {
  font-size: 17.5px;
  max-width: 54ch;
  margin: 20px auto 32px;
}

.hero-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-features {
  margin: 64px auto 0;
  padding: 8px;
  max-width: 780px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
  gap: 4px;
  text-align: left;
}

.hero-feature {
  padding: 18px;
  border-radius: var(--r-md);
  display: grid;
  gap: 5px;
  transition: background var(--t) var(--ease);
}

.hero-feature:hover {
  background: var(--primary-soft);
}

.hero-feature b {
  font: 600 15px var(--font-display);
}

.hero-feature span {
  font-size: 13px;
  color: var(--muted);
}

.hero-feature i {
  font-style: normal;
  font-size: 20px;
  line-height: 1;
}

/* --- Entrance animation ------------------------------------------------ */

/* Applied to whole regions on load, and to grid children with a stagger via
   the --i custom property set in markup or script. */
.reveal {
  animation: rise var(--t-slow) var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 65ms);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

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