:root {
  --paper: #f3f6f4;
  --ink: #14241b;
  --muted: #5c6d63;
  --line: #d5e2da;
  --green: #0c6a32;
  --green-deep: #084e24;
  --white: #fff;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --font: "Be Vietnam Pro", sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

img { display: block; max-width: 100%; }

button, input, select { font-family: inherit; }

::placeholder { color: #7d8e84; }

:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  z-index: 20;
  padding: 8px 12px;
  background: var(--ink);
  color: var(--white);
  border-radius: 8px;
}

.skip:focus { top: 12px; }

.wrap {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  margin: 0;
  color: inherit;
}

.brand-kicker {
  margin: 16px 0 0;
  color: var(--green-deep);
  font-size: clamp(28px, 2.4vw, 36px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

h1.brand {
  max-width: none;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: normal;
  line-height: inherit;
  text-wrap: wrap;
}

.brand img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  flex: 0 0 72px;
}

.brand em {
  display: block;
  margin-bottom: 2px;
  color: var(--green-deep);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.3;
}

.brand strong {
  display: block;
  color: #c8102e;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-transform: uppercase;
}

.brand small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
}

.utility {
  position: absolute;
  top: 22px;
  right: 28px;
  z-index: 2;
  font-size: 14px;
  font-weight: 600;
  color: var(--green-deep);
}

.utility:hover { text-decoration: underline; text-underline-offset: 3px; }

.stage {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  min-height: 100dvh;
  background: var(--white);
}

.stage-photo {
  position: relative;
  min-height: 520px;
  background: #123222;
  overflow: hidden;
}

.stage-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 88%;
}

.stage-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 40px 48px 40px;
}

.sheet {
  width: min(100%, 460px);
}

.sheet h1 {
  margin: 0;
  max-width: 16em;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  text-wrap: balance;
}

.sheet h1.brand {
  max-width: none;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: normal;
  line-height: inherit;
}

.lede {
  margin: 12px 0 0;
  max-width: 38em;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

.search-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 28px;
}

.field-grid {
  display: grid;
  gap: 14px;
}

.field-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
}

.field-group input,
.field-group select {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  color: var(--ink);
  font-size: 15px;
  transition: border-color 180ms var(--ease), box-shadow 180ms var(--ease);
}

.field-group select {
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14' fill='none'%3E%3Cpath d='M3 5.2L7 9l4-3.8' stroke='%2314241b' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.field-group input:focus,
.field-group select:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(12, 106, 50, 0.12);
}

.btn {
  min-height: 52px;
  border: 0;
  border-radius: 10px;
  background: var(--green);
  color: var(--white);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 180ms var(--ease), transform 180ms var(--ease);
}

.btn:hover { background: var(--green-deep); }

.btn:active { transform: translateY(1px); }

.btn:disabled { cursor: progress; opacity: 0.7; }

.quick-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

.quick-tag {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 8px;
  background: #f4f8f5;
  color: var(--green-deep);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.place {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.feedback {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 10px;
  display: grid;
  gap: 2px;
  font-size: 14px;
  line-height: 1.5;
}

.feedback-title {
  font-size: 12px;
  font-weight: 700;
}

.feedback.error { background: #f8efee; color: #8a2e26; }

.feedback.success { background: #eef6f0; color: var(--green-deep); }

.result-panel {
  align-self: stretch;
  width: 100%;
  margin-top: 28px;
  padding-top: 22px;
  box-shadow: inset 0 1px 0 var(--line);
}

.result-sheet + .result-sheet { margin-top: 28px; }

.result-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.eyebrow {
  margin: 0;
  color: var(--green-deep);
  font-size: 13px;
  font-weight: 600;
}

.result-hero h3 {
  margin: 6px 0 0;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.result-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.ghost-btn {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  background: var(--white);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.ghost-btn:hover { border-color: var(--green); color: var(--green-deep); }

.result-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-top: 16px;
  border-top: 1px solid var(--line);
}

.metric {
  padding: 12px 12px 12px 0;
}

.metric:nth-child(2n) { padding-right: 0; padding-left: 12px; }

.metric-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.metric strong {
  display: block;
  margin-top: 4px;
  font-size: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  word-break: break-word;
}

.result-table-wrap {
  margin-top: 8px;
  overflow: auto;
}

.result-table { width: 100%; border-collapse: collapse; }

.result-table th,
.result-table td {
  padding: 11px 10px 11px 0;
  text-align: left;
  vertical-align: top;
  font-size: 14px;
  line-height: 1.5;
  box-shadow: inset 0 1px 0 var(--line);
}

.result-table th {
  width: 40%;
  color: var(--muted);
  font-weight: 600;
}

.muted { color: #8a978e; }

.print-mast { display: none; }

.foot {
  display: none;
  padding: 22px 0 28px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.foot p { margin: 0; }

@media (min-width: 801px) {
  .sheet { width: min(100%, 540px); }

  .sheet h1.brand { text-wrap: nowrap; }

  .brand strong {
    white-space: nowrap;
    font-size: clamp(15px, 1.05vw, 18px);
  }

  .stage.has-result {
    display: block;
    min-height: 0;
  }

  .stage.has-result .stage-photo {
    display: none;
  }

  .stage.has-result .stage-form {
    display: block;
    width: min(1120px, calc(100% - 64px));
    margin: 0 auto;
    padding: 28px 0 56px;
  }

  .stage.has-result .sheet {
    width: 100%;
  }

  .stage.has-result .sheet > h1 {
    max-width: none;
  }

  .stage.has-result .search-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px 16px;
    align-items: end;
    margin-top: 20px;
  }

  .stage.has-result .field-grid {
    display: contents;
  }

  .stage.has-result .search-form .btn {
    width: 100%;
  }

  .stage.has-result .result-panel {
    margin-top: 36px;
  }

  .stage.has-result .result-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .stage.has-result .metric,
  .stage.has-result .metric:nth-child(2n) {
    padding: 14px 24px 14px 0;
  }

  .stage.has-result .result-table tbody {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 40px;
  }

  .stage.has-result .result-table tr {
    display: grid;
    grid-template-columns: minmax(108px, 34%) minmax(0, 1fr);
    align-items: baseline;
  }

  .stage.has-result .result-table th {
    width: auto;
  }
}

@media (max-width: 800px) {
  .foot { display: block; }

  .wrap { width: calc(100% - 32px); }

  .utility { top: 16px; right: 16px; }

  .brand img { width: 56px; height: 56px; flex-basis: 56px; }

  .brand strong { font-size: 18px; }

  .stage {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .stage-form {
    order: 1;
    align-items: stretch;
    padding: 28px 20px 12px;
  }

  .stage-photo {
    order: 2;
    min-height: 0;
    height: 220px;
  }

  .sheet { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .btn { transition: none; }
}

@media print {
  .skip,
  .utility,
  .brand,
  .brand-kicker,
  .stage-photo,
  .search-form,
  .quick-tags,
  .note,
  .place,
  .lede,
  .sheet h1,
  .feedback,
  .ghost-btn,
  .foot { display: none !important; }

  body, .stage, .stage-form, .sheet {
    background: #fff;
    display: block;
    min-height: 0;
    padding: 0;
  }

  .print-mast { display: block; margin-bottom: 12px; }

  .print-mast strong,
  .print-mast span { display: block; }

  .result-sheet { break-inside: avoid; }

  .result-table { display: table; width: 100%; }
  .result-table tbody { display: table-row-group; }
  .result-table tr { display: table-row; }
  .result-table th,
  .result-table td { display: table-cell; }
}
