:root {
  color-scheme: dark;
  --ink: #f4f1e7;
  --muted: #9eaaa3;
  --panel: #0b2018;
  --panel-soft: #0f281e;
  --line: rgba(228, 222, 197, 0.14);
  --green: #1ecf83;
  --green-dark: #0aa967;
  --gold: #d6bd77;
  --danger: #ff856f;
  --page: #06140f;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 82% 3%, rgba(30, 207, 131, 0.12), transparent 28rem),
    radial-gradient(circle at 10% 40%, rgba(214, 189, 119, 0.07), transparent 32rem),
    var(--page);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button,
label[for] {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

.topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 74px;
  padding: 12px max(22px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(6, 20, 15, 0.84);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.08em;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: #052016;
  border-radius: 50%;
  background: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 14px;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.training-badge {
  padding: 7px 10px;
  color: var(--gold);
  border: 1px solid rgba(214, 189, 119, 0.4);
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  padding: clamp(64px, 10vw, 124px) 0 56px;
}

.eyebrow,
.step,
.result-kicker {
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.hero h1 {
  max-width: 870px;
  margin: 16px 0 24px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(48px, 8.5vw, 106px);
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: -0.055em;
}

.hero h1 em {
  color: var(--gold);
  font-weight: 400;
}

.hero-copy {
  max-width: 640px;
  color: #b8c2bc;
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.65;
}

.hero-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 30px;
  margin-top: 36px;
  color: var(--muted);
  font-size: 12px;
}

.hero-proof b {
  margin-right: 7px;
  color: var(--gold);
  font-size: 10px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
  gap: 18px;
  align-items: start;
}

.panel {
  padding: clamp(22px, 3.5vw, 38px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(15, 40, 30, 0.96), rgba(9, 29, 21, 0.96));
  box-shadow: var(--shadow);
}

.panel-heading,
.history-heading {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 26px;
}

.panel-heading h2,
.history-heading h2 {
  margin: 7px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 400;
}

.status-dot,
.confidence {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.status-dot::before {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 14px rgba(30, 207, 131, 0.7);
  content: "";
}

.dropzone {
  display: flex;
  min-height: 330px;
  padding: 30px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: var(--muted);
  border: 1px dashed rgba(30, 207, 131, 0.35);
  border-radius: 18px;
  background:
    linear-gradient(rgba(6, 20, 15, 0.4), rgba(6, 20, 15, 0.4)),
    repeating-linear-gradient(
      45deg,
      rgba(255, 255, 255, 0.015) 0,
      rgba(255, 255, 255, 0.015) 1px,
      transparent 1px,
      transparent 9px
    );
  text-align: center;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.dropzone.dragging,
.dropzone:hover {
  border-color: var(--green);
  background-color: rgba(30, 207, 131, 0.05);
  transform: translateY(-2px);
}

.dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.dropzone strong {
  margin: 18px 0 7px;
  color: var(--ink);
  font-size: 17px;
}

.dropzone > span:not(.camera-icon) {
  font-size: 12px;
}

.camera-icon {
  display: grid;
  width: 66px;
  height: 66px;
  place-items: center;
  color: var(--green);
  border: 1px solid rgba(30, 207, 131, 0.3);
  border-radius: 50%;
  background: rgba(30, 207, 131, 0.08);
  font-size: 34px;
}

.secondary-button,
.primary-button {
  border: 0;
  border-radius: 12px;
  font-weight: 800;
}

.secondary-button {
  margin-top: 22px;
  padding: 11px 18px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
}

.primary-button {
  display: flex;
  width: 100%;
  min-height: 54px;
  margin-top: 16px;
  padding: 0 18px;
  align-items: center;
  justify-content: space-between;
  color: #042016;
  background: var(--green);
  box-shadow: 0 10px 35px rgba(30, 207, 131, 0.18);
}

.primary-button:hover:not(:disabled) {
  background: #43dd99;
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.primary-button.loading span:first-child::after {
  content: "…";
}

.preview-shell {
  position: relative;
  min-height: 330px;
  overflow: hidden;
  border-radius: 18px;
  background: #03100c;
}

.preview-shell img {
  display: block;
  width: 100%;
  height: 330px;
  object-fit: contain;
}

.image-remove {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 8px 11px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(6, 20, 15, 0.88);
  font-size: 11px;
}

.inline-message {
  min-height: 18px;
  margin: 12px 2px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.inline-message.error {
  color: var(--danger);
}

form {
  display: grid;
  gap: 17px;
}

.field-grid {
  display: grid;
  gap: 14px;
}

.cards-grid {
  grid-template-columns: 0.8fr 1.2fr;
}

.numbers-grid {
  grid-template-columns: repeat(2, 1fr);
}

label > span {
  display: block;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 49px;
  padding: 0 13px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: none;
  background: rgba(4, 19, 13, 0.72);
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease;
}

input:focus,
select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(30, 207, 131, 0.1);
}

input::placeholder {
  color: #5f6f66;
}

.warnings {
  padding: 12px 14px;
  color: #edc68d;
  border: 1px solid rgba(214, 189, 119, 0.24);
  border-radius: 10px;
  background: rgba(214, 189, 119, 0.06);
  font-size: 12px;
  line-height: 1.55;
}

.calculate {
  margin-top: 8px;
}

.result-section {
  padding: 96px 0 30px;
  scroll-margin-top: 76px;
}

.result-kicker {
  margin-bottom: 15px;
}

.result-grid {
  display: grid;
  grid-template-columns: 1.45fr 0.55fr;
  overflow: hidden;
  border: 1px solid rgba(30, 207, 131, 0.26);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.decision-card {
  padding: clamp(30px, 6vw, 68px);
  background:
    radial-gradient(circle at 90% 20%, rgba(30, 207, 131, 0.14), transparent 15rem),
    #0c2c20;
}

.decision-label {
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.2em;
}

.decision-card h2 {
  margin: 12px 0 20px;
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(48px, 8vw, 96px);
  font-weight: 400;
  line-height: 0.98;
}

.decision-card > p {
  max-width: 720px;
  color: #c2cbc6;
  font-size: 16px;
  line-height: 1.7;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 38px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--line);
}

.metric-row div {
  padding: 17px;
  background: #092219;
}

.metric-row span,
.metric-row strong {
  display: block;
}

.metric-row span {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.metric-row strong {
  font-size: 16px;
  text-transform: capitalize;
}

.lesson-card {
  padding: 34px;
  background: #dac98f;
  color: #173024;
}

.lesson-number {
  display: inline-grid;
  min-width: 44px;
  height: 27px;
  padding: 0 9px;
  place-items: center;
  border: 1px solid rgba(23, 48, 36, 0.35);
  border-radius: 999px;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.lesson-card h3 {
  margin: 28px 0 14px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 29px;
  font-weight: 400;
}

.lesson-card p {
  font-size: 13px;
  line-height: 1.65;
}

.lesson-card .caveat {
  padding-top: 16px;
  border-top: 1px solid rgba(23, 48, 36, 0.2);
  opacity: 0.75;
}

.text-button {
  padding: 0;
  color: inherit;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  font-size: 11px;
  font-weight: 800;
}

.lesson-card .text-button {
  margin-top: 18px;
}

.history-section {
  padding: 90px 0 100px;
}

.history-heading {
  align-items: end;
}

.history-heading .eyebrow {
  margin: 0;
}

.history-heading h2 {
  font-size: 42px;
}

.danger {
  color: var(--danger);
}

.history-list {
  border-top: 1px solid var(--line);
}

.history-item {
  display: grid;
  grid-template-columns: 1.3fr 0.8fr 0.5fr;
  gap: 20px;
  padding: 20px 4px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.history-item span,
.history-item strong {
  display: block;
}

.history-item span {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.history-item strong {
  font-size: 14px;
}

.history-action {
  color: var(--green);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
}

.history-action.fold {
  color: var(--danger);
}

.history-equity {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.empty-state {
  padding: 30px 0;
  color: var(--muted);
  font-size: 13px;
}

footer {
  display: flex;
  min-height: 100px;
  padding: 28px max(22px, calc((100vw - 1180px) / 2));
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

footer strong {
  color: var(--ink);
  letter-spacing: 0.12em;
}

@media (max-width: 860px) {
  .workspace,
  .result-grid {
    grid-template-columns: 1fr;
  }

  .lesson-card {
    min-height: auto;
  }

  .hero h1 {
    max-width: 680px;
  }
}

@media (max-width: 580px) {
  main {
    width: min(100% - 22px, 1180px);
  }

  .topbar {
    min-height: 64px;
    padding: 10px 13px;
  }

  .training-badge {
    padding: 6px 8px;
    font-size: 8px;
  }

  .hero {
    padding-top: 62px;
  }

  .hero h1 {
    font-size: clamp(45px, 14vw, 70px);
  }

  .hero-proof {
    display: grid;
  }

  .panel {
    padding: 20px 16px;
    border-radius: 18px;
  }

  .panel-heading {
    gap: 12px;
  }

  .panel-heading h2 {
    font-size: 25px;
  }

  .dropzone,
  .preview-shell,
  .preview-shell img {
    min-height: 280px;
    height: 280px;
  }

  .cards-grid,
  .numbers-grid {
    grid-template-columns: 1fr;
  }

  .result-section {
    padding-top: 74px;
  }

  .decision-card {
    padding: 34px 20px;
  }

  .decision-card h2 {
    font-size: 52px;
  }

  .metric-row {
    grid-template-columns: 1fr;
  }

  .history-item {
    grid-template-columns: 1fr auto;
  }

  .history-equity {
    grid-column: 1 / -1;
    text-align: left;
  }

  footer {
    display: block;
    text-align: center;
  }

  footer p {
    line-height: 1.6;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
