:root {
  --bg: #0a0a0a;
  --fg: #eaeaea;
  --muted: #9a9a9a;
  --accent: #7cff7c;
  --amber: #ffcc66;

  --space-1: 8px;
  --space-2: 12px;
  --space-3: 18px;
  --space-4: 24px;
  --space-5: 28px;
  --space-6: 32px;
  --space-7: 48px;

  --container-max: 920px;
  --fs-mark-min: 32px;
  --fs-mark-fluid: 7vw;
  --fs-mark-max: 72px;
  --lh-mark: 1.05;
  --fs-tagline-min: 15px;
  --fs-tagline-fluid: 2vw;
  --fs-tagline-max: 19px;
  --lh-tagline: 1.7;
  --fs-body: 14px;
  --lh-body: 1.8;
  --fs-meta: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: "IBM Plex Mono", "JetBrains Mono", "Source Code Pro", "Courier New", monospace;
}

.shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
}

.frame {
  width: 100%;
  max-width: var(--container-max);
  border: 1px solid rgba(234, 234, 234, 0.16);
  box-shadow: 0 0 0 1px rgba(124, 255, 124, 0.04) inset;
  background: linear-gradient(rgba(124, 255, 124, 0.03), rgba(124, 255, 124, 0.03)), var(--bg);
  padding: var(--space-5) var(--space-5) var(--space-4);
}

.domain {
  margin: 0 0 var(--space-3);
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: lowercase;
  font-size: var(--fs-meta);
}

.mark {
  margin: 0;
  font-size: clamp(var(--fs-mark-min), var(--fs-mark-fluid), var(--fs-mark-max));
  line-height: var(--lh-mark);
  font-weight: 400;
  letter-spacing: 0.01em;
  word-break: break-word;
}

.slash {
  color: var(--accent);
}

.tagline {
  margin: var(--space-5) 0 0;
  max-width: 44rem;
  font-size: clamp(var(--fs-tagline-min), var(--fs-tagline-fluid), var(--fs-tagline-max));
  line-height: var(--lh-tagline);
}

.subline {
  margin: var(--space-3) 0 0;
  max-width: 40rem;
  color: rgba(234, 234, 234, 0.82);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
}

.domain-link {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.domain-link a {
  color: inherit;
  text-decoration: none;
}

.domain-link a:hover {
  color: var(--accent);
}

.meta-link {
  margin-top: 32px;
  font-size: 12px;
  color: var(--muted);
}

.meta-link a {
  color: inherit;
  text-decoration: none;
}

.meta-link a:hover {
  color: var(--accent);
}

.meta-link a:focus-visible,
.module-link:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
  color: var(--accent);
}

.modules {
  margin-top: 28px;
  font-size: 14px;
  line-height: 1.8;
}

.modules-title {
  margin-bottom: 6px;
  color: var(--muted);
}

.module-line {
  display: flex;
  gap: 1ch;
  font-family: inherit;
}

.status {
  margin-right: 8px;
  color: rgba(234, 234, 234, 0.38); /* decay (default fallback) */
}

/* Module state intensity palette (least → most) */
.status[data-state="decay"] {
  color: rgba(234, 234, 234, 0.38);
}

.status[data-state="latent"] {
  color: var(--muted);
}

.status[data-state="ignition"] {
  color: var(--accent);
}

.status[data-state="propagation"] {
  color: var(--amber);
}

.status[data-state="sustained"] {
  color: rgba(234, 234, 234, 0.96);
  text-shadow: 0 0 14px rgba(124, 255, 124, 0.12);
}

.module-link,
.module-name {
  color: inherit;
  text-decoration: none;
  font-family: inherit;
  text-transform: lowercase;
}

.module-name {
  opacity: 0.78;
}

.module-link {
  position: relative;
}

/* Subtle "clickable" cue without underline/color shift */
.module-link::after {
  content: "›";
  display: inline-block;
  margin-left: 0.5ch;
  opacity: 0.35;
  transform: translateY(-0.02em);
  transition: opacity 160ms ease, transform 160ms ease;
}

.module-link:hover::after,
.module-link:focus-visible::after {
  opacity: 0.7;
  transform: translate(0.12ch, -0.02em);
}

.module-link:hover {
  color: var(--accent);
}

.meta-divider {
  margin-bottom: 4px;
  line-height: 1;
  color: var(--muted);
  opacity: 0.6;
}

.meta {
  margin-top: 32px;
  font-size: 12px;
  line-height: 1.8;
  color: var(--muted);
  opacity: 0.6;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.meta div {
  white-space: nowrap;
}

@media (max-width: 640px) {
  .shell {
    align-items: flex-start;
    padding: var(--space-3);
  }

  .frame {
    padding: 22px 18px 20px;
  }

  .domain {
    margin-bottom: var(--space-2);
  }

  .meta {
    margin-top: 36px;
    gap: 8px 18px;
  }

  .meta span:not(:last-child)::after {
    right: -10px;
  }
}

.module-title {
  margin: 0 0 var(--space-5);
  font-size: clamp(var(--fs-mark-min), var(--fs-mark-fluid), var(--fs-mark-max));
  line-height: var(--lh-mark);
  font-weight: 400;
  letter-spacing: 0.01em;
}

/* will.system page */

.frame--will {
  position: relative;
  min-height: 420px;
  overflow: hidden;
}

/* When the SVG origin appears, collapse the frame so the page doesn't
   reserve the full “system” height (keeps only enough space for the logo). */
.frame--will.logo-only {
  min-height: calc(min(220px, 52vw) + 48px);
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
  overflow: visible;
}

.system {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0);
  transition:
    opacity 6s ease,
    filter 6s ease,
    transform 6s ease;
}

.system.degrading {
  opacity: 0;
  filter: blur(3px);
  transform: translateY(4px);
}

.module-title {
  margin: 0;
  font-size: clamp(30px, 6vw, 68px);
  line-height: var(--lh-mark);
  font-weight: 400;
  letter-spacing: 0.01em;
}

.module-semantics {
  margin: 24px 0 0;
  color: rgba(255, 204, 102, 0.78);
  font-size: var(--fs-body);
  line-height: 1.7;
}

.module-block {
  margin: 24px 0 0;
  max-width: 40rem;
  font-size: clamp(var(--fs-tagline-min), var(--fs-tagline-fluid), var(--fs-tagline-max));
  line-height: var(--lh-body);
}

.module-ellipsis {
  margin-top: 20px;
  color: var(--muted);
}

.origin {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 4s ease;
  padding: 0;
}

.origin.visible {
  opacity: 1;
  pointer-events: auto;
}

.origin-mark {
  width: min(220px, 52vw);
  max-width: 100%;
  aspect-ratio: 1 / 1;
  color: var(--fg);
  opacity: 0.94;
}

.origin-link {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.origin-link:hover .origin-mark,
.origin-link:focus-visible .origin-mark {
  color: var(--accent);
  opacity: 1;
}

.origin-link:focus-visible {
  outline: none;
}

.origin-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.origin-caption {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  color: rgba(234, 234, 234, 0.64);
}

.origin-link:hover .origin-caption,
.origin-link:focus-visible .origin-caption {
  color: rgba(124, 255, 124, 0.86);
}

@media (prefers-reduced-motion: reduce) {
  .system,
  .origin {
    transition: none;
  }
}

@media (max-width: 640px) {
  .frame--will {
    min-height: 70vh;
  }

  .frame--will.logo-only {
    min-height: min(220px, 52vw);
  }
}
