/* CAD Blocks public site. Tokens match static/app.css so the site and the app read as one drawing set. */

:root {
  --table: #E7EAE8;
  --sheet: #FFFFFF;
  --graphite: #1F2328;
  --lead: #626970;
  --rule: #CDD3D6;
  --rule-strong: #9AA2A8;
  --blue: #5AA9DD;
  --blue-ink: #1D6CA3;
  --redline: #CC3B2F;
  --redline-wash: #FBEDEB;

  --font: "Archivo", "Segoe UI", system-ui, -apple-system, sans-serif;
  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.625rem;
  --step-3: clamp(1.875rem, 1.3rem + 2.2vw, 2.75rem);
  --step-4: clamp(2.5rem, 1.25rem + 5.2vw, 5.25rem);
  --radius: 3px;
  --gutter: clamp(16px, 3.2vw, 44px);
  --max: 1280px;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--table);
  color: var(--graphite);
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.5;
  font-variation-settings: "wdth" 100;
  overflow-x: hidden;
}

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

a { color: var(--blue-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--graphite); }

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

[hidden] { display: none !important; }

h1, h2, h3 { margin: 0; color: var(--graphite); }

h2 {
  font-size: var(--step-3);
  line-height: 1.05;
  font-weight: 680;
  font-variation-settings: "wdth" 118;
  letter-spacing: -0.02em;
}

h3 {
  font-size: var(--step-1);
  line-height: 1.2;
  font-weight: 650;
  font-variation-settings: "wdth" 104;
}

p { margin: 0; }

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  padding: 8px 12px;
  background: var(--graphite);
  color: var(--sheet);
  z-index: 10;
}
.skip:focus { left: 8px; }

/* ------------------------------------------------------------------ buttons */

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 13px 20px;
  border: 1px solid var(--graphite);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: var(--step-0);
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.button.primary { background: var(--graphite); color: var(--sheet); }
.button.primary:hover { background: #343a41; color: var(--sheet); }
.button.secondary { background: var(--sheet); color: var(--graphite); }
.button.secondary:hover { background: var(--table); color: var(--graphite); }
.button.quiet {
  border-color: transparent;
  background: none;
  color: var(--blue-ink);
  padding-left: 4px;
  padding-right: 4px;
  text-decoration: underline;
}
.button.quiet:hover { color: var(--graphite); }
.button.small { padding: 8px 13px; font-size: var(--step--1); }

/* ------------------------------------------------------------------ header */

.site-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 20px var(--gutter) 8px;
}

.wordmark {
  font-size: var(--step-2);
  font-weight: 720;
  font-variation-settings: "wdth" 125;
  letter-spacing: -0.015em;
  color: var(--graphite);
  text-decoration: none;
  white-space: nowrap;
}
.wordmark:hover { color: var(--graphite); }

.site-nav { display: flex; align-items: center; gap: clamp(12px, 2.4vw, 28px); }
.site-nav a { color: var(--graphite); text-decoration: none; font-weight: 550; font-size: var(--step--1); white-space: nowrap; }
@media (max-width: 440px) {
  .site-bar { flex-wrap: wrap; row-gap: 10px; }
  .wordmark { font-size: var(--step-1); }
}
.site-nav a:hover { text-decoration: underline; }
.site-nav .nav-account {
  padding: 7px 12px;
  border: 1px solid var(--graphite);
  border-radius: var(--radius);
  background: var(--sheet);
}
.site-nav .nav-account:hover { background: var(--table); text-decoration: none; }

/* ------------------------------------------------------------------ hero */

main { display: block; }

.hero, .band {
  max-width: var(--max);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.hero { padding-top: clamp(28px, 5vw, 64px); }

.hero-copy {
  display: grid;
  gap: clamp(18px, 2.4vw, 28px);
  margin-bottom: clamp(28px, 4vw, 44px);
}

.hero h1 {
  max-width: 17ch;
  font-size: var(--step-4);
  line-height: 0.95;
  font-weight: 720;
  font-variation-settings: "wdth" 125;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.hero-side { display: grid; gap: 18px 48px; }
.hero-act { display: grid; gap: 10px; align-content: start; }
.lead { font-size: var(--step-1); line-height: 1.45; max-width: 52ch; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.fine { color: var(--lead); font-size: var(--step--1); }

@media (min-width: 900px) {
  .hero-side { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: end; }
}

/* the example sheet: photo, plotted drawing and title strip, as in the app */

.demo {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  margin: 0;
  background: var(--sheet);
  border: 1px solid var(--rule-strong);
  box-shadow: 0 1px 0 rgba(31, 35, 40, 0.06), 0 24px 48px -30px rgba(31, 35, 40, 0.5);
}

.demo-photo {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-content: start;
  padding: 16px;
  border-bottom: 1px solid var(--rule);
}

.photo-pin {
  position: relative;
  height: clamp(220px, 60vw, 300px);
  overflow: hidden;
  background: var(--sheet);
  border: 1px solid var(--rule);
}
.photo-pin img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 0.25s ease;
}
.photo-pin.is-swapping img { opacity: 0; }

/* reading the photo: one blue scan line, the same cue the app shows while drawing */
.photo-pin.is-reading::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 4%;
  height: 2px;
  background: var(--blue);
  box-shadow: 0 0 10px 2px rgba(90, 169, 221, 0.55);
  animation: scan 0.9s ease-in-out forwards;
}
@keyframes scan { from { top: 4%; } to { top: 96%; } }

.picker { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.picker button {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 6px 4px 5px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--sheet);
  color: var(--lead);
  font-size: var(--step--1);
  font-variation-settings: "wdth" 88;
  cursor: pointer;
}
.picker button:hover { border-color: var(--rule-strong); color: var(--graphite); }
.picker img { width: auto; height: 44px; object-fit: contain; }
.picker button[aria-checked="true"] {
  border-color: var(--graphite);
  box-shadow: inset 0 0 0 1px var(--graphite);
  color: var(--graphite);
  font-weight: 600;
}

.demo-drawing {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 340px;
  padding: 26px 22px 30px 30px;
  outline: 1px solid var(--graphite);
  outline-offset: -10px;
}
.noscript { color: var(--lead); }

.sheet-svg { width: 100%; height: 100%; max-height: 560px; overflow: visible; --u: 1px; }
.sheet-svg .construction { stroke: var(--blue); stroke-width: calc(var(--u) * 1); fill: none; opacity: 0.4; }
.sheet-svg .projector { stroke: var(--blue); stroke-width: calc(var(--u) * 0.75); fill: none; opacity: 0.2; }
.sheet-svg .ink { fill: none; stroke: var(--graphite); stroke-linejoin: round; stroke-linecap: round; }
.sheet-svg .outline { stroke-width: calc(var(--u) * 1.5); }
.sheet-svg .detail { stroke-width: calc(var(--u) * 0.75); }
.sheet-svg .hidden { stroke-width: calc(var(--u) * 0.75); stroke-dasharray: calc(var(--u) * 5) calc(var(--u) * 3.5); }
.sheet-svg .dim-line { stroke: var(--graphite); stroke-width: calc(var(--u) * 0.7); fill: none; }
.sheet-svg text { font-family: var(--font); fill: var(--graphite); }
.sheet-svg .dim-text { font-variant-numeric: tabular-nums; }
.sheet-svg .view-label { font-weight: 600; }

/* plotting: construction first, then ink (clip sweep set from JS), then annotation */
.sheet-svg.plotting .construction, .sheet-svg.plotting .projector { animation: construct 0.5s ease both; }
.sheet-svg.plotting .projector { animation-delay: 0.15s; }
.sheet-svg.plotting .annotation { animation: annotate 0.45s ease 1.55s both; }
@keyframes construct { from { opacity: 0; } }
@keyframes annotate { from { opacity: 0; } }

.demo-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  background: var(--rule);
  border-top: 1px solid var(--graphite);
  font-size: var(--step--1);
}
.strip-row { padding: 10px 14px; background: var(--sheet); min-width: 0; }
.strip-row dt { color: var(--lead); margin-bottom: 2px; font-variation-settings: "wdth" 88; }
.strip-row dd { margin: 0; overflow-wrap: anywhere; }
.strip-item, .strip-wide, .strip-action { grid-column: 1 / -1; }
.strip-item { padding-top: 14px; }
.strip-item dd {
  font-size: var(--step-1);
  line-height: 1.2;
  font-weight: 650;
  font-variation-settings: "wdth" 108;
}
.block-base { display: block; font-weight: 600; }
.block-views { display: block; color: var(--lead); }
.strip-action { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding-bottom: 16px; }
.strip-note { color: var(--lead); }

@media (min-width: 720px) {
  .demo { grid-template-columns: minmax(200px, 30%) minmax(0, 1fr); }
  .demo-photo { border-bottom: 0; border-right: 1px solid var(--rule); padding: 20px; }
  .photo-pin { height: clamp(260px, 34vw, 420px); }
  .demo-drawing { min-height: 440px; padding: 36px 30px 40px 44px; }
  .picker { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .demo-strip { grid-column: 1 / -1; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .strip-item, .strip-wide { grid-column: span 2; }
  .strip-action { grid-column: 1 / -1; }
}

@media (min-width: 1100px) {
  .demo { grid-template-columns: minmax(220px, 24%) minmax(0, 1fr) 240px; }
  .demo-drawing { min-height: 600px; }
  .demo-photo { grid-template-rows: minmax(0, 1fr) auto; align-content: stretch; }
  .picker { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .photo-pin { height: auto; min-height: 360px; }
  .demo-strip {
    grid-column: auto;
    display: flex;
    flex-direction: column;
    border-top: 0;
    border-left: 1px solid var(--graphite);
  }
  .strip-item { padding-top: 18px; padding-bottom: 16px; box-shadow: 0 1px 0 var(--graphite); position: relative; }
  .strip-action { flex: 1; display: grid; align-content: end; justify-items: start; padding-top: 14px; }
}

/* ------------------------------------------------------------------ bands */

.band { padding-top: clamp(64px, 9vw, 112px); }
.band > h2, .file-intro h2, .pricing-head h2 { margin-bottom: clamp(20px, 3vw, 32px); }

/* how it works: a real sequence, so it's numbered */
.step-list {
  display: grid;
  gap: 28px 40px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.step-list li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 2.4rem minmax(0, 1fr);
  gap: 6px 14px;
  padding-top: 18px;
  border-top: 2px solid var(--graphite);
}
.step-list li::before {
  content: counter(step);
  grid-row: span 2;
  font-size: 2.6rem;
  line-height: 0.9;
  font-weight: 300;
  font-variation-settings: "wdth" 125;
  color: var(--blue-ink);
}
.step-list p { color: var(--lead); max-width: 40ch; }
@media (min-width: 980px) {
  .step-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* what's in the file */
.file { display: grid; gap: 28px 56px; }
.file-intro p { color: var(--lead); max-width: 44ch; }
@media (min-width: 960px) {
  .file { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
}

.register {
  width: 100%;
  border-collapse: collapse;
  background: var(--sheet);
  border: 1px solid var(--graphite);
  font-size: var(--step--1);
}
.register caption { caption-side: top; text-align: left; padding: 0 0 8px; color: var(--lead); font-size: var(--step--1); }
.register th, .register td { padding: 10px 12px; text-align: left; vertical-align: top; }
.register th {
  font-weight: 500;
  color: var(--lead);
  font-variation-settings: "wdth" 88;
  border-bottom: 1px solid var(--graphite);
}
.register td { border-top: 1px solid var(--rule); }
.register td:first-child { font-weight: 600; font-variation-settings: "wdth" 90; overflow-wrap: anywhere; }
@media (max-width: 520px) {
  .register th:nth-child(2), .register td:nth-child(2) { display: none; }
}

.spec { display: grid; gap: 18px 32px; margin: 26px 0 0; }
.spec dt { font-weight: 650; margin-bottom: 2px; }
.spec dd { margin: 0; color: var(--lead); }
@media (min-width: 640px) {
  .spec { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* the accuracy note is a redline markup, as in the app */
.redline {
  max-width: 76ch;
  padding: clamp(20px, 3vw, 30px) clamp(20px, 3vw, 34px);
  border-left: 3px solid var(--redline);
  background: var(--redline-wash);
}
.redline h2 {
  margin-bottom: 10px;
  font-size: var(--step-2);
  color: var(--redline);
  font-variation-settings: "wdth" 112;
}

/* ------------------------------------------------------------------ pricing schedule */

.pricing-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 24px;
}
.currency { display: flex; align-items: center; gap: 10px; color: var(--lead); font-size: var(--step--1); margin-bottom: 24px; }
.switch {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  background: var(--sheet);
}
.switch button {
  padding: 5px 10px;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: var(--lead);
  font: inherit;
  cursor: pointer;
}
.switch button:hover { color: var(--graphite); }
.switch button[aria-checked="true"] { background: var(--graphite); color: var(--sheet); }

.schedule {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  background: var(--sheet);
  border: 1px solid var(--graphite);
}

.plan {
  display: grid;
  grid-template-rows: auto auto auto auto auto 1fr;
  padding: 0 20px 22px;
  border-bottom: 1px solid var(--graphite);
}
.plan:last-child { border-bottom: 0; }
.plan h3 { padding: 20px 0 4px; }
.mark {
  display: block;
  margin-top: 4px;
  color: var(--redline);
  font-size: var(--step--1);
  font-weight: 600;
  font-variation-settings: "wdth" 96;
}
.price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; padding: 8px 0 16px; }
.amount {
  font-size: clamp(2.25rem, 1.8rem + 1.4vw, 2.875rem);
  line-height: 1;
  font-weight: 720;
  font-variation-settings: "wdth" 125;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.per { color: var(--lead); font-size: var(--step--1); }
.row { padding: 10px 0; border-top: 1px solid var(--rule); font-size: var(--step--1); }
.row-label { display: block; color: var(--lead); font-variation-settings: "wdth" 88; }
.plan .button { align-self: end; justify-self: stretch; margin-top: 18px; }
.plan-marked { position: relative; outline: 2px solid var(--redline); outline-offset: -2px; z-index: 1; }

@media (min-width: 640px) and (max-width: 1039px) {
  .schedule { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: auto; }
  .plan { grid-row: span 6; grid-template-rows: subgrid; }
  .plan:nth-child(odd) { border-right: 1px solid var(--graphite); }
  .plan:nth-child(3), .plan:nth-child(4) { border-bottom: 0; }
  .plan:nth-child(1), .plan:nth-child(2) { border-bottom: 1px solid var(--graphite); }
}
@media (min-width: 1040px) {
  .schedule { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .plan { grid-row: span 6; grid-template-rows: subgrid; border-bottom: 0; border-right: 1px solid var(--graphite); }
  .plan:last-child { border-right: 0; }
}

.pricing-notes { display: grid; gap: 10px; margin-top: 20px; max-width: 74ch; color: var(--lead); font-size: var(--step--1); }
.pricing-notes strong { color: var(--graphite); font-weight: 650; }

/* ------------------------------------------------------------------ questions */

.faq { display: grid; gap: 8px 56px; }
@media (min-width: 960px) {
  .faq { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); align-items: start; }
}
.faq-list { border-bottom: 1px solid var(--rule-strong); }
.faq details { border-top: 1px solid var(--rule-strong); }
.faq summary {
  position: relative;
  display: block;
  padding: 16px 40px 16px 0;
  font-weight: 620;
  font-size: var(--step-0);
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
/* a drafting cross that becomes a minus when open */
.faq summary::before, .faq summary::after {
  content: "";
  position: absolute;
  right: 6px;
  top: 50%;
  width: 14px;
  height: 1.5px;
  background: var(--graphite);
}
.faq summary::after { transform: rotate(90deg); transition: transform 0.2s ease; }
.faq details[open] summary::after { transform: rotate(0deg); }
.faq summary:hover { color: var(--blue-ink); }
.faq details p { padding: 0 0 20px; color: var(--lead); max-width: 66ch; }

/* ------------------------------------------------------------------ closing */

.closing { display: grid; gap: 14px; justify-items: start; padding-bottom: clamp(56px, 8vw, 96px); }
.closing h2 { margin-bottom: 0; max-width: 18ch; }
.closing p { color: var(--lead); max-width: 52ch; }
.closing .button { margin-top: 6px; }

/* ------------------------------------------------------------------ footer title block */

.title-block {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  max-width: calc(var(--max) - 2 * var(--gutter));
  margin: 0 var(--gutter) var(--gutter);
  background: var(--rule);
  border: 1px solid var(--graphite);
  font-size: var(--step--1);
}
@media (min-width: 1280px) {
  .title-block { margin-left: auto; margin-right: auto; }
}
.tb-cell { display: grid; align-content: start; gap: 2px; padding: 10px 14px; background: var(--sheet); min-width: 0; }
.tb-name { grid-column: 1 / -1; }
.tb-label { color: var(--lead); font-variation-settings: "wdth" 88; }
.tb-value { overflow-wrap: anywhere; color: var(--graphite); }
a.tb-value { color: var(--blue-ink); }
.tb-mark { font-size: var(--step-1); font-weight: 720; font-variation-settings: "wdth" 125; letter-spacing: -0.015em; }
.tb-links { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.tb-links a { overflow-wrap: normal; white-space: nowrap; }
.tb-links a { color: var(--blue-ink); }
.tb-wide { grid-column: 1 / -1; }

@media (min-width: 900px) {
  .title-block { grid-template-columns: 1.2fr 2.2fr 1.4fr 1fr 0.6fr; }
  .tb-name, .tb-wide { grid-column: auto; }
}

/* ------------------------------------------------------------------ legal pages */

.legal {
  max-width: 860px;
  margin: clamp(20px, 4vw, 44px) auto clamp(48px, 7vw, 88px);
  padding: 0 var(--gutter);
}
.legal-sheet {
  padding: clamp(30px, 5vw, 64px) clamp(26px, 5vw, 64px);
  background: var(--sheet);
  border: 1px solid var(--rule-strong);
  outline: 1px solid var(--graphite);
  outline-offset: -10px;
}
.legal h1 {
  font-size: var(--step-3);
  line-height: 1.05;
  font-weight: 720;
  font-variation-settings: "wdth" 122;
  letter-spacing: -0.02em;
}
.legal .updated { margin: 10px 0 28px; color: var(--lead); font-size: var(--step--1); }
.legal h2 {
  margin: 34px 0 10px;
  font-size: var(--step-1);
  font-weight: 680;
  font-variation-settings: "wdth" 108;
  letter-spacing: 0;
}
.legal p, .legal li { line-height: 1.6; max-width: 70ch; }
.legal p + p { margin-top: 12px; }
.legal ul { padding-left: 1.2em; margin: 10px 0 0; }
.legal li + li { margin-top: 6px; }
.legal .summary { padding: 16px 18px; border-left: 3px solid var(--blue-ink); background: #EDF4FA; }

/* ------------------------------------------------------------------ a colleague's invite */

.invite-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 20px;
  max-width: calc(var(--max) - 2 * var(--gutter));
  margin: 8px var(--gutter) 0;
  padding: 12px 16px;
  background: var(--sheet);
  border: 1px solid var(--rule-strong);
  border-left: 3px solid var(--blue-ink);
}
@media (min-width: 1280px) {
  .invite-note { margin-left: auto; margin-right: auto; }
}
.invite-note p { max-width: 70ch; }

/* ------------------------------------------------------------------ motion */

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