/* Scrap gold calculator page. Builds on the tokens and components in styles.css. */

.calc-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: clamp(30px, 4.2vw, 64px);
  padding-block: 48px 40px;
}

.calc-intro { padding-top: 12px; }

.calc-intro h1 {
  margin-top: 20px;
  font-size: clamp(40px, 4.6vw, 66px);
  font-weight: 700;
  line-height: 1.03;
  letter-spacing: -.07em;
  text-wrap: balance;
}

.calc-intro h1 em {
  display: block;
  color: var(--gold);
  font-family: "Noto Display", Georgia, serif;
  font-weight: 400;
}

.calc-lede {
  max-width: 44ch;
  margin-top: 22px;
  color: var(--muted);
  font-size: clamp(17px, 1.36vw, 19px);
  line-height: 1.62;
}

.calc-lede-note {
  max-width: 48ch;
  margin-top: 16px;
  color: var(--soft);
  font-size: 14px;
  line-height: 1.6;
}

.calc-lede-note a, .calc-cta a { color: var(--gold); }
.calc-lede-note a { text-decoration: underline; text-underline-offset: 3px; }

.calc {
  display: grid;
  gap: 18px;
  padding: 24px;
  border: 1px solid #493b26;
  border-radius: 16px;
  background: radial-gradient(ellipse at 100% 0%, #2d2417, #1b1813 60%);
}

.calc-metal { margin: 0; padding: 0; border: 0; min-width: 0; }

.calc-metal legend, .calc-field > label {
  display: block;
  margin-bottom: 8px;
  padding: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 620;
}

.calc-metal-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--rule);
  border-radius: 11px;
  background: var(--background);
}

.calc-metal-option { position: relative; display: block; }

.calc-metal-option input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.calc-metal-option span {
  display: grid;
  min-height: 44px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
  transition: background-color .2s, color .2s;
}

.calc-metal-option:hover span { color: var(--text); }
.calc-metal-option input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }

.calc-metal-option[data-metal="gold"] input:checked + span {
  border-color: #a78337;
  color: #2f2006;
  background: linear-gradient(#fff2bc, #efc654 38%, #c59023 71%, #f1d677);
}

.calc-metal-option[data-metal="silver"] input:checked + span {
  border-color: #a4acb4;
  color: #1d2227;
  background: linear-gradient(#fff, #e2e6eb 30%, #aeb8c3 75%, #d9dfe5);
}

/* High-contrast (forced colors) mode drops the gradients above, so mark the chosen metal with a thick system-color border. */
@media (forced-colors: active) {
  .calc-metal-option[data-metal] input:checked + span { border: 3px solid Highlight; }
}

.calc-field { min-width: 0; }
.calc-field[hidden] { display: none; }

.calc select,
.calc-input,
.calc-combo input {
  width: 100%;
  min-height: 50px;
  border: 1px solid #55442b;
  border-radius: 8px;
  color: var(--text);
  background-color: var(--background);
  font: inherit;
  font-size: 16px;
}

.calc select {
  padding: 0 40px 0 14px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23efc774' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-position: right 14px center;
  background-repeat: no-repeat;
  cursor: pointer;
}

.calc-input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
}

.calc-input input {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  outline: none;
}

.calc-input:focus-within { border-color: #826238; outline: 2px solid var(--gold); outline-offset: 2px; }
.calc-affix { color: var(--soft); font-variant-numeric: tabular-nums; }

.calc-combo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 8px;
}

.calc-combo input { padding: 0 14px; }
.calc select:focus-visible, .calc-combo input:focus-visible { border-color: #826238; outline-offset: 2px; }

.calc input::placeholder { color: var(--soft); opacity: 1; }

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

.calc-hint { margin-top: 8px; color: var(--soft); font-size: 13px; line-height: 1.5; }

.calc-result {
  margin: 4px -24px -24px;
  padding: 20px 24px 22px;
  border-top: 1px solid #493b26;
  border-radius: 0 0 15px 15px;
  background: #151310;
}

.calc-result-label {
  color: var(--gold);
  font: 600 11px/1.5 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
}

.calc-value {
  display: block;
  margin-top: 4px;
  font-size: clamp(38px, 4.4vw, 52px);
  font-weight: 720;
  line-height: 1.1;
  letter-spacing: -.05em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.calc-detail { margin-top: 6px; color: var(--muted); font-size: 14px; line-height: 1.5; font-variant-numeric: tabular-nums; }

.calc-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding-block: 20px;
  border-block: 1px solid var(--rule);
}

.calc-cta p { max-width: 70ch; color: var(--muted); font-size: 15px; line-height: 1.6; }
.calc-cta strong { color: var(--text); font-weight: 650; }

/* Long-form prose (.guide, .guide-formula) lives in guides.css. */

@media (max-width: 880px) {
  .calc-hero { grid-template-columns: 1fr; gap: 28px; padding-block: 36px 32px; }
  .calc-intro { padding-top: 0; }
  .calc-intro h1 { font-size: clamp(40px, 8vw, 60px); }
}

@media (max-width: 560px) {
  .calc { gap: 16px; padding: 18px; }
  .calc-result { margin: 2px -18px -18px; padding: 18px; }
  .calc-combo { grid-template-columns: 1fr; }
  .calc-intro h1 { font-size: clamp(36px, 10.4vw, 48px); }
}
