/* Shared by the ENCalc and BTFCalc product explanation pages. The editorial
   homepage uses home.css. Read SITE_GUIDE.md before changing this system. */

:root {
  --blue: #245B78;
  --blue-deep: #17445D;
  --hero-blue: #245B78;
  --blue-background: #F3F8FA;
  --yellow: #D9A62E;
  --yellow-background: #FFF9E8;
  --yellow-hover: #F0C75E;
  --claret: #A4243A;
  --ground: #FAFAFA;
  --ink: #292526;
  --ink-soft: #5E5558;
  --rule: #CBDDE5;
  --on-blue: #FFFFFF;
  --on-yellow: #292526;
  --cta-bg: var(--yellow);
  --cta-hover: var(--yellow-hover);
  --cta-text: var(--on-yellow);
  --radius: 10px;
  --frame: 1184px;
  --gutter: 64px;

  --theme-border: var(--rule);
  --theme-ground: var(--ground);
  --theme-text: var(--blue);
  --theme-hover: #E7F1F5;
  --theme-active: var(--blue);
  --theme-active-text: #FFFFFF;
  --theme-focus: var(--blue);

  color-scheme: light;
}

:root[data-theme="dark"] {
  --blue: #76B8DA;
  --blue-deep: #9ACCE5;
  --hero-blue: #17445D;
  --blue-background: #152A35;
  --yellow: #F0C75E;
  --yellow-background: #332C17;
  --yellow-hover: #F5D77E;
  --claret: #E0708A;
  --ground: #0E1117;
  --ink: #F5F5F5;
  --ink-soft: #C9BFC2;
  --rule: #334956;
  --on-blue: #FFFFFF;
  --on-yellow: #0E1117;
  --cta-bg: var(--yellow);
  --cta-hover: var(--yellow-hover);
  --cta-text: var(--on-yellow);

  --theme-hover: #203B49;
  --theme-active: #76B8DA;
  --theme-active-text: #0E1117;

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  background: var(--ground);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
               Helvetica, Arial, sans-serif;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: inherit;
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.65;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

img { max-width: 100%; height: auto; }

a {
  color: var(--blue);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--blue-deep);
  text-decoration-thickness: 2px;
}

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

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 20;
  padding: 0.75rem 1.25rem;
  background: var(--hero-blue);
  color: var(--on-blue);
  font-weight: 650;
  text-decoration: none;
}

.skip:focus { left: 0.5rem; top: 0.5rem; }

.copy,
.wide,
.media .shot {
  width: min(calc(100% - (2 * var(--gutter))), var(--frame));
  margin-inline: auto;
}

/* ---------- masthead ---------- */

.masthead { border-bottom: 0; }

.masthead .wide {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  min-height: 76px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--blue);
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.product-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem 1.5rem;
}

.masthead nav {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  font-size: 0.875rem;
}

.masthead nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
}

.masthead nav a:hover { text-decoration: underline; }
.masthead nav a[aria-current="page"] {
  color: var(--blue);
  font-weight: 700;
}

/* ---------- product introduction ---------- */

.hero { padding: 2.25rem 0 4.25rem; }

.product-title-surface {
  width: min(74%, 54rem);
  padding: 2.15rem 2.5rem 2.35rem;
  border-bottom: 6px solid var(--yellow);
  background: var(--hero-blue);
  border-radius: var(--radius);
  color: var(--on-blue);
}

h1 {
  margin: 0;
  color: var(--on-blue);
  font-size: clamp(2.75rem, 5.2vw, 3.75rem);
  font-weight: 650;
  line-height: 1;
  letter-spacing: -0.045em;
}

.standfirst {
  max-width: 34ch;
  margin: 1rem 0 0;
  color: var(--on-blue);
  font-size: clamp(1.125rem, 2.25vw, 1.375rem);
  font-weight: 550;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.product-introduction {
  width: min(100%, 48rem);
  margin: 1.75rem 0 0;
  padding: 1.4rem 1.5rem;
  background: var(--yellow-background);
  border-radius: var(--radius);
}

.product-introduction .intro { max-width: 66ch; }

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin-top: 1.5rem;
}

.cta {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0.7rem 1.2rem;
  border-radius: 6px;
  background: var(--cta-bg);
  color: var(--cta-text);
  font-size: 1rem;
  font-weight: 650;
  text-decoration: none;
}

.cta:hover {
  background: var(--cta-hover);
  color: var(--cta-text);
  text-decoration: none;
}

.note {
  margin: 0.9rem 0 0;
  color: var(--ink-soft);
  font-size: 0.9375rem;
  line-height: 1.55;
}

.byline {
  margin: 1.4rem 0 0;
  color: var(--ink-soft);
  font-size: 0.9375rem;
}

/* ---------- calculator image ---------- */

.media { padding-bottom: 4.5rem; }

.media figure {
  width: 100%;
  margin: 0;
}

.media img {
  display: block;
  width: 100%;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: #FCFAF9;
}

figcaption {
  width: 100%;
  margin-top: 0.75rem;
  color: var(--ink-soft);
  font-size: 0.875rem;
  line-height: 1.55;
}

/* ---------- product sections ---------- */

section { scroll-margin-top: 1.5rem; }

section .copy {
  padding-block: 4.5rem;
}

section .copy > * {
  width: min(100%, 66ch);
}

.band {
  background: var(--blue-background);
  border-block: 1px solid var(--yellow);
}

.yellow-band { background: var(--yellow-background); }

h2 {
  margin: 0 0 1.1rem;
  color: var(--blue);
  font-size: clamp(1.35rem, 2.2vw, 1.55rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

h3 {
  margin: 0 0 0.4rem;
  color: var(--ink);
  font-size: 1.125rem;
  font-weight: 700;
}

p { margin: 0 0 1.1rem; }
p:last-child { margin-bottom: 0; }

ul { margin: 0 0 1.1rem; padding-left: 1.25rem; }
li { margin-bottom: 0.55rem; }
li:last-child { margin-bottom: 0; }

strong { font-weight: 700; }

/* ---------- steps ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem 2.5rem;
  max-width: none;
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
}

.steps li {
  display: grid;
  grid-template-columns: 1.4rem minmax(0, 1fr);
  column-gap: 0.35rem;
  align-items: baseline;
  margin: 0;
}

.steps .num {
  grid-column: 1;
  grid-row: 1;
  color: var(--claret);
  font-size: 0.8125rem;
  font-weight: 700;
}

.steps h3 {
  grid-column: 2;
  grid-row: 1;
}

.steps p {
  grid-column: 2;
  grid-row: 2;
  margin: 0;
  color: var(--ink-soft);
}

/* ---------- expandable details ---------- */

details {
  margin-top: 2rem;
  border-top: 1px solid var(--yellow);
  border-bottom: 1px solid var(--yellow);
}

summary {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0.8rem 0;
  color: var(--blue);
  font-weight: 650;
  cursor: pointer;
}

summary:hover { color: var(--blue-deep); }
details[open] summary { border-bottom: 1px solid var(--yellow); }
.details-body { padding-block: 1.5rem; }
.details-body h3 { margin-top: 1.75rem; }
.details-body h3:first-child { margin-top: 0; }

/* ---------- caution ---------- */

.caution {
  margin-top: 1.5rem;
  padding: 0.75rem 0 0.75rem 1rem;
  border-left: 4px solid var(--claret);
}

.caution p { margin: 0; }

/* ---------- final action ---------- */

.final {
  border-block: 0;
  background: var(--hero-blue);
  color: var(--on-blue);
}

.final h2 { color: var(--on-blue); }
.final .note { color: var(--on-blue); }

.final .cta {
  background: var(--yellow);
  color: var(--on-yellow);
}

.final .cta:hover {
  background: var(--yellow-hover);
  color: var(--on-yellow);
}

.final :focus-visible { outline-color: var(--yellow); }

/* ---------- footer ---------- */

footer {
  border-top: 1px solid var(--yellow);
  color: var(--ink-soft);
  font-size: 0.875rem;
  line-height: 1.6;
}

footer .wide {
  padding-block: 2.25rem 3rem;
}

footer p { max-width: 66ch; margin: 0 0 0.85rem; }
footer p:last-child { margin-bottom: 0; }
footer .scope { color: var(--ink); }

/* ---------- responsive layout ---------- */

@media (max-width: 900px) {
  :root {
    --gutter: 40px;
  }

  .masthead .wide { flex-wrap: wrap; padding-block: 0.75rem; }
  .product-header-actions { flex-wrap: wrap; }
  .product-title-surface { width: min(86%, 54rem); }
}

@media (max-width: 700px) {
  section .copy { padding-block: 3.25rem; }
}

@media (max-width: 600px) {
  :root { --gutter: 20px; }

  body { font-size: 1rem; }
  .masthead .wide { align-items: flex-start; }
  .product-header-actions { width: 100%; justify-content: space-between; }
  .masthead nav { gap: 1rem; font-size: 0.8125rem; }

  .hero { padding: 1.25rem 0 3.25rem; }
  .product-title-surface { width: 100%; padding: 1.75rem 1.5rem 2rem; }
  .product-introduction { width: 100%; margin-top: 1.25rem; padding: 1.15rem; }
  .media { padding-bottom: 3.25rem; }
  .steps { grid-template-columns: 1fr; gap: 1.6rem; }
}
