/* ========================================
   Soul Protocol — Landing Page Styles
   Dark, futuristic, minimal
   ======================================== */

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #0a0a0f;
  --bg-alt: #0f0f18;
  --surface: #14141f;
  --surface-hover: #1a1a2a;
  --border: #1e1e30;
  --border-light: #2a2a40;
  --text: #e4e4ed;
  --text-muted: #8888a0;
  --text-dim: #5c5c72;
  --accent: #8b5cf6;
  --accent-light: #a78bfa;
  --accent-glow: rgba(139, 92, 246, 0.15);
  --accent-glow-strong: rgba(139, 92, 246, 0.3);
  --green: #34d399;
  --blue: #60a5fa;
  --purple: #a78bfa;
  --amber: #fbbf24;
  --rose: #f472b6;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', Consolas, monospace;
  --max-width: 1120px;
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

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

img {
  max-width: 100%;
  display: block;
}

code {
  font-family: var(--font-mono);
}

/* --- Container --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Header / Nav --- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 16px 0;
  transition: background var(--transition), backdrop-filter var(--transition), border-color var(--transition);
  border-bottom: 1px solid transparent;
}

.header--scrolled {
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom-color: var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  transition: color var(--transition);
}

.nav__logo:hover {
  color: var(--accent-light);
}

.nav__logo-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav__links a {
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: color var(--transition);
}

.nav__links a:hover {
  color: var(--text);
}

.nav__github {
  display: flex;
  align-items: center;
  color: var(--text-muted);
  transition: color var(--transition);
}

.nav__github:hover {
  color: var(--text);
}

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav__toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-muted);
  border-radius: 1px;
  transition: transform var(--transition), opacity var(--transition);
}

.nav__toggle[aria-expanded="true"] span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav__toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav__toggle[aria-expanded="true"] span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* --- Hero --- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 0 80px;
  overflow: hidden;
}

.hero__glow {
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
  animation: glow-pulse 6s ease-in-out infinite;
}

@keyframes glow-pulse {
  0%, 100% { opacity: 0.6; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
}

.hero__content {
  position: relative;
  z-index: 1;
}

.hero__tag {
  display: inline-block;
  padding: 6px 16px;
  border: 1px solid var(--border-light);
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent-light);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 32px;
}

.hero__title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
}

.hero__title--accent {
  background: linear-gradient(135deg, var(--accent-light), #c084fc, #e879f9);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero__subtitle {
  max-width: 600px;
  margin: 0 auto 40px;
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.hero__actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero__scroll {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-dim);
  animation: scroll-hint 2s ease-in-out infinite;
}

@keyframes scroll-hint {
  0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.5; }
  50% { transform: translateX(-50%) translateY(8px); opacity: 1; }
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  font-size: 0.95rem;
  font-weight: 500;
  font-family: var(--font);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  border: none;
}

.btn--primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 24px var(--accent-glow);
}

.btn--primary:hover {
  background: var(--accent-light);
  box-shadow: 0 0 32px var(--accent-glow-strong);
  transform: translateY(-1px);
}

.btn--disabled {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
}

.btn--ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-light);
}

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

/* --- Sections --- */
.section {
  padding: 100px 0;
}

.section--alt {
  background: var(--bg-alt);
}

.section--cta {
  padding: 100px 0;
  text-align: center;
}

.section__tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
  text-align: center;
}

.section__title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  text-align: center;
}

.section__title--large {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  margin-bottom: 24px;
}

.section__title em {
  font-style: normal;
  color: var(--accent-light);
}

.section__desc {
  max-width: 640px;
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin: 0 auto 32px;
  text-align: center;
}

.section__desc:last-of-type {
  margin-bottom: 48px;
}

.section__desc code {
  color: var(--text);
  font-size: 0.95em;
  padding: 2px 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
}

/* --- Grid --- */
.grid {
  display: grid;
  gap: 20px;
}

.grid--2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

/* Odd card in 2-col grid: span full width, centered */
.grid--2 > :last-child:nth-child(odd) {
  grid-column: 1 / -1;
  max-width: calc(50% - 10px);
  justify-self: center;
}

/* --- Cards --- */
.card {
  padding: 28px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.card p {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* File cards */
.card--file .card__header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.card__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.card__dot--accent { background: var(--accent); }
.card__dot--green { background: var(--green); }
.card__dot--blue { background: var(--blue); }
.card__dot--purple { background: var(--purple); }
.card__dot--amber { background: var(--amber); }
.card__dot--rose { background: var(--rose); }

.card--file code {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.card--file a {
  color: var(--accent-light);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition);
}

.card--file a:hover {
  border-bottom-color: var(--accent-light);
}

/* Principle cards */
.card--principle {
  border-left: 2px solid var(--accent);
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

/* --- File tree --- */
.tree {
  max-width: 520px;
  margin: 0 auto 48px;
  padding: 24px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.88rem;
}

.tree__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
}

.tree__item code {
  color: var(--text);
  font-weight: 500;
}

.tree__item--root {
  padding-bottom: 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.tree__item--root code {
  color: var(--accent-light);
  font-weight: 600;
}

.tree__children {
  padding-left: 20px;
  border-left: 1px solid var(--border-light);
  margin-left: 4px;
}

.tree__children .tree__item {
  padding: 5px 0;
}

.tree__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.tree__dot--green { background: var(--green); }
.tree__dot--blue { background: var(--blue); }
.tree__dot--purple { background: var(--purple); }
.tree__dot--amber { background: var(--amber); }
.tree__dot--rose { background: var(--rose); }

.tree__label {
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 400;
}

/* --- Note --- */
.note {
  margin-top: 32px;
  padding: 20px 24px;
  border-left: 2px solid var(--border-light);
  background: transparent;
}

.note p {
  font-size: 0.92rem;
  color: var(--text-dim);
  line-height: 1.65;
}

.note a {
  color: var(--accent-light);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition);
}

.note a:hover {
  border-bottom-color: var(--accent-light);
}

/* --- Footer --- */
.footer {
  padding: 32px 0;
  border-top: 1px solid var(--border);
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer__text {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.footer__text a {
  color: var(--text-muted);
  transition: color var(--transition);
}

.footer__text a:hover {
  color: var(--text);
}

.footer__links {
  display: flex;
  gap: 24px;
}

.footer__link {
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: color var(--transition);
}

.footer__link:hover {
  color: var(--text);
}

/* --- Animations --- */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.grid .card.fade-in:nth-child(1) { transition-delay: 0s; }
.grid .card.fade-in:nth-child(2) { transition-delay: 0.1s; }
.grid .card.fade-in:nth-child(3) { transition-delay: 0.15s; }
.grid .card.fade-in:nth-child(4) { transition-delay: 0.2s; }
.grid .card.fade-in:nth-child(5) { transition-delay: 0.25s; }

/* --- Responsive --- */
@media (max-width: 900px) {
  .grid--3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .section {
    padding: 72px 0;
  }
}

@media (max-width: 680px) {
  .nav__links {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 260px;
    background: var(--surface);
    border-left: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    padding: 80px 32px 32px;
    gap: 24px;
    transform: translateX(100%);
    transition: transform var(--transition);
    z-index: 99;
  }

  .nav__links--open {
    transform: translateX(0);
  }

  .nav__toggle {
    display: flex;
    z-index: 101;
  }

  .grid--2,
  .grid--3 {
    grid-template-columns: 1fr;
  }

  .grid--2 > :last-child:nth-child(odd) {
    max-width: 100%;
  }

  .hero {
    padding: 100px 0 60px;
  }

  .hero__title {
    font-size: 2.2rem;
  }

  .hero__subtitle {
    font-size: 1rem;
  }

  .section {
    padding: 56px 0;
  }

  .section__title {
    font-size: 1.6rem;
  }

  .section__desc {
    font-size: 0.95rem;
  }

  .btn {
    padding: 12px 24px;
    font-size: 0.9rem;
    width: 100%;
    justify-content: center;
  }

  .hero__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .tree {
    padding: 20px;
    font-size: 0.82rem;
  }

  .footer__inner {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .card {
    padding: 24px;
  }
}

/* --- Prefers reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }

  .fade-in {
    opacity: 1;
    transform: none;
  }
}
