/* landing.css — design tokens, base styles, components, motion */

:root {
  /* Palette — WHITE bg, BLACK ink. The legacy --black / --white aliases
     point at the *semantic* role: --black = ink, --white = paper. */
  --bg: #ffffff;
  --fg: #000000;
  --black: #000000;
  --white: #ffffff;

  /* Greyscale derived from white-bg (light surfaces, dark text). */
  --grey-9: #fafafa;   /* subtle off-white surface (card bg) */
  --grey-8: #f5f5f5;
  --grey-7: #e5e5e5;   /* light borders */
  --grey-6: #c4c4c4;   /* placeholder text */
  --grey-3: #5c5c5c;   /* secondary body text */
  --grey-2: #2e2e2e;   /* emphasized body text */

  --font-display: 'Syne', system-ui, sans-serif;
  --font-editorial: 'Instrument Serif', Georgia, serif;
  --font-mono: 'Geist Mono', 'JetBrains Mono', monospace;

  --t-mega: clamp(4rem, 16vw, 14rem);
  --t-h1:   clamp(2.5rem, 8vw, 6rem);
  --t-h2:   clamp(1.75rem, 4vw, 3rem);
  --t-body: clamp(1rem, 1.2vw, 1.125rem);
  --t-label: 0.75rem;

  --ease-expo: cubic-bezier(.16, 1, .3, 1);
  --ease-quart: cubic-bezier(.25, 1, .5, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
html, body {
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body {
  font-family: var(--font-display);
  font-size: var(--t-body);
  line-height: 1.5;
  overflow-x: hidden;
}
img, video, canvas, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { all: unset; cursor: pointer; box-sizing: border-box; }
::selection { background: var(--fg); color: var(--bg); }

/* ============================================================
   HEADER
   ============================================================ */

.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  mix-blend-mode: difference;
  color: var(--bg);  /* difference of bg color = fg; reads correct on hero */
}
.site-header .logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}
.site-nav {
  display: flex;
  gap: 1.75rem;
  align-items: center;
}
.nav-link {
  font-family: var(--font-mono);
  font-size: var(--t-label);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  transition: opacity .25s var(--ease-quart);
}
.nav-link:hover { opacity: 0.6; }

/* ============================================================
   LAYOUT — SECTIONS
   (note: scoped to a class so this doesn't bleed into pages that
   use main>section for normal-flow layout — dashboard, admin, etc.)
   ============================================================ */

.scroll-section {
  position: relative;
  padding: 9rem 2rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.section-inner {
  width: 100%;
  max-width: 96rem;
  margin-inline: auto;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--t-label);
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--grey-3);
  margin-bottom: 2.5rem;
}

.display {
  font-family: var(--font-display);
  font-size: var(--t-h1);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.035em;
  max-width: 52rem;
  color: var(--fg);
}
.display em {
  font-family: var(--font-editorial);
  font-style: italic;
  font-weight: 400;
}
.display-sm {
  font-family: var(--font-display);
  font-size: var(--t-h2);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin-bottom: 3rem;
  max-width: 40rem;
  color: var(--fg);
}
.display-sm em {
  font-family: var(--font-editorial);
  font-style: italic;
  font-weight: 400;
}

/* ============================================================
   HERO
   ============================================================ */

.hero {
  padding-top: 11rem;
  min-height: 100vh;
  overflow: hidden;
}
#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}
.hero-content {
  position: relative;
  z-index: 1;
  max-width: 96rem;
  margin-inline: auto;
  width: 100%;
}
.hero-headline {
  font-family: var(--font-display);
  font-size: var(--t-mega);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.045em;
  margin: 1.75rem 0 2.5rem;
  color: var(--fg);
}
.hero-headline .line {
  display: block;
  overflow: hidden;
}
.hero-headline em {
  font-family: var(--font-editorial);
  font-style: italic;
  font-weight: 400;
}
.hero-sub {
  font-size: clamp(1.125rem, 1.6vw, 1.5rem);
  color: var(--grey-2);
  max-width: 36rem;
  margin-bottom: 3rem;
  line-height: 1.45;
}
.hero-cta {
  display: flex;
  gap: 0.875rem;
  flex-wrap: wrap;
}

.hero-scroll-cue {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  z-index: 2;
  color: var(--grey-3);
}
.hero-scroll-cue span {
  font-family: var(--font-mono);
  font-size: var(--t-label);
  letter-spacing: 0.3em;
}
.hero-scroll-line {
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, var(--fg), transparent);
  animation: scroll-bob 2.2s ease-in-out infinite;
  transform-origin: top;
}
@keyframes scroll-bob {
  0%, 100% { transform: scaleY(1); opacity: 0.4; }
  50%      { transform: scaleY(0.4); opacity: 1; }
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 1.125rem 1.875rem;
  font-family: var(--font-mono);
  font-size: var(--t-label);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  border: 1px solid var(--fg);
  border-radius: 999px;
  transition: background .35s var(--ease-quart), color .35s var(--ease-quart), transform .25s var(--ease-quart), border-color .35s var(--ease-quart);
  will-change: transform;
}
.btn-primary { background: var(--fg); color: var(--bg); }
.btn-primary:hover { background: var(--grey-2); border-color: var(--grey-2); }
.btn-ghost { background: transparent; color: var(--fg); }
.btn-ghost:hover { background: var(--fg); color: var(--bg); }
.btn-block {
  width: 100%;
  justify-content: center;
  margin-top: 0.5rem;
}

/* ============================================================
   PRODUCT — APP CARDS
   ============================================================ */

.apps-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
}
.app-card {
  border: 1px solid var(--grey-7);
  padding: 2.75rem 2.5rem;
  border-radius: 1.25rem;
  background: var(--grey-9);
  transition: border-color .4s var(--ease-quart), transform .4s var(--ease-quart), background .4s var(--ease-quart), box-shadow .4s var(--ease-quart);
  min-height: 22rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  color: var(--fg);
}
.app-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(0,0,0,0.05), transparent 60%);
  opacity: 0;
  transition: opacity .4s var(--ease-quart);
  pointer-events: none;
}
.app-card:hover {
  border-color: var(--fg);
  transform: translateY(-6px);
  box-shadow: 0 24px 48px -24px rgba(0,0,0,0.18);
}
.app-card:hover::before { opacity: 1; }
.app-card-num {
  font-family: var(--font-mono);
  font-size: var(--t-label);
  color: var(--grey-3);
  letter-spacing: 0.15em;
}
.app-card-name {
  font-family: var(--font-display);
  font-size: var(--t-h2);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 1.25rem 0;
}
.app-card-desc {
  color: var(--grey-2);
  margin-bottom: 2rem;
  line-height: 1.5;
}
.app-card-link {
  font-family: var(--font-mono);
  font-size: var(--t-label);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  display: inline-block;
  transition: transform .25s var(--ease-quart);
  will-change: transform;
  color: var(--fg);
}
.app-card-link:hover { transform: translateX(4px); }
.app-card--soon {
  border-style: dashed;
  background: transparent;
}
.app-card--soon .app-card-name,
.app-card--soon .app-card-desc { color: var(--grey-3); }

/* ============================================================
   TRUST
   ============================================================ */

.trust-grid {
  display: grid;
  gap: 3rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}
.trust-num {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 7vw, 6rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 1.25rem;
  color: var(--fg);
}
.trust-item p {
  color: var(--grey-2);
  max-width: 18rem;
  line-height: 1.5;
}
.trust-item em {
  font-family: var(--font-editorial);
  font-style: italic;
  color: var(--fg);
}

/* ============================================================
   AUTH SECTION
   ============================================================ */

.auth { min-height: auto; padding: 9rem 2rem; }
.auth-inner {
  max-width: 30rem;
  margin-inline: auto;
}
.auth-loading {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 4rem 0;
}
.auth-loading.active { display: flex; }
.auth-loading-text {
  font-family: var(--font-mono);
  font-size: var(--t-label);
  letter-spacing: 0.3em;
  color: var(--grey-3);
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}
.auth-container {
  background: var(--grey-9);
  border: 1px solid var(--grey-7);
  border-radius: 1.25rem;
  padding: 2.5rem;
  width: 100%;
  margin-top: 1rem;
}
.auth-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
}
.auth-tab {
  flex: 1;
  padding: 0.875rem;
  text-align: center;
  font-family: var(--font-mono);
  font-size: var(--t-label);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  border: 1px solid var(--grey-7);
  border-radius: 999px;
  color: var(--grey-3);
  transition: background .25s var(--ease-quart), color .25s var(--ease-quart), border-color .25s var(--ease-quart);
}
.auth-tab.active {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.125rem;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.field span {
  font-family: var(--font-mono);
  font-size: var(--t-label);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--grey-3);
}
.field input {
  padding: 0.95rem 1rem;
  background: var(--bg);
  border: 1px solid var(--grey-7);
  border-radius: 0.625rem;
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  transition: border-color .25s var(--ease-quart);
}
.field input:focus {
  outline: none;
  border-color: var(--fg);
}
.field input::placeholder { color: var(--grey-6); }
.auth-error {
  color: #d63b3b;
  font-family: var(--font-mono);
  font-size: var(--t-label);
  letter-spacing: 0.05em;
}
.auth-success {
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: var(--t-label);
  letter-spacing: 0.05em;
}
.auth-bonus {
  font-family: var(--font-mono);
  font-size: var(--t-label);
  text-align: center;
  margin-top: 1rem;
  color: var(--grey-3);
  letter-spacing: 0.05em;
}
.auth-bonus strong { color: var(--fg); font-weight: 500; }

/* ============================================================
   FOOTER
   ============================================================ */

.site-footer {
  padding: 4rem 2rem 2rem;
  text-align: center;
  overflow: hidden;
}
.footer-mega {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(6rem, 22vw, 22rem);
  line-height: 0.85;
  letter-spacing: -0.07em;
  color: var(--grey-7);  /* very faint giant wordmark on white */
  margin-bottom: 3rem;
  user-select: none;
}
.footer-links {
  display: flex;
  gap: 2rem;
  justify-content: center;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.footer-links a {
  font-family: var(--font-mono);
  font-size: var(--t-label);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--grey-3);
  transition: color .25s var(--ease-quart);
}
.footer-links a:hover { color: var(--fg); }
.footer-meta {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.2em;
  color: var(--grey-6);
  text-transform: uppercase;
}

/* ============================================================
   CUSTOM CURSOR
   ============================================================ */

/* Custom ring cursor disabled — using native browser cursor.
   Element kept in markup so JS init doesn't error; hidden via CSS. */
#cursor { display: none !important; }

/* ============================================================
   GRAIN OVERLAY
   ============================================================ */

#grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.05;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.7'/></svg>");
  animation: grain-shift 1s steps(8) infinite;
}
@keyframes grain-shift {
  0%   { transform: translate(0, 0); }
  20%  { transform: translate(-3%, 2%); }
  40%  { transform: translate(2%, -3%); }
  60%  { transform: translate(-2%, 3%); }
  80%  { transform: translate(3%, -2%); }
  100% { transform: translate(0, 0); }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  #grain { animation: none; }
  #cursor { display: none; }
  body { cursor: auto; }
  .hero-scroll-cue { display: none; }
}

/* ============================================================
   AUTH PAGE LAYOUT (index.html — auth is the homepage)
   ============================================================ */

body.auth-page {
  min-height: 100vh;
  overflow: hidden;
}

body.auth-page #hero-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.auth-stage {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem 1.5rem;
}

.auth-stage-content {
  width: 100%;
  max-width: 28rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2.5rem;
}

.auth-brand { text-align: center; }

.brand-wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3rem, 8vw, 5.5rem);
  letter-spacing: 0.18em;
  line-height: 1;
  display: flex;
  justify-content: center;
  gap: 0.05em;
  color: var(--fg);
}

.brand-letter {
  display: inline-block;
  opacity: 0;
  transform: translateY(28px);
  animation: brand-drop 0.75s var(--ease-expo) forwards;
  animation-delay: calc(var(--i) * 0.08s);
}

@keyframes brand-drop {
  to { opacity: 1; transform: translateY(0); }
}

.brand-subtitle {
  margin-top: 1rem;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.5em;
  color: var(--grey-3);
  opacity: 0;
  animation: brand-fade 0.5s ease 0.55s forwards;
}

@keyframes brand-fade {
  to { opacity: 1; }
}

body.auth-page .auth-loading {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg);
  display: none;
}
body.auth-page .auth-loading.active { display: flex; }

body.auth-page .auth-container {
  margin-top: 0;
  background: var(--bg);
  border: 1px solid var(--grey-7);
  box-shadow: 0 28px 64px -32px rgba(0, 0, 0, 0.12);
  border-radius: 1.25rem;
  padding: 2.5rem;
  opacity: 0;
  animation: brand-fade 0.6s ease 0.7s forwards;
}

.auth-footnote {
  text-align: center;
  font-family: var(--font-mono);
  opacity: 0;
  animation: brand-fade 0.5s ease 0.95s forwards;
}

.footnote-links {
  display: flex;
  gap: 1.25rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.footnote-links a {
  font-size: 0.625rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--grey-3);
  transition: color .25s var(--ease-quart);
}
.footnote-links a:hover { color: var(--fg); }

.footnote-meta {
  font-size: 0.55rem;
  letter-spacing: 0.3em;
  color: var(--grey-6);
  text-transform: uppercase;
}

/* ============================================================
   MOBILE
   ============================================================ */

@media (max-width: 768px) {
  .site-header { padding: 1rem 1.25rem; }
  .site-nav { gap: 1rem; }
  main > section { padding: 5rem 1.25rem; min-height: auto; }
  .hero {
    padding-top: 7rem;
    min-height: 90vh;
  }
  .hero-headline { margin: 1.25rem 0 2rem; }
  .hero-sub { margin-bottom: 2rem; }
  .hero-cta { gap: 0.625rem; }
  .btn { padding: 0.95rem 1.5rem; }
  .app-card { padding: 2rem 1.75rem; min-height: 18rem; }
  .auth { padding: 5rem 1.25rem; }
  .auth-container { padding: 1.75rem; }
  .footer-links { gap: 1rem; }
  .hero-scroll-cue { display: none; }
}

@media (max-width: 480px) {
  .auth-stage { padding: 1.5rem 1rem; }
  .auth-stage-content { gap: 1.75rem; }
  body.auth-page .auth-container { padding: 1.75rem; }
  .brand-wordmark { font-size: 2.75rem; letter-spacing: 0.15em; }
  .footnote-links { gap: 1rem; }
}
