:root {
  --bg: #080807;
  --bg-elev: #10100e;
  --bg-panel: #141412;
  --bg-input: #1c1b18;
  --bg-hover: #22211d;
  --line: rgba(243, 239, 230, 0.08);
  --line-strong: rgba(243, 239, 230, 0.16);
  --text: #f3efe6;
  --text-dim: #9a9488;
  --text-faint: #6a655c;
  --gold: #d4b07a;
  --gold-soft: rgba(212, 176, 122, 0.14);
  --gold-deep: #b08a4e;
  --coral: #e07058;
  --coral-soft: rgba(224, 112, 88, 0.14);
  --sage: #8fa382;
  --sage-soft: rgba(143, 163, 130, 0.14);
  --white: #f3efe6;
  --sans: "Inter Tight", "Inter", ui-sans-serif, system-ui, sans-serif;
  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  --mono: "IBM Plex Mono", "SF Mono", ui-monospace, Menlo, monospace;
  --r: 8px;
  --r-sm: 6px;
  --max: 1120px;
  --header: 58px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

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

html {
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
  background:
    radial-gradient(900px 480px at 12% -10%, rgba(212, 176, 122, 0.09), transparent 55%),
    radial-gradient(700px 420px at 100% 0%, rgba(224, 112, 88, 0.05), transparent 50%),
    var(--bg);
  color: var(--text);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 40;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

::selection {
  background: var(--gold);
  color: #1a140c;
}

:focus-visible {
  outline: 1.5px solid var(--gold);
  outline-offset: 2px;
}

button,
input {
  font-family: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--gold);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--gold);
  color: #1a140c;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  z-index: 50;
}

.skip:focus {
  top: 12px;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: var(--header);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 8, 7, 0.78);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: -0.03em;
  font-size: 15px;
}

.brand:hover {
  text-decoration: none;
  color: var(--text);
}

.brand svg {
  display: block;
}

.brand-mark {
  width: 22px;
  height: 22px;
}

.brand-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.brand-sub {
  margin: 0 0 0 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 2px 14px;
  font-size: 11px;
  line-height: 1.35;
}

.brand-sub a {
  color: var(--text-dim);
}

.brand-sub a:hover {
  color: var(--gold);
}

.brand-sub a + a {
  color: var(--gold);
}

.header-mid {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--text-dim);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
}

.header-mid span + span::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-faint);
  margin-right: 18px;
  vertical-align: middle;
  transform: translateY(-1px);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.price-pill {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--text-dim);
  border: 1px solid var(--line);
  padding: 5px 9px;
  border-radius: 999px;
}

/* Buttons */

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  height: 36px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px);
}

.btn-gold {
  background: linear-gradient(180deg, #e1c08a 0%, var(--gold) 100%);
  color: #1a140c;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.28) inset, 0 8px 20px rgba(212, 176, 122, 0.12);
}

.btn-gold:hover {
  background: linear-gradient(180deg, #ebd09a 0%, #dcb67f 100%);
}

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border-color: var(--line);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: var(--bg-hover);
}

.btn-block {
  width: 100%;
  height: 44px;
  font-size: 14px;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* Layout */

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 36px 28px 80px;
  position: relative;
  z-index: 1;
}

.hero {
  position: relative;
  padding: 8px 0 36px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 32px;
}

.kicker {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}

.pain {
  margin: 0 0 18px;
  max-width: 54ch;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.45;
}

.label-short {
  display: none;
}

.headline {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(34px, 5.4vw, 56px);
  line-height: 1.12;
  letter-spacing: -0.025em;
  max-width: 18ch;
  color: var(--text);
}

.headline em {
  font-style: italic;
  color: var(--gold);
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}

.lede {
  margin: 18px 0 0;
  max-width: 62ch;
  color: var(--text-dim);
  font-size: 16px;
  line-height: 1.5;
}

.chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 26px 0 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.01em;
}

.chip strong {
  color: var(--text);
  font-weight: 600;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
}

.chip.is-warn {
  border-color: rgba(224, 112, 88, 0.35);
  background: var(--coral-soft);
  color: #f0c2b6;
}

.chip.is-warn strong {
  color: var(--coral);
}

.chip.is-ok {
  border-color: rgba(143, 163, 130, 0.35);
  background: var(--sage-soft);
}

.chip.is-ok strong {
  color: var(--sage);
}

/* Workspace */

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
}

.panel-head p,
.linkish {
  margin: 0;
  background: none;
  border: 0;
  color: var(--text-faint);
  font-size: 12px;
  font-weight: 500;
  padding: 0;
}

.linkish:hover {
  color: var(--gold);
}

.panel-body {
  padding: 16px 18px 18px;
}

.target-block {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 16px;
  align-items: center;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.target-block label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.target-block .hint {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 12px;
  color: var(--text-faint);
  line-height: 1.45;
}

.target-control {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-input);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 0 10px;
  height: 36px;
}

.target-control:focus-within {
  border-color: var(--gold-deep);
}

.target-control input {
  width: 52px;
  background: transparent;
  border: 0;
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  text-align: right;
  outline: none;
  font-variant-numeric: tabular-nums;
}

.target-control span {
  color: var(--text-dim);
  font-size: 12px;
}

#locations {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.loc {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-elev);
  overflow: hidden;
}

.loc.is-drag {
  border-color: rgba(224, 112, 88, 0.45);
  box-shadow: inset 3px 0 0 var(--coral);
}

.loc-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 8px;
}

.loc-name {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.02em;
  outline: none;
  padding: 2px 0;
}

.loc-name:hover,
.loc-name:focus {
  color: var(--gold);
}

.icon-btn {
  appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-faint);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {
  color: var(--text);
  border-color: var(--line);
  background: var(--bg-hover);
}

.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 10px;
  padding: 0 12px 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field.wide {
  grid-column: 1 / -1;
}

.field label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.field input {
  height: 34px;
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  padding: 0 10px;
  font-variant-numeric: tabular-nums;
  outline: none;
}

.field input:hover {
  border-color: var(--line-strong);
}

.field input:focus {
  border-color: var(--gold-deep);
  background: #211f1b;
}

.field input::placeholder {
  color: var(--text-faint);
}

.field .optional {
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  text-transform: none;
  font-size: 10px;
}

.loc-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px 10px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
}

.loc-foot .leak {
  color: var(--coral);
}

.loc-foot .ok {
  color: var(--sage);
}

.add-row {
  margin-top: 12px;
}

/* Output */

.output {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.math-card {
  padding: 18px 20px;
}

.math-card h2 {
  margin: 0 0 8px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}

.math-card p {
  margin: 0;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.55;
}

.math-card code {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--gold);
  background: var(--gold-soft);
  padding: 1px 5px;
  border-radius: 4px;
}

.gate-wrap {
  position: relative;
  min-height: 420px;
}

.gate {
  position: relative;
  overflow: hidden;
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
}

.gate-bg {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      -12deg,
      transparent,
      transparent 18px,
      rgba(255, 255, 255, 0.015) 18px,
      rgba(255, 255, 255, 0.015) 19px
    ),
    linear-gradient(180deg, #161512, #10100e);
  filter: blur(0.2px);
}

.gate-bg table {
  width: 100%;
  border-collapse: collapse;
  opacity: 0.28;
  filter: blur(5px);
  transform: scale(1.02);
  pointer-events: none;
  user-select: none;
}

.gate-bg td,
.gate-bg th {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  color: var(--text-dim);
  font-family: var(--mono);
}

.gate-card {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  background: rgba(16, 16, 14, 0.88);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 24px 24px 20px;
  box-shadow: var(--shadow);
  text-align: center;
  backdrop-filter: blur(12px);
}

.gate-card h3 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 400;
  letter-spacing: -0.02em;
}

.gate-card p {
  margin: 0 0 18px;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.5;
}

.gate-note {
  margin: 12px 0 0 !important;
  font-size: 12px !important;
  color: var(--text-faint) !important;
}

.gate-wrap {
  scroll-margin-top: calc(var(--header) + 24px);
}

.gate-wrap[hidden] {
  display: none;
}

.lead-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}

.lead-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lead-field > span {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.lead-field .optional {
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: none;
  color: var(--text-faint);
}

.lead-field input {
  height: 40px;
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
  padding: 0 12px;
  outline: none;
}

.lead-field input:focus {
  border-color: var(--gold-deep);
  background: #211f1b;
}

.lead-form .btn-block {
  margin-top: 6px;
}

.gate-card .form-error {
  margin: 0;
  font-size: 13px;
  color: #f0c2b6;
}

.form-error[hidden] {
  display: none;
}

/* Honeypot: invisible to people, still in the markup for bots and Netlify. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.report {
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: rise 0.45s ease both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

table.data th {
  text-align: right;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 0 12px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

table.data th:first-child,
table.data td:first-child {
  text-align: left;
  padding-left: 18px;
}

table.data th:last-child,
table.data td:last-child {
  padding-right: 18px;
}

table.data td {
  text-align: right;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
}

table.data td.name {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: -0.02em;
}

table.data tr.drag td {
  background: rgba(224, 112, 88, 0.06);
}

table.data tr.total td {
  border-bottom: 0;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.02);
}

table.data .neg {
  color: var(--coral);
}

table.data .pos {
  color: var(--sage);
}

.badge {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--coral-soft);
  color: var(--coral);
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.bars {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
  padding: 4px 18px 6px;
  height: 92px;
  align-items: end;
}

.bar-col {
  display: flex;
  gap: 3px;
  align-items: flex-end;
  height: 100%;
}

.bar {
  flex: 1;
  border-radius: 2px 2px 0 0;
  min-height: 4px;
}

.bar.now {
  background: var(--coral);
  opacity: 0.85;
}

.bar.hit {
  background: var(--gold);
  opacity: 0.9;
}

.legend {
  display: flex;
  gap: 16px;
  padding: 0 18px 14px;
  font-size: 11px;
  color: var(--text-faint);
}

.legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  margin-right: 6px;
}

.legend .now {
  background: var(--coral);
}

.legend .hit {
  background: var(--gold);
}

.note {
  margin: 0;
  padding: 0 18px 16px;
  font-size: 12px;
  color: var(--text-faint);
  line-height: 1.45;
}

.download-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  flex-wrap: wrap;
}

.download-row p {
  margin: 0;
  color: var(--text-dim);
  font-size: 13px;
  max-width: 48ch;
}

.download-row p strong {
  color: var(--text);
}

.download-row-sub {
  border-top: 1px solid var(--line);
}

.download-row-sub p {
  color: var(--text-faint);
  font-size: 12px;
}

a.btn:hover {
  text-decoration: none;
}

.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 8px 28px 48px;
  color: var(--text-faint);
  font-size: 12px;
  line-height: 1.6;
  position: relative;
  z-index: 1;
}

.site-footer strong {
  color: var(--text-dim);
  font-weight: 600;
}

.unlock-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--bg-panel);
  border: 1px solid var(--line-strong);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  z-index: 30;
  box-shadow: var(--shadow);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.unlock-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.hidden {
  display: none !important;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

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

  .header-mid {
    display: none;
  }

  .site-header,
  main,
  .site-footer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .headline {
    max-width: none;
  }

  .price-pill {
    display: none;
  }

  .label-full {
    display: none;
  }

  .label-short {
    display: inline;
  }
}

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

  .btn-gold.header-unlock {
    padding: 0 10px;
    font-size: 12px;
  }

  .download-row {
    align-items: stretch;
    flex-direction: column;
  }

  .download-row .btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
