:root {
  --ink: #18212f;
  --muted: #667085;
  --line: #d8e1ea;
  --paper: #ffffff;
  --wash: #f4f8fb;
  --teal: #008a7c;
  --teal-dark: #05675e;
  --blue: #225ea8;
  --amber: #b46b08;
  --shadow: 0 20px 50px rgba(24, 33, 47, 0.11);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--wash);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.5;
}

button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(216, 225, 234, 0.82);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 72px;
}

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

.brand {
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #e9f8f5;
  color: var(--teal-dark);
}

.brand-mark svg,
.icon-button svg,
.primary-button svg {
  width: 22px;
  height: 22px;
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-links {
  gap: 8px;
}

.nav-links a {
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 10px 12px;
}

.nav-links a:hover {
  background: #eef5f8;
  color: var(--ink);
}

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 520px);
  align-items: center;
  gap: 40px;
  min-height: 430px;
  padding: 52px 0 26px;
}

.hero-copy {
  max-width: 650px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal-dark);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 680px;
  font-size: clamp(2.4rem, 6vw, 5rem);
}

h2 {
  font-size: clamp(1.55rem, 3vw, 2.25rem);
}

.hero-copy p:last-child {
  max-width: 590px;
  margin: 20px 0 0;
  color: #4f5f70;
  font-size: 1.13rem;
}

.hero-visual {
  margin: 0;
  min-width: 0;
}

.hero-visual svg {
  display: block;
  width: 100%;
  height: auto;
  color: #233142;
}

.hero-shadow {
  fill: rgba(24, 33, 47, 0.12);
  stroke: none;
}

.scale-platform {
  fill: #dce9ef;
  stroke: #8ea5b1;
}

.scale-screen {
  fill: #ffffff;
  stroke: #90a8b5;
}

.screen-line {
  stroke: var(--amber);
}

.screen-dot {
  fill: var(--amber);
  stroke: none;
}

.cup-body {
  fill: url("#quartGradient");
  stroke: #6f93a1;
}

.cup-rim,
.measure-line {
  stroke: #6f93a1;
}

.cup-fill {
  fill: url("#fillGradient");
  stroke: none;
}

.cup-label,
.weight-label {
  fill: var(--ink);
  stroke: none;
  font-size: 26px;
  font-weight: 900;
}

.conversion-arrows {
  color: var(--teal-dark);
  stroke-width: 5;
}

.weight-body {
  fill: #f7ead7;
  stroke: #b57920;
}

.weight-handle {
  stroke: #b57920;
}

.ingredient-bowl .bowl {
  fill: #eef8f6;
  stroke: #7aa79f;
}

.bowl-rim {
  stroke: #7aa79f;
}

.ingredient-dot {
  fill: var(--amber);
  stroke: none;
}

.dot-two {
  fill: var(--teal);
}

.dot-three {
  fill: var(--blue);
}

.calculator-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 22px;
  align-items: stretch;
  margin: 18px 0 34px;
}

.calculator-panel,
.result-panel,
.info-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.calculator-panel,
.result-panel {
  padding: 28px;
}

.panel-heading,
.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.icon-button {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--blue);
  cursor: pointer;
}

.icon-button:hover {
  border-color: #9fb6ca;
  background: #f4f8fb;
}

.converter {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 26px;
}

.field,
.density-field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.field span:first-child,
.density-field label {
  color: #344054;
  font-size: 0.93rem;
  font-weight: 800;
}

.input-wrap {
  display: flex;
  align-items: center;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #c8d5df;
  border-radius: 8px;
  background: #ffffff;
}

input,
select {
  min-width: 0;
  width: 100%;
  border: 1px solid #c8d5df;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  outline: none;
}

input {
  border: 0;
  padding: 13px 12px;
}

select {
  min-height: 50px;
  padding: 0 38px 0 12px;
}

.input-wrap span:last-child {
  display: inline-flex;
  align-items: center;
  min-height: 50px;
  border-left: 1px solid #e2eaf0;
  background: #f6f9fb;
  color: var(--muted);
  font-weight: 800;
  padding: 0 12px;
  white-space: nowrap;
}

input:focus,
select:focus,
.input-wrap:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(34, 94, 168, 0.14);
}

.density-field {
  grid-column: 1 / -1;
}

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

.actions {
  display: flex;
  flex-wrap: wrap;
  grid-column: 1 / -1;
  gap: 12px;
  margin-top: 2px;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 8px;
  font-weight: 850;
  cursor: pointer;
}

.primary-button {
  gap: 9px;
  border: 1px solid var(--teal-dark);
  background: var(--teal);
  color: #ffffff;
  padding: 0 18px;
}

.primary-button:hover {
  background: var(--teal-dark);
}

.secondary-button {
  border: 1px solid #c8d5df;
  background: #ffffff;
  color: #344054;
  padding: 0 16px;
}

.secondary-button:hover {
  background: #f4f8fb;
}

.result-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.result-value {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 8px;
  color: var(--blue);
  font-weight: 900;
  line-height: 1;
}

.result-value span:first-child {
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: clamp(2.3rem, 6vw, 4.2rem);
}

.result-value span:last-child {
  color: var(--muted);
  font-size: 1.25rem;
}

.result-equation {
  margin: 18px 0 0;
  color: #4f5f70;
  font-weight: 750;
}

.quick-stats {
  display: grid;
  gap: 10px;
  margin: 24px 0 0;
}

.quick-stats div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid #e7eef3;
  padding-top: 12px;
}

.quick-stats dt {
  color: var(--muted);
  font-weight: 700;
}

.quick-stats dd {
  margin: 0;
  font-weight: 850;
  text-align: right;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin: 0 0 34px;
}

.info-block {
  padding: 28px;
}

.info-block p {
  color: #4f5f70;
}

.formula-box {
  display: grid;
  gap: 4px;
  margin: 22px 0;
  border-left: 4px solid var(--teal);
  background: #eef8f6;
  padding: 16px 18px;
}

.formula-box span {
  font-size: 1.2rem;
  font-weight: 900;
}

.formula-box small {
  color: #526475;
  font-weight: 700;
}

.check-list {
  display: grid;
  gap: 12px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.check-list li {
  position: relative;
  padding-left: 30px;
  color: #4f5f70;
}

.check-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.28em;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background:
    linear-gradient(135deg, transparent 48%, #ffffff 49% 55%, transparent 56%),
    var(--teal);
}

.table-section {
  padding: 6px 0 42px;
}

.table-section .section-heading {
  display: block;
  text-align: center;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

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

th,
td {
  border-bottom: 1px solid #e8eef3;
  padding: 14px 16px;
  text-align: right;
  white-space: nowrap;
}

th:first-child,
td:first-child {
  text-align: left;
}

th {
  background: #f7fafc;
  color: #344054;
  font-size: 0.86rem;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: #ffffff;
  color: var(--muted);
  padding: 28px 16px;
  text-align: center;
}

.site-footer p {
  margin: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@media (max-width: 860px) {
  .nav {
    min-height: 66px;
  }

  .nav-links {
    display: none;
  }

  .hero,
  .calculator-shell,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    gap: 10px;
    min-height: 0;
    padding-top: 34px;
  }

  .hero-visual {
    max-width: 520px;
    margin: 0 auto;
  }
}

@media (max-width: 580px) {
  main,
  .nav {
    width: min(100% - 24px, 1120px);
  }

  .calculator-panel,
  .result-panel,
  .info-block {
    padding: 20px;
  }

  .converter,
  .density-grid {
    grid-template-columns: 1fr;
  }

  .actions {
    display: grid;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
  }

  .quick-stats div {
    display: grid;
    gap: 4px;
  }

  .quick-stats dd {
    text-align: left;
  }
}
