/*
 * ContextLore Marketing Site — hand-written CSS
 *
 * Design tokens mirrored from tailwind.config.ts:
 *   obsidian #0A0F14, slate #1A1F24, archival #F5F5F0, amber #FF9F1C, grid #333333
 *
 * Animations (spin-slow 12s, reverse-spin 15s) mirror tailwind keyframes.
 */

/* ─── Self-hosted fonts ──────────────────────────────────────── */

@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/instrument-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/instrument-sans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/instrument-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/instrument-sans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/jetbrains-mono-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ─── Reset & base ───────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  background-color: #0A0F14;
  color: #F5F5F0;
  font-family: 'Instrument Sans', system-ui, -apple-system, Segoe UI, Arial, sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
}

::selection {
  background-color: #FF9F1C;
  color: #0A0F14;
}

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

/* ─── Layout shell ───────────────────────────────────────────── */

.page {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Background grid overlay (mirrors tailwind .bg-grid-pattern at 20% opacity) */
.grid-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.2;
  background-image:
    linear-gradient(to right, #1A1F24 1px, transparent 1px),
    linear-gradient(to bottom, #1A1F24 1px, transparent 1px);
  background-size: 40px 40px;
}

.shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  flex: 1 0 auto;
  min-height: 100vh;
}

/* ─── Top-right login link ───────────────────────────────────── */

.login-link {
  position: absolute;
  top: 24px;
  right: 24px;
  font-size: 14px;
  color: rgba(245, 245, 240, 0.6);
  transition: color 200ms ease;
}
.login-link:hover, .login-link:focus { color: #FF9F1C; outline: none; }

/* ─── Main content ───────────────────────────────────────────── */

main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}

.content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
}

/* ─── Logo orbital container ────────────────────────────────── */

.logo {
  position: relative;
  height: 280px;
  width: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 32px;
  cursor: pointer;
}
.logo .orbit {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: spin-slow 60s linear infinite;
}
.logo .orbit .axis {
  position: absolute;
  top: 0;
  width: 1px;
  height: 100%;
  background: rgba(51, 51, 51, 0.3);
}
.logo .orbit .axis.r45 { transform: rotate(45deg); }
.logo .orbit .axis.r-45 { transform: rotate(-45deg); }
.logo .orbit .satellite {
  position: absolute;
  width: 12px;
  height: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.logo .orbit .satellite.s1 { top: 16px; left: 25%; transform: rotate(45deg); }
.logo .orbit .satellite.s2 { bottom: 32px; right: 25%; transform: rotate(12deg); }

.lore-node {
  position: relative;
  z-index: 10;
  width: 144px;
  height: 144px;
  filter: drop-shadow(0 0 30px rgba(255, 159, 28, 0.15));
  /* Mirrors src/app/page.tsx: group-hover:rotate-90 transition-transform duration-500 */
  transition: transform 500ms cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: 50% 50%;
}
.logo:hover .lore-node {
  transform: rotate(90deg);
}
.lore-node .inner-ring { animation: reverse-spin 15s linear infinite; transform-origin: 50% 50%; color: rgba(255, 255, 255, 0.5); }
.lore-node .outer-ring { animation: spin-slow 12s linear infinite; transform-origin: 50% 50%; color: rgba(255, 255, 255, 0.9); }
.lore-node .core-pulse { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
.lore-node .core-halo { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; animation-delay: 0.5s; opacity: 0.1; }

/* ─── Headline + tagline ────────────────────────────────────── */

h1 {
  font-size: clamp(36px, 5vw, 48px);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 16px 0;
}
h1 .accent { color: #FF9F1C; }

.tagline {
  font-size: clamp(20px, 2.5vw, 24px);
  color: rgba(245, 245, 240, 0.8);
  margin: 0 0 40px 0;
}

/* ─── Waitlist form ─────────────────────────────────────────── */

.waitlist {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 480px;
}
@media (min-width: 640px) {
  .waitlist { flex-direction: row; }
}
.waitlist input[type="email"] {
  flex: 1;
  padding: 12px 16px;
  background-color: #1A1F24;
  border: 1px solid #333333;
  border-radius: 8px;
  color: #F5F5F0;
  font-family: inherit;
  font-size: 16px;
  transition: border-color 200ms ease;
}
.waitlist input[type="email"]::placeholder { color: rgba(245, 245, 240, 0.5); }
.waitlist input[type="email"]:focus { outline: none; border-color: #FF9F1C; }
.waitlist button {
  padding: 12px 24px;
  background-color: #FF9F1C;
  color: #0A0F14;
  border: 0;
  border-radius: 8px;
  font-family: inherit;
  font-weight: 500;
  font-size: 16px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 200ms ease, opacity 200ms ease;
}
.waitlist button:hover { background-color: rgba(255, 159, 28, 0.9); }
.waitlist button:disabled { opacity: 0.5; cursor: not-allowed; }

.waitlist-message {
  margin-top: 8px;
  font-size: 14px;
  min-height: 1.4em;
}
.waitlist-message.is-success { color: #FF9F1C; font-weight: 500; }
.waitlist-message.is-error { color: #f87171; }

.early-access {
  margin-top: 32px;
  font-size: 14px;
  color: rgba(245, 245, 240, 0.4);
}

/* ─── Footer ────────────────────────────────────────────────── */

footer {
  padding: 24px 0;
  text-align: center;
  font-size: 14px;
  color: rgba(245, 245, 240, 0.4);
}
footer p { margin: 0; }

/* ─── Animations (mirrored from tailwind keyframes) ─────────── */

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes reverse-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(-360deg); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ─── Reduced motion ────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .logo:hover .lore-node {
    transform: none;
  }
}
