/* ── Tokens ─────────────────────────────────────────────── */
:root {
  --white:       #FFFFFF;
  --petal:       #FAF0F4;
  --ice:         #EFF5FF;
  --mauve-tint:  #C9A7C7;
  --mauve-text:  #7D5C7B;
  --ink:         #1A1A2E;

  --ff-display: 'Cormorant Garamond', Georgia, serif;
  --ff-body:    'Inter', system-ui, sans-serif;
  --ff-mono:    'JetBrains Mono', 'Fira Code', monospace;

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

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

html, body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  position: relative;
  scroll-behavior: smooth;
}

body {
  background: var(--white);
  color: var(--ink);
  font-family: var(--ff-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Floating Theme Toggle Switch ───────────────────────── */
.theme-toggle {
  position: fixed;
  top: 1.15rem;
  right: 1.5rem;
  z-index: 110;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(26, 26, 46, 0.15);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(26,26,46,0.08);
  transition: transform 0.2s var(--ease-out), background 0.2s;
}

.theme-toggle:hover {
  transform: scale(1.05);
  background: var(--white);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--mauve-text);
  outline-offset: 2px;
}

/* ── Glowing Orb Background ────────────────────────────── */
.orb-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.orb {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(680px, 90vw);
  aspect-ratio: 1;
  transform: translate(-50%, -52%);
  border-radius: 50%;
  background: radial-gradient(ellipse at 40% 40%,
    #f9d0e5 0%,
    #e0c8f0 30%,
    #c5d8fb 60%,
    transparent 75%
  );
  filter: blur(48px);
  opacity: 0.55;
  animation: pulse 7s ease-in-out infinite;
  will-change: transform, opacity;
}

@keyframes pulse {
  0%, 100% { transform: translate(-50%, -52%) scale(1);   opacity: 0.55; }
  50%       { transform: translate(-50%, -52%) scale(1.08); opacity: 0.42; }
}

@media (prefers-reduced-motion: reduce) {
  .orb { animation: none; }
}

/* ── Nav (Fades in on scroll via JS) ─────────────────────── */
nav.sticky-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  
  /* Increased right padding from 4rem to 6.5rem to clear toggle button */
  padding: 1.25rem 6.5rem 1.25rem 4rem; 
  
  background: rgba(13, 13, 21, 0.95); 
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(201, 167, 199, 0.15);

  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out);
}

nav.sticky-nav.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.nav-logo-wrap {
  display: flex;
  align-items: center;
  height: 100%;
  text-decoration: none;
}

.nav-logo-img {
  height: 38px;
  width: auto;
  display: block;
}

.nav-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--white);
  text-decoration: none;
  opacity: 0.75;
  transition: opacity 0.2s var(--ease-out), color 0.2s var(--ease-out);
}

.nav-links a:hover,
.nav-links a:focus-visible { 
  opacity: 1; 
  color: var(--mauve-tint);
}

/* ── Hero & Large Hero Logo ────────────────────────────── */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 2rem 6rem;
  overflow: hidden;
}

.hero-brand-container {
  margin-bottom: 2rem;
  position: relative;
  z-index: 1;
}

.hero-brand-logo {
  height: clamp(140px, 20vw, 220px);
  width: auto;
  display: block;
  filter: drop-shadow(0 8px 24px rgba(26,26,46,0.06));
}

.hero-eyebrow {
  font-family: var(--ff-mono);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mauve-text);
  margin-bottom: 2rem;
  position: relative;
  z-index: 1;
}

.hero-title {
  font-family: var(--ff-display);
  font-size: clamp(3.2rem, 8vw, 7.5rem);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--ink);
  max-width: 14ch;
  position: relative;
  z-index: 1;
}

.hero-title em {
  font-style: italic;
  font-weight: 300;
}

.hero-sub {
  margin-top: 2.25rem;
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.75;
  color: var(--ink);
  opacity: 0.65;
  max-width: 44ch;
  position: relative;
  z-index: 1;
}

.hero-cta {
  margin-top: 3rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  font-family: var(--ff-body);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
  border: 1.5px solid transparent;
}

.btn:focus-visible {
  outline: 2px solid var(--mauve-text);
  outline-offset: 4px;
}

.btn-primary {
  background: var(--ink);
  color: var(--white);
  border-color: var(--ink);
}

.btn-primary:hover {
  background: #111827;
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: rgba(26,26,46,0.3);
}

.btn-ghost:hover {
  border-color: var(--ink);
  transform: translateY(-1px);
}

/* ── Section Shared ─────────────────────────────────────── */
section {
  padding: 7rem 4rem;
  position: relative;
}

.section-label {
  font-family: var(--ff-mono);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mauve-text);
  margin-bottom: 3.5rem;
}

/* ── Products ───────────────────────────────────────────── */
.products {
  background: var(--petal);
}

.products-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.products-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 4rem;
  flex-wrap: wrap;
  gap: 2rem;
}

.products-title {
  font-family: var(--ff-display);
  font-size: clamp(2rem, 4vw, 3.25rem);
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: -0.01em;
  max-width: 20ch;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5px;
  background: rgba(201,167,199,0.2);
  border: 1.5px solid rgba(201,167,199,0.2);
  border-radius: 4px;
  overflow: hidden;
}

.card {
  background: var(--white);
  padding: 2.75rem 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  transition: background 0.25s var(--ease-out), transform 0.25s var(--ease-out);
}

.card:hover {
  background: var(--ice);
  transform: translateY(-4px);
}

.card-label {
  font-family: var(--ff-mono);
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--mauve-tint);
}

.card-name {
  font-family: var(--ff-display);
  font-size: 1.75rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.card-desc {
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--ink);
  opacity: 0.65;
  flex: 1;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mauve-text);
  text-decoration: none;
  margin-top: auto;
  transition: gap 0.2s var(--ease-out);
}

/* ── Light Mode: Featured Card Separators ───────────────── */
.card-featured {
  /* Match the border of your light mode grid container */
  border: 1.5px solid rgba(201, 167, 199, 0.2); 
  border-bottom: none; /* Let it connect seamlessly with the grid below */
  border-radius: 4px 4px 0 0; /* Smooth top corners only */
}

/* ── Light Mode Grid Border Fix ─────────────────────────── */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5px;
  /* Darken the background color so the separating lines become crisp and visible */
  background: rgba(201, 167, 199, 0.6); 
  border: 1.5px solid rgba(201, 167, 199, 0.6);
  border-radius: 4px;
  overflow: hidden;
}

/* ── Featured Card Layout & Grid Fix ────────────────────── */
@media (min-width: 901px) {
  /* Restrict the grid to exactly 2 columns so the bottom 2 cards split 50/50 */
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .card-featured {
    grid-column: 1 / -1; /* Keep the featured card spanning all the way across */
    padding: 4.5rem 4rem; /* Keep premium padding */
  }

  .card-featured .card-name {
    font-size: clamp(2rem, 3.5vw, 2.75rem);
  }

  .card-featured .card-desc {
    max-width: 75ch;
  }
}

.card-link:hover { gap: 0.65rem; }
.card-link:focus-visible { 
  outline: 2px solid var(--mauve-text); 
  outline-offset: 4px; 
  border-radius: 2px; 
}

.card-link svg { flex-shrink: 0; }

/* ── Live Demo ─────────────────────────────────────────── */
.demo {
  background: var(--white);
  border-bottom: 1px solid rgba(201,167,199,0.18);
}

.demo-inner {
  max-width: 800px;
  margin: 0 auto;
}

.demo-header {
  text-align: center;
  margin-bottom: 3rem;
}

.demo-title {
  font-family: var(--ff-display);
  font-size: clamp(2rem, 4vw, 3.25rem);
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
}

.demo-sub {
  font-size: 0.9rem;
  opacity: 0.65;
  max-width: 50ch;
  margin: 0 auto;
}

.chat-container {
  background: var(--petal);
  border: 1px solid rgba(201,167,199,0.3);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 480px;
  box-shadow: 0 12px 40px rgba(26,26,46,0.04);
}

.chat-header {
  background: var(--white);
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(201,167,199,0.2);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.status-indicator {
  width: 8px;
  height: 8px;
  background: #10B981;
  border-radius: 50%;
  animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.bot-name {
  font-family: var(--ff-display);
  font-weight: 500;
  font-size: 1.1rem;
  color: var(--ink);
}

.prompt-counter {
  margin-left: auto;
  font-family: var(--ff-mono);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--mauve-text);
  background: rgba(201,167,199,0.15);
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
}

.chat-messages {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: linear-gradient(180deg, var(--petal) 0%, rgba(255,255,255,0.5) 100%);
}

.msg {
  display: flex;
  flex-direction: column;
  max-width: 75%;
}

.msg-bubble {
  padding: 0.85rem 1.1rem;
  font-size: 0.9rem;
  line-height: 1.5;
}

.msg-bubble a.chat-link {
  color: var(--mauve-text);
  text-decoration: underline;
  font-weight: 500;
  transition: color 0.2s var(--ease-out);
}

.msg-bubble a.chat-link:hover {
  color: var(--ink);
}

.msg-bot {
  align-self: flex-start;
}

.msg-bot .msg-bubble {
  background: var(--white);
  color: var(--ink);
  border-radius: 2px 14px 14px 14px;
  border: 1px solid rgba(201,167,199,0.15);
}

.msg-user {
  align-self: flex-end;
}

.msg-user .msg-bubble {
  background: var(--ink);
  color: var(--white);
  border-radius: 14px 14px 2px 14px;
}

.msg-user .msg-bubble a.chat-link {
  color: var(--petal);
}

.chat-input-area {
  display: flex;
  background: var(--white);
  border-top: 1px solid rgba(201,167,199,0.2);
  padding: 0.75rem 1rem;
  gap: 0.75rem;
}

#chat-input {
  flex: 1;
  border: 1px solid rgba(201,167,199,0.2);
  border-radius: 4px;
  padding: 0.6rem 1rem;
  font-family: var(--ff-body);
  font-size: 0.9rem;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s var(--ease-out);
}

#chat-input:focus {
  border-color: var(--mauve-tint);
}

#chat-input:disabled {
  background: var(--ice);
  cursor: not-allowed;
  opacity: 0.6;
}

.btn-send {
  padding: 0.5rem 1.25rem;
  font-size: 0.75rem;
}

.btn-send:disabled {
  background: rgba(26,26,46,0.15);
  border-color: transparent;
  color: rgba(26,26,46,0.3);
  cursor: not-allowed;
}

/* ── Philosophy ─────────────────────────────────────────── */
.philosophy {
  background: var(--white);
}

.philosophy-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6rem;
  align-items: start;
}

.philosophy-title {
  font-family: var(--ff-display);
  font-size: clamp(2rem, 3.5vw, 2.75rem);
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-top: 1rem;
}

.philosophy-right {
  padding-top: 3.5rem;
}

.philosophy-body {
  font-size: 0.95rem;
  line-height: 1.85;
  color: var(--ink);
  opacity: 0.7;
  margin-bottom: 1.5rem;
}

.philosophy-body + .philosophy-body { margin-top: 0; }

.pillar-list {
  margin-top: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.pillar {
  display: grid;
  grid-template-columns: 1.5rem 1fr;
  gap: 1rem;
  align-items: start;
}

.pillar-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mauve-tint);
  margin-top: 0.55rem;
  justify-self: center;
}

.pillar-text {
  font-size: 0.875rem;
  line-height: 1.7;
  opacity: 0.7;
}

.pillar-text strong {
  font-weight: 500;
  opacity: 1;
  color: var(--ink);
}

/* ── Contact ────────────────────────────────────────────── */
.contact {
  background: var(--ice);
  text-align: center;
}

.contact-inner {
  max-width: 600px;
  margin: 0 auto;
}

.contact-title {
  font-family: var(--ff-display);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 300;
  line-height: 1.1;
  margin: 1rem 0 1.75rem;
}

.contact-sub {
  font-size: 0.9rem;
  opacity: 0.65;
  line-height: 1.7;
  margin-bottom: 2.5rem;
}

/* ── Footer ─────────────────────────────────────────────── */
footer {
  background: var(--ink);
  color: rgba(255,255,255,0.45);
  padding: 2.5rem 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-logo {
  font-family: var(--ff-display);
  font-size: 1rem;
  font-weight: 400;
  color: rgba(255,255,255,0.8);
  letter-spacing: 0.05em;
}

.footer-meta {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 900px) {
  nav.sticky-nav { padding: 1.25rem 2rem; }
  section { padding: 5rem 2rem; }
  footer { padding: 2rem; }

  .philosophy-inner {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .philosophy-right { padding-top: 0; }

  .products-header { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 600px) {
  nav.sticky-nav { padding: 1rem 1.25rem; }
  nav.sticky-nav .nav-links { display: none; }
  section { padding: 4rem 1.25rem; }
  footer { padding: 1.75rem 1.25rem; }
}

/* ── Fade-in on load ─────────────────────────────────────── */
.fade-up {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.85s var(--ease-out) forwards;
}

.fade-up:nth-child(1) { animation-delay: 0.05s; }
.fade-up:nth-child(2) { animation-delay: 0.18s; }
.fade-up:nth-child(3) { animation-delay: 0.30s; }
.fade-up:nth-child(4) { animation-delay: 0.42s; }

@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .fade-up { animation: none; opacity: 1; transform: none; }
}