/* lestrrat-3d — showcase page */

:root {
  color-scheme: dark;

  --bg:        #0b1020;
  --bg-raised: #121a30;
  --bg-sunken: #080d1a;
  --rule:      #223052;
  --rule-soft: #1a2440;

  --fg:        #e6ecf7;
  --fg-muted:  #9fb0cc;
  --fg-faint:  #6d7f9e;

  --cyan:      #5ad1e6;
  --violet:    #9b8cf0;
  --coral:     #ff7f6b;
  --amber:     #f0b429;
  --green:     #63d29a;

  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: ui-sans-serif, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --measure: 68ch;
  --radius: 10px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 120% 80% at 50% -10%, #16224400 0%, transparent 70%),
    linear-gradient(var(--rule-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--rule-soft) 1px, transparent 1px);
  background-size: auto, 48px 48px, 48px 48px;
  background-attachment: fixed;
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  width: min(100% - 2.5rem, 1040px);
  margin-inline: auto;
}

a { color: var(--cyan); text-decoration-color: #5ad1e666; text-underline-offset: 3px; }
a:hover { color: #8ce4f4; text-decoration-color: currentColor; }

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: #ffffff0f;
  border: 1px solid var(--rule-soft);
  border-radius: 4px;
  padding: 0.08em 0.35em;
}

pre {
  margin: 1.25rem 0 0;
  padding: 0.95rem 1.1rem;
  background: var(--bg-sunken);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--cyan);
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.6;
}
pre code { background: none; border: 0; padding: 0; font-size: inherit; }

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

/* ---------- hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(4rem, 12vw, 8rem) 0 clamp(3rem, 8vw, 5rem);
  border-bottom: 1px solid var(--rule);
  background:
    radial-gradient(ellipse 90% 70% at 20% 0%, #5ad1e618, transparent 60%),
    radial-gradient(ellipse 70% 60% at 85% 10%, #9b8cf016, transparent 60%);
}

.hero .wrap { position: relative; }
.hero .wrap > * { position: relative; z-index: 1; }

/* The part behind the headline. It is a solidlens render of a body decad
   built from sketch profiles; tools/hero regenerates it. */
.hero .wrap::after {
  content: "";
  position: absolute;
  z-index: 0;
  top: 50%;
  right: clamp(-8rem, -5vw, -1rem);
  translate: 0 -50%;
  width: min(57%, 690px);
  aspect-ratio: 1300 / 950;
  background: url("hero.png") no-repeat center center / contain;
  opacity: 0.85;
  -webkit-mask-image: linear-gradient(100deg, transparent 10%, #000 46%);
  mask-image: linear-gradient(100deg, transparent 10%, #000 46%);
  pointer-events: none;
}

@media (max-width: 900px) {
  .hero .wrap::after {
    width: 112%;
    right: -26%;
    translate: 0 -56%;
    opacity: 0.16;
    -webkit-mask-image: none;
    mask-image: none;
  }
}

.eyebrow {
  margin: 0 0 1.1rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.09em;
  text-transform: lowercase;
  color: var(--cyan);
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 5.2vw, 3.35rem);
  line-height: 1.14;
  letter-spacing: -0.022em;
  font-weight: 650;
  max-width: 20ch;
}

.lede {
  margin: 1.5rem 0 0;
  max-width: var(--measure);
  font-size: clamp(1rem, 1.7vw, 1.12rem);
  color: var(--fg-muted);
}

.cta { margin: 2.25rem 0 0; display: flex; flex-wrap: wrap; gap: 0.75rem; }

.btn {
  display: inline-block;
  padding: 0.6rem 1.15rem;
  border-radius: 999px;
  border: 1px solid var(--cyan);
  background: #5ad1e61a;
  color: var(--cyan);
  font-size: 0.92rem;
  font-weight: 550;
  text-decoration: none;
}
.btn:hover { background: #5ad1e62e; color: #b6eef7; }
.btn-ghost { border-color: var(--rule); background: transparent; color: var(--fg-muted); }
.btn-ghost:hover { border-color: var(--fg-faint); background: #ffffff0a; color: var(--fg); }

/* ---------- sections ---------- */

.section { padding: clamp(3rem, 7vw, 4.5rem) 0 0; }

h2 {
  margin: 0;
  font-size: 0.85rem;
  font-family: var(--mono);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-faint);
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--rule);
}

.section-lede {
  margin: 1.5rem 0 0;
  max-width: var(--measure);
  color: var(--fg-muted);
}

/* ---------- stack diagram ---------- */

.stack {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.layer a {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 1rem;
  padding: 0.95rem 1.25rem;
  border: 1px solid var(--rule);
  border-left: 4px solid var(--accent, var(--cyan));
  border-radius: var(--radius);
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent, var(--cyan)) 12%, transparent), var(--bg-raised) 55%);
  text-decoration: none;
  color: inherit;
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.layer a:hover { transform: translateX(4px); border-color: var(--accent, var(--cyan)); }

.layer-name {
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent, var(--cyan));
  min-width: 9ch;
}
.layer-role { color: var(--fg-muted); font-size: 0.95rem; }

/* the arrow between layers */
.layer + .layer { position: relative; }
.layer + .layer::before {
  content: "↓";
  position: absolute;
  top: -0.72rem;
  left: 1.15rem;
  font-size: 0.8rem;
  line-height: 1;
  color: var(--fg-faint);
}

.layer-render { --accent: var(--coral); }
.layer-cad    { --accent: var(--amber); }
.layer-sketch { --accent: var(--violet); }
.layer-r3     { --accent: var(--cyan); }
.layer-units  { --accent: var(--green); }

/* ---------- cards ---------- */

.card {
  margin: 1.5rem 0 0;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--bg-raised);
  overflow: hidden;
}

.card-body { padding: clamp(1.4rem, 3vw, 2rem); }
.card-body > :first-child { margin-top: 0; }
.card-body p { max-width: var(--measure); }

.card h3 {
  margin: 0 0 0.15rem;
  font-family: var(--mono);
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.card h3 a { text-decoration: none; }
.card h3 a:hover { text-decoration: underline; }

.tagline {
  margin: 0 0 1rem;
  color: var(--fg);
  font-size: 1.02rem;
  font-weight: 500;
}

.card p { margin: 0 0 1rem; color: var(--fg-muted); }
.card p:last-child { margin-bottom: 0; }

.badge {
  display: inline-block;
  vertical-align: 0.28em;
  margin-left: 0.4rem;
  padding: 0.14rem 0.55rem;
  border: 1px solid var(--amber);
  border-radius: 999px;
  background: #f0b4291a;
  color: var(--amber);
  font-family: var(--sans);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.features { margin: 0 0 1rem; padding-left: 1.15rem; max-width: var(--measure); color: var(--fg-muted); }
.features li { margin-bottom: 0.4rem; }

.meta { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 1.25rem; }

.chip {
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--bg-sunken);
  color: var(--fg-faint);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
}
.chip-go   { border-color: #5ad1e64d; color: var(--cyan); }
.chip-py   { border-color: #f0b4294d; color: var(--amber); }

/* ---------- figures ---------- */

.card-figure {
  margin: 0;
  background: var(--plate, var(--bg-sunken));
  border-bottom: 1px solid var(--rule);
}
.card-figure img {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  object-position: center;
}

/* artwork that carries its own white page: float it on the dark ground */
.card-figure-contain {
  background: var(--bg-sunken);
  display: flex;
  justify-content: center;
  padding: 1.75rem 1.25rem;
}
.card-figure-contain img {
  width: auto;
  max-width: min(100%, 560px);
  max-height: 200px;
  background: var(--plate, #fff);
  border-radius: 8px;
  padding: 1rem 1.25rem;
}

.card-figure-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--rule);
}
.card-figure-row img { background: var(--plate, var(--bg-sunken)); max-height: 220px; }

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.75rem;
  margin: 1.4rem 0 0;
}
.gallery img { border: 1px solid var(--rule); border-radius: 6px; }

/* ---------- footer ---------- */

footer {
  margin-top: clamp(3.5rem, 8vw, 5.5rem);
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--rule);
  color: var(--fg-faint);
  font-size: 0.9rem;
}
footer p { margin: 0 0 0.6rem; max-width: var(--measure); }
footer p:last-child { margin-bottom: 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
