/* ───────────────────────────────────────────────────────────────────────
   Adalyn — public welcome page
   Canonical identity tokens mirror design-system/generated/adalyn.tokens.css.
   The public site deliberately extends the operational palette with
   atmospheric gradients and interactive lighting (§2.2 of the brief).
   ─────────────────────────────────────────────────────────────────────── */

:root {
  /* Canonical Adalyn tokens */
  --adalyn-black: #000000;
  --adalyn-white: #FFFFFF;
  --adalyn-gray-900: #111111;
  --adalyn-gray-800: #1A1A1A;
  --adalyn-gray-700: #222222;
  --adalyn-gray-600: #333333;
  --adalyn-gray-500: #4A4A4A;
  --adalyn-gray-400: #666666;
  --adalyn-gray-300: #888888;
  --adalyn-purple: #7C3AED;
  --adalyn-purple-light: #9F67FD;
  --adalyn-purple-dark: #6D28D9;
  --adalyn-danger: #EF5350;
  --adalyn-border-color: #222222;
  --adalyn-font-sans: system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --adalyn-font-mono: ui-monospace, "JetBrains Mono", "Roboto Mono", Menlo, Consolas, monospace;
  --adalyn-radius-squaricle: 20px;
  --adalyn-radius-button: 16px;
  --adalyn-space-m: 16px;
  --adalyn-space-l: 24px;
  --adalyn-space-xl: 32px;
  --adalyn-duration-fast: 160ms;
  --adalyn-duration-base: 200ms;
  --adalyn-duration-slow: 260ms;
  --adalyn-ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --adalyn-ease-emphasized: cubic-bezier(0.4, 0, 0.2, 1);

  /* Public-page extensions (atmosphere) */
  --bg-base: #07040d;
  --bg-deep: #0d0817;
  --text-primary: #EFEAF7;
  --text-secondary: #A89EC4;
  --purple-glow: rgba(124, 58, 237, 0.35);

  /* Pointer state (driven by welcome.js) */
  --px: 50vw;
  --py: 30vh;
  --mx: 50%;
  --my: 50%;
}

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

html { scroll-behavior: smooth; }

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

::selection { background: var(--adalyn-purple); color: #fff; }

a { color: inherit; }

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

/* ── Atmospheric background ──────────────────────────────────────────── */
.bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
.bg-grad { position: absolute; border-radius: 50%; filter: blur(1px); will-change: transform; }
.bg-grad-1 {
  width: 120vmax; height: 120vmax; top: -55vmax; left: -35vmax;
  background: radial-gradient(circle at 50% 50%, rgba(124, 58, 237, 0.16), transparent 60%);
}
.bg-grad-2 {
  width: 100vmax; height: 100vmax; bottom: -50vmax; right: -40vmax;
  background: radial-gradient(circle at 50% 50%, rgba(109, 40, 217, 0.13), transparent 62%);
}
.bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(124, 58, 237, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124, 58, 237, 0.045) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, black 30%, transparent 75%);
}
.bg-noise {
  position: absolute; inset: 0; opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
}

/* Cursor spotlight — follows the pointer, never blocks interaction */
.spotlight {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(520px circle at var(--px) var(--py),
    rgba(159, 103, 253, 0.075), rgba(124, 58, 237, 0.03) 45%, transparent 70%);
  transition: opacity var(--adalyn-duration-base) var(--adalyn-ease-standard);
}

/* ── Typography ──────────────────────────────────────────────────────── */
h1, h2, h3 { line-height: 1.1; margin: 0; font-weight: 700; }

.hl {
  background: linear-gradient(90deg, var(--adalyn-purple-light), var(--adalyn-purple));
  background-size: 100% 100%;
  background-repeat: no-repeat;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
html.js .hl { background-size: var(--hl-size, 0%) 100%; }
.hl-fallback { -webkit-text-fill-color: var(--adalyn-purple-light); }

/* ── Navigation ──────────────────────────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: center; gap: var(--adalyn-space-l);
  padding: 14px clamp(16px, 4vw, 48px);
  background: rgba(7, 4, 13, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(34, 34, 34, 0.8);
}
.nav-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.nav-mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--bg-deep); border: 1px solid var(--adalyn-purple);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--adalyn-font-mono); font-weight: 700; color: var(--adalyn-purple);
}
.nav-name { font-family: var(--adalyn-font-mono); font-weight: 700; letter-spacing: 3px; font-size: 14px; }
.nav-links { display: flex; gap: 22px; margin-left: auto; }
.nav-links a { color: var(--text-secondary); text-decoration: none; font-size: 14px; transition: color var(--adalyn-duration-fast); }
.nav-links a:hover { color: var(--text-primary); }
.nav-actions { display: flex; align-items: center; gap: 14px; }
.nav-ghost { color: var(--text-secondary); text-decoration: none; font-size: 14px; }
.nav-ghost:hover { color: var(--text-primary); }

/* ── Buttons (magnetic) ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 26px; border-radius: var(--adalyn-radius-button);
  font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer;
  border: 1px solid transparent;
  transition: background var(--adalyn-duration-fast) var(--adalyn-ease-standard),
              border-color var(--adalyn-duration-fast) var(--adalyn-ease-standard),
              transform var(--adalyn-duration-fast) var(--adalyn-ease-standard);
  will-change: transform;
}
.btn-primary {
  background: var(--adalyn-purple); color: #fff;
  box-shadow: 0 0 0 1px rgba(124, 58, 237, 0.4), 0 12px 40px -12px var(--purple-glow);
}
.btn-primary:hover { background: var(--adalyn-purple-light); }
.btn-ghost { border-color: var(--adalyn-gray-700); color: var(--text-primary); background: rgba(26, 26, 26, 0.4); }
.btn-ghost:hover { border-color: var(--adalyn-purple); color: var(--adalyn-purple-light); }
.nav-cta {
  min-height: 40px; padding: 0 18px; border-radius: 12px;
  background: var(--adalyn-purple); color: #fff; text-decoration: none;
  font-size: 14px; font-weight: 600; display: inline-flex; align-items: center;
  transition: background var(--adalyn-duration-fast);
}
.nav-cta:hover { background: var(--adalyn-purple-light); }

/* ── Hero ────────────────────────────────────────────────────────────── */
.hero {
  min-height: 100svh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  padding: 120px 24px 80px; position: relative;
}
.hero-kicker {
  font-family: var(--adalyn-font-mono); font-size: 12px; letter-spacing: 4px;
  color: var(--adalyn-purple-light); margin: 0 0 24px; text-transform: uppercase;
}
.hero-title {
  font-size: clamp(40px, 12vw, 148px); letter-spacing: -0.03em; font-weight: 800;
  background: linear-gradient(180deg, #FFFFFF 30%, rgba(159, 103, 253, 0.85));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin: 0 0 28px;
}
.hero-sub {
  max-width: 640px; font-size: clamp(17px, 2.4vw, 21px);
  color: var(--text-secondary); margin: 0 0 40px;
}
.hero-cta { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; margin-bottom: 8px; }
.hero-strip {
  display: flex; gap: clamp(20px, 5vw, 64px); margin: 88px 0 0;
  padding: 20px 32px; border: 1px solid var(--adalyn-gray-700);
  border-radius: var(--adalyn-radius-squaricle); background: rgba(13, 8, 23, 0.6);
}
.hero-strip div { text-align: center; }
.hero-strip dt { font-family: var(--adalyn-font-mono); font-size: 11px; letter-spacing: 2px; color: var(--adalyn-purple-light); text-transform: uppercase; }
.hero-strip dd { margin: 4px 0 0; font-size: 14px; color: var(--text-secondary); }

.hero-orbit { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.orbit-ring {
  width: min(72vmin, 640px); height: min(72vmin, 640px); border-radius: 50%;
  border: 1px solid rgba(124, 58, 237, 0.14);
  animation: spin 46s linear infinite;
}
.orbit-dot {
  position: absolute; width: 8px; height: 8px; border-radius: 50%;
  background: var(--adalyn-purple-light); box-shadow: 0 0 18px 3px var(--purple-glow);
  offset-path: circle(min(36vmin, 320px)); animation: spin 18s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Sections ────────────────────────────────────────────────────────── */
.section { max-width: 1120px; margin: 0 auto; padding: clamp(72px, 12vh, 140px) clamp(20px, 5vw, 48px); }
.section-kicker {
  font-family: var(--adalyn-font-mono); font-size: 12px; letter-spacing: 3px;
  color: var(--adalyn-purple-light); text-transform: uppercase; margin: 0 0 16px;
}
.section-title { font-size: clamp(32px, 5vw, 54px); letter-spacing: -0.02em; margin: 0 0 48px; }

/* What Adalyn is */
.what-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.what-lede { font-size: clamp(17px, 2.2vw, 20px); color: var(--text-secondary); margin: 0; }
.what-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.what-chips li {
  padding: 8px 16px; border: 1px solid var(--adalyn-gray-700); border-radius: 999px;
  font-size: 13px; color: var(--text-secondary); background: rgba(13, 8, 23, 0.5);
  transition: border-color var(--adalyn-duration-fast), color var(--adalyn-duration-fast);
}
.what-chips li:hover { border-color: var(--adalyn-purple); color: var(--text-primary); }

/* Architecture */
.arch-diagram { margin: 0 0 56px; }
.arch-svg { width: 100%; height: auto; }
.arch-label { font-family: var(--adalyn-font-mono); font-size: 13px; letter-spacing: 3px; fill: var(--text-primary); }
.arch-sub { font-family: var(--adalyn-font-sans); font-size: 11px; fill: var(--text-secondary); }
.arch-link { stroke-dashoffset: 220; animation: draw 2.4s var(--adalyn-ease-standard) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.arch-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.arch-note { color: var(--text-secondary); font-size: 14px; margin: 40px 0 0; max-width: 760px; }

/* Cards (interactive lighting + tilt) */
.arch-card, .cap, .link-card {
  position: relative;
  background: linear-gradient(165deg, rgba(26, 26, 26, 0.85), rgba(13, 8, 23, 0.9));
  border: 1px solid var(--adalyn-gray-700);
  border-radius: var(--adalyn-radius-squaricle);
  padding: 28px;
  display: flex; flex-direction: column;
  transition: border-color var(--adalyn-duration-base) var(--adalyn-ease-standard),
              transform var(--adalyn-duration-base) var(--adalyn-ease-standard);
  will-change: transform;
}
.cap-tag { margin-top: auto; padding-top: 12px; }
.arch-card::before, .cap::before, .link-card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: radial-gradient(240px circle at var(--mx) var(--my), rgba(159, 103, 253, 0.1), transparent 65%);
  opacity: 0; transition: opacity var(--adalyn-duration-base);
  pointer-events: none;
}
.arch-card:hover, .cap:hover, .link-card:hover { border-color: rgba(124, 58, 237, 0.55); }
.arch-card:hover::before, .cap:hover::before, .link-card:hover::before { opacity: 1; }
.arch-card h3, .cap h3, .link-card h3 { font-size: 19px; margin: 0 0 6px; }
.arch-card h3 span { font-size: 12px; font-family: var(--adalyn-font-mono); color: var(--adalyn-purple-light); letter-spacing: 2px; text-transform: uppercase; margin-left: 8px; }
.arch-card p, .cap p, .link-card p { color: var(--text-secondary); font-size: 14.5px; margin: 0 0 16px; }
.arch-card ul { margin: 0; padding: 0; list-style: none; }
.arch-card li { font-size: 13.5px; color: var(--text-secondary); padding: 7px 0 7px 18px; position: relative; }
.arch-card li::before { content: "—"; position: absolute; left: 0; color: var(--adalyn-purple); }

.section-links { padding-bottom: 48px; }

/* Capabilities */
.cap-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.cap-wide { grid-column: span 2; }
.cap-tag {
  display: inline-block; font-family: var(--adalyn-font-mono); font-size: 11px;
  letter-spacing: 1px; color: var(--adalyn-purple-light);
  border: 1px solid rgba(124, 58, 237, 0.35); border-radius: 999px; padding: 5px 12px;
}

/* Engineering */
.eng-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.eng-item {
  padding: 24px; border: 1px solid var(--adalyn-gray-700); border-radius: var(--adalyn-radius-squaricle);
  background: rgba(13, 8, 23, 0.55);
  transition: border-color var(--adalyn-duration-base);
}
.eng-item:hover { border-color: rgba(124, 58, 237, 0.5); }
.eng-item h3 { font-size: 16px; margin: 0 0 8px; }
.eng-item p { color: var(--text-secondary); font-size: 14px; margin: 0; }

/* Links */
.link-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.link-card { text-decoration: none; display: block; }
.link-go { font-family: var(--adalyn-font-mono); font-size: 12.5px; color: var(--adalyn-purple-light); }

/* ── Footer ──────────────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--adalyn-gray-700);
  padding: 48px clamp(20px, 5vw, 48px) 32px;
  display: grid; grid-template-columns: 1.5fr 1fr; gap: 32px;
  max-width: 1120px; margin: 0 auto;
}
.footer-brand { display: flex; gap: 16px; align-items: flex-start; }
.footer-brand strong { font-family: var(--adalyn-font-mono); letter-spacing: 3px; }
.footer-brand p { color: var(--text-secondary); font-size: 14px; margin: 6px 0 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 20px; align-content: start; }
.footer-links a { color: var(--text-secondary); text-decoration: none; font-size: 14px; }
.footer-links a:hover { color: var(--text-primary); }
.footer-copy { grid-column: 1 / -1; color: var(--adalyn-gray-400); font-size: 13px; margin: 24px 0 0; }

/* ── Scroll reveals ────────────────────────────────────────────────────
   Progressive enhancement: the hidden state applies ONLY when JS is active
   (html.js). Without JS — or if JS fails — every section renders fully. */
.reveal { opacity: 1; transform: none; }
html.js .reveal {
  opacity: 0; transform: translateY(26px);
  transition: opacity var(--adalyn-duration-slow) var(--adalyn-ease-emphasized),
              transform var(--adalyn-duration-slow) var(--adalyn-ease-emphasized);
  transition-delay: calc(var(--d, 0) * 70ms);
}
html.js .reveal.in-view { opacity: 1; transform: none; }

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .what-grid, .arch-cards, .cap-grid, .eng-grid, .link-grid, .footer { grid-template-columns: 1fr; }
  .cap-wide { grid-column: span 1; }
  .nav-links { display: none; }
  .hero-strip { flex-direction: column; gap: 16px; }
}
@media (max-width: 480px) {
  .nav-ghost { display: none; }
  .hero { padding-top: 96px; }
}

/* ── Touch: no hover dependence ──────────────────────────────────────── */
@media (hover: none) {
  .arch-card::before, .cap::before, .link-card::before { display: none; }
  .spotlight { display: none; }
  .arch-card:active, .cap:active, .link-card:active { border-color: var(--adalyn-purple); }
}

/* ── Reduced motion ──────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; }
  html.js .reveal { opacity: 1; transform: none; }
  .spotlight, .orbit-ring, .orbit-dot { display: none; }
  .hl { background-size: 100% 100%; }
  html.js .hl { background-size: 100% 100%; }
}
