/* ═══════════════════════════════════════════
   INFINITY FLOW MODEL — GLOBAL STYLES
   ═══════════════════════════════════════════ */

:root {
  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --sans: 'Instrument Sans', -apple-system, sans-serif;
  --mono: 'JetBrains Mono', monospace;

  --ink: #0D0D0D;
  --ink-2: #3D3D3D;
  --ink-3: #6B6B6B;
  --ink-4: #9A9A9A;
  --ink-5: #C4C4C4;
  --paper: #F8F7F4;
  --paper-warm: #F2F0EB;
  --card: #FFFFFF;
  --rule: rgba(0,0,0,0.08);
  --rule-strong: rgba(0,0,0,0.14);

  --accent: #4A7BF7;
  --accent-warm: #7B68EE;
  --accent-soft: rgba(74,123,247,0.07);
  --accent-glow: rgba(74,123,247,0.15);
  --dark: #0a0a14;

  --sidebar-w: 200px;
  --nav-h: 56px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  overflow-x: hidden;
}

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

/* ═══════ LAYOUT ═══════ */
.page-wrapper {
  display: flex;
  min-height: 100vh;
  padding-top: var(--nav-h);
}

.content-area {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
}

.content-narrow {
  max-width: 820px;
  padding: 0 48px;
}

.full-bleed {
  width: 100%;
  position: relative;
}

/* ═══════ NAV ═══════ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 0 48px;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(248,247,244,0.85);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--rule);
  transition: background 0.3s;
}

.nav.scrolled { background: rgba(248,247,244,0.95); }

.nav-left {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-mark {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 17px;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-logo-icon {
  width: 26px !important;
  height: 26px !important;
  max-width: 26px;
  max-height: 26px;
  display: block;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  gap: 6px;
}

.nav-links a {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-3);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

.nav-links a:hover { color: var(--ink); background: rgba(0,0,0,0.04); }
.nav-links a.active { color: var(--ink); font-weight: 500; }

.nav-cta {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-decoration: none;
  padding: 7px 16px;
  border: 1px solid var(--rule-strong);
  border-radius: 6px;
  transition: all 0.15s;
  white-space: nowrap;
}

.nav-cta:hover { background: var(--ink); color: var(--paper); }

/* ═══════ LEFT RAIL ═══════ */
.left-rail {
  position: fixed;
  top: var(--nav-h);
  left: 0;
  width: var(--sidebar-w);
  height: calc(100vh - var(--nav-h));
  padding: 40px 24px 40px 48px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 50;
}

/* Hide empty sidebar */
.left-rail:empty { display: none; }

.rail-link {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-4);
  text-decoration: none;
  padding: 5px 0;
  transition: color 0.2s;
}

.rail-link:hover { color: var(--ink-2); }
.rail-link.active { color: var(--ink); font-weight: 500; }

/* ═══════ SECTIONS ═══════ */
.section {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.section.visible { opacity: 1; transform: translateY(0); }

.section-rule {
  width: 100%;
  height: 1px;
  background: var(--rule);
  margin-bottom: 48px;
}

.section-label {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-bottom: 14px;
  display: block;
}

.section h2 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 16px;
}

.section-intro {
  font-size: 15.5px;
  color: var(--ink-3);
  line-height: 1.65;
  max-width: 560px;
  margin-bottom: 48px;
}

/* ═══════ PROSE ═══════ */
.prose {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.72;
  color: var(--ink-2);
  max-width: 620px;
}

.prose p { margin-bottom: 20px; }
.prose strong { font-weight: 500; color: var(--ink); }
.prose em { font-style: italic; }

/* ═══════ CALLOUT ═══════ */
.callout {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 18px 22px;
  margin: 32px 0;
}

.callout p { font-size: 14px; color: var(--ink-2); line-height: 1.6; font-family: var(--sans); }
.callout strong { color: var(--ink); }

/* ═══════ CARDS ═══════ */
.card-grid-1 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 40px;
}

.card-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 40px;
}

.card-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 40px;
}

.card {
  background: var(--card);
  padding: 28px 24px;
  transition: background 0.15s;
}

.card:hover { background: #FDFCFA; }

/* ═══════ GRADIENT BANNER ═══════ */
.gradient-banner {
  position: relative;
  padding: 88px 48px 88px calc(var(--sidebar-w) + 48px);
  background: var(--dark);
  overflow: hidden;
}

.gradient-banner::before {
  content: '';
  position: absolute;
  bottom: -40%;
  left: -5%;
  width: 80%;
  height: 160%;
  background: radial-gradient(ellipse at center, 
    rgba(74,123,247,0.35) 0%, 
    rgba(123,104,238,0.2) 30%, 
    rgba(147,180,255,0.1) 50%, 
    transparent 70%
  );
  filter: blur(60px);
  pointer-events: none;
  animation: gradientDrift 12s ease-in-out infinite alternate;
}

.gradient-banner::after {
  content: '';
  position: absolute;
  bottom: -20%;
  right: 5%;
  width: 50%;
  height: 120%;
  background: radial-gradient(ellipse at center, 
    rgba(147,180,255,0.15) 0%, 
    rgba(74,123,247,0.08) 40%, 
    transparent 65%
  );
  filter: blur(50px);
  pointer-events: none;
  animation: gradientDrift2 10s ease-in-out infinite alternate;
}

@keyframes gradientDrift {
  0% { transform: translate(0, 0) scale(1); opacity: 0.85; }
  100% { transform: translate(3%, -4%) scale(1.08); opacity: 1; }
}

@keyframes gradientDrift2 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-2%, 3%) scale(1.05); }
}

.gradient-banner-inner {
  position: relative;
  z-index: 1;
  max-width: 820px;
}

.gradient-banner-label {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 400;
  color: rgba(255,255,255,0.3);
  position: absolute;
  right: 48px;
  top: 88px;
  z-index: 1;
  letter-spacing: 0.02em;
}

.gradient-banner h2 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  line-height: 1.18;
  color: rgba(255,255,255,0.92);
  margin-bottom: 28px;
  max-width: 620px;
  letter-spacing: -0.02em;
}

.gradient-banner p {
  font-size: 15.5px;
  color: rgba(255,255,255,0.38);
  line-height: 1.65;
  max-width: 500px;
}

/* ═══════ CTA SECTION ═══════ */
.cta-section {
  position: relative;
  padding: 72px 48px 72px calc(var(--sidebar-w) + 48px);
  background: var(--dark);
  overflow: hidden;
}

.cta-section::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -10%;
  width: 50%;
  height: 180%;
  background: radial-gradient(ellipse, rgba(74,123,247,0.12), transparent 60%);
  filter: blur(60px);
  pointer-events: none;
}

.cta-inner {
  position: relative;
  z-index: 1;
  max-width: 820px;
}

.cta-section h2 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.6rem, 2.5vw, 2.2rem);
  color: rgba(255,255,255,0.9);
  margin-bottom: 12px;
  line-height: 1.2;
}

.cta-section p {
  font-size: 14.5px;
  color: rgba(255,255,255,0.35);
  line-height: 1.6;
  margin-bottom: 28px;
  max-width: 480px;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--ink);
  background: var(--paper);
  padding: 12px 24px;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.2s;
}

.cta-btn:hover { background: #fff; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0,0,0,0.2); }
.cta-btn svg { width: 14px; height: 14px; }

/* ═══════ FOOTER ═══════ */
.footer {
  position: relative;
  background: var(--dark);
  overflow: hidden;
}

.footer-glow {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(74,123,247,0.4) 30%, rgba(123,104,238,0.4) 50%, rgba(147,180,255,0.3) 70%, transparent 100%);
}

.footer-gradient-bg {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 100%;
  background: 
    radial-gradient(ellipse at 20% 100%, rgba(74,123,247,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(123,104,238,0.06) 0%, transparent 50%);
  pointer-events: none;
}

.footer-infinity {
  position: absolute;
  bottom: 20px;
  right: 48px;
  opacity: 0.03;
  z-index: 0;
  pointer-events: none;
}

.footer-infinity svg { width: 320px; height: 140px; }

.footer-infinity-path {
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
  animation: drawInfinity 8s ease-in-out infinite;
}

@keyframes drawInfinity {
  0% { stroke-dashoffset: 1200; }
  50% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -1200; }
}

.footer-inner {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 72px 48px 48px;
}

.footer-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.footer-brand h3 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 22px;
  color: rgba(255,255,255,0.85);
  margin-bottom: 12px;
}

.footer-brand p {
  font-size: 13.5px;
  color: rgba(255,255,255,0.28);
  line-height: 1.6;
  max-width: 280px;
}

.footer-col-title {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.25);
  margin-bottom: 16px;
}

.footer-col a {
  display: block;
  font-size: 13.5px;
  color: rgba(255,255,255,0.45);
  text-decoration: none;
  padding: 4px 0;
  transition: color 0.15s;
}

.footer-col a:hover { color: rgba(255,255,255,0.8); }

.footer-bottom {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-bottom-left {
  font-family: var(--mono);
  font-size: 11px;
  color: rgba(255,255,255,0.18);
}

.footer-bottom-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.footer-bottom-right a {
  font-size: 11px;
  color: rgba(255,255,255,0.2);
  text-decoration: none;
  transition: color 0.15s;
}

.footer-bottom-right a:hover { color: rgba(255,255,255,0.5); }

/* ═══════ ANIMATIONS ═══════ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ═══════ RESPONSIVE ═══════ */
@media (max-width: 1024px) {
  .left-rail { display: none; }
  .content-area { margin-left: 0 !important; }
  .content-narrow { max-width: 720px; margin: 0 auto; }
  .nav { padding: 0 24px; }
  .gradient-banner { padding-left: 48px; }
  .cta-section { padding-left: 48px; }
}

@media (max-width: 768px) {
  .content-narrow { padding: 0 24px; }
  .nav-links { display: none; }
  .card-grid-2 { grid-template-columns: 1fr; }
  .card-grid-3 { grid-template-columns: 1fr; }
  .gradient-banner { padding: 64px 24px; }
  .cta-section { padding: 64px 24px; }
  .footer-inner { padding: 48px 24px 32px; }
  .footer-top { grid-template-columns: 1fr; gap: 28px; }
}

@media (max-width: 480px) {
  .content-narrow { padding: 0 18px; }
}
