/* ------------------------------------------------------------------
   The Amari Fitness Blueprint — design system
   Dark, quiet, glass. One accent. Serif for voice, sans for body,
   mono for labels.
------------------------------------------------------------------- */

:root {
  --bg: #0b0b0a;
  --bg-2: #121211;
  --ink: #ece9e2;
  --ink-2: #b9b6ae;
  --muted: #7f7d76;
  --line: rgba(236, 233, 226, 0.09);
  --line-strong: rgba(236, 233, 226, 0.18);
  --glass: rgba(255, 255, 255, 0.035);
  --glass-hover: rgba(255, 255, 255, 0.06);
  --accent: #b9cf9a;          /* sage */
  --accent-ink: #0b0b0a;
  --accent-soft: rgba(185, 207, 154, 0.14);
  --warm: #e0b58a;            /* used sparingly for glows */
  --radius: 22px;
  --radius-sm: 12px;
  --font-serif: "Instrument Serif", "Iowan Old Style", "Times New Roman", serif;
  --font-sans: "Geist", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --max: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: var(--accent-ink); }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.05;
}

p { margin: 0 0 1em; }

.serif { font-family: var(--font-serif); font-weight: 400; }
.italic { font-style: italic; }
.mono {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.accent { color: var(--accent); }
.muted { color: var(--muted); }

.wrap {
  width: min(var(--max), calc(100% - 40px));
  margin-inline: auto;
}

@media (max-width: 640px) {
  .wrap { width: calc(100% - 32px); }
}

/* ---------- atmosphere ---------- */

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.atmosphere .glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  will-change: transform;
}

.atmosphere .glow.a {
  width: 60vw; height: 60vw; max-width: 760px; max-height: 760px;
  left: -14vw; top: -18vw;
  background: radial-gradient(closest-side, rgba(185, 207, 154, 0.32), transparent 70%);
  animation: drift-a 26s ease-in-out infinite alternate;
}

.atmosphere .glow.b {
  width: 50vw; height: 50vw; max-width: 640px; max-height: 640px;
  right: -16vw; top: 18vh;
  background: radial-gradient(closest-side, rgba(224, 181, 138, 0.18), transparent 70%);
  animation: drift-b 32s ease-in-out infinite alternate;
}

.atmosphere .glow.c {
  width: 46vw; height: 46vw; max-width: 600px; max-height: 600px;
  left: 30vw; bottom: -24vw;
  background: radial-gradient(closest-side, rgba(185, 207, 154, 0.16), transparent 70%);
  animation: drift-c 38s ease-in-out infinite alternate;
}

.atmosphere .grain {
  position: absolute;
  inset: -50%;
  width: 200%;
  height: 200%;
  opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.6 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(4) infinite;
}

@keyframes drift-a { to { transform: translate(10vw, 8vh) scale(1.08); } }
@keyframes drift-b { to { transform: translate(-8vw, 10vh) scale(0.94); } }
@keyframes drift-c { to { transform: translate(-6vw, -8vh) scale(1.1); } }
@keyframes grain {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-2%, 3%); }
  50% { transform: translate(3%, -1%); }
  75% { transform: translate(-1%, -3%); }
  100% { transform: translate(2%, 2%); }
}

main, header, footer { position: relative; z-index: 1; }

/* ---------- glass ---------- */

.glass {
  position: relative;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 20px 60px -30px rgba(0, 0, 0, 0.7);
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease), transform 0.6s var(--ease);
}

.glass.spot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.07), transparent 45%);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}

.glass.spot:hover::after { opacity: 1; }
.glass.spot:hover { background: var(--glass-hover); border-color: var(--line-strong); }

/* ---------- buttons ---------- */

.btn {
  --pad-y: 14px;
  --pad-x: 24px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: var(--pad-y) var(--pad-x);
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.005em;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.5s var(--ease), background 0.4s var(--ease), border-color 0.4s var(--ease), color 0.4s var(--ease);
  white-space: nowrap;
}

.btn:hover { border-color: var(--ink-2); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn.primary {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.btn.primary::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: translateY(101%);
  transition: transform 0.5s var(--ease);
}
.btn.primary:hover::before { transform: translateY(0); }
.btn.primary > * { position: relative; }
.btn.primary:hover { color: var(--accent-ink); }

.btn .arrow {
  display: inline-block;
  transition: transform 0.4s var(--ease);
}
.btn:hover .arrow { transform: translateX(4px); }

.btn.small { --pad-y: 10px; --pad-x: 18px; font-size: 14px; }
.btn.block { width: 100%; justify-content: center; }

/* ---------- nav ---------- */

.nav {
  position: fixed;
  top: 18px;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  justify-content: center;
  padding: 0 20px;
  pointer-events: none;
}

.nav .bar {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 10px 10px 10px 20px;
  border-radius: 999px;
  width: min(900px, 100%);
  transform: translateY(-20px);
  opacity: 0;
  animation: nav-in 0.9s var(--ease) 0.2s forwards;
}

@keyframes nav-in { to { transform: translateY(0); opacity: 1; } }

.nav .brand {
  font-family: var(--font-serif);
  font-size: 20px;
  letter-spacing: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.nav .brand em { color: var(--muted); font-style: italic; }

.nav .links {
  display: flex;
  gap: 22px;
  margin-left: auto;
  font-size: 14px;
  color: var(--ink-2);
}
.nav .links a { position: relative; padding: 4px 0; transition: color 0.3s; }
.nav .links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease);
}
.nav .links a:hover { color: var(--ink); }
.nav .links a:hover::after { transform: scaleX(1); }

@media (max-width: 760px) {
  .nav .links { display: none; }
  .nav .bar { gap: 12px; }
  .nav .btn { margin-left: auto; }
}

/* ---------- sections ---------- */

section { padding: 120px 0; }
@media (max-width: 760px) { section { padding: 84px 0; } }

.section-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: end;
  margin-bottom: 56px;
}
.section-head h2 {
  font-family: var(--font-serif);
  font-size: clamp(38px, 5.2vw, 64px);
  letter-spacing: -0.02em;
}
.section-head p { color: var(--ink-2); max-width: 46ch; margin: 0; font-size: 17px; }
.section-head .mono { display: block; margin-bottom: 18px; }

@media (max-width: 860px) {
  .section-head { grid-template-columns: 1fr; gap: 20px; }
}

.rule {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
  border: 0;
  margin: 0;
}

/* ---------- reveal animations ---------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.9s var(--ease), transform 1s var(--ease);
  transition-delay: var(--d, 0ms);
}
[data-reveal].in { opacity: 1; transform: none; }

.word-up {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
}
.word-up > span {
  display: inline-block;
  transform: translateY(110%);
  animation: word-up 1.1s var(--ease) forwards;
  animation-delay: var(--d, 0ms);
}
@keyframes word-up { to { transform: translateY(0); } }

/* ---------- forms ---------- */

.field {
  width: 100%;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink);
  font: inherit;
  outline: none;
  transition: border-color 0.3s, background 0.3s;
}
.field:focus { border-color: var(--accent); background: rgba(255, 255, 255, 0.05); }
.field::placeholder { color: var(--muted); }

/* ---------- footer ---------- */

footer {
  padding: 60px 0 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}
footer .row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 40px;
  justify-content: space-between;
  align-items: center;
}
footer a { color: var(--ink-2); transition: color 0.3s; }
footer a:hover { color: var(--ink); }
footer .disclaimer { max-width: 70ch; margin-top: 24px; font-size: 13px; line-height: 1.6; }

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
  .word-up > span { transform: none; }
  .nav .bar { opacity: 1; transform: none; }
}
