/* Kalico Drapery — cool editorial light theme
   A calm, neutral palette (cool stone, slate-navy, graphite) paired with
   local system serif and sans-serif stacks. */

:root {
  /* Cool neutral surfaces */
  --paper: #eceeee;
  --paper-2: #e3e6e7;
  --surface: #fcfcfd;
  --surface-2: #f4f6f7;
  --surface-3: #eceff1;

  /* Ink + text */
  --ink: #1f262c;
  --ink-2: #475059;
  --muted: #7c868f;

  /* Lines */
  --line: #dee2e5;
  --line-strong: #ccd2d8;

  /* Brand colours — slate-navy primary, mid-slate accent, graphite metal */
  --navy: #2c3e4f;
  --navy-d: #1f2d3a;
  --navy-tint: #e2e8ec;
  --accent: #466178;
  --accent-d: #375064;
  --accent-tint: #e5eaee;
  --metal: #434b52;
  --metal-soft: #828b92;

  /* Effects */
  --shadow-xs: 0 1px 2px rgba(28, 33, 38, 0.05);
  --shadow-sm: 0 2px 6px rgba(28, 33, 38, 0.06), 0 1px 2px rgba(28, 33, 38, 0.04);
  --shadow-md: 0 10px 30px rgba(28, 33, 38, 0.08), 0 2px 8px rgba(28, 33, 38, 0.05);
  --shadow-lg: 0 28px 70px rgba(28, 33, 38, 0.14), 0 6px 18px rgba(28, 33, 38, 0.07);
  --ring: 0 0 0 4px rgba(44, 62, 79, 0.2);

  --r-lg: 26px;
  --r-md: 16px;
  --r-sm: 11px;
  --r-pill: 999px;

  --font-display: Georgia, "Times New Roman", serif;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  /* JS-driven visual variables */
  --rod-scale: 78%;
  --window-scale: 62%;
  --stack-scale: 8%;
  --fold-density: 1;

  --pad-x: clamp(20px, 4vw, 64px);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  margin: 0;
  width: 100%;
  overflow-x: hidden;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  background:
    radial-gradient(1200px 680px at 86% -8%, rgba(44, 62, 79, 0.10), transparent 60%),
    radial-gradient(900px 620px at -6% 8%, rgba(70, 97, 120, 0.07), transparent 58%),
    var(--paper);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

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

a {
  color: inherit;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 540;
  letter-spacing: -0.01em;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  outline: none;
  background: var(--surface);
  color: var(--ink);
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

input:focus,
select:focus {
  border-color: var(--navy);
  background: var(--surface);
  box-shadow: var(--ring);
}

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ink-2) 50%),
    linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - 19px) 53%, calc(100% - 13px) 53%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

select option {
  color: var(--ink);
}

/* ---------- Small caps / label typography ---------- */
.eyebrow,
.panel-index,
.segmented button,
.choice-button,
.finish-button,
.demo-button,
.metric span,
.metric small,
.visual-toolbar,
.measure-line span,
.blog-card span,
.article-meta,
.mini-label,
.main-nav a,
.site-footer a,
.field span,
.range-row label,
.confidence {
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 14px var(--pad-x);
  color: var(--ink);
  background: rgba(236, 238, 238, 0.8);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px) saturate(1.1);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-size: clamp(1.02rem, 1.2vw, 1.18rem);
  font-weight: 560;
  letter-spacing: -0.01em;
  text-transform: none;
  text-decoration: none;
  min-width: 0;
}

.brand-logo {
  display: block;
  width: clamp(210px, 18vw, 268px);
  height: auto;
  max-height: 52px;
  object-fit: contain;
  object-position: left center;
}

.brand-mark {
  position: relative;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: url("./assets/kalico-logo-mark-image2.png") center / contain no-repeat;
  box-shadow: var(--shadow-xs);
}

.main-nav,
.site-footer nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2vw, 30px);
}

.main-nav a,
.site-footer a {
  position: relative;
  font-size: 0.7rem;
  text-decoration: none;
  color: var(--ink-2);
  opacity: 0.92;
  transition: color 180ms ease;
}

.main-nav a::after,
.site-footer a::after {
  position: absolute;
  right: 0;
  bottom: -7px;
  left: 0;
  height: 2px;
  content: "";
  border-radius: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.main-nav a:hover,
.main-nav a.is-active,
.site-footer a:hover {
  color: var(--ink);
}

.main-nav a:hover::after,
.main-nav a.is-active::after,
.site-footer a:hover::after {
  transform: scaleX(1);
}

/* ---------- Hero ---------- */
.hero-tool {
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  align-items: center;
  gap: clamp(32px, 5vw, 76px);
  padding: clamp(118px, 13vw, 168px) var(--pad-x) clamp(26px, 4vw, 44px);
}

.hero-copy,
.hero-photo,
.main-nav {
  min-width: 0;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 18px;
  padding: 7px 13px;
  border-radius: var(--r-pill);
  background: var(--accent-tint);
  color: var(--accent-d);
  font-size: 0.66rem;
}

h1 {
  max-width: 14ch;
  overflow-wrap: break-word;
  color: var(--ink);
  font-size: clamp(2.9rem, 5.4vw, 4.6rem);
  font-weight: 500;
  line-height: 1.02;
}

h1 em {
  display: block;
  color: var(--navy);
  font-style: italic;
  font-weight: 460;
}

.hero-copy p:not(.eyebrow) {
  max-width: 46ch;
  margin-top: 22px;
  color: var(--ink-2);
  font-size: 1.08rem;
  overflow-wrap: break-word;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.hero-links a,
.section-cta {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 12px 22px;
  border: 1.5px solid var(--ink);
  border-radius: var(--r-pill);
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 180ms ease, color 180ms ease, border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.hero-links a:first-child,
.section-cta {
  border-color: var(--navy);
  background: var(--navy);
  color: #f6f8f9;
  box-shadow: var(--shadow-sm);
}

.hero-links a:first-child:hover,
.section-cta:hover {
  background: var(--navy-d);
  border-color: var(--navy-d);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.hero-links a:not(:first-child):hover {
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-2px);
}

.hero-photo {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
}

.hero-photo::before {
  position: absolute;
  inset: 0;
  z-index: 2;
  content: "";
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
  pointer-events: none;
}

.hero-photo::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  content: "";
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(28, 33, 38, 0) 40%, rgba(28, 33, 38, 0.5) 100%),
    linear-gradient(110deg, rgba(44, 62, 79, 0.16), rgba(28, 33, 38, 0) 46%);
  pointer-events: none;
}

.hero-photo img {
  width: 100%;
  height: clamp(380px, 52vw, 560px);
  object-fit: cover;
  object-position: 56% 50%;
  transform: scale(1.03);
  animation: imageSettle 1100ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.hero-photo figcaption {
  position: absolute;
  right: 18px;
  bottom: 18px;
  left: 18px;
  z-index: 3;
  padding: 0 4px 4px;
  color: rgba(255, 253, 248, 0.96);
  font-size: 0.82rem;
  line-height: 1.5;
  text-shadow: 0 1px 10px rgba(28, 33, 38, 0.5);
  overflow-wrap: break-word;
}

/* ---------- Calculator shell ---------- */
.calculator-section {
  padding: clamp(8px, 2vw, 22px) var(--pad-x) clamp(48px, 7vw, 96px);
}

.calculator-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.82fr) minmax(0, 1.18fr);
  max-width: 1200px;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.measure-panel,
.result-panel {
  min-width: 0;
  padding: clamp(22px, 2.4vw, 34px);
}

.measure-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.result-panel {
  background:
    linear-gradient(180deg, var(--surface-2), var(--surface));
}

.panel-heading,
.result-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.panel-index {
  margin-bottom: 7px;
  color: var(--accent-d);
  font-size: 0.64rem;
}

.panel-heading h2,
.result-head h2 {
  font-size: clamp(1.5rem, 2.1vw, 2rem);
  font-weight: 520;
  line-height: 1.08;
}

/* ---------- Segmented controls ---------- */
.segmented,
.choice-row,
.finish-grid,
.demo-strip {
  display: flex;
  gap: 5px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface-3);
}

.finish-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.segmented button,
.choice-button,
.finish-button,
.demo-button {
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--ink-2);
  font-size: 0.68rem;
  transition: background 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.segmented button {
  min-width: 48px;
  padding: 9px 12px;
}

.choice-button,
.finish-button,
.demo-button {
  min-height: 42px;
  padding: 10px 10px;
}

.choice-button,
.demo-button {
  flex: 1;
}

.segmented button:hover,
.choice-button:hover,
.finish-button:hover,
.demo-button:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.7);
}

.segmented button.is-active,
.choice-button.is-active,
.finish-button.is-active,
.demo-button.is-active {
  background: var(--navy);
  color: #f6f8f9;
  box-shadow: var(--shadow-xs);
}

/* ---------- Field groups ---------- */
.control-group {
  min-width: 0;
  margin: 0;
  padding: 0 0 20px;
  border: 0;
  border-bottom: 1px solid var(--line);
}

.control-group.compact {
  display: grid;
  gap: 14px;
}

.control-group legend {
  margin-bottom: 12px;
  padding: 0;
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 540;
}

.field-help {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.field {
  display: grid;
  gap: 8px;
  transition: opacity 200ms ease;
}

.field span,
.range-row label {
  color: var(--muted);
  font-size: 0.62rem;
}

.field input,
.control-group select {
  min-height: 48px;
  padding: 10px 14px;
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 500;
}

.control-group select {
  font-family: var(--font-sans);
  font-size: 0.98rem;
  font-weight: 600;
}

.range-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.range-row label {
  font-size: 0.62rem;
}

.range-row output {
  color: var(--accent-d);
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 540;
}

.range {
  width: 100%;
  height: 6px;
  margin: 2px 0;
  appearance: none;
  border-radius: var(--r-pill);
  background: var(--line-strong);
  accent-color: var(--navy);
}

.range::-webkit-slider-thumb {
  appearance: none;
  width: 22px;
  height: 22px;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--navy);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

.range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--navy);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

.demo-strip {
  margin-top: 4px;
}

/* ---------- Result side ---------- */
.confidence {
  align-self: flex-start;
  max-width: 150px;
  padding: 9px 13px;
  border: 1px solid var(--metal-soft);
  border-radius: var(--r-pill);
  background: rgba(70, 80, 90, 0.1);
  color: var(--metal);
  font-size: 0.6rem;
  line-height: 1.3;
  text-align: center;
}

.curtain-visual {
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  margin-top: 20px;
  padding: 18px 18px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: linear-gradient(180deg, #fafbfc 0%, #eceff1 74%, #e4e8ea 100%);
  box-shadow: inset 0 1px 0 #fff, var(--shadow-sm);
  transform: perspective(1200px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y));
  transition: transform 240ms ease;
}

.visual-toolbar {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.62rem;
}

.visual-toolbar span:last-child {
  color: var(--ink);
}

.rod-line {
  position: relative;
  width: var(--rod-scale);
  height: 22px;
  margin: 22px auto 0;
  border-top: 5px solid var(--metal);
  border-radius: 2px;
  animation: rodDraw 900ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.rod-line::before,
.rod-line::after {
  position: absolute;
  top: -10px;
  width: 14px;
  height: 14px;
  content: "";
  border-radius: 50%;
  background: var(--metal);
  box-shadow: 0 2px 5px rgba(28, 33, 38, 0.22);
}

.rod-line::before {
  left: -7px;
}

.rod-line::after {
  right: -7px;
}

.bracket {
  position: absolute;
  top: -1px;
  width: 2px;
  height: 26px;
  border-radius: 2px;
  background: var(--ink-2);
  opacity: 0.45;
}

.bracket-left {
  left: 10%;
}

.bracket-mid {
  left: 50%;
}

.bracket-right {
  right: 10%;
}

.window-stage {
  position: relative;
  min-height: clamp(260px, 28vw, 350px);
  margin-top: 2px;
  overflow: hidden;
  border-radius: var(--r-sm);
}

.window-stage::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 34px;
  content: "";
  background: linear-gradient(180deg, transparent, rgba(70, 90, 110, 0.16));
}

.window-frame,
.curtain-panel,
.measure-line {
  z-index: 1;
}

.window-frame {
  position: absolute;
  top: 38px;
  left: 50%;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  width: var(--window-scale);
  max-width: 76%;
  min-width: 34%;
  height: 60%;
  border: 2px solid #fff;
  border-radius: 4px;
  background: linear-gradient(165deg, #e7edf1 0%, #f0f4f6 60%, #e4ebef 100%);
  box-shadow: 0 8px 22px rgba(28, 33, 38, 0.12), inset 0 0 0 1px rgba(70, 90, 110, 0.18);
  transform: translateX(-50%);
  transition: width 420ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.window-frame::before,
.window-frame::after {
  position: absolute;
  content: "";
  background: rgba(255, 255, 255, 0.9);
}

.window-frame::before {
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  transform: translateX(-1px);
}

.window-frame::after {
  top: 50%;
  right: 0;
  left: 0;
  height: 2px;
  transform: translateY(-1px);
}

.window-pane {
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) 55%);
}

.curtain-panel {
  position: absolute;
  top: 24px;
  bottom: 18px;
  width: calc((100% - var(--window-scale)) / 2 + var(--stack-scale));
  min-width: 20%;
  max-width: 43%;
  border-radius: 3px;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.55) 0 calc(7px * var(--fold-density)),
      rgba(70, 88, 105, 0.18) calc(7px * var(--fold-density)) calc(13px * var(--fold-density))
    ),
    linear-gradient(90deg, #edefee, #d9dedb);
  box-shadow: 0 16px 32px rgba(28, 33, 38, 0.16);
  animation: clothRise 760ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  transition: width 420ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.curtain-left {
  left: calc((100% - var(--rod-scale)) / 2);
  border-radius: 3px 5px 5px 3px;
}

.curtain-right {
  right: calc((100% - var(--rod-scale)) / 2);
  border-radius: 5px 3px 3px 5px;
}

.measure-line {
  position: absolute;
}

.measure-line span {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: var(--r-pill);
  background: var(--ink);
  color: var(--surface);
  font-size: 0.56rem;
  letter-spacing: 0.1em;
  box-shadow: var(--shadow-sm);
}

.width-line {
  right: calc((100% - var(--window-scale)) / 2);
  bottom: 42px;
  left: calc((100% - var(--window-scale)) / 2);
  border-top: 1.5px dashed rgba(28, 33, 38, 0.4);
  text-align: center;
}

.width-line span {
  transform: translateY(-50%);
}

.drop-line {
  top: 44px;
  right: 16px;
  bottom: 24px;
  border-right: 1.5px dashed rgba(28, 33, 38, 0.4);
}

.drop-line span {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translate(50%, -50%) rotate(90deg);
  white-space: nowrap;
}

.result-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.metric {
  min-height: 116px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.metric.primary {
  border-color: rgba(70, 97, 120, 0.34);
  background: linear-gradient(180deg, var(--accent-tint), var(--surface) 130%);
}

.metric.is-pulsing {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.metric span,
.metric small {
  display: block;
  color: var(--muted);
  font-size: 0.6rem;
}

.metric span {
  letter-spacing: 0.12em;
}

.metric small {
  letter-spacing: 0.06em;
  font-weight: 600;
  text-transform: none;
}

.metric strong {
  display: block;
  margin: 12px 0 6px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(1.95rem, 2.9vw, 2.7rem);
  font-weight: 520;
  line-height: 1;
}

.metric.primary strong {
  color: var(--accent-d);
}

.result-note {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.result-note p {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 0.9rem;
  line-height: 1.5;
}

.result-explain,
.fit-advice {
  margin-top: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.explain-head,
.fit-advice > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.explain-head h3,
.fit-advice h3 {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.28rem;
  font-weight: 540;
  line-height: 1.15;
}

.formula-list {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
}

.formula-list div {
  display: grid;
  grid-template-columns: minmax(110px, 0.36fr) minmax(0, 1fr);
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}

.formula-list dt {
  color: var(--muted);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.formula-list dd {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.9rem;
  line-height: 1.55;
}

.fit-advice ul {
  margin: 14px 0 0;
  padding-left: 20px;
}

.fit-advice li {
  color: var(--ink-2);
  font-size: 0.92rem;
  line-height: 1.55;
}

.fit-advice li + li {
  margin-top: 8px;
}

.range-note {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

/* ---------- Guides band (home) ---------- */
.page-band {
  display: grid;
  grid-template-columns: minmax(0, 0.74fr) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 60px);
  align-items: end;
  padding: clamp(56px, 7vw, 92px) var(--pad-x);
  background: var(--paper-2);
  border-top: 1px solid var(--line);
}

.band-copy h2,
.page-hero h1,
.article-hero h1 {
  max-width: 16ch;
  color: var(--ink);
  font-size: clamp(2.1rem, 4vw, 3.4rem);
  font-weight: 500;
  line-height: 1.04;
}

.band-copy p:not(.eyebrow),
.page-hero p {
  max-width: 46ch;
  margin-top: 18px;
  color: var(--ink-2);
}

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

.blog-card {
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 280ms ease;
}

.blog-card img {
  width: 100%;
  height: 210px;
  object-fit: cover;
  transition: transform 600ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.blog-card:nth-child(2n) img {
  object-position: 78% 50%;
}

.blog-card:nth-child(3n) img {
  object-position: 46% 70%;
}

.blog-card span,
.blog-card strong,
.blog-card p {
  padding-right: 20px;
  padding-left: 20px;
}

.blog-card span {
  margin-top: 18px;
  color: var(--accent-d);
  font-size: 0.64rem;
}

.blog-card strong {
  display: block;
  margin-top: 10px;
  font-family: var(--font-display);
  font-size: 1.32rem;
  font-weight: 540;
  line-height: 1.16;
}

.blog-card p {
  margin-top: 12px;
  padding-bottom: 22px;
  color: var(--muted);
  font-size: 0.92rem;
}

.blog-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
}

.blog-card:hover img {
  transform: scale(1.05);
}

/* ---------- Inner content pages ---------- */
.page-hero,
.article-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 64px);
  align-items: end;
  padding: clamp(120px, 13vw, 160px) var(--pad-x) clamp(36px, 5vw, 56px);
}

.page-hero img,
.article-hero img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  padding: 0 var(--pad-x) clamp(56px, 8vw, 88px);
}

.content-card,
.faq-item,
.formula-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.content-card h2,
.formula-card h2,
.faq-item summary {
  font-family: var(--font-display);
  font-size: 1.34rem;
  font-weight: 540;
  line-height: 1.16;
}

.content-card p,
.formula-card p,
.faq-item p {
  margin-top: 12px;
  color: var(--ink-2);
}

.mini-label,
.article-meta {
  display: inline-block;
  margin-bottom: 12px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: var(--navy-tint);
  color: var(--navy-d);
  font-size: 0.62rem;
}

.formula-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding: 0 var(--pad-x) clamp(56px, 8vw, 88px);
}

.formula-card code {
  display: block;
  margin-top: 16px;
  padding: 15px 16px;
  border-radius: var(--r-sm);
  background: var(--navy-d);
  color: #eef1f3;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92rem;
  white-space: normal;
}

.blog-page {
  padding: 0 var(--pad-x) clamp(56px, 8vw, 88px);
}

.blog-cluster + .blog-cluster {
  margin-top: clamp(42px, 6vw, 72px);
}

.blog-cluster > h2 {
  max-width: 18ch;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 520;
  line-height: 1.08;
}

.blog-cluster > p:not(.mini-label) {
  max-width: 58ch;
  margin-top: 12px;
  margin-bottom: 22px;
  color: var(--ink-2);
}

.article-body {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 var(--pad-x) clamp(64px, 9vw, 100px);
}

.article-body p,
.article-body li {
  color: var(--ink-2);
  font-size: 1.08rem;
  line-height: 1.72;
}

.article-body h2 {
  margin-top: 42px;
  color: var(--ink);
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  font-weight: 540;
}

.article-body p,
.article-body ul,
.article-body ol {
  margin-top: 16px;
}

.article-body li + li {
  margin-top: 8px;
}

.article-body a {
  color: var(--accent-d);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.article-callout {
  margin-top: 32px;
  padding: 22px 24px;
  border: 1px solid rgba(70, 97, 120, 0.3);
  border-left: 4px solid var(--accent);
  border-radius: var(--r-md);
  background: var(--accent-tint);
  color: var(--ink);
}

.article-table {
  width: 100%;
  margin-top: 20px;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

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

.article-table th {
  color: var(--ink);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

.article-note,
.related-links {
  margin-top: 28px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
}

.article-note strong,
.related-links strong {
  display: block;
  color: var(--ink);
}

.related-links ul {
  margin-top: 12px;
  padding-left: 20px;
}

.faq-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 0 var(--pad-x) clamp(56px, 8vw, 88px);
}

.faq-item {
  align-self: start;
}

.faq-item summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  flex: none;
  font-family: var(--font-sans);
  font-size: 1.4rem;
  font-weight: 500;
  line-height: 1;
  color: var(--accent-d);
  transition: transform 220ms ease;
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
}

/* ---------- Footer ---------- */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 28px var(--pad-x) 40px;
  border-top: 1px solid var(--line);
  background: var(--paper-2);
  color: var(--muted);
}

.site-footer > p {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 540;
  color: var(--ink);
}

.site-footer a {
  font-size: 0.68rem;
  color: var(--ink-2);
}

/* ---------- Reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 640ms ease, transform 640ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes imageSettle {
  from {
    opacity: 0;
    transform: scale(1.08);
  }
  to {
    opacity: 1;
    transform: scale(1.03);
  }
}

@keyframes rodDraw {
  from {
    clip-path: inset(0 100% 0 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}

@keyframes clothRise {
  from {
    opacity: 0;
    transform: translateY(-18px) scaleY(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scaleY(1);
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .hero-tool,
  .calculator-grid,
  .page-band,
  .page-hero,
  .article-hero {
    grid-template-columns: 1fr;
  }

  .hero-photo {
    order: -1;
  }

  .hero-photo img {
    height: clamp(280px, 44vw, 420px);
  }

  .measure-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .content-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .blog-preview-grid,
  .blog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .site-header {
    position: sticky;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 14px 18px;
    background: rgba(236, 238, 238, 0.95);
  }

  .main-nav {
    flex-wrap: wrap;
    gap: 12px 18px;
    max-width: 100%;
    overflow-x: auto;
  }

  .brand-logo {
    width: min(214px, 72vw);
    max-height: 42px;
  }

  .hero-tool {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    max-width: 100%;
    padding: 24px 18px 8px;
    overflow: hidden;
  }

  .hero-copy,
  .hero-photo {
    justify-self: stretch;
    width: 100%;
    max-width: calc(100vw - 36px);
  }

  .hero-photo img {
    height: clamp(260px, 62vw, 340px);
    object-position: 30% 62%;
  }

  h1,
  .page-hero h1,
  .article-hero h1 {
    max-width: 10ch;
    font-size: clamp(2.25rem, 10vw, 2.95rem);
    line-height: 1.04;
  }

  .hero-copy p:not(.eyebrow),
  .page-hero p,
  .article-hero p {
    max-width: 100%;
  }

  .hero-photo figcaption {
    right: 14px;
    bottom: 14px;
    left: 14px;
    font-size: 0.78rem;
  }

  .calculator-grid {
    border-radius: var(--r-md);
  }

  .measure-panel,
  .result-panel {
    padding: 22px 18px;
  }

  .field-grid,
  .result-metrics,
  .result-note,
  .blog-preview-grid,
  .blog-grid,
  .content-grid,
  .formula-layout,
  .faq-list {
    grid-template-columns: 1fr;
  }

  .article-table {
    display: block;
    overflow-x: auto;
  }

  .article-table th,
  .article-table td {
    min-width: 150px;
  }

  .choice-row,
  .demo-strip {
    flex-wrap: wrap;
  }

  .finish-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .formula-list div {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .result-explain,
  .fit-advice {
    padding: 16px;
  }

  .window-stage {
    min-height: 290px;
  }

  .page-hero,
  .article-hero {
    padding: 104px 18px 32px;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
