:root {
  --color-bg: #0b0b0b;
  --color-gold: #c9a227;
  --color-gold-bright: #e0c15a;
  --color-gold-muted: #b8943e;
  --color-text: #d8d2c4;
  --color-panel: #111;
  --color-error: #e8a0a0;
  --font-data: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
}

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

html {
  background-color: var(--color-bg);
  color-scheme: dark;
}

body {
  margin: 0 auto;
  max-width: 48rem;
  min-height: 100vh;
  padding: 2.5rem 1.5rem 4rem;
  background:
    radial-gradient(ellipse 80% 36% at 50% -8%, rgba(201, 162, 39, 0.1), transparent 62%),
    var(--color-bg);
  color: var(--color-text);
  font-family: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  font-size: 1.125rem;
  line-height: 1.7;
}

h1,
h2,
h3,
h4,
.field-label,
label {
  font-family: Cinzel, "Times New Roman", serif;
  font-weight: 500;
  color: var(--color-gold);
}

h1 {
  margin: 0;
  color: var(--color-gold-bright);
  font-size: clamp(2rem, 5vw, 3.1rem);
  font-weight: 600;
  letter-spacing: 0.22em;
  text-align: left;
  text-transform: uppercase;
  text-shadow: 0 0 28px rgba(201, 162, 39, 0.18);
}

h1::after {
  content: "";
  display: block;
  width: 4.5rem;
  height: 1px;
  margin: 0.85rem 0 0;
  background: linear-gradient(90deg, transparent, var(--color-gold), transparent);
}

h2 {
  margin: 0 0 1.25rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid rgba(201, 162, 39, 0.45);
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h3 {
  margin: 0 0 0.85rem;
  color: var(--color-gold-muted);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  padding: 0.5rem 0.85rem;
  background: var(--color-gold);
  color: #0b0b0b;
  font-family: Cinzel, "Times New Roman", serif;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-decoration: none;
  text-transform: uppercase;
}

.skip-link:focus {
  top: 0.75rem;
}

.banner {
  margin: 0 0 1.35rem;
  padding: 1.65rem 1.7rem;
  border: 1px solid var(--color-gold);
  background:
    linear-gradient(100deg, rgba(201, 162, 39, 0.08), transparent 58%),
    var(--color-panel);
  box-shadow: inset 0 0 0 4px #0b0b0b, inset 0 0 0 5px rgba(201, 162, 39, 0.45);
}

.banner__kicker {
  margin: 0 0 0.45rem;
  color: var(--color-gold-muted);
  font-family: Cinzel, "Times New Roman", serif;
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.banner__tagline {
  margin: 0.9rem 0 0;
  max-width: 38rem;
  color: var(--color-text);
  font-size: 1.05rem;
  line-height: 1.55;
}

nav {
  margin: 0 0 1.25rem;
  color: var(--color-gold-muted);
  font-family: Cinzel, "Times New Roman", serif;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
}

nav a,
nav a:visited,
.site-footer a,
.site-footer a:visited {
  color: var(--color-gold-muted);
  text-decoration: none;
}

nav a:hover,
.site-footer a:hover {
  color: var(--color-gold-bright);
}

.status {
  margin: 0 0 1.25rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-gold);
  background: rgba(201, 162, 39, 0.08);
  color: var(--color-gold-bright);
  font-family: var(--font-data);
  font-size: 1rem;
}

.status[hidden] {
  display: none;
}

.status.is-error {
  border-color: var(--color-error);
  background: rgba(120, 32, 32, 0.28);
  color: var(--color-error);
}

.workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  align-items: start;
}

.panel {
  position: relative;
  min-width: 0;
  padding: 1.85rem 1.55rem 1.65rem;
  border: 1px solid var(--color-gold);
  background:
    linear-gradient(180deg, rgba(201, 162, 39, 0.05), transparent 38%),
    var(--color-panel);
  box-shadow: inset 0 0 0 4px #0b0b0b, inset 0 0 0 5px rgba(201, 162, 39, 0.45);
}

.panel::before,
.panel::after {
  content: "";
  position: absolute;
  width: 1.1rem;
  height: 1.1rem;
  border: 1px solid var(--color-gold);
  pointer-events: none;
}

.panel::before {
  top: 0.55rem;
  left: 0.55rem;
  border-right: 0;
  border-bottom: 0;
}

.panel::after {
  right: 0.55rem;
  bottom: 0.55rem;
  border-top: 0;
  border-left: 0;
}

.zone-block + .swap-row,
.swap-row + .zone-block {
  margin-top: 0.35rem;
}

.swap-row {
  display: flex;
  justify-content: center;
  margin: 0.35rem 0 1.1rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0 0 0.9rem;
}

.field-label,
label {
  color: var(--color-gold-muted);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.datetime-row {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 0.65rem;
}

.datetime-row .field {
  margin-bottom: 0.55rem;
}

input[type="text"],
input[type="search"],
input[type="date"],
input[type="time"],
select {
  width: 100%;
  min-height: 2.65rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--color-gold);
  background: #0b0b0b;
  color: var(--color-text);
  font-family: var(--font-data);
  font-size: 0.98rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

input[type="search"] {
  min-height: 2.35rem;
  margin-bottom: 0.4rem;
  font-size: 1rem;
}

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--color-gold) 50%),
    linear-gradient(135deg, var(--color-gold) 50%, transparent 50%);
  background-position:
    calc(100% - 16px) 50%,
    calc(100% - 11px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 2rem;
}

input::placeholder {
  color: rgba(216, 210, 196, 0.45);
}

input:hover,
select:hover {
  border-color: var(--color-gold-bright);
}

input:focus-visible,
select:focus-visible,
.button:focus-visible,
.bit-toggle button:focus-visible {
  outline: 1px solid var(--color-gold-bright);
  outline-offset: 3px;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  filter: invert(0.82) sepia(0.8) saturate(4) hue-rotate(6deg);
  cursor: pointer;
}

.meta,
.hint {
  margin: 0 0 0.35rem;
  color: var(--color-gold-muted);
  font-size: 0.98rem;
  line-height: 1.45;
}

.meta {
  font-family: var(--font-data);
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}

.hint {
  margin-bottom: 0.85rem;
  font-size: 0.95rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0.15rem 0 0.35rem;
}

.divider {
  height: 1px;
  margin: 1.15rem 0 1.05rem;
  background: linear-gradient(90deg, transparent, rgba(201, 162, 39, 0.55), transparent);
}

.bit-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.bit-toggle button {
  appearance: none;
  min-height: 2.65rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--color-gold);
  background: #0b0b0b;
  color: var(--color-gold-bright);
  font-family: Cinzel, "Times New Roman", serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
}

.bit-toggle button[aria-checked="true"] {
  border-color: #4e3b0c;
  background-color: #8a6a16;
  background-image:
    linear-gradient(
      118deg,
      transparent 38%,
      rgba(212, 175, 55, 0.28) 49%,
      transparent 61%
    ),
    linear-gradient(
      180deg,
      #c9a227 0%,
      #a8862a 16%,
      #8a6a16 44%,
      #5c470e 70%,
      #7a5f14 88%,
      #a07e1a 100%
    );
  color: #0b0b0b;
}

.button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 2.65rem;
  margin: 0;
  padding: 0.58rem 1.35rem;
  border: 1px solid #4e3b0c;
  background-color: #8a6a16;
  background-image:
    linear-gradient(
      118deg,
      transparent 38%,
      rgba(212, 175, 55, 0.28) 49%,
      transparent 61%
    ),
    linear-gradient(
      180deg,
      #c9a227 0%,
      #a8862a 16%,
      #8a6a16 44%,
      #5c470e 70%,
      #7a5f14 88%,
      #a07e1a 100%
    );
  box-shadow:
    inset 0 1px 0 rgba(212, 175, 55, 0.4),
    inset 0 -1px 0 rgba(40, 28, 4, 0.5),
    0 1px 2px rgba(0, 0, 0, 0.45);
  color: #0b0b0b;
  font-family: Cinzel, "Times New Roman", serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
}

.button:hover,
.bit-toggle button[aria-checked="true"]:hover {
  background-image:
    linear-gradient(
      118deg,
      transparent 30%,
      rgba(224, 193, 90, 0.4) 48%,
      transparent 66%
    ),
    linear-gradient(
      180deg,
      #d4af37 0%,
      #b8943e 16%,
      #9a7618 44%,
      #6b5010 70%,
      #8a6a16 88%,
      #b8943e 100%
    );
}

.button:active {
  background-image: linear-gradient(180deg, #5c470e 0%, #8a6a16 38%, #c9a227 100%);
  box-shadow: inset 0 1px 2px rgba(40, 28, 4, 0.5);
}

.button--ghost {
  border: 1px solid var(--color-gold);
  background: #111;
  background-image: none;
  box-shadow: none;
  color: var(--color-gold-bright);
}

.button--ghost:hover {
  background: rgba(201, 162, 39, 0.12);
  background-image: none;
}

.button--ghost:active {
  background: rgba(201, 162, 39, 0.2);
  background-image: none;
  box-shadow: none;
}

.result__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.result__header h3 {
  margin: 0;
}

.stamp-value {
  margin: 0 0 1rem;
  color: var(--color-gold-bright);
  font-family: var(--font-data);
  font-size: clamp(1.2rem, 2.4vw, 1.55rem);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: 0.02em;
  word-break: break-all;
}

.result__list {
  display: grid;
  gap: 0.85rem;
  margin: 0;
}

.result__list div {
  min-width: 0;
}

.result__list dt {
  color: var(--color-gold-muted);
  font-family: Cinzel, "Times New Roman", serif;
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.result__list dd {
  margin: 0.15rem 0 0;
  overflow-wrap: anywhere;
  font-family: var(--font-data);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.site-footer {
  margin: 2.25rem 0 0;
  color: var(--color-gold-muted);
  font-family: Cinzel, "Times New Roman", serif;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-align: center;
  text-transform: uppercase;
}

@media (max-width: 900px) {
  h1,
  h1::after {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
  }

  .banner {
    text-align: center;
  }

  .banner__tagline {
    margin-left: auto;
    margin-right: auto;
  }

  .actions .button,
  .swap-row .button {
    width: 100%;
  }
}

@media (max-width: 640px) {
  body {
    padding: 1.5rem 1rem 3rem;
  }

  .datetime-row {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 1.55rem 1.15rem 1.35rem;
  }
}
