/* Shared styles for the Demonstrations pages. Palette and type mirror the
   main page (index.html) — keep the two in sync when the theme changes. */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:         #0d0d0d;
  --bg-2:       #141414;
  --bg-3:       #1c1c1c;
  --border:     rgba(255,255,255,0.07);
  --border-mid: rgba(255,255,255,0.13);
  --border-light: rgba(255,255,255,0.22);
  --text:       #f0ebe6;
  --text-dim:   #d4cdc7;
  --text-mid:   #9c948b;
  --text-faint: #847d74;
  --red:        #7a1220;
  --slate:      #5c7a8f;
  --slate-light:#8aacbe;
  --slate-glow: rgba(92,122,143,0.18);
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Barlow', sans-serif;
  font-weight: 400;
  line-height: 1.7;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.025'/%3E%3C/svg%3E");
  pointer-events: none; z-index: 999; opacity: 0.5;
}

nav {
  position: fixed;
  top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.4rem 4rem;
  background: rgba(13,13,13,0.96);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
}
.nav-logo { display: flex; align-items: center; gap: 0.5rem; text-decoration: none; }
.nav-logo-img { height: 26px; width: auto; display: block; }
.nav-links { display: flex; gap: 2.5rem; list-style: none; }
.nav-links a {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem; letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-mid); text-decoration: none;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.current { color: var(--text); }

main { padding: 9rem 4rem 5rem; max-width: 1428px; margin: 0 auto; }

.section-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem; font-weight: 500; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--text-mid);
  margin-bottom: 1rem;
  display: flex; align-items: center; gap: 0.75rem;
}
.section-label::before {
  content: ''; display: block;
  width: 1.25rem; height: 1px; background: var(--border-mid);
}

h1 {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: clamp(2.2rem, 4.5vw, 3.6rem);
  letter-spacing: 0.02em; text-transform: uppercase;
  line-height: 1.05; color: var(--text);
  margin-bottom: 1.25rem;
}
h1 em { font-style: normal; color: var(--slate-light); }

.page-intro {
  font-size: 1.08rem; font-weight: 400;
  color: var(--text-dim); max-width: 780px;
  margin-bottom: 3.5rem; line-height: 1.85;
}

/* artifact frames */
.artifact {
  border: 1px solid var(--border);
  background: var(--bg-2);
  margin-bottom: 1rem;
}
.artifact iframe, .artifact video {
  display: block; width: 100%;
  aspect-ratio: 16 / 9;
  border: 0; background: var(--bg);
}
.artifact.portrait { max-width: 400px; margin-left: auto; margin-right: auto; }
.artifact.portrait video { aspect-ratio: 9 / 16; }
.artifact.portrait + .artifact-caption { justify-content: center; text-align: center; }
.artifact-caption {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  font-family: 'DM Mono', monospace;
  font-size: 0.74rem; font-weight: 500; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-mid);
  margin-bottom: 3.5rem;
}
.artifact-caption a { color: var(--text-mid); text-decoration: none; transition: color 0.2s; }
.artifact-caption a:hover { color: var(--slate-light); }

.demo-note {
  border-left: 2px solid var(--slate);
  padding: 0.25rem 0 0.25rem 1.5rem;
  max-width: 780px;
  margin-bottom: 3rem;
}
.demo-note p { font-size: 1.08rem; color: var(--text-dim); line-height: 1.85; margin-bottom: 1rem; }
.demo-note p:last-child { margin-bottom: 0; }
.demo-note strong { color: var(--text); font-weight: 400; }

/* tiles (landing page) */
.demo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px; background: var(--border);
  border: 1px solid var(--border);
}
.demo-tile {
  background: var(--bg-2); padding: 2.25rem;
  display: flex; flex-direction: column;
  text-decoration: none;
  transition: background 0.25s;
}
.demo-tile:hover { background: var(--bg-3); }
/* an odd last tile spans the row */
.demo-tile:last-child:nth-child(odd) { grid-column: 1 / -1; }
.demo-number {
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem; font-weight: 500; letter-spacing: 0.18em;
  color: var(--text-mid); margin-bottom: 1.25rem;
}
.demo-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600; font-size: 1.15rem;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text); margin-bottom: 0.75rem;
}
.demo-body {
  font-size: 1.06rem; font-weight: 400;
  color: var(--text-dim); line-height: 1.75; flex: 1;
  margin-bottom: 1.4rem;
}
.demo-cta {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--slate-light);
}

footer {
  padding: 2rem 4rem; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.footer-logo { display: flex; align-items: baseline; gap: 0.45rem; }
.footer-logo-main {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700; font-size: 1rem;
  letter-spacing: 0.18em; color: var(--text-faint);
}
.footer-logo-main span { color: var(--red); }
.footer-logo-tech {
  font-family: 'DM Mono', monospace;
  font-size: 0.56rem; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--text-faint);
  opacity: 0.5;
}
.footer-copy, .footer-location {
  font-family: 'DM Mono', monospace;
  font-size: 0.66rem; letter-spacing: 0.1em; color: var(--text-faint);
}
.footer-location { display: flex; align-items: center; gap: 0.5rem; }
.footer-location::before {
  content: ''; display: inline-block;
  width: 6px; height: 6px; background: var(--red); border-radius: 50%;
}

@media (max-width: 768px) {
  nav { padding: 1.25rem 1.5rem; }
  .nav-links { gap: 1.25rem; }
  main { padding: 7rem 1.5rem 4rem; }
  .demo-grid { grid-template-columns: 1fr; }
  footer { flex-direction: column; gap: 1rem; text-align: center; }
}

/* detail pages (platform/) */
.flow {
  display: flex; flex-wrap: wrap; align-items: stretch;
  gap: 0.6rem; margin-bottom: 3.5rem; max-width: 1300px;
}
.flow-stage {
  background: var(--bg-2); border: 1px solid var(--border);
  padding: 1.1rem 1.3rem; flex: 1 1 190px; min-width: 190px;
}
.flow-stage h3 {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600; font-size: 0.95rem;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text); margin-bottom: 0.35rem;
}
.flow-stage p {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem; letter-spacing: 0.04em;
  color: var(--text-mid); line-height: 1.75;
}
.flow-arrow {
  align-self: center; color: var(--text-faint);
  font-family: 'DM Mono', monospace; flex: 0 0 auto;
}

.detail-section { max-width: 780px; margin-bottom: 3rem; }
.detail-section h2 {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700; font-size: 1.6rem;
  letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--text); margin-bottom: 0.7rem;
}
.detail-section p {
  font-size: 1.08rem; font-weight: 400;
  color: var(--text-dim); line-height: 1.85; margin-bottom: 1rem;
}
.detail-section strong { color: var(--text); font-weight: 400; }
.detail-list { list-style: none; }
.detail-list li {
  font-size: 1.06rem; font-weight: 400;
  color: var(--text-dim); line-height: 1.8;
  padding-left: 1.2rem; position: relative; margin-bottom: 0.5rem;
}
.detail-list li::before {
  content: '—'; position: absolute; left: 0; color: var(--text-faint);
}

.tag-row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem; }
.tag-row .tag {
  font-family: 'DM Mono', monospace;
  font-size: 0.62rem; letter-spacing: 0.1em;
  color: var(--slate-light);
  border: 1px solid rgba(92,122,143,0.3);
  padding: 0.25rem 0.55rem; border-radius: 1px;
}

.fig-row {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1rem; margin-bottom: 3rem; max-width: 1000px;
}
.fig-row.single { grid-template-columns: 1fr; max-width: 900px; }
.fig-row.narrow { grid-template-columns: 1fr; max-width: 520px; }
.fig-row figure { border: 1px solid var(--border); background: var(--bg-2); margin: 0; }
.fig-row img { display: block; width: 100%; }
.fig-row figcaption {
  font-size: 0.86rem; font-weight: 400;
  color: var(--text-mid); padding: 0.8rem 1rem; line-height: 1.6;
}

.page-links {
  display: flex; flex-wrap: wrap; gap: 2.5rem;
  margin-top: 1rem; margin-bottom: 1rem;
}

@media (max-width: 768px) {
  .fig-row { grid-template-columns: 1fr; }
  .flow-arrow { display: none; }
}

.detail-section p a {
  color: var(--slate-light); text-decoration: none;
  border-bottom: 1px solid rgba(138,172,190,0.35);
  transition: color 0.2s, border-color 0.2s;
}
.detail-section p a:hover { color: var(--text); border-color: var(--border-light); }
