:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-soft: #f2f3f5;
  --text: #111111;
  --muted: #6b7280;
  --line: rgba(17, 17, 17, 0.08);
  --accent: #ff5c38;
  --accent-soft: rgba(255, 92, 56, 0.14);
  --dark: #161823;
  --shadow: 0 18px 40px rgba(17, 17, 17, 0.05);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(255, 92, 56, 0.08), transparent 24%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
}

input,
button,
textarea,
select {
  font: inherit;
}

.page-shell {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.75rem 0 3rem;
}

.hero {
  margin-bottom: 1.15rem;
}

.eyebrow,
.panel-kicker,
.stack-label {
  margin: 0 0 0.45rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero h1,
.control-panel h2,
.stack-panel h2,
.stack-card h3,
.result-panel h3 {
  margin: 0;
  font-family: "Arial Black", "Avenir Next Condensed", "Inter", sans-serif;
  letter-spacing: -0.03em;
}

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  line-height: 0.94;
}

.hero-copy {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.layout {
  display: grid;
  grid-template-columns: minmax(320px, 390px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.control-panel,
.stack-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.control-panel {
  position: sticky;
  top: 1rem;
  padding: 1rem;
}

.stack-panel {
  padding: 1.2rem;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 0.8rem;
}

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

.field {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.field {
  display: grid;
  gap: 0.35rem;
  padding: 0.8rem;
}

.field span {
  font-size: 0.84rem;
  font-weight: 800;
}

.field input {
  width: 100%;
  border: 1px solid rgba(17, 17, 17, 0.12);
  border-radius: 12px;
  background: var(--surface-soft);
  padding: 0.8rem 0.9rem;
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
}

.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(255, 92, 56, 0.15);
}

.result-panel {
  margin-top: 0.75rem;
  padding: 0.9rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #111111 0%, var(--dark) 100%);
  color: #ffffff;
}

.result-panel__head {
  margin-bottom: 0.75rem;
}

.result-panel h3 {
  font-size: 1.35rem;
  line-height: 1.08;
}

.result-grid {
  display: grid;
  gap: 0.6rem;
}

.result-card {
  display: grid;
  gap: 0.35rem;
  padding: 0.8rem 0.9rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
}

.result-card--accent {
  background: linear-gradient(135deg, rgba(255, 92, 56, 0.18), rgba(255, 92, 56, 0.08));
}

.result-card span,
.featured-values span,
.featured-footer span {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.result-card strong {
  font-size: clamp(1.4rem, 3vw, 1.95rem);
  line-height: 1;
}

.rule-pills,
.top-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.rule-pills {
  margin-top: 0.7rem;
}

.rule-pill,
.stack-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.46rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.rule-pill {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.top-filters {
  justify-content: flex-end;
  align-items: center;
  gap: 0.4rem;
}

.filter-toggle {
  min-height: 34px;
  padding: 0 0.8rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease, color 160ms ease;
}

.filter-toggle:hover {
  transform: translateY(-1px);
}

.filter-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(255, 92, 56, 0.14);
}

.filter-toggle--on {
  background: rgba(34, 197, 94, 0.16);
  border-color: rgba(34, 197, 94, 0.24);
  color: #15803d;
}

.filter-toggle--off {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.2);
  color: #b91c1c;
  white-space: nowrap;
}

.stack-timeline {
  position: relative;
  display: grid;
  gap: 0.95rem;
  padding-left: 1.1rem;
}

.stack-timeline::before {
  content: "";
  position: absolute;
  left: 0.32rem;
  top: 0.55rem;
  bottom: 0.55rem;
  width: 2px;
  background: linear-gradient(180deg, rgba(255, 92, 56, 0.35), rgba(17, 17, 17, 0.08));
}

.stack-card {
  position: relative;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.stack-card::before {
  content: "";
  position: absolute;
  left: -1rem;
  top: 1.2rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(255, 92, 56, 0.14);
}

.stack-card--featured {
  background: linear-gradient(135deg, #111111 0%, var(--dark) 100%);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.08);
}

.stack-card--support::before {
  background: #111111;
  box-shadow: 0 0 0 6px rgba(17, 17, 17, 0.08);
}

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

.stack-chip {
  background: var(--surface-soft);
}

.stack-chip--featured {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.stack-value {
  display: block;
  margin-top: 0.9rem;
  font-size: clamp(1.55rem, 3vw, 2.1rem);
  line-height: 1;
}

.stack-meta {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.stack-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.85rem;
}

.stack-tag {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0.32rem 0.72rem;
  border: 1px solid rgba(255, 92, 56, 0.16);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 92, 56, 0.14), rgba(255, 92, 56, 0.05));
  color: #bb3f24;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1.15;
}

.stack-card--featured .stack-label,
.stack-card--featured .stack-meta {
  color: rgba(255, 255, 255, 0.72);
}

.stack-card--featured .stack-tag {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.stack-meta--light {
  margin-top: 0.45rem;
  font-size: 0.84rem;
}

.featured-values {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.9rem;
}

.featured-values div {
  padding: 0.95rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.07);
}

.featured-values strong {
  display: block;
  margin-top: 0.55rem;
  font-size: clamp(1.35rem, 3vw, 1.8rem);
}

.featured-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.featured-footer strong {
  font-size: 1.15rem;
}

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

  .control-panel {
    position: static;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 1rem, 100%);
  }

  .control-form,
  .featured-values {
    grid-template-columns: 1fr;
  }

  .panel-head,
  .stack-card__top,
  .featured-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .top-filters {
    justify-content: flex-start;
    width: 100%;
  }
}
