/* =========================================================
   FRAMEFLOW MARKETING — styles.css
   "Officina" style, tokens from the FrameFlow app (frontend/app/globals.css):
   ink #111827, ground #f3f4f6, one accent (yellow #facc15) always with ink text.
   ========================================================= */

:root {
  --ink: #111827;
  --ink-2: #1f2937;
  --ink-3: #273244;
  --ink-soft: #374151;
  --muted: #4b5563;
  --ground: #f3f4f6;
  --white: #ffffff;
  --track: #e5e7eb;
  --line: #d1d5db;
  --line-strong: #6b7280;

  --accent: #facc15;
  --accent-hover: #eab308;
  --accent-subtle: #fef9c3;
  --on-accent-subtle: #713f12;
  --accent-edge: #ca8a04;

  /* bar drawings (components/plan/barPalette.ts) */
  --piece: var(--ink);
  --kerf: var(--accent);
  --kerf-edge: #a16207;
  --leftover: #fde047;
  --scrap-hatch: var(--line-strong);
  --scratch: #dc2626;
  --scratch-subtle: #fee2e2;
  --trim: var(--line-strong);

  --success-subtle: #dcfce7;
  --on-success-subtle: #14532d;
  --danger: #b91c1c;
  --danger-subtle: #fef2f2;
  --warning-subtle: #ffedd5;
  --on-warning-subtle: #7c2d12;

  /* text on dark surfaces */
  --on-dark: #ffffff;
  --on-dark-2: #d1d5db; /* 12:1 on ink */
  --on-dark-3: #9ca3af; /* 7:1 on ink */

  --radius-card: 14px;
  --radius-control: 10px;
  --shadow-card: 0 1px 2px rgb(17 24 39 / 0.08);
  --shadow-lift: 0 18px 50px -12px rgb(0 0 0 / 0.55);

  --font: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: "Barlow Condensed", "Arial Narrow", Arial, sans-serif;

  --gutter: 16px;
  --header-h: 64px;
  --focus: var(--ink);
}

@media (min-width: 640px) { :root { --gutter: 24px; } }
@media (min-width: 1024px) { :root { --gutter: 32px; --header-h: 72px; } }

/* ─── Reset / base ─── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 12px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--ground);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .92em; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
.dark { --focus: var(--accent); }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--accent); color: var(--ink); font-weight: 700;
  padding: 10px 16px; border-radius: var(--radius-control); text-decoration: none;
}
.skip-link:focus { top: 12px; }

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

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }
.container-narrow { max-width: 860px; }

.dark { background: var(--ink); color: var(--on-dark); }

/* ─── Buttons (app hierarchy: primary yellow / secondary white+ink border / ghost) ─── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px;
  border: 2px solid transparent; border-radius: var(--radius-control);
  font-weight: 700; font-size: 16px; line-height: 1.1; text-decoration: none; white-space: nowrap;
  cursor: pointer; transition: background-color .15s, border-color .15s, color .15s, transform .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--ink); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--white); color: var(--ink); border-color: var(--ink); }
.btn-secondary:hover { background: var(--ground); }
.btn-ghost-light { color: var(--on-dark); border-color: rgb(255 255 255 / .55); background: transparent; }
.btn-ghost-light:hover { border-color: var(--white); background: rgb(255 255 255 / .08); }
.btn-lg { min-height: 52px; padding: 0 26px; font-size: 17px; }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: 15px; }
.btn-xs { min-height: 32px; padding: 0 12px; font-size: 14px; border-radius: 8px; gap: 6px; }
.btn-xs svg { width: 16px; height: 16px; }
.btn-block { width: 100%; }
@media (pointer: coarse) { .btn-sm, .btn-xs { min-height: 44px; } }

/* ─── Eyebrows and section heads ─── */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 14px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.eyebrow::before {
  /* a saw cut: yellow bar with dark-yellow edges */
  content: ""; width: 6px; height: 18px; background: var(--kerf);
  box-shadow: inset 1px 0 0 var(--kerf-edge), inset -1px 0 0 var(--kerf-edge);
}
.eyebrow-light { color: var(--on-dark-2); }

.section { padding: 72px 0; }
@media (min-width: 1024px) { .section { padding: 112px 0; } }
.section-white { background: var(--white); }
.section-head { max-width: 760px; margin-bottom: 40px; }
@media (min-width: 1024px) { .section-head { margin-bottom: 56px; } }
.section-title {
  margin-top: 12px;
  font-family: var(--font-display); font-weight: 700; text-transform: uppercase;
  font-size: clamp(34px, 6vw, 56px); line-height: .98; letter-spacing: .005em;
  text-wrap: balance;
}
.section-lead { margin-top: 18px; font-size: 19px; line-height: 1.55; color: var(--ink-soft); max-width: 680px; }
.dark .section-lead { color: var(--on-dark-2); }

/* ─── Header ─── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--ink); color: var(--on-dark);
  border-bottom: 1px solid rgb(255 255 255 / .08);
  --focus: var(--accent);
}
.header-inner { display: flex; align-items: center; gap: 24px; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--on-dark); flex-shrink: 0; }
.brand-mark { width: 36px; height: 36px; margin: -3px; }
.brand-word {
  font-family: var(--font-display); font-weight: 700; font-size: 25px; letter-spacing: .04em; line-height: 1;
  position: relative; top: -.03em;
}
.main-nav { display: none; margin-left: 8px; }
.nav-links { display: flex; gap: 4px; }
.nav-links a {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; border-radius: 8px;
  color: var(--on-dark-2); font-weight: 600; font-size: 16px; text-decoration: none;
}
.nav-links a:hover { color: var(--white); background: rgb(255 255 255 / .08); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.header-actions .btn-ghost-light, .header-cta { display: none; }
@media (min-width: 560px) { .header-cta { display: inline-flex; } }
@media (min-width: 960px) {
  .main-nav { display: block; }
  .header-actions .btn-ghost-light { display: inline-flex; }
}

.menu-toggle {
  width: 44px; height: 44px; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  background: transparent; border: 2px solid rgb(255 255 255 / .35); border-radius: var(--radius-control); cursor: pointer;
}
.menu-toggle { display: inline-flex; }
@media (min-width: 960px) { .menu-toggle { display: none; } }
.menu-toggle span { width: 20px; height: 2px; background: var(--white); transition: transform .2s, opacity .2s; }
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu { border-top: 1px solid rgb(255 255 255 / .1); padding: 8px var(--gutter) 20px; }
.mobile-menu ul { margin-bottom: 16px; }
.mobile-menu li a {
  display: flex; align-items: center; min-height: 52px; color: var(--white); text-decoration: none;
  font-family: var(--font-display); font-weight: 700; font-size: 24px; text-transform: uppercase; letter-spacing: .02em;
  border-bottom: 1px solid rgb(255 255 255 / .08);
}
@media (min-width: 960px) { .mobile-menu { display: none !important; } }

/* ─── Hero ─── */
.hero {
  position: relative; overflow: hidden;
  background-color: var(--ink);
  background-image:
    linear-gradient(rgb(255 255 255 / .035) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / .035) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: -1px -1px;
}
.hero-grid { display: grid; gap: 48px; padding-top: 48px; padding-bottom: 72px; }
@media (min-width: 1024px) {
  .hero-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: center; gap: 56px; padding-top: 88px; padding-bottom: 112px; }
}
.hero-title {
  margin-top: 18px;
  font-family: var(--font-display); font-weight: 700; text-transform: uppercase;
  font-size: clamp(44px, 9.5vw, 76px); line-height: .94; letter-spacing: .003em;
}
.tape {
  display: inline-block; background: var(--accent); color: var(--ink);
  padding: .06em .16em .02em; margin-left: -.06em; margin-bottom: .12em;
  box-shadow: inset 0 -4px 0 var(--accent-edge);
}
.hero-title-rest { display: block; text-wrap: balance; }
.hero-lead { margin-top: 24px; font-size: 19px; line-height: 1.6; color: var(--on-dark-2); max-width: 560px; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 32px; font-size: 15px; color: var(--on-dark-3); }
.hero-facts li { display: inline-flex; align-items: center; gap: 8px; }
.hero-facts li::before { content: ""; width: 8px; height: 8px; background: var(--accent); }
@media (max-width: 420px) { .hero-ctas .btn { flex: 1 1 100%; } }

/* ruler under the hero: mm ticks */
.ruler {
  height: 22px; background-color: var(--accent);
  background-image:
    repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 100px),
    repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px 50px),
    repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px 10px);
  background-size: 100% 14px, 100% 9px, 100% 5px;
  background-repeat: no-repeat;
  background-position: 0 0, 0 0, 0 0;
}

/* ─── Plan card (hero visual) ─── */
.plan-card {
  position: relative; background: var(--white); color: var(--ink);
  border-radius: 18px; padding: 18px; box-shadow: var(--shadow-lift);
  border-top: 6px solid var(--accent);
  min-width: 0;
}
@media (min-width: 640px) { .plan-card { padding: 24px; } }
.plan-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.plan-card-title { display: flex; flex-direction: column; min-width: 0; }
.plan-card-kicker { font-family: var(--font-display); font-weight: 700; font-size: 26px; text-transform: uppercase; line-height: 1; }
.plan-card-profile { margin-top: 6px; font-size: 14px; color: var(--muted); font-weight: 500; }
.replay { flex-shrink: 0; }

.plan-progress { height: 4px; margin: 14px 0 0; background: var(--track); border-radius: 2px; overflow: hidden; }
.plan-progress span { display: block; height: 100%; width: 100%; background: var(--ink); transform-origin: left; }

.plan-summary { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip {
  display: inline-flex; align-items: baseline; gap: 6px; padding: 6px 10px; border-radius: 8px;
  background: var(--ink); color: var(--white); font-size: 13px; line-height: 1.2;
}
.chip dt { font-weight: 500; color: var(--on-dark-2); }
.chip dd { font-family: var(--font-display); font-weight: 700; font-size: 19px; line-height: 1; }
.chip-buy { background: var(--accent); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--accent-edge); }
.chip-buy dt { color: var(--ink); }

.plan-status {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 12px;
  padding: 4px 10px 4px 6px; border-radius: 999px;
  background: var(--success-subtle); color: var(--on-success-subtle); font-weight: 700; font-size: 14px;
}
.plan-status svg { width: 18px; height: 18px; }

.plan-bars { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.plan-caption { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--track); font-size: 14px; color: var(--muted); line-height: 1.5; }

/* ─── Bar drawing (shared by hero and feature mocks) ─── */
.bar-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 13px; min-width: 0; }
.bar-num {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: var(--white);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 14px;
}
.bar-tag { font-weight: 600; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.bar-tag-remnant { background: var(--accent-subtle); color: var(--on-accent-subtle); padding: 1px 8px; border-radius: 6px; box-shadow: inset 0 0 0 1px var(--accent-edge); }
.bar-len { color: var(--muted); white-space: nowrap; }
.bar-use { margin-left: auto; font-family: var(--font-display); font-weight: 700; font-size: 17px; white-space: nowrap; }

.strip {
  display: flex; height: 44px; width: calc(var(--bar) / 6000 * 100%);
  background: var(--white); border-radius: 4px; overflow: hidden;
  box-shadow: 0 0 0 1px var(--line);
}
.strip > * { flex: var(--w) 1 0%; min-width: 0; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; }
.strip .p { background: var(--piece); color: var(--white); line-height: 1; container-type: inline-size; padding: 0 2px; }
.strip .p + .p { border-left: 1px solid rgb(255 255 255 / .5); }
.strip b { font-family: var(--font-display); font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; }
.strip small { display: none; font-size: 11px; color: #e5e7eb; margin-top: 3px; white-space: nowrap; }
@container (max-width: 30px) { .strip .p b { font-size: 12px; } }
@container (max-width: 26px) { .strip .scrap b { display: none; } }
@container (min-width: 96px) { .strip .p small { display: block; } }
.strip .k {
  flex: 0 0 4px; background: var(--kerf);
  box-shadow: inset 1px 0 0 var(--kerf-edge), inset -1px 0 0 var(--kerf-edge);
}
.strip .scrap {
  container-type: inline-size;
  background-color: #fff;
  background-image: repeating-linear-gradient(135deg, var(--scrap-hatch) 0 2px, transparent 2px 7px);
}
.strip .scrap b { background: #fff; color: var(--ink-soft); font-size: 13px; padding: 1px 3px; border-radius: 3px; }
.strip .leftover { background: var(--leftover); box-shadow: inset 0 0 0 2px var(--kerf-edge); color: var(--ink); flex-direction: row; gap: 4px; }
.strip .leftover svg { width: 16px; height: 16px; flex-shrink: 0; }
.strip .scratch {
  background-color: var(--scratch-subtle);
  background-image:
    repeating-linear-gradient(45deg, var(--scratch) 0 2px, transparent 2px 6px),
    repeating-linear-gradient(-45deg, var(--scratch) 0 2px, transparent 2px 6px);
  min-width: 6px;
}
.strip .trim { background: var(--trim); min-width: 3px; }
@media (max-width: 479px) {
  .strip { height: 38px; }
  .strip b { font-size: 14px; }
  .strip .scrap b { font-size: 11px; }
}

.strip-wrap { display: flex; align-items: stretch; gap: 6px; }
.strip-wrap .strip { flex: 1; width: auto; }
.m-mark, .m-inline {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 26px; border: 2px solid var(--ink); border-radius: 4px; background: var(--white);
  font-family: var(--font-display); font-weight: 700; font-size: 16px; line-height: 1;
}
.m-inline { width: auto; height: 1.35em; padding: 0 .3em; vertical-align: -.2em; font-size: .9em; }

/* hero animation: only with JS and motion allowed (the card is complete without it) */
@media (prefers-reduced-motion: no-preference) {
  .js .plan-card.is-calculating .plan-progress span { animation: progress .9s linear both; }
  .js .plan-card.is-calculating .plan-summary,
  .js .plan-card.is-calculating .plan-status,
  .js .plan-card.is-calculating .strip > *,
  .js .plan-card.is-waiting .plan-summary,
  .js .plan-card.is-waiting .plan-status,
  .js .plan-card.is-waiting .strip > * { opacity: 0; }
  .js .plan-card.is-building .strip > * { animation: piece-in .42s cubic-bezier(.2,.9,.3,1.2) both; animation-delay: calc(var(--i, 0) * 85ms); }
  .js .plan-card.is-building .strip > .k { animation: kerf-in .3s ease-out both; animation-delay: calc(var(--i, 0) * 85ms + 220ms); }
  .js .plan-card.is-building .plan-summary { animation: fade-up .4s ease-out both; animation-delay: 1.15s; }
  .js .plan-card.is-building .plan-status { animation: pop .45s cubic-bezier(.2,.9,.3,1.3) both; animation-delay: 1.3s; }
  .js .plan-card.is-building .plan-progress span { transform: scaleX(1); }
}
.plan-card:not(.is-calculating) .plan-progress span { transform: scaleX(1); }
@keyframes progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes piece-in { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes kerf-in { 0% { opacity: 0; background: #fff; } 40% { opacity: 1; background: #fff7a8; } 100% { opacity: 1; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }

/* ─── Problem → solution ─── */
.compare { display: grid; gap: 16px; }
@media (min-width: 860px) { .compare { grid-template-columns: 1fr 1fr; gap: 24px; } }
.compare-card { border-radius: var(--radius-card); padding: 28px 24px; }
@media (min-width: 640px) { .compare-card { padding: 36px; } }
.compare-before { background: var(--white); border: 2px solid var(--line); }
.compare-after { background: var(--ink); color: var(--white); border-top: 6px solid var(--accent); --focus: var(--accent); }
.compare-title { font-family: var(--font-display); font-weight: 700; text-transform: uppercase; font-size: 28px; line-height: 1; margin-bottom: 20px; }
.compare-before .compare-title { color: var(--ink-soft); }
.compare-list { display: flex; flex-direction: column; gap: 18px; }
.compare-list li { position: relative; padding-left: 38px; color: var(--ink-soft); }
.compare-after .compare-list li { color: var(--on-dark-2); }
.compare-list strong { display: block; color: var(--ink); font-size: 18px; margin-bottom: 2px; }
.compare-after .compare-list strong { color: var(--white); }
.compare-list li::before {
  content: ""; position: absolute; left: 0; top: 2px; width: 26px; height: 26px; border-radius: 6px;
  background-position: center; background-repeat: no-repeat; background-size: 16px;
}
.compare-before .compare-list li::before {
  background-color: var(--ground); box-shadow: inset 0 0 0 1.5px var(--line-strong);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 4l8 8M12 4l-8 8' stroke='%234b5563' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E");
}
.compare-after .compare-list li::before {
  background-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%23111827' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* ─── Showcases ─── */
.showcase { display: grid; gap: 32px; padding: 40px 0; border-top: 1px solid var(--track); }
.showcase:first-of-type { border-top: 0; padding-top: 0; }
@media (min-width: 960px) {
  .showcase { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; align-items: center; padding: 64px 0; }
  .showcase-flip .showcase-copy { order: 2; }
}
.showcase-kicker { font-size: 14px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.showcase-title {
  margin: 8px 0 18px;
  font-family: var(--font-display); font-weight: 700; text-transform: uppercase;
  font-size: clamp(30px, 4.6vw, 42px); line-height: 1; text-wrap: balance;
}
.showcase-copy p + p { margin-top: 14px; }
.showcase-copy p { color: var(--ink-soft); }
.showcase-copy strong { color: var(--ink); }
.ticks { margin-top: 22px; display: flex; flex-direction: column; gap: 10px; }
.ticks li { position: relative; padding-left: 30px; font-weight: 600; font-size: 16px; }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: 4px; width: 18px; height: 18px; border-radius: 4px; background-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%23111827' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: 14px; background-position: center; background-repeat: no-repeat;
}

.showcase-visual {
  position: relative; min-width: 0;
  background: var(--ground); border-radius: 18px; padding: 20px;
  display: flex; flex-direction: column; gap: 14px; justify-content: center;
  background-image:
    linear-gradient(rgb(17 24 39 / .045) 1px, transparent 1px),
    linear-gradient(90deg, rgb(17 24 39 / .045) 1px, transparent 1px);
  background-size: 24px 24px;
}
@media (min-width: 640px) { .showcase-visual { padding: 36px; min-height: 360px; } }

.mock { background: var(--white); border-radius: var(--radius-card); box-shadow: 0 1px 2px rgb(17 24 39 / .08), 0 12px 32px -12px rgb(17 24 39 / .25); padding: 18px; min-width: 0; }
@media (min-width: 640px) { .mock { padding: 22px; } }
.mock-kicker { display: block; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.mock-title { display: block; font-family: var(--font-display); font-weight: 700; font-size: 24px; text-transform: uppercase; line-height: 1.05; margin-top: 4px; }

.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px 5px 8px; border-radius: 999px; font-weight: 700; font-size: 14px; line-height: 1.3; }
.status-pill svg { width: 18px; height: 18px; flex-shrink: 0; }
.status-ok { background: var(--success-subtle); color: var(--on-success-subtle); }
.status-warn { background: var(--warning-subtle); color: var(--on-warning-subtle); padding-left: 12px; }
.mock-status-ok p { margin-top: 10px; font-size: 15px; color: var(--ink-soft); }
.mock-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin-top: 18px; background: var(--track); border: 1px solid var(--track); border-radius: 10px; overflow: hidden; }
.mock-stats div { background: var(--white); padding: 10px 12px; }
.mock-stats dt { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.mock-stats dd { font-family: var(--font-display); font-weight: 700; font-size: 24px; line-height: 1.1; }
.mock-stats div:first-child { background: var(--accent); }
.mock-stats div:first-child dt { color: var(--ink); }
.mock-status-alt { margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: 10px; opacity: .78; }

.mock-remnant .bar-head { margin-bottom: 8px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 16px; font-size: 13px; font-weight: 500; color: var(--ink-soft); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 18px; height: 12px; border-radius: 2px; display: inline-block; }
.sw-piece { background: var(--piece); }
.sw-kerf { width: 5px; background: var(--kerf); box-shadow: 0 0 0 1px var(--kerf-edge); }
.sw-leftover { background: var(--leftover); box-shadow: inset 0 0 0 2px var(--kerf-edge); }
.sw-scrap { background-color: #fff; background-image: repeating-linear-gradient(135deg, var(--scrap-hatch) 0 2px, transparent 2px 5px); box-shadow: 0 0 0 1px var(--line); }
.sw-scratch { background-color: var(--scratch-subtle); background-image: repeating-linear-gradient(45deg, var(--scratch) 0 1.5px, transparent 1.5px 4px), repeating-linear-gradient(-45deg, var(--scratch) 0 1.5px, transparent 1.5px 4px); }
.sw-trim { background: var(--trim); }

.saving { display: flex; align-items: center; gap: 12px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--track); flex-wrap: wrap; }
.saving > div { display: flex; flex-direction: column; }
.saving-label { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.saving-value { font-family: var(--font-display); font-weight: 700; font-size: 22px; line-height: 1.1; text-decoration: line-through; text-decoration-thickness: 2px; color: var(--ink-soft); }
.saving-good { text-decoration: none; color: var(--ink); background: var(--accent); padding: 0 6px; border-radius: 4px; }
.saving-arrow { width: 24px; height: 24px; color: var(--ink); }
@media (max-width: 479px) { .saving { flex-direction: column; align-items: flex-start; gap: 6px; } .saving-arrow { transform: rotate(90deg); } }

.mock-head { display: flex; flex-direction: column; }
.dims { margin-top: 8px; align-self: flex-start; font-family: var(--font-display); font-weight: 600; font-size: 18px; background: var(--ink); color: var(--white); padding: 2px 10px; border-radius: 6px; }
.dims b { color: var(--accent); }
.formula-table { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 14px; }
.formula-table th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 0 6px 6px 0; border-bottom: 2px solid var(--ink); }
.formula-table td { padding: 8px 6px 8px 0; border-bottom: 1px solid var(--track); vertical-align: middle; }
.formula-table td:last-child, .formula-table th:last-child { text-align: right; padding-right: 0; white-space: nowrap; }
.formula-table td:last-child { font-family: var(--font-display); font-weight: 700; font-size: 17px; }
.formula-table code { background: var(--ground); padding: 2px 6px; border-radius: 4px; white-space: nowrap; }
@media (max-width: 400px) { .formula-table { font-size: 13px; } .formula-table code { font-size: 12px; padding: 1px 4px; } }

.mock-agenda ul { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.mock-agenda li { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 8px 10px; border-radius: 8px; background: var(--ground); }
.appt-type { font-weight: 700; font-size: 14px; padding: 2px 8px; border-radius: 6px; }
.appt-sopralluogo { background: var(--white); box-shadow: inset 0 0 0 1.5px var(--ink); }
.appt-montaggio { background: var(--ink); color: var(--white); }
.appt-consegna { background: var(--accent); color: var(--ink); }
.appt-when { font-size: 14px; font-weight: 600; color: var(--ink-soft); }

/* ─── Feature grid ─── */
.grid-title {
  margin: 48px 0 20px; font-family: var(--font-display); font-weight: 700; text-transform: uppercase; font-size: 28px;
  display: flex; align-items: center; gap: 16px;
}
.grid-title::after { content: ""; flex: 1; height: 2px; background: var(--track); }
.feature-grid { display: grid; gap: 16px; }
@media (min-width: 640px) { .feature-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .feature-grid { grid-template-columns: repeat(3, 1fr); gap: 20px; } }
.feature {
  background: var(--ground); border-radius: var(--radius-card); padding: 24px;
  border: 1px solid transparent; transition: border-color .15s, background-color .15s;
}
.feature:hover { border-color: var(--line); background: #fafafa; }
.feature-icon {
  width: 44px; height: 44px; padding: 10px; border-radius: 10px; background: var(--ink); color: var(--accent);
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.feature h4 { margin-top: 16px; font-size: 19px; font-weight: 700; line-height: 1.25; }
.feature p { margin-top: 6px; font-size: 16px; color: var(--ink-soft); line-height: 1.55; }

/* ─── Steps ─── */
.section-steps { background-image: linear-gradient(rgb(255 255 255 / .035) 1px, transparent 1px), linear-gradient(90deg, rgb(255 255 255 / .035) 1px, transparent 1px); background-size: 40px 40px; }
.steps { display: grid; gap: 4px; counter-reset: step; }
@media (min-width: 720px) { .steps { grid-template-columns: 1fr 1fr; gap: 4px; } }
@media (min-width: 1100px) { .steps { grid-template-columns: repeat(4, 1fr); } }
.step { position: relative; background: var(--ink-2); padding: 28px 24px 30px; border-radius: 4px; }
.step:first-child { border-radius: var(--radius-card) 4px 4px 4px; }
.step::after {
  /* saw cut between steps */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--kerf);
  box-shadow: inset 0 1px 0 var(--kerf-edge), inset 0 -1px 0 var(--kerf-edge);
}
.step-num { display: block; font-family: var(--font-display); font-weight: 700; font-size: 64px; line-height: .9; color: var(--accent); }
.step h3 { margin-top: 18px; font-family: var(--font-display); font-weight: 700; font-size: 26px; text-transform: uppercase; line-height: 1.05; }
.step p { margin-top: 10px; color: var(--on-dark-2); font-size: 16px; }

/* ─── Audience ─── */
.audience { display: grid; gap: 16px; }
@media (min-width: 860px) { .audience { grid-template-columns: repeat(3, 1fr); gap: 20px; } }
.audience-card { background: var(--white); border-radius: var(--radius-card); padding: 26px 24px 28px; border: 2px solid var(--ink); box-shadow: 6px 6px 0 var(--ink); margin-right: 6px; }
.audience-card h3 { margin-top: 20px; font-family: var(--font-display); font-weight: 700; font-size: 30px; text-transform: uppercase; line-height: 1; }
.audience-card p { margin-top: 10px; color: var(--ink-soft); }
.audience-strip { display: flex; height: 16px; gap: 3px; background: var(--kerf); padding: 0; border-radius: 3px; overflow: hidden; }
.audience-strip i { flex: var(--w) 1 0; background: var(--ink); }
.audience-strip em { flex: var(--w) 1 0; background-color: #fff; background-image: repeating-linear-gradient(135deg, var(--scrap-hatch) 0 2px, transparent 2px 6px); }

/* ─── FAQ ─── */
.faq { border-top: 2px solid var(--ink); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; position: relative;
  padding: 20px 52px 20px 0; font-size: 19px; font-weight: 700; line-height: 1.35;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 4px; top: 50%; width: 32px; height: 32px; margin-top: -16px; border-radius: 8px;
  background: var(--ground) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 3v10M3 8h10' stroke='%23111827' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E") center / 16px no-repeat;
  transition: transform .2s, background-color .2s;
}
.faq details[open] summary::after { transform: rotate(45deg); background-color: var(--accent); }
.faq summary:hover::after { background-color: var(--track); }
.faq details[open] summary:hover::after { background-color: var(--accent-hover); }
.faq-body { padding: 0 52px 24px 0; color: var(--ink-soft); }
@media (max-width: 479px) { .faq-body { padding-right: 0; } .faq summary { font-size: 17px; } }

/* ─── Contact ─── */
.section-contact { border-top: 6px solid var(--accent); }
.contact-grid { display: grid; gap: 40px; }
@media (min-width: 960px) { .contact-grid { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 64px; align-items: start; } }
.contact-points { margin-top: 28px; display: flex; flex-direction: column; gap: 12px; color: var(--on-dark-2); }
.contact-points li { display: flex; gap: 10px; align-items: baseline; }
.contact-points li::before { content: ""; width: 8px; height: 8px; background: var(--accent); flex-shrink: 0; transform: translateY(-2px); }
.contact-points a { color: var(--white); font-weight: 700; text-underline-offset: 3px; }
.contact-points a:hover { color: var(--accent); }

.form-card { background: var(--white); color: var(--ink); border-radius: 18px; padding: 22px; --focus: var(--ink); min-width: 0; }
@media (min-width: 640px) { .form-card { padding: 32px; } }
.form-row { display: grid; gap: 0 16px; }
@media (min-width: 560px) { .form-row { grid-template-columns: 1fr 1fr; } }
.field { display: flex; flex-direction: column; margin-bottom: 14px; min-width: 0; }
.field label { font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.req { color: var(--danger); }
.opt { font-weight: 400; color: var(--muted); }
.field input, .field textarea {
  width: 100%; min-height: 48px; padding: 10px 14px; font-size: 16px;
  border: 1.5px solid var(--line-strong); border-radius: var(--radius-control); background: var(--white);
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: vertical; min-height: 110px; line-height: 1.5; }
.field input::placeholder, .field textarea::placeholder { color: #6b7280; }
.field input:focus-visible, .field textarea:focus-visible { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--accent), 0 0 0 5px var(--ink); }
.field [aria-invalid="true"] { border-color: var(--danger); background: var(--danger-subtle); }
.field-error { font-size: 14px; font-weight: 600; color: var(--danger); margin-top: 4px; }
.field-error:empty { display: none; }
.field-check { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: start; margin: 4px 0 20px; }
.field-check input { width: 22px; height: 22px; min-height: 0; margin: 2px 0 0; accent-color: var(--ink); cursor: pointer; }
.field-check label { font-weight: 500; font-size: 15px; margin: 0; line-height: 1.5; }
.field-check label a { font-weight: 700; text-underline-offset: 2px; }
.field-check .field-error { grid-column: 2; }
.field-check input[aria-invalid="true"] { outline: 2px solid var(--danger); outline-offset: 2px; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-note { margin-top: 12px; font-size: 14px; color: var(--muted); }
.form-status:empty { display: none; }
.form-status { margin-top: 14px; padding: 12px 14px; border-radius: var(--radius-control); font-size: 15px; font-weight: 500; }
.form-status.is-error { background: var(--danger-subtle); color: #7f1d1d; box-shadow: inset 0 0 0 1.5px var(--danger); }
.form-status.is-info { background: var(--accent-subtle); color: var(--on-accent-subtle); box-shadow: inset 0 0 0 1.5px var(--accent-edge); }
.form-status a { font-weight: 700; color: inherit; }
#cf-submit[disabled] { opacity: .7; cursor: progress; }

.form-done { text-align: center; padding: 32px 8px; }
.form-done:focus { outline: none; }
.form-done-icon { display: inline-flex; width: 64px; height: 64px; border-radius: 50%; background: var(--accent); color: var(--ink); align-items: center; justify-content: center; }
.form-done-icon svg { width: 32px; height: 32px; }
.form-done h3 { margin-top: 18px; font-family: var(--font-display); font-weight: 700; font-size: 32px; text-transform: uppercase; }
.form-done p { margin-top: 8px; color: var(--ink-soft); }
.form-done a { font-weight: 700; }

/* ─── Footer ─── */
.site-footer { padding: 56px 0 28px; border-top: 1px solid rgb(255 255 255 / .08); }
.footer-grid { display: grid; gap: 36px; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.6fr 1fr 1fr; } }
.footer-brand p { margin-top: 14px; color: var(--on-dark-3); max-width: 340px; font-size: 15px; }
.footer-heading { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--on-dark-3); margin-bottom: 10px; }
.footer-nav a { display: inline-flex; align-items: center; min-height: 36px; color: var(--on-dark-2); text-decoration: none; font-weight: 500; }
.footer-nav a:hover { color: var(--white); text-decoration: underline; text-underline-offset: 3px; }
.footer-bottom { margin-top: 44px; padding-top: 22px; border-top: 1px solid rgb(255 255 255 / .1); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.footer-copy { font-size: 14px; color: var(--on-dark-3); }
.made-by { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--on-dark-3); font-size: 14px; padding: 6px 0; }
.made-by img { width: 124px; height: auto; }
.made-by:hover { color: var(--white); }

/* ─── Legal pages ─── */
.legal { background: var(--white); }
.legal-page { max-width: 780px; margin: 0 auto; padding: 48px var(--gutter) 88px; }
.legal-back { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 15px; color: var(--ink-soft); text-decoration: none; min-height: 44px; }
.legal-back:hover { color: var(--ink); text-decoration: underline; }
.legal-back svg { width: 16px; height: 16px; }
.legal-page h1 { margin-top: 12px; font-family: var(--font-display); font-weight: 700; text-transform: uppercase; font-size: clamp(36px, 6vw, 52px); line-height: 1; }
.legal-date { margin-top: 10px; font-size: 15px; color: var(--muted); }
.draft-note { margin: 24px 0 8px; padding: 14px 16px; border-radius: var(--radius-control); background: var(--accent-subtle); color: var(--on-accent-subtle); box-shadow: inset 0 0 0 1.5px var(--accent-edge); font-size: 15px; font-weight: 500; }
.legal-page h2 { margin: 36px 0 10px; font-size: 20px; font-weight: 700; }
.legal-page p, .legal-page li { color: var(--ink-soft); line-height: 1.7; margin-bottom: 10px; font-size: 16px; }
.legal-page ul { padding-left: 22px; list-style: disc; margin-bottom: 10px; }
.legal-page a { color: var(--ink); font-weight: 600; text-underline-offset: 2px; }
.legal-page .todo { background: var(--accent-subtle); color: var(--on-accent-subtle); padding: 0 4px; border-radius: 3px; font-weight: 600; }
.site-header-simple .header-inner { justify-content: space-between; }

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

/* phones: compact feature cards (icon beside the text) */
@media (max-width: 639px) {
  .feature { display: grid; grid-template-columns: 40px 1fr; column-gap: 14px; padding: 18px; }
  .feature-icon { width: 40px; height: 40px; padding: 9px; grid-row: span 2; }
  .feature h4 { margin-top: 0; font-size: 18px; align-self: center; }
  .feature p { font-size: 15px; }
  .feature-grid { gap: 12px; }
}
@media (max-width: 639px) {
  .step { padding: 22px 20px 24px; }
  .step-num { font-size: 48px; }
  .step h3 { margin-top: 10px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px 16px; }
  .footer-brand { grid-column: 1 / -1; }
}
