:root {
  color-scheme: dark;
  --bg: #141728;
  --paper: rgba(14, 18, 34, 0.24);
  --paper-2: rgba(14, 18, 34, 0.36);
  --ink: #ecf0ff;
  --ink-soft: #c7cde9;
  --line: rgba(236, 240, 255, 0.2);
  --accent: #55529a;
  --accent-2: #8f6f66;
  --accent-3: #4f7f79;
  --danger: #c65b68;
  --warn: #bb8b4a;
  --ok: #4b8a63;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", "Inter", "Segoe UI", sans-serif;
  line-height: 1.45;
  color: var(--ink);
  background: #090b16;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 22%, rgba(6, 8, 16, 0.16), rgba(6, 8, 16, 0.52)),
    linear-gradient(to bottom, rgba(4, 6, 12, 0.36), rgba(4, 6, 12, 0.44));
}

.bg-video-wrap {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.bg-video-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(190, 215, 255, 0.08) 0px,
      rgba(190, 215, 255, 0.08) 1px,
      transparent 1px,
      transparent 7px
    ),
    linear-gradient(to bottom, rgba(6, 10, 22, 0.1), rgba(6, 10, 22, 0.18));
  animation: glitch-scan 4.6s linear infinite;
}

.bg-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  filter: hue-rotate(-18deg) saturate(1.18) contrast(1.2) brightness(0.9);
  transition: filter 400ms ease;
  animation: glitch-flicker 3.4s steps(2, end) infinite;
}

/* Disable optional decorative overlay layers by default. */
.cursor-glow,
.spark-layer,
.blob {
  display: none;
}

.shell {
  position: relative;
  z-index: 2;
  width: min(1080px, calc(100% - 2rem));
  margin: 2.4rem auto 3.5rem;
  background: transparent;
  backdrop-filter: none;
  border: 0;
  border-radius: 0;
  padding: 2rem 1.5rem 2.3rem;
  box-shadow: none;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.5);
}

.shell::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(
      102deg,
      transparent 0%,
      transparent 18%,
      rgba(236, 240, 255, 0.08) 18.2%,
      transparent 19%,
      transparent 100%
    );
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.4rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  transform: none;
}

.hero {
  margin-bottom: 1.8rem;
  padding-bottom: 1.3rem;
  border-bottom: 1px solid rgba(236, 240, 255, 0.38);
}

h1 {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
  font-size: clamp(1.85rem, 4.1vw, 2.65rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.12;
  max-width: 18ch;
}

.lead {
  margin: 0.9rem 0 0;
  color: var(--ink-soft);
  line-height: 1.5;
  max-width: 56ch;
}

.studio {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 1.8rem;
  align-items: start;
}

.pinboard {
  padding: 0.2rem 0.3rem 0.4rem;
  border-right: 1px solid rgba(236, 240, 255, 0.24);
}

.pinboard h2 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

.note-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.note {
  display: inline-flex;
  padding: 0.42rem 0.7rem;
  border-radius: 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(236, 240, 255, 0.26);
  font-size: 0.82rem;
  color: var(--ink);
  cursor: grab;
  touch-action: none;
  letter-spacing: 0.01em;
}

.note:nth-child(2n) {
  background: transparent;
  transform: none;
}

.note:nth-child(3n) {
  transform: none;
}

.note.dragging,
.flag-card.dragging {
  cursor: grabbing;
  z-index: 14;
}

form {
  background: transparent;
  border: 0;
  padding: 0;
}

.field + .field {
  margin-top: 1rem;
}

label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.82rem;
  color: var(--ink-soft);
  font-weight: 600;
}

.lane {
  padding: 0.72rem 0 0.86rem 1rem;
  border-left: 1px solid rgba(236, 240, 255, 0.36);
  border-radius: 0;
  background: transparent;
  position: relative;
}

.lane::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 1.05rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.9;
}

.lane-url {
  color: var(--accent);
}

.lane-file {
  color: var(--accent-3);
}

.lane-text {
  color: var(--accent-2);
}

input[type="url"],
input[type="file"],
textarea {
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(236, 240, 255, 0.45);
  background: transparent;
  color: var(--ink);
  border-radius: 0;
  padding: 0.72rem 0;
  font: inherit;
}

input[type="file"]::file-selector-button {
  background: transparent;
  color: var(--ink);
  border: 0;
  border-bottom: 1px solid rgba(236, 240, 255, 0.45);
  margin-right: 0.7rem;
  padding: 0.2rem 0;
  font: inherit;
  cursor: pointer;
}

textarea {
  min-height: 160px;
  line-height: 1.45;
  resize: vertical;
}

input:focus-visible,
textarea:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(85, 82, 154, 0.3);
  outline-offset: 1px;
}

.divider {
  margin: 1rem 0 0.2rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #d5dbf4;
  font-size: 0.71rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.divider::before,
.divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: rgba(236, 240, 255, 0.28);
}

.mode-toggle {
  display: inline-flex;
  gap: 0.55rem;
  padding: 0;
  border: 0;
  background: transparent;
}

.mode-option {
  position: relative;
}

.mode-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mode-option span {
  display: inline-block;
  padding: 0.22rem 0.2rem;
  border-radius: 0;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  color: #b8c0e3;
  border-bottom: 2px solid transparent;
  transition: color 140ms ease, border-color 140ms ease;
}

.mode-option input:checked + span {
  background: transparent;
  color: #f1f4ff;
  border-bottom-color: var(--accent);
}

.mode-option input:focus-visible + span {
  outline: 2px solid rgba(85, 82, 154, 0.3);
  outline-offset: 2px;
}

.text-meta {
  margin-top: 0.45rem;
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: #d4daf4;
}

.text-meta .ok {
  color: var(--ok);
}

.text-meta .warn {
  color: #a45f08;
}

button {
  width: 100%;
  margin-top: 1.1rem;
  border: 0;
  border-radius: 0;
  padding: 0.8rem 0;
  background: transparent;
  color: #f6f8ff;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  border-bottom: 1px solid rgba(236, 240, 255, 0.5);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

button[disabled] {
  opacity: 0.62;
  cursor: wait;
}

.status {
  margin: 1.3rem 0 0;
  color: #d6dbf0;
  font-size: 0.93rem;
}

.summary,
.results {
  margin-top: 1rem;
  display: grid;
  gap: 0.65rem;
}

.summary-strip,
.results-head {
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(236, 240, 255, 0.32);
  border-radius: 0;
  padding: 0.72rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.summary-label {
  font-size: 0.88rem;
  color: #e6eaff;
}

.summary-label strong {
  color: #f7f8ff;
}

.meter {
  display: flex;
  gap: 0.3rem;
}

.meter-seg {
  width: 30px;
  height: 8px;
  border-radius: 999px;
  background: rgba(17, 19, 38, 0.12);
}

.meter-seg.active {
  background: var(--accent);
}

.counts {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.count-pill,
.risk-pill {
  border-radius: 0;
  border: 0;
  border-bottom: 1px solid rgba(236, 240, 255, 0.42);
  background: transparent;
  padding: 0.14rem 0.08rem;
  font-size: 0.76rem;
  color: #f3f5ff;
}

.results-board {
  position: relative;
  display: grid;
  gap: 1.15rem;
}

.results-spine {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 15px;
  width: 2px;
  background: rgba(85, 82, 154, 0.28);
}

.timeline-node {
  position: relative;
  margin-left: 2rem;
  display: grid;
  gap: 0.45rem;
}

.pin-node {
  position: absolute;
  left: -2rem;
  top: 0.8rem;
  width: 22px;
  height: 22px;
  margin: 0;
  border-radius: 999px;
  border: 2px solid #fff;
  background: var(--accent-2);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 700;
  padding: 0;
}

.flag-card {
  background: transparent;
  border: 0;
  border-left: 1px solid rgba(236, 240, 255, 0.36);
  border-radius: 0;
  padding: 0.72rem 0 0.72rem 1rem;
  cursor: grab;
  touch-action: none;
  position: relative;
}

.flag-card::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 1rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(236, 240, 255, 0.85);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
}

.flag-title {
  margin: 0;
  font-size: 1rem;
}

.badge {
  border-radius: 999px;
  padding: 0.18rem 0.5rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  color: #fff;
}

.severity-critical,
.severity-high {
  background: var(--danger);
}

.severity-medium {
  background: var(--warn);
}

.severity-low {
  background: var(--ok);
}

.clause-type {
  margin: 0.4rem 0 0.3rem;
  font-size: 0.78rem;
  color: #d2d8f6;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.plain,
.impact {
  margin: 0.3rem 0;
  color: #edf0ff;
  line-height: 1.45;
}

.quote {
  margin: 0.56rem 0 0;
  padding: 0.3rem 0 0.3rem 0.8rem;
  border-left: 1px solid rgba(236, 240, 255, 0.45);
  background: transparent;
  border-radius: 0;
  color: #e8ecff;
  font-style: italic;
}

.fun-row {
  margin-top: 0.62rem;
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.react-btn {
  margin: 0;
  width: auto;
  border: 0;
  border-bottom: 1px solid rgba(236, 240, 255, 0.34);
  background: transparent;
  color: #d8def9;
  border-radius: 0;
  padding: 0.24rem 0.56rem;
  font-size: 0.74rem;
}

.react-btn.is-on {
  background: transparent;
  color: #fff;
  border-bottom-color: #fff;
}

.hidden {
  display: none;
}

.egg-toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 7;
  padding: 0.35rem 0;
  color: #f4f6ff;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255, 255, 255, 0.7);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.65);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 220ms ease, transform 220ms ease;
}

.egg-toast.is-on {
  opacity: 1;
  transform: translateY(0);
}

body.egg-night-vision .bg-video {
  filter: hue-rotate(86deg) saturate(1.25) contrast(1.08) brightness(0.82);
}

body.egg-night-vision .results-spine {
  background: rgba(78, 220, 152, 0.8);
}

body.egg-party .bg-video {
  animation: egg-video-pulse 8s ease-in-out infinite alternate;
}

body.egg-party .brand-logo {
  animation: egg-logo-spin 2.4s linear infinite;
}

body.egg-laser-lines::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(170, 208, 255, 0.08) 0px,
      rgba(170, 208, 255, 0.08) 1px,
      transparent 1px,
      transparent 8px
    );
  mix-blend-mode: screen;
}

@keyframes egg-video-pulse {
  0% {
    filter: hue-rotate(-8deg) saturate(1.06) contrast(1.12) brightness(0.93);
  }
  50% {
    filter: hue-rotate(8deg) saturate(1.35) contrast(1.18) brightness(0.88);
  }
  100% {
    filter: hue-rotate(-14deg) saturate(1.24) contrast(1.15) brightness(0.9);
  }
}

@keyframes egg-logo-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes glitch-flicker {
  0%,
  100% {
    filter: hue-rotate(-18deg) saturate(1.18) contrast(1.2) brightness(0.9);
  }
  8% {
    filter: hue-rotate(-26deg) saturate(1.34) contrast(1.28) brightness(0.86);
  }
  9% {
    filter: hue-rotate(-14deg) saturate(1.12) contrast(1.16) brightness(0.92);
  }
  58% {
    filter: hue-rotate(-30deg) saturate(1.4) contrast(1.3) brightness(0.84);
  }
  59% {
    filter: hue-rotate(-18deg) saturate(1.18) contrast(1.2) brightness(0.9);
  }
}

@keyframes glitch-scan {
  0% {
    transform: translateY(0);
    opacity: 0.9;
  }
  48% {
    transform: translateY(0);
    opacity: 0.88;
  }
  49% {
    transform: translateY(-2px);
    opacity: 1;
  }
  50% {
    transform: translateY(1px);
    opacity: 0.82;
  }
  100% {
    transform: translateY(0);
    opacity: 0.9;
  }
}

@media (max-width: 920px) {
  .shell {
    width: min(100%, calc(100% - 1rem));
    margin: 1rem auto 2rem;
    border-radius: 24px;
    padding: 1.25rem 1rem 1.5rem;
  }

  .studio {
    grid-template-columns: 1fr;
  }

  .pinboard {
    order: 2;
  }

  .timeline-node {
    margin-left: 1.7rem;
  }

  .pin-node {
    left: -1.7rem;
  }
}

