
:root {
  color-scheme: light;
  --ink: #20201d;
  --muted: #66635c;
  --line: #ded7cc;
  --paper: #fbfaf6;
  --surface: #ffffff;
  --green: #2f6f5e;
  --green-dark: #204d42;
  --blue: #315f7d;
  --amber: #d69b33;
  --rose: #b85f55;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
}

a {
  color: inherit;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  background: rgba(251, 250, 246, 0.94);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 750;
  text-decoration: none;
}

.brand-mark {
  width: 26px;
  height: 18px;
  border: 3px solid var(--green);
  border-radius: 4px;
  box-shadow: inset 0 0 0 3px #e8c777;
}

.site-header nav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 14px;
}

.site-header nav a {
  text-decoration: none;
}

.site-header nav a:hover {
  color: var(--green-dark);
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  padding: clamp(28px, 5vw, 64px) 0 26px;
}

.utility-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(420px, 1.1fr);
  gap: clamp(24px, 5vw, 58px);
  align-items: start;
}

.hero-copy {
  padding-top: 18px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--green);
  text-transform: uppercase;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
  line-height: 1.04;
}

h1 {
  font-size: clamp(42px, 7vw, 76px);
  max-width: 820px;
}

h2 {
  font-size: clamp(24px, 4vw, 36px);
}

.lede,
.answer {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
  max-width: 640px;
}

.answer {
  color: var(--ink);
  border-left: 4px solid var(--amber);
  padding-left: 16px;
}

.task-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.task-strip span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  padding: 8px 12px;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 800;
}

.calculator-panel,
.formula-box,
.table-wrap {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(61, 47, 29, 0.08);
}

.calculator-panel {
  padding: clamp(18px, 3vw, 28px);
}

.tool-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.converter-sides {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.pan-input-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fcfbf8;
  padding: 14px;
  display: grid;
  gap: 12px;
}

.side-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.side-title span {
  color: var(--green);
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 900;
}

.side-title strong {
  font-size: 18px;
}

.dimension-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.dimension-grid.single {
  grid-template-columns: 1fr;
}

.swap-column {
  display: grid;
  place-items: center;
}

.swap-button {
  width: 58px;
  min-height: 58px;
  border-radius: 999px;
  border: 1px solid rgba(47, 111, 94, 0.35);
  background: #eef6f2;
  color: var(--green-dark);
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

label span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
}

select,
input {
  width: 100%;
  min-height: 44px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: inherit;
  padding: 0 12px;
}

.visual-result {
  display: grid;
  grid-template-areas: "source result target";
  grid-template-columns: minmax(0, 1fr) minmax(190px, 0.8fr) minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
  margin: 14px 0 10px;
}

.visual-result [data-source-visual] {
  grid-area: source;
}

.visual-result [data-target-visual] {
  grid-area: target;
}

.conversion-card {
  grid-area: result;
  border: 1px solid rgba(47, 111, 94, 0.35);
  border-radius: 8px;
  background: #eef6f2;
  padding: 14px;
  display: grid;
  align-content: center;
  gap: 8px;
  min-height: 132px;
}

.conversion-card span {
  color: var(--green-dark);
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 900;
}

.conversion-card strong {
  color: var(--green-dark);
  font-size: 34px;
  line-height: 1;
}

.conversion-card p {
  margin: 0;
  color: var(--ink);
  line-height: 1.45;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.result-grid.compact {
  margin: 0 0 14px;
}

.result-metric {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  min-height: 88px;
  background: #fcfbf8;
}

.result-metric span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 800;
}

.result-metric strong {
  display: block;
  margin-top: 10px;
  font-size: 22px;
}

.result-metric.accent {
  border-color: rgba(47, 111, 94, 0.35);
  background: #eef6f2;
}

.pan-visual {
  min-height: 132px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #f7f1e8;
}

.pan-shape {
  display: grid;
  place-items: center;
  border: 4px solid var(--green);
  background: #e5c46d;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  padding: 6px;
}

.pan-shape.round {
  border-radius: 999px;
}

.recommendation {
  min-height: 54px;
  border-left: 4px solid var(--blue);
  padding: 10px 0 10px 14px;
  margin: 0 0 14px;
  color: var(--ink);
  line-height: 1.5;
}

.button-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  min-height: 42px;
  padding: 0 15px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.button.primary {
  background: var(--green);
  color: white;
  border-color: var(--green);
}

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

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 420px);
  gap: 32px;
  align-items: center;
}

.section-heading {
  margin-bottom: 18px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
  text-align: left;
  vertical-align: top;
}

thead th {
  background: #f5efe4;
  font-size: 13px;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0;
}

.check-list {
  padding-left: 18px;
  line-height: 1.7;
  color: var(--muted);
}

.formula-box {
  padding: 24px;
  display: grid;
  gap: 8px;
  text-align: center;
}

.formula-box strong {
  color: var(--green-dark);
  font-size: 24px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.related-grid a {
  display: grid;
  gap: 6px;
  min-height: 104px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  text-decoration: none;
}

.related-grid span {
  color: var(--green);
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 900;
}

.related-grid strong {
  font-size: 18px;
  line-height: 1.25;
}

.note-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.note-grid article {
  min-height: 130px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.note-grid strong {
  display: block;
  color: var(--green-dark);
  font-size: 18px;
  line-height: 1.25;
  margin-bottom: 10px;
}

.note-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.site-footer {
  margin-top: 48px;
  padding: 22px clamp(18px, 4vw, 48px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.simple-index {
  min-height: 70vh;
  display: grid;
  align-content: center;
  gap: 16px;
}

.noscript {
  color: var(--rose);
  font-weight: 700;
}

@media (max-width: 900px) {
  .site-header,
  .utility-layout,
  .split {
    grid-template-columns: 1fr;
  }

  .site-header {
    display: grid;
    gap: 12px;
  }

  .site-header nav {
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 2px;
    white-space: nowrap;
  }

  .converter-sides,
  .result-grid,
  .related-grid,
  .note-grid {
    grid-template-columns: 1fr;
  }

  .swap-column {
    place-items: stretch;
  }

  .swap-button {
    width: 100%;
    min-height: 44px;
    border-radius: 6px;
  }

  .tool-head {
    display: grid;
    justify-content: start;
  }

}

@media (max-width: 620px) {
  main {
    width: min(100% - 20px, 1180px);
  }

  .hero {
    padding: 22px 0 18px;
  }

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

  h1 {
    font-size: 38px;
    line-height: 1.02;
  }

  h2 {
    font-size: 26px;
  }

  .lede,
  .answer {
    font-size: 16px;
  }

  .task-strip {
    display: grid;
    grid-template-columns: 1fr;
  }

  .calculator-panel {
    padding: 14px;
  }

  .pan-input-card {
    padding: 12px;
  }

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

  .visual-result {
    grid-template-areas:
      "result result"
      "source target";
    grid-template-columns: 1fr 1fr;
  }

  .conversion-card {
    min-height: 0;
  }

  .conversion-card strong {
    font-size: 32px;
  }

  .pan-visual {
    min-height: 110px;
  }

  .result-metric {
    min-height: 78px;
  }

  .button-row .button {
    flex: 1 1 150px;
    justify-content: center;
  }

  .band {
    padding: 34px 0;
  }

  th,
  td {
    padding: 12px;
  }
}

@media (max-width: 380px) {
  .visual-result {
    grid-template-areas:
      "result"
      "source"
      "target";
    grid-template-columns: 1fr;
  }
}
