@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@300;400;500&family=Inter:wght@300;400;500&display=swap');

:root {
  --bg: #06090b;
  --surface: #0b0f12;
  --surface-2: #101417;
  --ink: #f0eeeb;
  --muted: #aaa7a3;
  --quiet: #74716e;
  --rule: #373839;
  --rule-soft: #242729;
  --accent: #e37d60;
  --accent-deep: #ae474d;
  --display: 'Barlow Condensed', 'Arial Narrow', 'Bahnschrift Condensed', sans-serif;
  --body: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --max: 1400px;
  --gutter: clamp(22px, 4.2vw, 70px);
}

*, *::before, *::after { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; color-scheme: dark; }
body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button { color: inherit; }
::selection { background: var(--accent); color: var(--bg); }

.sr-only,
.skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus {
  position: fixed;
  z-index: 1000;
  top: 14px;
  left: 14px;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--bg);
}

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  background: rgba(6, 9, 11, .94);
  backdrop-filter: blur(14px);
}

.header-inner {
  width: min(var(--max), calc(100% - (2 * var(--gutter))));
  min-height: 78px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--rule);
}

.brand-wordmark {
  text-decoration: none;
  font-family: var(--body);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: .31em;
}

.site-navigation { display: flex; align-items: center; gap: clamp(28px, 4vw, 58px); }
.site-navigation a {
  position: relative;
  padding: 28px 0 24px;
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: .14em;
}
.site-navigation a:hover,
.site-navigation a:focus-visible,
.site-navigation a.is-current { color: var(--accent); }
.site-navigation a::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), var(--accent-deep));
  content: '';
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .2s ease;
}
.site-navigation a:hover::after,
.site-navigation a:focus-visible::after,
.site-navigation a.is-current::after { transform: scaleX(1); }

.menu-button {
  width: 46px;
  height: 46px;
  display: none;
  place-items: center;
  gap: 4px;
  border: 0;
  background: transparent;
}
.menu-button span:not(.sr-only) { width: 26px; height: 1px; display: block; background: var(--ink); }

.technical-corners { position: relative; }
.technical-corners::before,
.technical-corners::after {
  position: absolute;
  top: 0;
  width: 28px;
  height: 28px;
  border-top: 1px solid var(--accent);
  content: '';
}
.technical-corners::before { left: 0; border-left: 1px solid var(--accent); }
.technical-corners::after { right: 0; border-right: 1px solid var(--accent); }

/* Directory */
.index-page,
.calculator-page,
.resource-page {
  width: min(var(--max), calc(100% - (2 * var(--gutter))));
  margin: 0 auto;
}

.index-hero {
  position: relative;
  min-height: 420px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--rule);
  isolation: isolate;
}
.index-hero::before {
  position: absolute;
  z-index: -2;
  inset: 0 calc(50% - 50vw);
  background: url('photoform-lens-still-life.png') center right / cover no-repeat;
  content: '';
}
.index-hero::after {
  position: absolute;
  z-index: -1;
  inset: 0 calc(50% - 50vw);
  background: linear-gradient(90deg, #06090b 7%, rgba(6,9,11,.98) 23%, rgba(6,9,11,.55) 53%, rgba(6,9,11,.05) 83%);
  content: '';
}

.index-hero-copy { width: min(720px, 58%); padding: 52px 36px; }
.index-hero h1,
.calculator-hero h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(72px, 8.3vw, 126px);
  font-weight: 300;
  line-height: .86;
  letter-spacing: -.025em;
}
.index-hero h1 { font-size: clamp(64px, 5.6vw, 86px); white-space: nowrap; }
.index-hero-copy::after {
  width: 52px;
  height: 2px;
  display: block;
  margin-top: 30px;
  background: linear-gradient(90deg, var(--accent), var(--accent-deep));
  content: '';
}
.index-hero p {
  max-width: 540px;
  margin: 28px 0 0;
  color: #d4d1ce;
  font-family: var(--display);
  font-size: clamp(21px, 2vw, 29px);
  font-weight: 300;
  line-height: 1.28;
}
.hero-shortcut {
  position: absolute;
  bottom: 30px;
  left: 36px;
  color: var(--accent);
  text-decoration: none;
  font-family: var(--display);
  font-size: 26px;
}

.directory { padding: 0 0 70px; }
.category-tabs {
  display: flex;
  gap: clamp(24px, 4.4vw, 72px);
  overflow-x: auto;
  overflow-y: hidden;
  border-bottom: 1px solid var(--rule);
  scrollbar-width: thin;
}
.category-tab {
  position: relative;
  min-height: 78px;
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--body);
  font-size: 12px;
  letter-spacing: .15em;
  text-align: left;
}
.category-tab::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-deep));
  content: '';
  transform: scaleX(0);
  transform-origin: left;
}
.category-tab:hover,
.category-tab:focus-visible,
.category-tab.is-active { color: var(--accent); }
.category-tab.is-active::after { transform: scaleX(1); }

.directory-search {
  width: min(430px, 100%);
  height: 52px;
  margin: 20px 0 10px;
  padding: 0 18px 0 50px;
  border: 1px solid var(--rule);
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23aaa7a3' stroke-width='1.5'%3E%3Ccircle cx='11' cy='11' r='6'/%3E%3Cpath d='m16 16 4 4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 16px center;
  background-size: 20px;
}
.directory-search:focus { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.directory-search::placeholder { color: var(--muted); }

.directory-panel { border-top: 1px solid var(--rule-soft); }
.directory-panel[hidden] { display: none; }
.tool-row {
  min-height: 74px;
  display: grid;
  grid-template-columns: 74px minmax(210px, .72fr) minmax(270px, 1.25fr) 44px;
  align-items: center;
  gap: 22px;
  border-bottom: 1px solid var(--rule-soft);
  color: inherit;
  text-decoration: none;
  transition: background .18s ease, padding .18s ease;
}
.tool-row:hover,
.tool-row:focus-visible {
  padding-inline: 16px 10px;
  outline: 0;
  background: linear-gradient(90deg, rgba(227,125,96,.08), rgba(227,125,96,.015));
  box-shadow: inset 2px 0 0 var(--accent);
}
.tool-row[hidden] { display: none; }
.tool-number { color: var(--accent); font-family: var(--display); font-size: 26px; font-weight: 300; }
.tool-number--resource { font-size: 22px; letter-spacing: .03em; }
.tool-name { font-family: var(--display); font-size: 29px; font-weight: 300; line-height: 1; }
.tool-description { color: var(--muted); font-size: 14px; }
.tool-arrow { color: var(--muted); font-family: var(--display); font-size: 31px; transition: transform .18s ease, color .18s ease; }
.tool-row:hover .tool-arrow { color: var(--accent); transform: translateX(5px); }

.index-section {
  display: grid;
  grid-template-columns: minmax(210px, .55fr) minmax(0, 1.45fr);
  gap: clamp(38px, 8vw, 130px);
  padding: 68px 0;
  border-top: 1px solid var(--rule);
}
.index-section h2 {
  margin: 0;
  color: var(--accent);
  font-family: var(--display);
  font-size: 46px;
  font-weight: 300;
  line-height: 1;
}
.index-section p { max-width: 800px; margin: 0 0 16px; color: var(--muted); }
.index-section a { text-underline-offset: 4px; }

/* Calculator */
.calculator-hero {
  min-height: 350px;
  display: grid;
  grid-template-columns: minmax(410px, .78fr) minmax(480px, 1.22fr);
  border-bottom: 1px solid var(--rule);
}
.hero-copy { align-self: center; padding: 40px 28px 40px 14px; }
.page-category,
.panel-heading,
.recommendation > span,
.explainer h2,
.related-tools h2 {
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .15em;
}
.page-category { margin: 0 0 16px; }
.calculator-hero h1 { font-size: clamp(72px, 7.5vw, 112px); }
.page-subtitle {
  max-width: 470px;
  margin: 19px 0 0;
  color: #d1cecb;
  font-family: var(--display);
  font-size: clamp(21px, 2vw, 28px);
  font-weight: 300;
  line-height: 1.25;
}
.formula {
  width: fit-content;
  max-width: 100%;
  margin: 20px 0 0;
  padding: 9px 13px;
  border: 1px solid rgba(227,125,96,.7);
  color: #d8d5d2;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.formula:empty { display: none; }
.hero-media {
  min-height: 310px;
  background: url('photoform-lens-still-life.png') center right / cover no-repeat;
  mask-image: linear-gradient(90deg, transparent 0, #000 17%, #000 100%);
}

.workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(36px, 5vw, 80px);
  padding: 34px 0 28px;
  border-bottom: 1px solid var(--rule);
}
.control-panel { min-width: 0; padding-right: clamp(0px, 2vw, 28px); border-right: 1px solid var(--rule); }
.panel-heading {
  min-height: 32px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid var(--rule);
}
.panel-heading > span::after {
  width: 54px;
  height: 1px;
  display: block;
  margin-top: 12px;
  background: var(--accent);
  content: '';
}
.control-list { margin-top: 10px; }
.field {
  min-height: 64px;
  display: grid;
  grid-template-columns: minmax(150px, .8fr) minmax(190px, 1.2fr);
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--rule-soft);
}
.field-label { display: flex; align-items: center; gap: 11px; color: #d0cdca; font-family: var(--display); font-size: 20px; font-weight: 300; }
.field-icon { width: 20px; height: 20px; flex: 0 0 auto; color: var(--quiet); }
.field-help { display: block; margin-top: 2px; color: var(--quiet); font-family: var(--body); font-size: 10px; line-height: 1.2; }
.select-wrap,
.number-wrap { position: relative; min-width: 0; display: flex; align-items: center; }
.select-wrap::after {
  position: absolute;
  right: 16px;
  width: 8px;
  height: 8px;
  border-right: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  content: '';
  pointer-events: none;
  transform: translateY(-3px) rotate(45deg);
}
.select-wrap select,
.number-wrap input {
  width: 100%;
  height: 46px;
  padding: 0 42px 0 15px;
  border: 1px solid var(--rule);
  border-radius: 0;
  outline: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--display);
  font-size: 19px;
  font-weight: 300;
  appearance: none;
}
.select-wrap select:focus,
.number-wrap input:focus { border-color: var(--accent); box-shadow: inset 2px 0 0 var(--accent); }
.number-wrap input { text-align: center; padding-inline: 42px; }
.number-wrap .unit { position: absolute; right: 12px; color: var(--muted); font-family: var(--display); pointer-events: none; }
.step-button {
  position: absolute;
  z-index: 2;
  width: 39px;
  height: 44px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
}
.step-button:first-child { left: 1px; }
.step-button:nth-of-type(2) { right: 1px; }
.number-wrap:has(.unit) .step-button:nth-of-type(2) { right: 35px; }
.step-button:hover,
.step-button:focus-visible { color: var(--accent); outline: 0; }
.segment-wrap { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
.segment-wrap input { position: absolute; opacity: 0; pointer-events: none; }
.segment-wrap label {
  min-height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid var(--rule);
  color: var(--muted);
  font-family: var(--display);
  font-size: 17px;
}
.segment-wrap label + input + label { border-left: 0; }
.segment-wrap input:checked + label { border-color: var(--accent); color: var(--accent); background: rgba(227,125,96,.07); }
.segment-wrap input:focus-visible + label { outline: 1px solid var(--accent); outline-offset: 2px; }
.form-actions { min-height: 42px; display: flex; align-items: end; justify-content: flex-end; }
.text-button {
  min-height: 40px;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 11px;
  letter-spacing: .14em;
}
.text-button:hover,
.text-button:focus-visible { color: var(--ink); outline: 0; text-decoration: underline; text-underline-offset: 5px; }

.result-panel { min-width: 0; }
.result-heading { align-items: flex-start; }
.copy-button { margin-top: -9px; }
.primary-result {
  min-height: 135px;
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: end;
  align-content: center;
  gap: 0 12px;
  padding: 18px 0 12px;
}
.primary-label { grid-column: 1 / -1; align-self: start; color: var(--muted); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.primary-value { font-family: var(--display); font-size: clamp(72px, 7vw, 108px); font-weight: 300; line-height: .8; white-space: nowrap; }
.primary-unit { align-self: end; padding-bottom: 7px; color: #d2cfcc; font-family: var(--display); font-size: 34px; font-weight: 300; }
.primary-note { grid-column: 1 / -1; margin-top: 15px; color: var(--muted); font-size: 12px; }
.result-grid { display: grid; border-top: 1px solid var(--rule-soft); border-bottom: 1px solid var(--rule-soft); }
.result-item { min-width: 0; padding: 15px 12px 15px 0; }
.result-item + .result-item { padding-left: 16px; border-left: 1px solid var(--rule-soft); }
.result-label { display: block; color: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.result-value { display: block; margin-top: 4px; font-family: var(--display); font-size: 25px; font-weight: 300; line-height: 1.05; overflow-wrap: anywhere; }
.result-unit { margin-left: 5px; color: var(--muted); font-size: .55em; font-weight: 300; }
.recommendation { padding: 18px 0 4px; }
.recommendation p { margin: 7px 0 0; color: #d0cdca; font-family: var(--display); font-size: 19px; font-weight: 300; line-height: 1.35; }
.copy-status { min-height: 18px; margin: 6px 0 0; color: var(--accent); font-size: 11px; text-align: right; }

.visualization { min-height: 0; padding: 22px 0; border-bottom: 1px solid var(--rule); }
.visualization:empty { display: none; }
.diagram-center { min-height: 90px; display: grid; place-items: center; align-content: center; gap: 14px; }
.diagram-line { position: relative; width: min(88%, 780px); height: 14px; border-top: 1px solid var(--muted); }
.diagram-line::before {
  position: absolute;
  top: -6px;
  left: var(--marker, 50%);
  width: 11px;
  height: 11px;
  border: 1px solid var(--accent);
  background: var(--bg);
  content: '';
  transform: translateX(-50%) rotate(45deg);
}
.diagram-copy { max-width: 720px; margin: 0; color: var(--muted); text-align: center; font-size: 13px; }
.viz-frame { position: relative; min-height: 145px; padding: 30px 5% 20px; }
.meter-track { position: relative; height: 36px; margin-top: 28px; border-top: 1px solid var(--muted); }
.focus-band { position: absolute; top: -4px; left: var(--band-left); width: var(--band-width); height: 7px; background: linear-gradient(90deg, var(--accent), var(--accent-deep)); opacity: .75; }
.meter-point { position: absolute; top: -7px; left: var(--pos); width: 13px; height: 13px; border: 1px solid var(--ink); background: var(--bg); transform: translateX(-50%) rotate(45deg); }
.meter-point--focus { border-color: var(--accent); background: var(--accent); }
.meter-label { position: absolute; bottom: 25px; left: var(--pos); color: var(--muted); font-size: 10px; transform: translateX(-50%); text-align: center; }
.meter-label strong { color: var(--accent); font-weight: 400; }
.scale-caption { display: flex; justify-content: space-between; color: #bbb8b4; font-size: 10px; }
.scale-caption span:first-child,
.scale-caption span:last-child { color: #d4d1cd; }
.button {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--accent);
  border-radius: 0;
  background: transparent;
  color: var(--accent);
  font-size: 11px;
  letter-spacing: .1em;
}

.explainers { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--rule); }
.explainer { min-height: 150px; padding: 25px 32px 28px 0; }
.explainer + .explainer { padding-left: 32px; border-left: 1px solid var(--rule); }
.explainer:last-child { padding-right: 0; }
.explainer h2 { margin: 0 0 9px; font-weight: 500; }
.explainer p { margin: 0; color: var(--muted); font-size: 13px; }
.explainer strong { color: var(--ink); font-weight: 400; }
.calculation-context,
.term-reference {
  display: grid;
  grid-template-columns: minmax(210px, .58fr) minmax(0, 1.42fr);
  gap: clamp(40px, 7vw, 112px);
  padding: 34px 0 38px;
  border-bottom: 1px solid var(--rule);
}
.context-heading span,
.term-heading span { color: var(--accent); font-size: 9px; letter-spacing: .18em; }
.context-heading h2,
.term-heading h2 { max-width: 310px; margin: 8px 0 0; font-family: var(--display); font-size: clamp(32px, 3vw, 48px); font-weight: 300; line-height: .95; }
.context-copy > p { max-width: 760px; margin: 0 0 24px; color: var(--ink); font-family: var(--display); font-size: clamp(22px, 2.2vw, 31px); font-weight: 300; line-height: 1.16; }
.context-copy ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; margin: 0; padding: 0; list-style: none; }
.context-copy li { padding-top: 11px; border-top: 1px solid var(--rule-soft); color: var(--muted); font-size: 12px; }
.context-copy li::before { margin-right: 9px; color: var(--accent); content: '↗'; }
.term-reference { padding-top: 38px; padding-bottom: 42px; }
.term-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 25px 34px; margin: 0; }
.term-item { min-width: 0; padding-top: 12px; border-top: 1px solid var(--rule-soft); }
.term-item dt { margin: 0 0 7px; color: var(--ink); font-family: var(--display); font-size: 20px; font-weight: 300; line-height: 1.1; }
.term-item dd { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.term-item abbr { color: var(--accent); text-decoration: none; cursor: help; }
.related-tools { min-height: 76px; display: grid; grid-template-columns: minmax(210px, .58fr) minmax(0, 1.42fr); align-items: center; gap: clamp(40px, 7vw, 112px); border-bottom: 1px solid var(--rule); }
.related-tools h2 { margin: 0; flex: 0 0 auto; }
.related-links { display: flex; flex-wrap: wrap; gap: 0; }
.related-links a { color: var(--muted); text-decoration: none; font-family: var(--display); font-size: 18px; font-weight: 300; }
.related-links a:hover,
.related-links a:focus-visible { color: var(--accent); outline: 0; }
.related-links a + a::before { margin: 0 15px; color: var(--accent); content: '·'; }

/* Advertising */
.ad-placement {
  width: 100%;
  min-height: clamp(180px, 18vw, 250px);
  display: grid;
  align-items: center;
  overflow: hidden;
  padding: clamp(54px, 7vw, 94px) 0;
  border-bottom: 1px solid var(--rule);
}
.ad-placement--index { border-top: 1px solid var(--rule); }
.ad-placement + .index-section { border-top: 0; }
.ad-placement .adsbygoogle { width: 100%; min-width: 0; }

/* Optional calculator reference */
.page-download {
  display: grid;
  grid-template-columns: minmax(280px, .82fr) minmax(360px, 1.18fr);
  align-items: center;
  gap: clamp(38px, 7vw, 108px);
  padding: 46px 0;
  border-bottom: 1px solid var(--rule);
}
.page-download[hidden] { display: none; }
.download-copy > span,
.resource-guide-heading > span,
.resource-reading > div > span {
  color: var(--accent);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .18em;
}
.download-copy h2,
.resource-guide h2,
.resource-reading h2 {
  margin: 8px 0 18px;
  font-family: var(--display);
  font-size: clamp(36px, 4vw, 58px);
  font-weight: 300;
  line-height: .94;
}
.download-copy > p { max-width: 570px; margin: 0; color: var(--muted); font-size: 13px; }
.download-actions,
.resource-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 24px; margin-top: 28px; }
.download-button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .14em;
  transition: background .18s ease, color .18s ease;
}
.download-button:hover,
.download-button:focus-visible { background: var(--accent); color: var(--bg); outline: 0; }
.download-preview {
  min-height: 250px;
  display: grid;
  place-items: center;
  padding: clamp(14px, 2vw, 24px);
  border: 1px solid var(--rule);
  background: #f7f7f5;
}
.download-preview img { width: 100%; max-height: 350px; display: block; object-fit: contain; }

/* Lens test resources */
.resource-hero {
  min-height: 520px;
  display: grid;
  grid-template-columns: minmax(400px, .76fr) minmax(520px, 1.24fr);
  gap: clamp(36px, 5vw, 78px);
  align-items: center;
  padding: 54px 0;
  border-bottom: 1px solid var(--rule);
}
.resource-copy { padding: 38px 32px 40px 18px; }
.resource-copy h1 {
  max-width: 570px;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(68px, 6.8vw, 104px);
  font-weight: 300;
  line-height: .88;
  letter-spacing: -.025em;
}
.resource-subtitle {
  max-width: 510px;
  margin: 24px 0 0;
  color: #d1cecb;
  font-family: var(--display);
  font-size: clamp(21px, 2vw, 27px);
  font-weight: 300;
  line-height: 1.28;
}
.resource-hero-media {
  position: relative;
  min-height: 390px;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: clamp(14px, 2vw, 26px);
  border: 1px solid var(--rule);
  background: #f4f4f2;
}
.resource-hero-media::after {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 42px;
  height: 42px;
  border-right: 1px solid var(--accent);
  border-bottom: 1px solid var(--accent);
  content: '';
}
.resource-hero-media img { width: 100%; max-height: 440px; display: block; object-fit: contain; }
.resource-guide {
  display: grid;
  grid-template-columns: minmax(280px, .72fr) minmax(0, 1.28fr);
  gap: clamp(42px, 8vw, 124px);
  padding: 62px 0;
  border-bottom: 1px solid var(--rule);
}
.resource-guide h2 { max-width: 390px; }
.resource-steps { margin: 0; padding: 0; list-style: none; counter-reset: lens-step; }
.resource-steps li {
  min-height: 82px;
  display: grid;
  grid-template-columns: 48px minmax(150px, .55fr) minmax(240px, 1.45fr);
  align-items: start;
  gap: 18px;
  padding: 18px 0;
  border-top: 1px solid var(--rule-soft);
  counter-increment: lens-step;
}
.resource-steps li::before {
  color: var(--accent);
  font-family: var(--display);
  font-size: 25px;
  font-weight: 300;
  content: '0' counter(lens-step);
}
.resource-steps strong { font-family: var(--display); font-size: 21px; font-weight: 300; line-height: 1.15; }
.resource-steps span { color: var(--muted); font-size: 12px; line-height: 1.55; }
.resource-reading {
  display: grid;
  grid-template-columns: minmax(280px, .72fr) minmax(260px, 1fr) minmax(260px, .75fr);
  gap: clamp(34px, 6vw, 88px);
  padding: 54px 0 62px;
  border-bottom: 1px solid var(--rule);
}
.resource-reading h2 { max-width: 390px; }
.resource-reading > p { margin: 0; color: var(--muted); font-size: 13px; }
.resource-reading .resource-caution { padding: 20px; border-left: 1px solid var(--accent); background: var(--surface); }
.resource-caution strong { display: block; margin-bottom: 8px; color: var(--ink); font-family: var(--display); font-size: 19px; font-weight: 300; }

.site-footer {
  width: min(var(--max), calc(100% - (2 * var(--gutter))));
  min-height: 126px;
  margin: auto auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 22px 0;
}
.footer-credit { display: flex; flex-direction: column; align-items: flex-start; }
.footer-credit a { color: var(--muted); text-decoration: none; font-family: var(--display); font-size: 20px; font-weight: 300; }
.footer-credit span { margin-top: 3px; color: var(--quiet); font-size: 9px; letter-spacing: .09em; text-transform: uppercase; }
.footer-credit a:hover,
.footer-credit a:focus-visible { color: var(--accent); outline: 0; }
.footer-qr { display: flex; align-items: center; gap: 14px; color: var(--muted); text-decoration: none; font-size: 9px; letter-spacing: .14em; }
.footer-qr img { width: 76px; height: 76px; display: block; padding: 3px; background: white; }
.footer-qr:hover,
.footer-qr:focus-visible { color: var(--accent); outline: 0; }

.noscript { margin: 30px; padding: 18px; border: 1px solid var(--accent); }

@media (max-width: 960px) {
  .calculator-hero { grid-template-columns: minmax(350px, .9fr) 1.1fr; }
  .resource-hero { grid-template-columns: minmax(350px, .86fr) minmax(390px, 1.14fr); }
  .resource-reading { grid-template-columns: minmax(230px, .65fr) minmax(0, 1.35fr); }
  .resource-reading .resource-caution { grid-column: 2; }
  .workbench { gap: 34px; }
  .field { grid-template-columns: 130px 1fr; }
  .tool-row { grid-template-columns: 62px minmax(180px, .8fr) minmax(230px, 1.2fr) 34px; gap: 15px; }
}

@media (max-width: 760px) {
  :root { --gutter: 20px; }
  .header-inner { min-height: 68px; }
  .brand-wordmark { font-size: 17px; letter-spacing: .27em; }
  .menu-button { display: grid; }
  .site-navigation {
    position: absolute;
    top: 68px;
    right: 0;
    left: 0;
    display: none;
    padding: 10px var(--gutter) 18px;
    gap: 18px;
    border-bottom: 1px solid var(--rule);
    background: rgba(6,9,11,.98);
  }
  .site-navigation.is-open { display: flex; }
  .site-navigation a { padding: 10px 0; }

  .index-hero { min-height: 610px; align-items: flex-start; }
  .index-hero::before { inset: 240px calc(50% - 50vw) 0; background-position: 64% center; }
  .index-hero::after { inset: 0 calc(50% - 50vw); background: linear-gradient(180deg, #06090b 0, rgba(6,9,11,.98) 33%, rgba(6,9,11,.15) 69%, #06090b 100%); }
  .index-hero-copy { width: 100%; padding: 48px 22px 20px; }
  .index-hero h1 { max-width: 310px; font-size: clamp(72px, 23vw, 94px); }
  .index-hero h1 { white-space: normal; }
  .index-hero p { max-width: 350px; margin-top: 22px; font-size: 21px; }
  .hero-shortcut { bottom: 22px; left: 22px; }
  .category-tabs { gap: 30px; }
  .category-tab { min-height: 64px; }
  .directory-search { width: 100%; }
  .tool-row {
    min-height: 78px;
    grid-template-columns: 40px minmax(0, 1fr) 26px;
    gap: 10px;
    padding: 11px 0;
  }
  .tool-row:hover,
  .tool-row:focus-visible { padding-inline: 10px 7px; }
  .tool-name { font-size: 24px; }
  .tool-description { grid-column: 2; font-size: 11px; line-height: 1.35; }
  .tool-arrow { grid-column: 3; grid-row: 1 / 3; }
  .tool-number { grid-row: 1 / 3; align-self: start; padding-top: 1px; font-size: 22px; }
  .index-section { grid-template-columns: 1fr; gap: 24px; padding: 50px 0; }
  .index-section h2 { font-size: 40px; }

  .calculator-page { width: 100%; }
  .calculator-hero { min-height: 620px; display: flex; flex-direction: column; border-bottom: 0; }
  .hero-copy { width: calc(100% - (2 * var(--gutter))); margin: 26px auto 0; padding: 30px 22px 28px; }
  .calculator-hero h1 { font-size: clamp(76px, 24vw, 104px); }
  .calculator-hero h1[data-title-fit="compact"] { font-size: clamp(60px, 18vw, 80px); }
  .page-subtitle { font-size: 22px; }
  .formula { font-size: 10px; }
  .hero-media { min-height: 260px; flex: 1; background-position: 66% center; mask-image: linear-gradient(180deg, transparent 0, #000 14%, #000 88%, transparent 100%); }
  .workbench { width: calc(100% - (2 * var(--gutter))); margin: 0 auto; display: block; padding-top: 25px; }
  .control-panel { padding-right: 0; border-right: 0; border-bottom: 1px solid var(--rule); }
  .field { grid-template-columns: minmax(120px, .85fr) minmax(170px, 1.15fr); gap: 10px; }
  .field-label { font-size: 18px; }
  .field-icon { display: none; }
  .field-help { display: none; }
  .select-wrap select,
  .number-wrap input { min-height: 48px; font-size: 18px; }
  .form-actions { min-height: 50px; }
  .result-panel { padding-top: 28px; }
  .primary-result { min-height: 125px; }
  .primary-value { font-size: clamp(82px, 25vw, 112px); }
  .primary-result[data-value-fit="compact"] .primary-value { font-size: clamp(58px, 17vw, 74px); }
  .result-grid { grid-template-columns: 1fr !important; }
  .result-item + .result-item { padding-left: 0; border-left: 0; border-top: 1px solid var(--rule-soft); }
  .recommendation { padding: 20px 0 14px; }
  .visualization { width: calc(100% - (2 * var(--gutter))); margin: auto; }
  .explainers { width: calc(100% - (2 * var(--gutter))); margin: auto; display: block; }
  .explainer { min-height: 0; padding: 24px 0; }
  .explainer + .explainer { padding-left: 0; border-top: 1px solid var(--rule); border-left: 0; }
  .calculation-context,
  .term-reference { width: calc(100% - (2 * var(--gutter))); margin: auto; display: block; padding: 30px 0 32px; }
  .context-heading h2,
  .term-heading h2 { margin-bottom: 24px; }
  .context-copy > p { margin-bottom: 21px; }
  .context-copy ul { grid-template-columns: 1fr; gap: 17px; }
  .term-list { grid-template-columns: 1fr; gap: 17px; }
  .term-item dt { font-size: 19px; }
  .ad-placement { width: calc(100% - (2 * var(--gutter))); min-height: 180px; margin: auto; padding: 52px 0; }
  .index-page > .ad-placement { width: 100%; }
  .page-download { width: calc(100% - (2 * var(--gutter))); margin: auto; display: flex; flex-direction: column; align-items: stretch; padding: 36px 0; }
  .download-preview { order: -1; min-height: 0; }
  .download-preview img { max-height: 390px; }
  .related-tools { width: calc(100% - (2 * var(--gutter))); min-height: 0; margin: auto; display: block; padding: 23px 0; }
  .related-tools h2 { margin-bottom: 10px; }
  .related-links a { font-size: 17px; }
  .resource-page { width: 100%; }
  .resource-hero { min-height: 0; display: flex; flex-direction: column; gap: 32px; padding: 34px var(--gutter) 40px; }
  .resource-copy { width: 100%; padding: 28px 22px 30px; }
  .resource-copy h1 { font-size: clamp(68px, 20vw, 88px); }
  .resource-subtitle { font-size: 22px; }
  .resource-hero-media { width: 100%; min-height: 0; padding: 13px; }
  .resource-hero-media img { max-height: 360px; }
  .resource-guide,
  .resource-reading { width: calc(100% - (2 * var(--gutter))); margin: auto; display: block; padding: 42px 0; }
  .resource-guide-heading { margin-bottom: 28px; }
  .resource-steps li { grid-template-columns: 38px minmax(0, 1fr); gap: 12px; }
  .resource-steps li span { grid-column: 2; }
  .resource-reading > p { margin-top: 24px; }
  .resource-reading .resource-caution { margin-top: 28px; }
  .site-footer { min-height: 112px; }
  .footer-qr img { width: 68px; height: 68px; }
}

@media (max-width: 420px) {
  .site-navigation { flex-direction: column; align-items: flex-start; }
  .field { min-height: 70px; grid-template-columns: 112px minmax(0, 1fr); }
  .field-label { font-size: 17px; }
  .segment-wrap label { font-size: 15px; }
  .result-heading { align-items: center; }
  .copy-button { margin-top: -5px; }
  .resource-actions,
  .download-actions { align-items: flex-start; flex-direction: column; }
  .footer-credit span { max-width: 150px; }
  .footer-qr { gap: 8px; }
  .footer-qr span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .001ms !important; animation-duration: .001ms !important; }
}

@media print {
  .site-header, .hero-media, .form-actions, .copy-button, .ad-placement, .related-tools, .site-footer { display: none !important; }
  body { background: white; color: black; }
  .calculator-page { width: 100%; }
  .calculator-hero { min-height: 0; display: block; }
  .hero-copy { padding: 20px 0; }
  .workbench { grid-template-columns: 42% 58%; }
}
