/* ============================================================
   OntoBricks website — styles
   Palette derived from the OntoBricks logo:
   red #FF3621 · indigo #6366F1 · teal #4ECDC4 · amber #F59E0B
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  --red: #FF3621;
  --indigo: #6366F1;
  --teal: #4ECDC4;
  --amber: #F59E0B;

  /* Dark theme (default) */
  --bg: #080B14;
  --bg-2: #0C1120;
  --surface: #111827;
  --surface-2: #151d30;
  --border: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.28);
  --text: #E7ECF3;
  --text-muted: #96A2B6;
  --heading: #F8FAFC;
  --shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.6);
  --shadow-sm: 0 8px 24px -12px rgba(0, 0, 0, 0.5);
  --grad: linear-gradient(120deg, var(--red), var(--amber) 45%, var(--teal) 80%);
  --grad-brand: linear-gradient(120deg, #ff5b45, #6366F1);
  --code-bg: #0a0f1c;

  --radius: 16px;
  --radius-sm: 10px;
  --max: 1180px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

:root[data-theme="light"] {
  --bg: #F7F9FC;
  --bg-2: #EEF2F9;
  --surface: #FFFFFF;
  --surface-2: #F3F6FC;
  --border: rgba(15, 23, 42, 0.10);
  --border-strong: rgba(15, 23, 42, 0.18);
  --text: #33415C;
  --text-muted: #5B6B85;
  --heading: #0F172A;
  --shadow: 0 24px 60px -24px rgba(30, 41, 89, 0.28);
  --shadow-sm: 0 8px 24px -14px rgba(30, 41, 89, 0.25);
  --code-bg: #0e1524;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background .4s ease, color .4s ease;
}

h1, h2, h3, h4, h5 {
  font-family: "Space Grotesk", "Inter", sans-serif;
  color: var(--heading);
  line-height: 1.12;
  margin: 0;
  letter-spacing: -0.02em;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: .95rem;
  padding: 11px 20px; border-radius: 999px;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s, border-color .25s, color .25s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-lg { padding: 14px 26px; font-size: 1rem; }

.btn-primary {
  background: var(--grad-brand);
  color: #fff;
  box-shadow: 0 10px 30px -10px rgba(99, 102, 241, .6);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 38px -10px rgba(99, 102, 241, .7); }

.btn-ghost {
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  border-color: var(--border-strong);
  color: var(--heading);
}
.btn-ghost:hover { border-color: var(--indigo); transform: translateY(-2px); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s;
}
.site-header.scrolled { border-bottom-color: var(--border); background: color-mix(in srgb, var(--bg) 90%, transparent); }
.header-inner { display: flex; align-items: center; gap: 24px; height: 68px; }

.brand { display: inline-flex; align-items: center; gap: 10px; font-family: "Space Grotesk", sans-serif; }
.brand-mark { filter: drop-shadow(0 2px 6px rgba(255, 54, 33, .25)); }
.brand-name { font-weight: 700; font-size: 1.25rem; color: var(--heading); letter-spacing: -0.02em; }
.brand-accent { color: var(--red); }

.main-nav { display: flex; gap: 26px; margin-left: auto; }
.main-nav a { color: var(--text-muted); font-weight: 500; font-size: .94rem; position: relative; padding: 4px 0; transition: color .2s; }
.main-nav a::after { content: ""; position: absolute; left: 0; bottom: -2px; width: 0; height: 2px; background: var(--grad-brand); border-radius: 2px; transition: width .3s var(--ease); }
.main-nav a:hover { color: var(--heading); }
.main-nav a:hover::after { width: 100%; }

.header-actions { display: flex; align-items: center; gap: 12px; }
.btn-github { padding: 9px 14px; }

/* GitHub star badge (populated by JS) */
.gh-stars {
  display: inline-flex; align-items: center; gap: 3px;
  font-variant-numeric: tabular-nums; font-weight: 700; font-size: .82rem;
  color: var(--amber);
  opacity: 0; max-width: 0; overflow: hidden;
  transition: opacity .4s ease, max-width .4s ease;
}
.gh-stars.loaded { opacity: 1; max-width: 90px; }
.btn-github .gh-stars.loaded { padding-left: 8px; margin-left: 2px; border-left: 1px solid var(--border-strong); }
.gh-stars-cta { color: #fff; max-width: none; opacity: 1; } /* keep the ★ visible until count loads */

.theme-toggle {
  display: grid; place-items: center; width: 38px; height: 38px;
  border-radius: 10px; border: 1px solid var(--border-strong);
  background: transparent; color: var(--heading); cursor: pointer;
  transition: border-color .2s, transform .2s;
}
.theme-toggle:hover { border-color: var(--indigo); transform: rotate(-8deg); }
.theme-toggle svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-sun { display: none; }
:root[data-theme="light"] .icon-sun { display: block; }
:root[data-theme="light"] .icon-moon { display: none; }

.nav-burger { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-burger span { width: 22px; height: 2px; background: var(--heading); border-radius: 2px; transition: .3s; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 96px 0 84px; overflow: hidden; }
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.hero-glow {
  position: absolute; z-index: 0; top: -20%; left: 50%; transform: translateX(-50%);
  width: 900px; height: 600px; pointer-events: none;
  background: radial-gradient(closest-side, rgba(99, 102, 241, .18), transparent 70%),
              radial-gradient(closest-side, rgba(255, 54, 33, .12), transparent 70%);
  filter: blur(20px);
}
.hero-content { position: relative; z-index: 1; text-align: center; max-width: 860px; }

.pill {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 7px 16px; border-radius: 999px; font-size: .82rem; font-weight: 600;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  border: 1px solid var(--border-strong);
  margin-bottom: 26px;
}
.pill-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px rgba(78, 205, 196, .18); animation: pulse 2.4s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

.hero-title { font-size: clamp(2.3rem, 5.6vw, 4rem); font-weight: 700; margin-bottom: 22px; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { font-size: clamp(1.05rem, 2vw, 1.28rem); color: var(--text-muted); max-width: 660px; margin: 0 auto 34px; }
.hero-sub strong { color: var(--heading); }

.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.hero-stack {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: 12px; margin-top: 46px; font-family: "JetBrains Mono", monospace;
  font-size: .8rem; color: var(--text-muted);
}
.hero-stack i { width: 4px; height: 4px; border-radius: 50%; background: var(--border-strong); }
.hero-stack span { transition: color .2s; }
.hero-stack span:hover { color: var(--teal); }

/* ---------- Pipeline strip ---------- */
.strip { border-block: 1px solid var(--border); background: var(--bg-2); }
.strip-inner { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 26px 24px; flex-wrap: wrap; }
.strip-step { display: flex; align-items: center; gap: 14px; flex: 1 1 200px; }
.strip-num { font-family: "Space Grotesk", sans-serif; font-weight: 700; font-size: 1.5rem; background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.strip-step h4 { font-size: 1rem; margin-bottom: 2px; }
.strip-step p { margin: 0; font-size: .84rem; color: var(--text-muted); }
.strip-arrow { color: var(--border-strong); font-size: 1.3rem; }

/* ---------- Sections ---------- */
.section { padding: 92px 0; }
.section-alt { background: var(--bg-2); border-block: 1px solid var(--border); }
.section-head { max-width: 720px; margin: 0 auto 56px; text-align: center; }
.eyebrow {
  display: inline-block; font-family: "JetBrains Mono", monospace; font-size: .78rem;
  font-weight: 500; letter-spacing: .12em; text-transform: uppercase;
  color: var(--teal); margin-bottom: 14px;
}
.section-head h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); margin-bottom: 16px; }
.section-lead { color: var(--text-muted); font-size: 1.08rem; margin: 0; }
.section-lead a { color: var(--indigo); font-weight: 600; }
.section-lead a:hover { text-decoration: underline; }

/* ---------- Feature grid ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.feature-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 30px 28px; position: relative; overflow: hidden;
  transition: transform .35s var(--ease), border-color .35s, box-shadow .35s;
}
.feature-card::before {
  content: ""; position: absolute; inset: 0; padding: 1px; border-radius: inherit;
  background: var(--grad-brand); opacity: 0; transition: opacity .35s;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}
.feature-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.feature-card:hover::before { opacity: .8; }
.feature-card h3 { font-size: 1.2rem; margin-bottom: 10px; }
.feature-card p { margin: 0; color: var(--text-muted); font-size: .96rem; }
.feature-card p strong { color: var(--heading); }

.feature-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 20px; }
.feature-icon svg { width: 26px; height: 26px; stroke-linecap: round; stroke-linejoin: round; }
.icon-indigo { background: rgba(99, 102, 241, .14); color: var(--indigo); }
.icon-teal { background: rgba(78, 205, 196, .14); color: var(--teal); }
.icon-red { background: rgba(255, 54, 33, .14); color: var(--red); }
.icon-amber { background: rgba(245, 158, 11, .14); color: var(--amber); }

/* ---------- Steps ---------- */
.steps { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; max-width: 940px; margin: 0 auto; }
.step {
  display: flex; gap: 20px; padding: 28px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  transition: transform .3s var(--ease), border-color .3s;
}
.step:hover { transform: translateY(-4px); border-color: var(--border-strong); }
.step-badge {
  flex: 0 0 46px; width: 46px; height: 46px; border-radius: 12px;
  display: grid; place-items: center; font-family: "Space Grotesk", sans-serif;
  font-weight: 700; font-size: 1.25rem; color: #fff; background: var(--grad-brand);
}
.step-body h3 { font-size: 1.15rem; margin-bottom: 8px; }
.step-body p { margin: 0; color: var(--text-muted); font-size: .95rem; }

/* ---------- Screenshots ---------- */
.shot-tabs { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 28px; }
.shot-tab {
  padding: 9px 18px; border-radius: 999px; border: 1px solid var(--border-strong);
  background: transparent; color: var(--text-muted); font-weight: 600; font-size: .9rem;
  cursor: pointer; font-family: inherit; transition: all .25s;
}
.shot-tab:hover { color: var(--heading); border-color: var(--indigo); }
.shot-tab.is-active { background: var(--grad-brand); color: #fff; border-color: transparent; }

.shot-frame {
  max-width: 1000px; margin: 0 auto; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; padding-top: 42px; position: relative;
}
.shot-dots { position: absolute; top: 15px; left: 18px; display: flex; gap: 7px; }
.shot-dots span { width: 11px; height: 11px; border-radius: 50%; background: var(--border-strong); }
.shot-dots span:nth-child(1) { background: #FF5F57; }
.shot-dots span:nth-child(2) { background: #FEBC2E; }
.shot-dots span:nth-child(3) { background: #28C840; }
.shot-img { display: none; width: 100%; border-top: 1px solid var(--border); }
.shot-img.is-active { display: block; animation: fade .5s var(--ease); }
@keyframes fade { from { opacity: 0; transform: scale(.99); } to { opacity: 1; transform: none; } }
.shot-frame figcaption { padding: 18px 24px; color: var(--text-muted); font-size: .92rem; text-align: center; }

/* ---------- Videos ---------- */
.video-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.video-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: transform .3s var(--ease), border-color .3s, box-shadow .3s;
}
.video-card:hover { transform: translateY(-5px); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.video-thumb { position: relative; aspect-ratio: 16 / 9; cursor: pointer; background: var(--surface-2); overflow: hidden; }
.video-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.video-card:hover .video-thumb img { transform: scale(1.05); }
.video-thumb iframe { width: 100%; height: 100%; border: 0; position: absolute; inset: 0; }
.play-btn {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: linear-gradient(180deg, rgba(8,11,20,.05), rgba(8,11,20,.45));
  border: 0; cursor: pointer;
}
.play-btn::before {
  content: ""; width: 60px; height: 60px; border-radius: 50%;
  background: rgba(255, 54, 33, .92); box-shadow: 0 8px 30px rgba(255,54,33,.5);
  transition: transform .25s var(--ease), background .25s;
}
.play-btn::after {
  content: ""; position: absolute; width: 0; height: 0;
  border-style: solid; border-width: 11px 0 11px 19px; border-color: transparent transparent transparent #fff;
  margin-left: 4px;
}
.video-thumb:hover .play-btn::before { transform: scale(1.12); background: var(--red); }
.video-meta { padding: 16px 18px 18px; }
.video-meta h3 { font-size: 1rem; line-height: 1.35; font-family: "Inter", sans-serif; font-weight: 600; }
.video-meta .video-tag { display: inline-block; margin-top: 8px; font-size: .74rem; font-family: "JetBrains Mono", monospace; color: var(--teal); }

/* ---------- Get started ---------- */
.start-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 26px; align-items: start; }
.start-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.code-tabs { display: flex; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.code-tab { padding: 14px 20px; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--text-muted); font-weight: 600; font-size: .9rem; cursor: pointer; font-family: inherit; transition: color .2s, border-color .2s; }
.code-tab:hover { color: var(--heading); }
.code-tab.is-active { color: var(--heading); border-bottom-color: var(--red); }
.code-block { display: none; }
.code-block.is-active { display: block; }
.code-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; background: var(--code-bg); border-bottom: 1px solid rgba(148,163,184,.12); }
.code-file { font-family: "JetBrains Mono", monospace; font-size: .78rem; color: #8b98b0; }
.copy-btn { background: rgba(148,163,184,.12); border: 1px solid rgba(148,163,184,.2); color: #cdd6e5; font-size: .76rem; padding: 4px 12px; border-radius: 7px; cursor: pointer; font-family: "JetBrains Mono", monospace; transition: background .2s; }
.copy-btn:hover { background: rgba(148,163,184,.22); }
.copy-btn.copied { color: var(--teal); border-color: var(--teal); }
.code-block pre { margin: 0; padding: 22px 20px; background: var(--code-bg); overflow-x: auto; }
.code-block code { font-family: "JetBrains Mono", monospace; font-size: .86rem; line-height: 1.85; color: #dbe3f0; white-space: pre; }
.c-cm { color: #5f6b82; font-style: italic; }

.start-req { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; }
.start-req h3 { font-size: 1.15rem; margin-bottom: 18px; }
.req-list { list-style: none; padding: 0; margin: 0 0 24px; }
.req-list li { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; color: var(--text); font-size: .95rem; border-bottom: 1px solid var(--border); }
.req-list li:last-child { border-bottom: 0; }
.req-list svg { color: var(--teal); flex: 0 0 auto; margin-top: 3px; }
.req-links { display: flex; flex-direction: column; gap: 10px; }
.req-links .btn { justify-content: center; }

/* ---------- Architecture ---------- */
.arch-wrap { display: grid; grid-template-columns: 1fr 1.1fr; gap: 44px; align-items: center; }
.arch-text p { color: var(--text-muted); font-size: 1.02rem; }
.arch-text h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); margin: 14px 0 18px; }
.arch-list { list-style: none; padding: 0; margin: 24px 0 0; }
.arch-list li { position: relative; padding: 8px 0 8px 26px; color: var(--text-muted); font-size: .97rem; }
.arch-list li strong { color: var(--heading); }
.arch-list li::before { content: ""; position: absolute; left: 0; top: 15px; width: 10px; height: 10px; border-radius: 3px; background: var(--grad-brand); }
.arch-fig { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.arch-fig img { border-radius: 8px; }

/* ---------- Contributors ---------- */
.contrib-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px 22px; max-width: 780px; margin: 0 auto; }
.contrib { display: flex; flex-direction: column; align-items: center; width: 76px; text-decoration: none; }
.contrib-avatar {
  width: 66px; height: 66px; border-radius: 50%; object-fit: cover; display: block;
  background: var(--surface-2); border: 2px solid var(--border-strong);
  transition: transform .28s var(--ease), border-color .28s, box-shadow .28s;
}
.contrib:hover .contrib-avatar { transform: translateY(-5px) scale(1.06); border-color: var(--indigo); box-shadow: 0 12px 26px -10px rgba(99, 102, 241, .55); }
.contrib-name {
  margin-top: 9px; font-size: .74rem; color: var(--text-muted); text-align: center;
  max-width: 76px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color .2s;
}
.contrib:hover .contrib-name { color: var(--heading); }

/* ---------- CTA ---------- */
.cta { padding: 96px 0; text-align: center; position: relative; overflow: hidden; }
.cta::before { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(99,102,241,.14), transparent 70%); }
.cta-inner { position: relative; }
.cta h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); margin-bottom: 12px; }
.cta p { color: var(--text-muted); font-size: 1.1rem; margin: 0 0 30px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--bg-2); border-top: 1px solid var(--border); padding: 60px 0 30px; }
.footer-inner { display: grid; grid-template-columns: 1.3fr 2fr; gap: 40px; }
.footer-brand p { color: var(--text-muted); font-size: .92rem; margin-top: 14px; }
.footer-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.footer-cols h5 { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); margin-bottom: 14px; font-family: "JetBrains Mono", monospace; font-weight: 500; }
.footer-cols a { display: block; color: var(--text); font-size: .92rem; padding: 5px 0; transition: color .2s; }
.footer-cols a:hover { color: var(--teal); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 44px; padding-top: 24px; border-top: 1px solid var(--border); }
.footer-bottom p { color: var(--text-muted); font-size: .84rem; margin: 0; }
.footer-made a { color: var(--indigo); font-weight: 600; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 940px) {
  .feature-grid, .video-grid { grid-template-columns: repeat(2, 1fr); }
  .start-grid, .arch-wrap, .footer-inner { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .strip-arrow { display: none; }
  .strip-step { flex-basis: 45%; }
}
@media (max-width: 720px) {
  .main-nav, .btn-github .gh-label { display: none; }
  .nav-burger { display: flex; margin-left: auto; }
  .main-nav.open {
    display: flex; flex-direction: column; position: absolute; top: 68px; left: 0; right: 0;
    background: var(--bg); border-bottom: 1px solid var(--border); padding: 18px 24px; gap: 8px;
  }
  .section { padding: 64px 0; }
  .feature-grid, .video-grid { grid-template-columns: 1fr; }
  .footer-cols { grid-template-columns: repeat(2, 1fr); }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}
