/* Paaz: foundation
   Tokens, font, base elements and the shared components every page uses:
   buttons, cards, device frames and screen glows. Loaded first on every page. */

/* Geist (SIL OFL, see assets/fonts/LICENSE-Geist-OFL.txt).
   Self-hosted so the site makes no third-party requests. */
@font-face {
  font-family: "Geist";
  src: url("../fonts/geist-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: dark;

  /* Ground and surfaces */
  --color-ground: #050506;
  --color-surface: #0e0f11;
  --color-surface-raised: #15171a;
  --color-line: rgba(255, 255, 255, 0.08);
  --color-line-strong: rgba(255, 255, 255, 0.14);

  /* Text */
  --color-text-primary: #f5f6f5;
  --color-text-secondary: rgba(245, 246, 245, 0.64);
  --color-text-tertiary: rgba(245, 246, 245, 0.56);

  /* The one accent: the app's sage button colour */
  --color-accent: #c9dfcf;
  --color-accent-strong: #e1efe5;
  --color-on-accent: #07090a;

  --color-error: #f2a39b;

  /* Screen glows, taken from the app's own screens */
  --glow-plan: #2448d8;
  --glow-setup: #c46a1e;
  --glow-hold: #a51f1f;
  --glow-review: #1b8a3a;
  --glow-night: #2a3c8c;

  /* Type */
  --font-sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --text-xs: 0.8125rem;
  --text-sm: 0.9375rem;
  --text-base: 1.0625rem;
  --text-lg: 1.25rem;
  --text-xl: clamp(1.375rem, 1.2rem + 0.6vw, 1.625rem);
  --text-2xl: clamp(2.25rem, 1.6rem + 2.4vw, 3.5rem);
  --text-3xl: clamp(2.75rem, 1.8rem + 3.6vw, 4.75rem);

  --tracking-tight: -0.035em;
  --tracking-snug: -0.02em;

  /* Space */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;
  --space-10: 9rem;

  --gutter: clamp(16px, 4vw, 40px);
  --wrap: 1160px;
  --header-h: 72px;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + var(--space-5));
  scrollbar-color: #26282c var(--color-ground);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--color-ground);
  color: var(--color-text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: var(--tracking-tight);
  text-wrap: balance;
}

h3 {
  letter-spacing: var(--tracking-snug);
}

p {
  margin: 0;
  text-wrap: pretty;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--color-text-primary);
  text-decoration-color: var(--color-line-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  transition: text-decoration-color 160ms var(--ease-out), color 160ms var(--ease-out);
}

a:not(.button):hover {
  text-decoration-color: currentColor;
}

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

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

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  z-index: 200;
  padding: var(--space-2) var(--space-4);
  background: var(--color-accent);
  color: var(--color-on-accent);
  font-weight: 600;
  border-radius: var(--radius-pill);
}

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

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: var(--space-2) var(--space-5);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 160ms var(--ease-out), border-color 160ms var(--ease-out), color 160ms var(--ease-out);
}

.button-primary {
  background: var(--color-accent);
  color: var(--color-on-accent);
}

.button-primary:hover {
  background: var(--color-accent-strong);
  color: var(--color-on-accent);
}

.button-quiet {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--color-line-strong);
  color: var(--color-text-primary);
}

.button-quiet:hover {
  background: rgba(255, 255, 255, 0.08);
}

.button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.store-badge {
  display: inline-block;
  line-height: 0;
  border-radius: 10px;
}

.store-badge img {
  height: 50px;
  width: auto;
}

/* Card: the one container, used sparingly */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
}

/* Device frame around real app screenshots (1206 × 2622) */
.device {
  --dw: 260px;
  position: relative;
  width: var(--dw);
  flex-shrink: 0;
  align-self: flex-start;
  padding: calc(var(--dw) * 0.03);
  border-radius: calc(var(--dw) * 0.16);
  background: linear-gradient(160deg, #2a2c30, #121315 40%, #1b1c1f);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.12),
    0 50px 90px -40px rgba(0, 0, 0, 0.9);
}

.device img {
  width: 100%;
  aspect-ratio: 1206 / 2622;
  object-fit: cover;
  border-radius: calc(var(--dw) * 0.132);
  background: #000;
}

/* Dynamic Island */
.device::after {
  content: "";
  position: absolute;
  top: calc(var(--dw) * 0.058);
  left: 50%;
  width: calc(var(--dw) * 0.29);
  height: calc(var(--dw) * 0.085);
  transform: translateX(-50%);
  border-radius: 999px;
  background: #000;
}

/* Screen glow: a soft light in the colour of the screen it sits behind */
.glow {
  position: relative;
  isolation: isolate;
}

.glow::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  top: 50%;
  width: min(900px, 120%);
  aspect-ratio: 1.3;
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, var(--glow), transparent);
  opacity: var(--glow-strength, 0.5);
  filter: blur(20px);
  pointer-events: none;
}

.glow-plan { --glow: var(--glow-plan); }
.glow-setup { --glow: var(--glow-setup); }
.glow-hold { --glow: var(--glow-hold); }
.glow-review { --glow: var(--glow-review); }
.glow-night { --glow: var(--glow-night); }

/* Reveal: content is visible by default; main.js opts blocks in once */
.motion .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 900ms var(--ease-out), transform 900ms var(--ease-out);
}

.motion .reveal.is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
