:root {
  color-scheme: dark;
  --bg: #121416;
  --bg-soft: #181b1f;
  --card: #1d2126;
  --card-strong: #242a31;
  --border: #333b45;
  --border-strong: #49515d;
  --text: #f6efe4;
  --muted: #b9b0a3;
  --muted-2: #8f98a3;
  --accent: #e21d2f;
  --accent-strong: #ff5a67;
  --danger: #ff8377;
  --warning: #ffd27a;
  --shadow: 0 24px 70px rgb(0 0 0 / 0.28);
  --radius: 22px;
  --input-radius: 14px;
  --focus: 0 0 0 4px rgb(226 29 47 / 0.28);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 0%, rgb(226 29 47 / 0.17), transparent 34rem),
    linear-gradient(180deg, #17191c 0%, var(--bg) 44%, #0e1012 100%);
  line-height: 1.5;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.site-shell {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 10px 10px 26px;
}

.site-header {
  padding: 2px 2px 10px;
}

.hero-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 5px;
}

.photo-card {
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 0.1);
  border-radius: 18px;
  background: linear-gradient(180deg, rgb(29 33 38 / 0.92), rgb(18 20 23 / 0.96));
  box-shadow: 0 16px 46px rgb(0 0 0 / 0.2);
}

.photo-panel {
  position: relative;
  min-height: clamp(112px, 27vw, 176px);
  overflow: hidden;
  background: #0d1115;
}

.photo-panel::before,
.photo-panel::after {
  content: '';
  position: absolute;
  inset: 0;
}

.photo-panel::before {
  background-image: url('assets/hero-gas-station.webp');
  background-position: center 56%;
  background-size: cover;
  opacity: 0.82;
}

.photo-panel::after {
  background:
    linear-gradient(90deg, rgb(8 10 12 / 0.58), transparent 58%, rgb(8 10 12 / 0.2)),
    linear-gradient(180deg, rgb(0 0 0 / 0.04), rgb(0 0 0 / 0.54));
}

.photo-caption {
  display: flex;
  justify-content: flex-end;
  padding: 9px 10px 10px;
  border-top: 1px solid rgb(255 255 255 / 0.08);
  background: rgb(0 0 0 / 0.2);
}

.photo-about-button {
  min-height: 32px;
  font-size: 0.8rem;
}

.eyebrow {
  margin: 0;
  color: var(--accent-strong);
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.about-button,
.rev-button {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid rgb(255 255 255 / 0.16);
  border-radius: 999px;
  color: var(--text);
  background: rgb(0 0 0 / 0.26);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.08);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.03em;
}

.rev-button {
  background: linear-gradient(180deg, rgb(226 29 47 / 0.28), rgb(92 10 20 / 0.42));
}

.about-button:hover,
.rev-button:hover {
  border-color: rgb(255 255 255 / 0.24);
  background: rgb(0 0 0 / 0.36);
}

.rev-button:hover {
  background: linear-gradient(180deg, rgb(226 29 47 / 0.38), rgb(92 10 20 / 0.5));
}

.about-button:focus-visible,
.rev-button:focus-visible {
  outline: none;
  box-shadow: var(--focus), inset 0 1px 0 rgb(255 255 255 / 0.08);
}

.rev-button.is-playing {
  border-color: rgb(255 255 255 / 0.28);
  animation: rev-pop 420ms ease-out;
  box-shadow: 0 0 0 3px rgb(226 29 47 / 0.24), inset 0 1px 0 rgb(255 255 255 / 0.08);
}

@keyframes rev-pop {
  0% { transform: translateY(0) scale(1); }
  28% { transform: translateY(-1px) scale(1.08) rotate(-2deg); }
  58% { transform: translateY(0) scale(0.98) rotate(1deg); }
  100% { transform: translateY(0) scale(1) rotate(0deg); }
}

h1,
h2,
p {
  margin-block-start: 0;
}

.hero-brand {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0.22rem 0.62rem;
  margin: 0;
  border: 1px solid rgb(255 255 255 / 0.13);
  border-radius: 999px;
  background: rgb(0 0 0 / 0.22);
  color: var(--text);
  font-size: clamp(0.78rem, 2.8vw, 0.98rem);
  font-style: italic;
  font-weight: 950;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

h1 {
  max-width: 15ch;
  margin: 0 0 3px;
  text-shadow: 0 3px 20px rgb(0 0 0 / 0.35);
  font-size: clamp(1.78rem, 8vw, 3.55rem);
  line-height: 0.95;
  letter-spacing: -0.048em;
}

.hero-subtitle {
  margin: 0;
  color: rgb(246 239 228 / 0.82);
  text-shadow: 0 2px 14px rgb(0 0 0 / 0.34);
  font-size: clamp(0.92rem, 3.6vw, 1.2rem);
  font-weight: 780;
}

.hero-copy {
  max-width: 31rem;
  margin: 9px 0 0;
  color: rgb(246 239 228 / 0.8);
  text-shadow: 0 2px 14px rgb(0 0 0 / 0.55);
}

.calculator-card {
  padding: clamp(12px, 3vw, 18px);
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(180deg, rgb(36 42 49 / 0.94), rgb(25 29 34 / 0.96));
  box-shadow: var(--shadow);
}

.card-heading {
  display: grid;
  gap: 2px;
  margin-bottom: 10px;
}

.card-heading h2 {
  margin: 0;
  font-size: 1.05rem;
}

.card-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgb(0 0 0 / 0.18);
}

.mode-tab {
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
}

.mode-tab.is-active {
  color: #250508;
  background: linear-gradient(180deg, var(--accent-strong), var(--accent));
}

.calculator-form {
  display: grid;
  gap: 10px;
}

.field-grid,
.ratio-row {
  display: grid;
  gap: 9px;
}

.field-grid {
  grid-template-columns: 1fr 1fr;
}

.field-grid .field:last-child {
  grid-column: 1 / -1;
}

@media (min-width: 640px) {
  .field-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .field-grid .field:last-child {
    grid-column: auto;
  }

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

.field {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border-strong);
  border-radius: var(--input-radius);
  color: var(--text);
  background-color: #111418;
  padding: 0 11px;
  outline: none;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.03);
}

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 18px,
    calc(100% - 12px) 18px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 36px;
}

input:focus,
select:focus,
button:focus-visible,
summary:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-color: var(--accent);
}


.field-hint {
  margin-top: -2px;
  color: var(--muted-2);
  font-size: 0.78rem;
  font-weight: 650;
}

.custom-ratio-input {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 900;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.calculate-button {
  justify-self: start;
  min-height: 38px;
  padding: 0 18px;
  border: 1px solid rgb(255 255 255 / 0.08);
  border-radius: 999px;
  color: #250508;
  background: linear-gradient(180deg, var(--accent-strong), var(--accent));
  font-weight: 900;
}

.secondary-button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--text);
  background: rgb(0 0 0 / 0.18);
  font-weight: 850;
}

.secondary-button:hover:not(:disabled),
.secondary-button:focus-visible:not(:disabled) {
  border-color: var(--accent);
  background: rgb(226 29 47 / 0.1);
}

.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

.messages {
  display: grid;
  gap: 8px;
}

.message {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 700;
}

.message-error {
  color: var(--danger);
  background: rgb(255 131 119 / 0.1);
  border: 1px solid rgb(255 131 119 / 0.3);
}


.message-info {
  color: var(--accent-strong);
  background: rgb(226 29 47 / 0.1);
  border: 1px solid rgb(47 140 255 / 0.28);
}

.message-warning {
  color: var(--warning);
  background: rgb(255 210 122 / 0.1);
  border: 1px solid rgb(255 210 122 / 0.28);
}

.result-card {
  margin-top: 12px;
  padding: clamp(12px, 3vw, 16px);
  border: 1px solid rgb(47 140 255 / 0.35);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgb(47 140 255 / 0.14), transparent 42%),
    var(--bg-soft);
  transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.result-pulse {
  animation: resultPulse 420ms ease;
}

@keyframes resultPulse {
  0% { transform: scale(1); border-color: rgb(226 29 47 / 0.35); }
  35% { transform: scale(1.012); border-color: rgb(255 90 103 / 0.95); }
  100% { transform: scale(1); border-color: rgb(226 29 47 / 0.35); }
}

.result-kicker {
  margin: 0 0 4px;
  color: var(--accent-strong);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.result-card h2 {
  margin: 0;
  font-size: clamp(1.42rem, 6vw, 2.35rem);
  line-height: 1.03;
  letter-spacing: -0.045em;
}

.result-detail {
  margin: 7px 0 0;
  color: var(--muted);
  font-weight: 720;
}

.formula {
  margin: 6px 0 0;
  color: var(--muted-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88rem;
}



.safety-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.extras {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.extra-panel {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgb(0 0 0 / 0.14);
  overflow: hidden;
}

summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 44px;
  padding: 0 14px;
  color: var(--text);
  cursor: pointer;
  font-weight: 850;
}

summary::after {
  content: '+';
  color: var(--accent-strong);
  font-size: 1.3rem;
  line-height: 1;
}

.extra-panel[open] summary::after {
  content: '–';
}

.extra-content {
  padding: 0 12px 12px;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--muted);
  font-size: 0.95rem;
}

.comparison-table th,
.comparison-table td {
  padding: 8px 0;
  border-top: 1px solid var(--border);
  text-align: left;
}

.comparison-table td {
  text-align: right;
  color: var(--text);
  font-weight: 780;
}

.empty-table-cell {
  color: var(--muted-2) !important;
  font-weight: 650 !important;
  text-align: left !important;
}

input::placeholder {
  color: var(--muted-2);
}

.helper-copy {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.84rem;
}

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--text);
  background: #111418;
  font-weight: 800;
}

.chip-button:hover,
.chip-button:focus-visible {
  border-color: var(--accent);
}

.seo-note {
  margin: 18px auto 0;
  padding: 0 4px;
  color: var(--muted);
  font-size: 0.92rem;
}

.seo-note p {
  margin: 0 0 8px;
}


.smell-note {
  color: var(--accent-strong);
  font-weight: 800;
}

.unit-note {
  color: var(--muted-2);
}

.noscript-message {
  position: fixed;
  inset-inline: 12px;
  bottom: 12px;
  padding: 14px;
  border: 1px solid var(--danger);
  border-radius: 14px;
  color: var(--text);
  background: #2a1717;
  text-align: center;
}

[hidden] {
  display: none !important;
}

@media (max-width: 480px) {
  .site-header {
    padding-top: 0;
  }

  .photo-panel {
    min-height: 116px;
  }
}

@media (max-width: 380px) {
  .site-shell {
    padding-inline: 10px;
  }

  .calculator-card {
    padding: 14px;
  }

  .mode-tab {
    font-size: 0.84rem;
  }
}


.about-dialog {
  width: min(calc(100% - 28px), 460px);
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 22px;
  color: var(--text);
  background: linear-gradient(180deg, rgb(36 42 49 / 0.98), rgb(23 27 32 / 0.98));
  box-shadow: 0 24px 90px rgb(0 0 0 / 0.56);
}

.about-dialog::backdrop {
  background: rgb(0 0 0 / 0.62);
  backdrop-filter: blur(4px);
}

.about-dialog-inner {
  position: relative;
  padding: 24px;
}

.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 1px solid rgb(255 255 255 / 0.14);
  border-radius: 999px;
  color: var(--text);
  background: rgb(0 0 0 / 0.22);
  font-size: 1.5rem;
  line-height: 1;
}

.dialog-close:hover {
  border-color: rgb(255 255 255 / 0.24);
  background: rgb(0 0 0 / 0.34);
}

.dialog-kicker {
  margin: 0 0 8px;
  color: var(--accent-strong);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.about-dialog h2 {
  margin: 0 38px 12px 0;
  font-size: 1.45rem;
  line-height: 1.1;
}

.about-dialog p:not(.dialog-kicker) {
  margin: 0 0 12px;
  color: rgb(246 239 228 / 0.86);
}

.about-dialog p:last-child {
  margin-bottom: 0;
}
