:root {
  --bg: #f7f1e6;
  --bg-strong: #fffaf1;
  --surface: rgba(255, 250, 241, 0.86);
  --surface-strong: #fffaf1;
  --ink: #161a27;
  --muted: #596273;
  --line: rgba(22, 26, 39, 0.12);
  --shadow: 0 18px 50px rgba(22, 26, 39, 0.12);
  --orange: #ff6b2c;
  --orange-deep: #d94b14;
  --teal: #1da8a0;
  --lime: #31905f;
  --amber: #d59b22;
  --red: #d55257;
  --navy: #171c2d;
  --navy-soft: #212842;
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --page-width: 1200px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top right, rgba(29, 168, 160, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0)),
    repeating-linear-gradient(
      90deg,
      rgba(22, 26, 39, 0.03) 0,
      rgba(22, 26, 39, 0.03) 1px,
      transparent 1px,
      transparent 36px
    ),
    var(--bg);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.page-shell {
  min-height: 100vh;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 2rem;
  align-items: end;
  overflow: clip;
  padding: 3rem clamp(1.25rem, 4vw, 3rem) 2.75rem;
  color: #f7f0e2;
  background:
    radial-gradient(circle at 82% 20%, rgba(255, 107, 44, 0.34), transparent 18%),
    radial-gradient(circle at 92% 76%, rgba(29, 168, 160, 0.24), transparent 18%),
    linear-gradient(135deg, #181d30 0%, #111626 56%, #222b45 100%);
}

.hero__noise {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.7), transparent);
  pointer-events: none;
}

.hero__copy,
.hero__diagram {
  position: relative;
  z-index: 1;
}

.hero__brand,
.hero__eyebrow,
.panel__eyebrow {
  margin: 0 0 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 700;
}

.hero__brand {
  color: #fdb594;
}

.hero__eyebrow {
  color: #71dfd7;
}

.hero h1 {
  max-width: 11ch;
  margin: 0;
  font-family: "Avenir Next Condensed", "Avenir Next", "Trebuchet MS", sans-serif;
  font-size: clamp(2.8rem, 7vw, 5rem);
  line-height: 0.94;
  letter-spacing: -0.04em;
}

.hero__lede {
  max-width: 48ch;
  margin: 1.15rem 0 0;
  color: rgba(247, 240, 226, 0.84);
  font-size: 1.05rem;
  line-height: 1.6;
}

.hero__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.hero__chips span,
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
}

.hero__chips span {
  border: 1px solid rgba(247, 240, 226, 0.16);
  background: rgba(255, 255, 255, 0.08);
}

.hero__diagram {
  display: grid;
  justify-items: center;
  gap: 1rem;
  padding-bottom: 0.5rem;
}

.hero__diagram-box {
  position: relative;
  width: min(36vw, 320px);
  aspect-ratio: 1;
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04)),
    rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.hero__cube {
  position: absolute;
  inset: 22% 24% 26% 20%;
  border: 2px solid rgba(247, 240, 226, 0.86);
  border-radius: 24px 18px 18px 18px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 107, 44, 0.3),
    0 0 0 1px rgba(29, 168, 160, 0.15);
  transform: skew(-10deg);
}

.hero__cube::before,
.hero__cube::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}

.hero__cube::before {
  inset: auto -20% 14% 0;
  border-top: 2px solid rgba(247, 240, 226, 0.45);
  transform: skewY(22deg);
}

.hero__cube::after {
  inset: -18% 0 auto 12%;
  border-left: 2px solid rgba(247, 240, 226, 0.4);
  transform: skewX(30deg);
}

.hero__axis {
  position: absolute;
  font-size: 0.9rem;
  font-weight: 800;
}

.hero__axis--x {
  right: 10%;
  bottom: 20%;
  color: #fdb594;
}

.hero__axis--y {
  left: 18%;
  bottom: 8%;
  color: #71dfd7;
}

.hero__axis--z {
  left: 14%;
  top: 14%;
  color: #f6e5b5;
}

.hero__diagram-caption {
  margin: 0;
  color: rgba(247, 240, 226, 0.72);
  text-align: center;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 1.5rem;
  width: min(calc(100% - 2.5rem), var(--page-width));
  margin: -1.5rem auto 0;
  padding-bottom: 3rem;
}

.builder,
.inspector {
  border: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.builder {
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.inspector {
  position: sticky;
  top: 1rem;
  align-self: start;
  border-radius: var(--radius-lg);
  padding: 1.4rem;
}

.panel {
  padding: 1.5rem;
}

.panel + .panel {
  border-top: 1px solid var(--line);
}

.panel__header h2,
.inspector__header h2 {
  margin: 0;
  font-size: 1.55rem;
  line-height: 1.1;
}

.panel__header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.dropzone {
  display: grid;
  place-items: center;
  gap: 0.35rem;
  min-height: 220px;
  padding: 1.4rem;
  border: 2px dashed rgba(22, 26, 39, 0.18);
  border-radius: calc(var(--radius-lg) - 8px);
  background:
    radial-gradient(circle at top left, rgba(255, 107, 44, 0.12), transparent 26%),
    radial-gradient(circle at bottom right, rgba(29, 168, 160, 0.12), transparent 28%),
    var(--bg-strong);
  text-align: center;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background-color 180ms ease,
    box-shadow 180ms ease;
  outline: none;
}

.dropzone:hover,
.dropzone:focus-visible,
.dropzone.is-dragover {
  transform: translateY(-2px);
  border-color: rgba(255, 107, 44, 0.58);
  box-shadow: 0 14px 32px rgba(22, 26, 39, 0.1);
}

.dropzone__title {
  margin: 0;
  font-size: clamp(1.3rem, 2vw, 1.7rem);
  font-weight: 800;
}

.dropzone__subtitle,
.panel__status,
.panel__hint,
.field--notice p,
.empty-state p,
.methodology p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.panel__status {
  margin-top: 1rem;
  font-size: 0.98rem;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.field-grid--triple {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field {
  display: grid;
  gap: 0.48rem;
}

.field > span,
.field legend {
  font-size: 0.92rem;
  font-weight: 700;
}

.field input,
.field select {
  width: 100%;
  min-height: 3rem;
  padding: 0.78rem 0.9rem;
  border: 1px solid rgba(22, 26, 39, 0.14);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field input:focus,
.field select:focus {
  border-color: rgba(255, 107, 44, 0.58);
  outline: none;
  box-shadow: 0 0 0 4px rgba(255, 107, 44, 0.14);
}

.field input:disabled,
.field select:disabled {
  color: rgba(22, 26, 39, 0.58);
  background: rgba(22, 26, 39, 0.05);
  cursor: not-allowed;
}

.field--notice {
  align-content: start;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  background: rgba(29, 168, 160, 0.08);
}

.range-field {
  display: grid;
  gap: 0.65rem;
}

.range-field output {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-width: 4rem;
  padding: 0.38rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 107, 44, 0.1);
  color: var(--orange-deep);
  font-weight: 800;
}

input[type="range"] {
  min-height: auto;
  padding: 0;
  accent-color: var(--orange);
}

.toggle {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: center;
  min-height: 3rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid rgba(22, 26, 39, 0.14);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.9);
}

.toggle input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
}

.toggle__track {
  position: relative;
  width: 3rem;
  height: 1.7rem;
  border-radius: 999px;
  background: rgba(22, 26, 39, 0.16);
  transition: background 180ms ease;
}

.toggle__track::after {
  content: "";
  position: absolute;
  top: 0.18rem;
  left: 0.18rem;
  width: 1.34rem;
  height: 1.34rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 3px 10px rgba(22, 26, 39, 0.18);
  transition: transform 180ms ease;
}

.toggle input:checked + .toggle__track {
  background: rgba(255, 107, 44, 0.75);
}

.toggle input:checked + .toggle__track::after {
  transform: translateX(1.3rem);
}

.toggle__label {
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.45;
}

.share-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.78rem 1.1rem;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--orange), var(--orange-deep));
  color: #fff8ef;
  font-weight: 800;
  letter-spacing: 0.01em;
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(217, 75, 20, 0.22);
  outline: none;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  transform: none;
  box-shadow: none;
}

.button--secondary {
  background: var(--navy);
}

.inspector__header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
}

.status-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pill {
  background: rgba(22, 26, 39, 0.08);
  color: var(--navy);
}

.pill--quiet {
  background: rgba(22, 26, 39, 0.08);
  color: var(--muted);
}

.pill--good {
  background: rgba(49, 144, 95, 0.12);
  color: var(--lime);
}

.pill--warn {
  background: rgba(213, 155, 34, 0.14);
  color: #94640f;
}

.pill--bad {
  background: rgba(213, 82, 87, 0.13);
  color: #a33c43;
}

.results-root {
  margin-top: 1rem;
}

.notice {
  margin-top: 1rem;
  padding: 0.95rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(22, 26, 39, 0.08);
  background: rgba(22, 26, 39, 0.06);
  color: var(--ink);
  line-height: 1.5;
}

.notice--info {
  background: rgba(29, 168, 160, 0.08);
}

.notice--warn {
  background: rgba(213, 155, 34, 0.14);
}

.notice--bad {
  background: rgba(213, 82, 87, 0.12);
}

.empty-state {
  display: grid;
  gap: 0.55rem;
  padding: 1.35rem 0;
}

.empty-state__headline {
  color: var(--ink);
  font-size: 1.1rem;
  font-weight: 800;
}

.report {
  display: grid;
  gap: 1.2rem;
}

.report-section {
  display: grid;
  gap: 0.8rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.report-section:first-child {
  padding-top: 0;
  border-top: none;
}

.verdict {
  display: grid;
  gap: 0.45rem;
}

.verdict__title {
  margin: 0;
  font-size: clamp(1.6rem, 2vw, 2.1rem);
  line-height: 1;
}

.verdict__detail,
.report-note,
.metric-row small,
.fit-list li p,
.quote {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.report-grid--single {
  grid-template-columns: 1fr;
}

.metric-block {
  display: grid;
  gap: 0.45rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(22, 26, 39, 0.08);
}

.metric-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 700;
}

.metric-value {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.1;
}

.metric-value--xl {
  font-size: clamp(1.6rem, 3vw, 2rem);
}

.metric-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
}

.metric-row strong {
  font-size: 1rem;
}

.fit-list {
  display: grid;
  gap: 0.65rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.fit-list li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: start;
  padding: 0.8rem 0.9rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.62);
}

.fit-icon {
  display: grid;
  place-items: center;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  font-weight: 900;
}

.fit-icon--good {
  background: rgba(49, 144, 95, 0.14);
  color: var(--lime);
}

.fit-icon--bad {
  background: rgba(213, 82, 87, 0.14);
  color: var(--red);
}

.fit-list li h3 {
  margin: 0;
  font-size: 1rem;
}

.fit-list li strong {
  font-size: 0.95rem;
}

.note-box {
  padding: 0.95rem 1rem;
  border-radius: var(--radius-md);
  background: rgba(29, 168, 160, 0.08);
  color: var(--ink);
}

.note-box--warn {
  background: rgba(213, 155, 34, 0.12);
}

.note-box--bad {
  background: rgba(213, 82, 87, 0.1);
}

.preview-card {
  display: grid;
  gap: 0.9rem;
}

.preview-card__header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 1rem;
}

.button--ghost {
  min-height: 2.45rem;
  padding: 0.62rem 0.9rem;
  background: rgba(22, 26, 39, 0.08);
  color: var(--navy);
  box-shadow: none;
}

.button--ghost:hover,
.button--ghost:focus-visible {
  background: rgba(22, 26, 39, 0.12);
  box-shadow: none;
}

.preview-stage {
  position: relative;
  overflow: hidden;
  min-height: 290px;
  border-radius: calc(var(--radius-lg) - 6px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.1), transparent 45%),
    linear-gradient(180deg, #12192b 0%, #202a45 100%);
}

.preview-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 36px 36px;
  opacity: 0.35;
  pointer-events: none;
}

.preview-stage canvas {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 290px;
  touch-action: none;
  cursor: grab;
}

.preview-stage canvas.is-dragging {
  cursor: grabbing;
}

.preview-stage__badge {
  position: absolute;
  z-index: 2;
  right: 0.9rem;
  bottom: 0.9rem;
  padding: 0.38rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 250, 241, 0.12);
  color: rgba(255, 248, 239, 0.86);
  font-size: 0.8rem;
  font-weight: 700;
  backdrop-filter: blur(8px);
  pointer-events: none;
}

.inspector__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.methodology {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.methodology summary {
  cursor: pointer;
  font-weight: 800;
}

.methodology[open] p {
  margin-top: 0.7rem;
}

.noscript {
  padding: 1rem;
  text-align: center;
  background: #fff4d2;
  color: #7b4a00;
}

body.ready .hero__copy > *,
body.ready .hero__diagram,
body.ready .builder,
body.ready .inspector {
  animation: rise-in 680ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

body.ready .hero__copy > *:nth-child(2) {
  animation-delay: 60ms;
}

body.ready .hero__copy > *:nth-child(3) {
  animation-delay: 120ms;
}

body.ready .hero__copy > *:nth-child(4) {
  animation-delay: 180ms;
}

body.ready .hero__copy > *:nth-child(5) {
  animation-delay: 240ms;
}

body.ready .hero__diagram {
  animation-delay: 200ms;
}

body.ready .builder {
  animation-delay: 260ms;
}

body.ready .inspector {
  animation-delay: 320ms;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .hero,
  .workspace {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-bottom: 4.5rem;
  }

  .hero h1 {
    max-width: 12ch;
  }

  .hero__diagram {
    justify-items: start;
  }

  .hero__diagram-box {
    width: min(72vw, 320px);
  }

  .workspace {
    width: min(calc(100% - 1.5rem), var(--page-width));
    margin-top: -2.5rem;
  }

  .inspector {
    position: static;
  }
}

@media (max-width: 760px) {
  .field-grid,
  .field-grid--triple,
  .share-row,
  .report-grid {
    grid-template-columns: 1fr;
  }

  .preview-card__header {
    display: grid;
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 1.25rem 1rem 4rem;
  }

  .workspace {
    width: min(calc(100% - 1rem), var(--page-width));
  }

  .panel,
  .inspector {
    padding: 1.15rem;
  }

  .fit-list li {
    grid-template-columns: auto 1fr;
  }

  .fit-list li strong {
    grid-column: 2;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
