@import url("/static/theme.css");

:root {
  --mast-h: 4.25rem;
}

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

html {
  background: var(--chassis);
  color: var(--ink);
  scroll-behavior: smooth;
}

body.site {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.5;
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 88% -8%, color-mix(in srgb, var(--amber) 16%, transparent), transparent 58%),
    radial-gradient(700px 380px at -10% 20%, color-mix(in srgb, var(--good) 7%, transparent), transparent 50%),
    linear-gradient(180deg, var(--chassis-2), var(--chassis) 28%);
}

a {
  color: var(--amber-hot);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--ink);
}

.skip {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  z-index: 20;
  padding: 0.55rem 0.8rem;
  background: var(--amber);
  color: var(--chassis);
  font-weight: 600;
  text-decoration: none;
}
.skip:focus {
  top: 0.75rem;
}

.mast {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--mast-h);
  padding: 0.65rem 1.25rem;
  padding-left: max(1.25rem, env(safe-area-inset-left));
  padding-right: max(1.25rem, env(safe-area-inset-right));
  background: color-mix(in srgb, var(--chassis) 88%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--ink);
  min-height: 44px;
}
.mark {
  width: 40px;
  height: 40px;
  overflow: hidden;
  display: grid;
  place-items: center;
  flex: 0 0 40px;
}
.mark img {
  width: 74px;
  height: 74px;
  display: block;
  object-fit: cover;
}
.wordmark span {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.7rem;
  letter-spacing: -0.03em;
  line-height: 1;
}
.wordmark .os {
  color: var(--amber);
}

.mast-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem 0.85rem;
}
.mast-nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 0.15rem;
}
.mast-nav a:hover {
  color: var(--amber-hot);
}
.mast-nav a[aria-current="page"] {
  color: var(--amber);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.55rem 1.05rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.98rem;
  text-decoration: none;
  cursor: pointer;
}
.btn-primary {
  background: var(--amber);
  color: var(--chassis);
  box-shadow: var(--elev-amber);
}
.btn-primary:hover {
  background: var(--amber-hot);
  color: var(--chassis);
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover {
  border-color: var(--amber);
  color: var(--amber-hot);
}
.mast-nav .btn-primary {
  color: var(--chassis);
  margin-left: 0.35rem;
}

.wrap {
  width: min(72rem, calc(100% - 2.5rem));
  margin: 0 auto;
}

main {
  padding-bottom: 4.5rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(16rem, 0.85fr);
  gap: 2.5rem 3rem;
  align-items: center;
  padding: 3.25rem 0 2.5rem;
}

.hero h1 {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.6rem, 7vw, 5.4rem);
  line-height: 0.92;
  letter-spacing: -0.03em;
  max-width: 14ch;
  text-wrap: balance;
}

.lede {
  margin: 0 0 1.5rem;
  max-width: 38rem;
  font-size: 1.12rem;
  color: var(--ink-dim);
}
:not(pre) > code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  white-space: nowrap;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.stage {
  position: relative;
  min-height: 22rem;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--panel) 80%, black), var(--panel));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.stage::before,
.stage::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 7px;
  border: 1px solid var(--amber);
  border-radius: 50%;
  opacity: 0.7;
}
.stage::before {
  top: 10px;
  left: 10px;
}
.stage::after {
  top: 10px;
  right: 10px;
}

.beetle {
  display: block;
  width: 100%;
  height: 15rem;
  object-fit: cover;
  object-position: 52% 46%;
  margin: 0.2rem 0 0;
  filter: drop-shadow(var(--shadow));
}

.console {
  margin: 0 1rem 1rem;
  padding: 0.85rem 1rem 1rem;
  background: var(--console);
  border-top: 1px dashed var(--amber);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--amber-hot);
  line-height: 1.55;
}
.console .prompt {
  color: var(--good);
}
.console code {
  font-family: inherit;
}

.band {
  padding: 3.25rem 0 0.5rem;
}
.band h2 {
  margin: 0 0 0.7rem;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}
.band > p,
.prose > p {
  color: var(--ink-dim);
  max-width: var(--measure);
}

.spec {
  margin: 1.75rem 0 0;
  border-top: 1px solid var(--line);
}
.spec > div {
  display: grid;
  grid-template-columns: minmax(9rem, 12.5rem) minmax(0, 1fr);
  gap: 0.4rem 1.5rem;
  padding: 1.15rem 0 1.05rem;
  border-bottom: 1px solid var(--line-soft);
}
.spec dt {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--amber);
}
.spec dd {
  margin: 0;
  max-width: 60ch;
}
.spec .tag {
  display: inline-block;
  margin-right: 0.35rem;
  padding: 0.08rem 0.4rem;
  border: 1px dashed var(--line);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--amber-hot);
}

.loop-board {
  margin-top: 1.5rem;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 70%, transparent);
  box-shadow: var(--shadow);
}
.loop-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px dashed var(--amber);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-dim);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.loop {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.loop li {
  position: relative;
  padding: 1.15rem 1rem 1.25rem;
  border-right: 1px solid var(--line-soft);
}
.loop li:last-child {
  border-right: 0;
}
.loop .idx {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-dim);
  margin-bottom: 0.35rem;
}
.loop h3 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: 1.45rem;
  letter-spacing: -0.02em;
}
.loop p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--ink-dim);
}
.loop li:not(:last-child)::after {
  content: "";
  position: absolute;
  right: -0.45rem;
  top: 1.55rem;
  width: 0.9rem;
  height: 0.9rem;
  border-top: 2px solid var(--amber);
  border-right: 2px solid var(--amber);
  transform: rotate(45deg);
  background: var(--panel);
  z-index: 1;
}

.loop.is-live li {
  animation: stage-heat 1.8s ease-out both;
}
.loop.is-live li:nth-child(2) { animation-delay: 0.12s; }
.loop.is-live li:nth-child(3) { animation-delay: 0.24s; }
.loop.is-live li:nth-child(4) { animation-delay: 0.36s; }
.loop.is-live li:nth-child(5) { animation-delay: 0.48s; }

@keyframes stage-heat {
  from { box-shadow: inset 0 0 0 0 transparent; }
  40% { box-shadow: inset 0 -3px 0 0 var(--amber); }
  to { box-shadow: inset 0 -2px 0 0 color-mix(in srgb, var(--amber) 55%, transparent); }
}

.loop-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-top: 1px solid var(--line);
}
.loop-meta article {
  padding: 1rem 1.1rem 1.15rem;
}
.loop-meta article + article {
  border-left: 1px solid var(--line-soft);
}
.loop-meta h3 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
}
.loop-meta p {
  margin: 0;
  color: var(--ink-dim);
  font-size: 0.95rem;
}

.planes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin-top: 1.25rem;
  background: var(--line);
  border: 1px solid var(--line);
}
.planes article {
  background: var(--chassis);
  padding: 1.1rem 1.15rem 1.2rem;
}
.planes h3 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
}

.steps {
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: start;
}
.steps li {
  counter-increment: start;
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr);
  gap: 0.85rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line-soft);
}
.steps li::before {
  content: counter(start);
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--amber);
  line-height: 1;
}
.steps li > div > strong:first-of-type {
  display: block;
  margin-bottom: 0.2rem;
}

.callout {
  margin: 1.5rem 0 0;
  padding: 1rem 1.1rem;
  border: 1px dashed var(--amber);
  background: color-mix(in srgb, var(--amber) 8%, transparent);
}
.callout strong {
  color: var(--amber-hot);
}

.soon {
  margin-top: 1.5rem;
  padding: 1.2rem 1.15rem 1.3rem;
  background: var(--panel);
  border: 1px solid var(--line);
}
.soon h3 {
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-size: 1.4rem;
}
.soon p {
  margin: 0 0 0.7rem;
  color: var(--ink-dim);
}
.soon p:last-child {
  margin-bottom: 0;
}

.foot {
  margin-top: 3rem;
  padding: 1.25rem 0 calc(1.5rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  color: var(--ink-dim);
  font-size: 0.95rem;
}
.foot a {
  color: var(--ink);
  text-decoration: none;
}
.foot a:hover {
  color: var(--amber-hot);
}
.made {
  font-weight: 600;
  color: var(--ink);
}

.doc {
  padding: 2.4rem 0 1rem;
  max-width: 46rem;
}
.doc h1 {
  margin: 0 0 0.7rem;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  letter-spacing: -0.03em;
  line-height: 0.95;
}
.doc h2 {
  margin: 2.4rem 0 0.55rem;
  font-family: var(--font-display);
  font-size: 1.8rem;
  letter-spacing: -0.02em;
}
.doc h3 {
  margin: 1.4rem 0 0.4rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
}
.doc ul,
.doc ol {
  padding-left: 1.2rem;
}
.doc li {
  margin: 0.35rem 0;
}
.doc pre {
  margin: 1rem 0;
  padding: 0.9rem 1rem;
  overflow: auto;
  background: var(--console);
  border: 1px solid var(--line);
  color: var(--amber-hot);
  font-family: var(--font-mono);
  font-size: 0.88rem;
}
.doc code {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

@media (max-width: 880px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 1.8rem;
  }
  .hero h1 {
    max-width: 12ch;
  }
  .loop,
  .loop-meta,
  .planes,
  .spec > div {
    grid-template-columns: 1fr;
  }
  .loop li {
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
    padding-left: 1.15rem;
  }
  .loop li:not(:last-child)::after {
    right: auto;
    left: 0.35rem;
    top: auto;
    bottom: -0.42rem;
    transform: rotate(135deg);
  }
  .loop-meta article + article {
    border-left: 0;
    border-top: 1px solid var(--line-soft);
  }
  .stage {
    min-height: 0;
  }
}

@media (max-width: 520px) {
  .wrap {
    width: min(100% - 1.5rem, 72rem);
  }
  .mast {
    align-items: flex-start;
    flex-direction: column;
    padding-top: 0.7rem;
    padding-bottom: 0.55rem;
  }
  .mast-nav {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .loop.is-live li,
  .loop.is-live li:nth-child(n) {
    animation: none;
    box-shadow: none;
  }
}
