/* ============================================
   RUINA — System Core Boot
   Tokens: #0B0E14 void / #E8E6E1 text / #7C9FFF neural / #FF6B5E pulse / #1A1F2C panel
   ============================================ */

:root {
  --void: #0B0E14;
  --panel: #1A1F2C;
  --panel-hi: #232A3B;
  --text: #E8E6E1;
  --text-dim: #8A8F9C;
  --neural: #7C9FFF;
  --pulse: #FF6B5E;
  --line: #2A3142;

  --font-display: "Space Grotesk", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "JetBrains Mono", monospace;

  --container: 1080px;
}

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

html {
  scroll-behavior: smooth;
}

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* subtle noise texture for depth */
.noise-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

a { color: inherit; text-decoration: none; }
code, pre { font-family: var(--font-mono); }

/* ============ TOPBAR ============ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px clamp(20px, 5vw, 64px);
  background: rgba(11, 14, 20, 0.75);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 0.95rem;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--neural);
  display: inline-block;
}

.dot--pulse {
  box-shadow: 0 0 0 0 rgba(124, 159, 255, 0.6);
  animation: pulseDot 2s infinite;
}

.dot--pulse-sm {
  width: 6px; height: 6px;
  box-shadow: 0 0 0 0 rgba(124, 159, 255, 0.6);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0% { box-shadow: 0 0 0 0 rgba(124, 159, 255, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(124, 159, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(124, 159, 255, 0); }
}

.topbar__nav {
  display: flex;
  gap: clamp(16px, 3vw, 32px);
  font-size: 0.85rem;
  color: var(--text-dim);
}

.topbar__nav a:hover { color: var(--neural); }

/* ============ LAYOUT HELPERS ============ */
main > section {
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(60px, 10vw, 120px) clamp(20px, 5vw, 64px);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 16px;
}

.eyebrow--live {
  color: var(--neural);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 600;
  margin-bottom: 24px;
  letter-spacing: -0.01em;
}

.body-text {
  color: var(--text-dim);
  font-size: 1rem;
  max-width: 560px;
  margin-bottom: 16px;
}

/* ============ HERO ============ */
.hero {
  padding-top: clamp(50px, 8vw, 90px) !important;
}

.hero__grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}

@media (max-width: 860px) {
  .hero__grid {
    grid-template-columns: 1fr;
  }
}

.terminal {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 20px 60px -20px rgba(0,0,0,0.6);
}

.terminal__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--panel-hi);
  border-bottom: 1px solid var(--line);
}

.terminal__dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.terminal__dot--a { background: #FF6B5E; }
.terminal__dot--b { background: #F5C26B; }
.terminal__dot--c { background: #6BCB77; }

.terminal__title {
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
}

.terminal__body {
  padding: 22px 20px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.9;
  min-height: 260px;
}

.boot-line {
  display: flex;
  gap: 10px;
  opacity: 0;
  animation: fadeIn 0.3s forwards;
}

.boot-line__ok { color: #6BCB77; }
.boot-line__tag { color: var(--neural); }
.boot-line__text { color: var(--text-dim); }

@keyframes fadeIn {
  to { opacity: 1; }
}

.cursor {
  display: inline-block;
  width: 7px;
  height: 14px;
  background: var(--neural);
  animation: blink 1s step-end infinite;
  vertical-align: middle;
}

@keyframes blink {
  50% { opacity: 0; }
}

.hero__intro .hl {
  color: var(--neural);
}

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin-bottom: 20px;
}

.hero__desc {
  color: var(--text-dim);
  font-size: 1.05rem;
  max-width: 480px;
  margin-bottom: 36px;
}

.heartbeat {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--neural);
}

.heartbeat__svg {
  width: 180px;
  height: 36px;
}

.heartbeat__line {
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
  animation: drawLine 3.2s ease-in-out infinite;
}

@keyframes drawLine {
  0% { stroke-dashoffset: 600; }
  60% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -10; }
}

.heartbeat__label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

/* ============ ABOUT ============ */
.about {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
  border-top: 1px solid var(--line);
}

@media (max-width: 860px) {
  .about { grid-template-columns: 1fr; }
}

.thumb-frame {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  aspect-ratio: 4 / 5;
  background: var(--panel);
}

.thumb-frame__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.92) contrast(1.05);
}

.thumb-frame__tag {
  position: absolute;
  bottom: 12px;
  left: 12px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  background: rgba(11,14,20,0.7);
  border: 1px solid var(--line);
  padding: 4px 10px;
  border-radius: 100px;
  color: var(--neural);
  backdrop-filter: blur(6px);
}

.meta-list {
  list-style: none;
  margin-top: 24px;
  border-top: 1px solid var(--line);
}

.meta-list li {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.meta-list li span:first-child {
  color: var(--text-dim);
}

.meta-live {
  color: #6BCB77;
}

/* ============ CAPABILITIES ============ */
.capabilities {
  border-top: 1px solid var(--line);
}

.cap-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 40px;
}

@media (max-width: 860px) {
  .cap-grid { grid-template-columns: 1fr; }
}

.cap-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px 24px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.cap-card:hover {
  border-color: var(--neural);
  transform: translateY(-3px);
}

.cap-card__index {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--neural);
  border: 1px solid var(--line);
  padding: 3px 9px;
  border-radius: 100px;
  margin-bottom: 16px;
}

.cap-card h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.cap-card em {
  color: var(--pulse);
  font-style: normal;
  font-size: 0.8rem;
}

.cap-card p {
  color: var(--text-dim);
  font-size: 0.92rem;
}

/* ============ ENDPOINT ============ */
.endpoint {
  border-top: 1px solid var(--line);
}

.endpoint__box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: clamp(28px, 5vw, 48px);
}

.code-block {
  margin-top: 20px;
  background: var(--void);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 20px;
  overflow-x: auto;
}

.code-block pre {
  font-size: 0.82rem;
  color: var(--neural);
  white-space: pre;
}

.code-block code {
  color: var(--text);
}

/* ============ FOOTER ============ */
.footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 32px 20px 48px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  border-top: 1px solid var(--line);
}

.footer__sep { opacity: 0.4; }

/* focus visibility */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--neural);
  outline-offset: 3px;
}
