:root {
  color-scheme: light;
  --paper: #f7f8f1;
  --ink: #161711;
  --muted: #5d6156;
  --panel: #ffffff;
  --panel-strong: #eef3e2;
  --line: #d9dece;
  --teal: #0d716b;
  --red: #d84a2f;
  --yellow: #edc748;
  --shadow: 0 24px 70px rgba(22, 23, 17, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, rgba(22, 23, 17, 0.045) 1px, transparent 1px),
    linear-gradient(180deg, rgba(22, 23, 17, 0.045) 1px, transparent 1px),
    var(--paper);
  background-size: 32px 32px;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration-color: rgba(13, 113, 107, 0.4);
  text-underline-offset: 0.2em;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: 1rem;
  z-index: 10;
  transform: translateY(-150%);
  background: var(--ink);
  color: #fff;
  padding: 0.7rem 1rem;
  border-radius: 6px;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(247, 248, 241, 0.9);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 5;
}

.nav-shell {
  align-items: center;
  display: flex;
  gap: 1.5rem;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 1180px;
  padding: 0.85rem 1.25rem;
}

.brand,
.nav-links {
  align-items: center;
  display: flex;
  gap: 0.85rem;
}

.brand {
  font-weight: 800;
  letter-spacing: 0;
  text-decoration: none;
}

.brand-mark {
  align-items: center;
  background: var(--ink);
  border-radius: 5px;
  color: #fff;
  display: inline-flex;
  font-size: 0.78rem;
  height: 2rem;
  justify-content: center;
  width: 2rem;
}

.nav-links {
  color: var(--muted);
  font-size: 0.95rem;
}

.hero-band,
.content-band {
  margin: 0 auto;
  max-width: 1180px;
  padding: 4.5rem 1.25rem;
}

.hero-band {
  align-items: start;
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(0, 0.85fr) minmax(360px, 1.15fr);
  min-height: calc(100vh - 68px);
}

.hero-copy {
  padding-top: 2.5rem;
}

.eyebrow {
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 0.65rem;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  font-family: inherit;
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1.05;
  margin: 0;
}

h1 {
  font-size: 4.5rem;
  max-width: 11ch;
}

h2 {
  font-size: 3rem;
}

.converter-panel h2,
.compact h2 {
  font-size: 2rem;
}

.hero-text {
  color: var(--muted);
  font-size: 1.15rem;
  margin: 1.25rem 0 0;
  max-width: 35rem;
}

.converter-panel {
  background: var(--panel);
  border: 1px solid var(--ink);
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin-top: 1rem;
  padding: clamp(1rem, 3vw, 1.5rem);
}

.tool-heading,
.tool-actions,
.section-heading,
.site-footer {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.field-grid {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: 1fr 1fr;
  margin-top: 1.5rem;
}

.field-grid label {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.field-grid input,
.field-grid select {
  background: #fbfcf7;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  min-height: 48px;
  padding: 0.75rem 0.85rem;
  width: 100%;
}

.field-grid label:nth-of-type(1),
.field-grid label:nth-of-type(2),
.field-grid label:nth-of-type(3),
.field-grid label:nth-of-type(4) {
  margin-top: 0.3rem;
}

.field-grid label,
.field-grid input,
.field-grid select {
  grid-column: span 1;
}

.tool-actions {
  justify-content: flex-start;
  margin-top: 1rem;
}

.primary-button,
.secondary-button,
.ghost-button,
.quick-grid button {
  border-radius: 6px;
  min-height: 44px;
  padding: 0.75rem 1rem;
}

.primary-button {
  background: var(--teal);
  border: 1px solid var(--teal);
  color: #fff;
  font-weight: 800;
}

.secondary-button,
.ghost-button {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}

.ghost-button {
  min-width: 5.2rem;
}

.result-box {
  background: var(--ink);
  border-radius: 8px;
  color: #fff;
  display: block;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 2.4rem;
  line-height: 1.1;
  margin-top: 1rem;
  min-height: 5.6rem;
  overflow-wrap: anywhere;
  padding: 1.1rem;
}

.formula {
  color: var(--muted);
  margin: 0.75rem 0 0;
  min-height: 1.5rem;
}

.quick-grid {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 1.25rem;
}

.quick-grid button {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 800;
}

.quick-grid button:hover,
.secondary-button:hover,
.ghost-button:hover {
  border-color: var(--teal);
}

.content-band {
  border-top: 1px solid var(--line);
}

.content-band.compact {
  padding-bottom: 3rem;
  padding-top: 3rem;
}

.split {
  align-items: center;
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(0, 0.85fr) minmax(280px, 1fr);
}

.split p,
.compact p {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 65ch;
}

.reference-art {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 16px 45px rgba(22, 23, 17, 0.1);
}

.conversion-table-wrap {
  overflow-x: auto;
  margin-top: 1.5rem;
}

.conversion-table {
  background: var(--panel);
  border: 1px solid var(--line);
  border-collapse: collapse;
  min-width: 720px;
  width: 100%;
}

.conversion-table caption {
  height: 1px;
  overflow: hidden;
  position: absolute;
  width: 1px;
}

.conversion-table th,
.conversion-table td {
  border-bottom: 1px solid var(--line);
  padding: 0.95rem;
  text-align: left;
}

.conversion-table th {
  background: var(--ink);
  color: #fff;
}

.conversion-table tbody tr:nth-child(even) {
  background: #fbfcf7;
}

.faq-list {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

details {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
}

summary {
  cursor: pointer;
  font-weight: 800;
}

details p {
  color: var(--muted);
  margin-bottom: 0;
}

.site-footer,
.footer-links {
  border-top: 1px solid var(--line);
  color: var(--muted);
  margin: 0 auto;
  max-width: 1180px;
  padding: 1.5rem 1.25rem 2rem;
}

.footer-links {
  border-top: 0;
  display: flex;
  gap: 1rem;
  margin: 0;
  padding: 0;
}

.policy-page {
  margin: 0 auto;
  max-width: 840px;
  padding: 4rem 1.25rem;
}

.policy-page h1 {
  font-size: 3.75rem;
  max-width: none;
}

.policy-page h2 {
  font-size: 2rem;
  margin-top: 2rem;
}

.policy-page p,
.policy-page li {
  color: var(--muted);
}

.policy-page ul {
  padding-left: 1.2rem;
}

@media (max-width: 860px) {
  .hero-band,
  .split {
    grid-template-columns: 1fr;
  }

  .hero-band {
    min-height: auto;
    padding-top: 3rem;
  }

  .hero-copy {
    padding-top: 0;
  }

  h1 {
    font-size: 3.75rem;
    max-width: 12ch;
  }
}

@media (max-width: 640px) {
  .nav-shell,
  .tool-heading,
  .section-heading,
  .site-footer,
  .footer-links {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-links {
    flex-wrap: wrap;
  }

  .hero-band,
  .content-band {
    padding-left: 1rem;
    padding-right: 1rem;
  }

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

  .tool-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .tool-actions button {
    width: 100%;
  }

  h1,
  .policy-page h1 {
    font-size: 2.75rem;
  }

  h2 {
    font-size: 2.25rem;
  }

  .converter-panel h2,
  .compact h2,
  .policy-page h2 {
    font-size: 1.65rem;
  }

  .hero-text {
    font-size: 1.05rem;
  }

  .result-box {
    font-size: 1.8rem;
  }
}
