/* ==========================================================================
   CardToCAD — round 2 site layout (loaded after style.css)
   Tool in the hero, cream "paper" bands, sticky header, results viewer.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;9..144,700&family=IBM+Plex+Sans:wght@400;500;600&display=swap');

:root {
  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --paper: #f1ece2;
  --paper-ink: #13202e;
  --paper-dim: #3d4b59;
  --paper-line: #d9cfbf;
  --rust: #8a5a2b;
  --good: #5bd38a;
  --warn: #f2c14e;
}

html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body { font-family: var(--sans); font-size: 17px; line-height: 1.6; }
p { margin: 0 0 14px; }
[hidden] { display: none !important; }

.wrap-wide { max-width: 1200px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.wrap { max-width: 880px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.section { padding-top: 84px; padding-bottom: 84px; }
.section-tight { padding-top: 0; padding-bottom: 84px; }
.section-rule { border-top: 1px solid var(--border); }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }

.display { font-family: var(--display); font-weight: 700; font-size: clamp(46px, 6vw, 78px); line-height: 1.0; margin: 0 0 22px; letter-spacing: -0.01em; }
.h1 { font-family: var(--display); font-size: clamp(32px, 4.4vw, 50px); line-height: 1.1; margin: 0; }
.h2 { font-family: var(--display); font-size: clamp(32px, 4vw, 46px); line-height: 1.08; margin: 0 0 14px; }
.h3 { font-family: var(--display); font-size: 23px; line-height: 1.2; margin: 0 0 6px; }
.h3-lg { font-size: 28px; }
.lede { font-size: 19px; color: var(--cream-dim); max-width: 32em; margin-bottom: 26px; }
.sub { color: var(--cream-dim); margin-bottom: 36px; }
.kicker { font-family: var(--mono); font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--tan); margin-bottom: 14px; }

/* ---------- buttons (extends style.css) ---------- */
.btn { justify-content: center; min-height: 48px; }
.btn-sm { min-height: 44px; padding: 0 18px; font-size: 12px; }
.btn-dark { background: var(--navy-900); border-color: var(--navy-900); color: var(--cream); font-weight: 700; }
.btn-dark:hover { background: #13294a; border-color: #13294a; color: var(--cream); }
.btn svg { flex-shrink: 0; }
.linklike { background: none; border: none; padding: 0; min-height: 44px; color: var(--tan); font-family: var(--mono); font-size: 13px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.linklike:hover { color: var(--orange); }

/* ---------- sticky header ---------- */
.topbar { position: sticky; top: 0; z-index: 50; background: rgba(10, 22, 40, 0.94); border-bottom: 1px solid var(--border); backdrop-filter: blur(8px); }
.topbar-in { max-width: 1200px; margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; flex-shrink: 0; }
.brand-mark { height: 62px; width: auto; display: block; }
.brand-word { font-family: Georgia, 'Times New Roman', serif; font-weight: 700; font-size: 38px; line-height: 1; letter-spacing: 0.01em; color: var(--cream); white-space: nowrap; }
.bw-card { color: var(--tan); }
.bw-to { font-size: 0.72em; margin: 0 0.06em; }
.brand:hover .brand-word { color: var(--cream); }
.nav-links { display: flex; align-items: center; gap: 26px; font-family: var(--mono); font-size: 13px; letter-spacing: 0.04em; }
.nav-links a:not(.btn) { color: var(--cream-dim); text-decoration: none; }
.nav-links a:not(.btn):hover { color: var(--orange); }
.nav-links .nav-coffee { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: 999px; color: var(--cream); }
.nav-links .nav-coffee svg { color: var(--tan); }
.nav-links .nav-coffee:hover { border-color: var(--orange); }
.menu-btn { display: none; width: 44px; height: 44px; align-items: center; justify-content: center; background: none; border: 1px solid var(--border); color: var(--cream); cursor: pointer; }

/* ---------- hero + tool ---------- */
.hero { display: flex; flex-wrap: wrap; align-items: center; gap: 56px; padding-top: 60px; padding-bottom: 76px; }
.hero-copy { flex: 1 1 440px; min-width: 0; }
.award { display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px; margin-bottom: 24px; border: 1px solid var(--border-strong); border-radius: 999px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; color: var(--cream); text-decoration: none; }
.award svg { color: var(--tan); }
.award:hover { border-color: var(--orange); color: var(--cream); }
.award-static { margin: 10px 0 0; border-radius: 2px; }
.award-short { display: none; }
.ticks { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 22px; font-family: var(--mono); font-size: 13px; color: var(--cream-dim); }
.ticks li { display: flex; align-items: center; gap: 8px; }
.ticks li::before { content: ""; width: 12px; height: 7px; border-left: 2px solid var(--tan); border-bottom: 2px solid var(--tan); transform: rotate(-45deg) translateY(-2px); }

.tool { flex: 1 1 480px; min-width: 0; margin: 0; background: var(--navy-800); }
.tool .dropzone { padding: 36px 20px 30px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.dz-mat { color: var(--tan); }
.dz-label { font-size: 18px; font-weight: 500; color: var(--cream); }
.dz-sub { font-family: var(--mono); font-size: 13px; color: var(--cream-dim); }
.tool-buttons { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.tool-buttons .btn { flex: 1 1 160px; }
.tool-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 18px; margin-top: 10px; }
.options summary { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; font-family: var(--mono); font-size: 13px; color: var(--cream-dim); list-style: none; }
.options summary::-webkit-details-marker { display: none; }
.options summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--tan); border-bottom: 2px solid var(--tan); transform: rotate(-45deg); transition: transform 0.15s ease; }
.options[open] summary::before { transform: rotate(45deg); }
.options-body { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border); }
.options-body .field-row { margin: 14px 0 0; }
.tool-foot { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; font-size: 14px; color: var(--cream-dim); }
.tool-foot .engine-status { margin: 0; font-family: var(--mono); font-size: 12px; }
.engine-status.idle .pip { background: var(--cream-dim); animation: none; opacity: 0.6; }
.tool-busy { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; background: rgba(13, 31, 46, 0.94); font-family: var(--mono); font-size: 14px; color: var(--cream); text-align: center; padding: 24px; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--border-strong); border-top-color: var(--orange); border-radius: 50%; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.desktop-only { display: inline; }

/* ---------- cream "paper" bands ---------- */
.band.cream { background: var(--paper); color: var(--paper-ink); padding: 84px 0; }
.band.cream p { color: var(--paper-dim); }
.band.cream .h2, .band.cream .h3 { color: var(--navy-800); }
.band.cream .kicker { color: var(--rust); }
.band.cream a { color: var(--rust); }
.band-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; margin-bottom: 32px; }
.band-head p { margin: 0; font-size: 16px; }
.band-head-tight { align-items: flex-end; margin: 48px 0 20px; }
.tag { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border: 1px solid var(--rust); font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--rust); }
.trio { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.trio figure { margin: 0; }
.trio figcaption { margin-top: 12px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--paper-dim); }

/* photo placeholders */
.ph { display: flex; align-items: center; justify-content: center; padding: 20px; text-align: center; font-family: var(--mono); font-size: 13px; }
.ph-cream { aspect-ratio: 4 / 5; border: 2px dashed #a67f52; color: #6b5133; background: repeating-linear-gradient(45deg, rgba(166,127,82,0.10) 0 10px, transparent 10px 20px); }
.ph-dark { border: 2px dashed var(--border-strong); color: var(--cream-dim); background: repeating-linear-gradient(45deg, rgba(200,155,108,0.07) 0 10px, transparent 10px 20px), var(--navy-800); }
.ph-43 { aspect-ratio: 4 / 3; }
.ph-11 { aspect-ratio: 1 / 1; }
.ph img, .ph video { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- split layouts ---------- */
.split { display: flex; flex-wrap: wrap; gap: 48px; }
.split > * { flex: 1 1 400px; min-width: 0; }
.split-head { flex: 1 1 300px; }
.split-head p { color: var(--cream-dim); }
.split-center { align-items: center; }
.steps { flex: 2 1 560px; list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.steps li { display: flex; flex-wrap: wrap; gap: 8px 28px; padding: 24px 0; border-bottom: 1px solid var(--border); }
.steps li > div { flex: 1 1 360px; min-width: 0; }
.steps p { color: var(--cream-dim); font-size: 16px; }
.step-n { flex: 0 0 56px; font-family: var(--mono); font-size: 30px; font-weight: 700; color: var(--orange); line-height: 1.2; }
.mat-list { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; font-family: var(--mono); font-size: 13px; }
.mat-region { color: var(--tan); text-transform: uppercase; letter-spacing: 0.1em; font-size: 11px; }
.mat-list .mat-region:not(:first-child) { margin-left: 12px; }

/* ---------- bento ---------- */
.bento { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); grid-auto-flow: dense; gap: 16px; }
.tile { position: relative; display: flex; flex-direction: column; justify-content: flex-end; padding: 24px; border: 1px solid var(--border); background: var(--navy-800); }
.tile p { margin: 0; font-size: 15px; color: var(--cream-dim); }
.tile svg { color: var(--tan); margin-bottom: auto; }
.tile-big { grid-column: span 2; min-height: 320px; border-style: dashed; border-color: var(--border-strong); }
.tile-tall { min-height: 320px; }
.ph-note { position: absolute; top: 20px; left: 24px; right: 24px; font-family: var(--mono); font-size: 12px; color: var(--cream-dim); }
@media (max-width: 620px) { .tile-big { grid-column: auto; } }

/* ---------- aids library ---------- */
.lib { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.lib article { background: #fff; border: 1px solid var(--paper-line); }
.lib-pic { height: 130px; display: flex; align-items: center; justify-content: center; border-bottom: 1px solid var(--paper-line); color: var(--navy-800); }
.lib-pic .acc { stroke: #c0622f; }
.lib-body { padding: 16px; }
.lib-body h4 { margin: 0 0 4px; font-size: 17px; font-weight: 600; color: var(--paper-ink); }
.lib-body p { margin: 0; font-size: 14px; }

/* ---------- print band ---------- */
.printband { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; padding: 36px 40px; background: var(--tan); color: var(--navy-900); }
.printband > div { flex: 1 1 420px; min-width: 0; }
.printband .h2 { color: var(--navy-900); font-size: clamp(26px, 3vw, 34px); margin-bottom: 6px; }
.printband p { color: #2b2116; margin: 0; }

/* ---------- FAQ ---------- */
.faq { border-top: 1px solid var(--border); }
.faq details { border-bottom: 1px solid var(--border); padding: 20px 0; }
.faq summary { font-size: 18px; font-weight: 500; cursor: pointer; }
.faq p { margin: 12px 0 0; color: var(--cream-dim); font-size: 16px; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--border); background: #08121f; margin-top: 0; }
.footer-in { padding-top: 40px; padding-bottom: 40px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 28px; }
.footer-brand { flex: 1 1 260px; min-width: 0; }
.brand-footer .brand-mark { height: 44px; }
.brand-footer .brand-word { font-size: 24px; }
.footer-brand p { margin: 12px 0 4px; font-size: 14px; color: var(--cream-dim); }
.coffee { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-family: var(--mono); font-size: 13px; }
.footer-links { flex: 2 1 420px; min-width: 0; display: flex; flex-wrap: wrap; gap: 12px 28px; font-family: var(--mono); font-size: 13px; }
.footer-links a { color: var(--cream-dim); }
.footer-copy { flex: 1 1 100%; font-family: var(--mono); font-size: 12px; color: #9fb0c0; }

/* ---------- results ---------- */
.result { padding-top: 40px; padding-bottom: 80px; }
.result-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin-bottom: 24px; }
.result-head .eyebrow { margin-bottom: 10px; }
.seg { display: inline-flex; border: 1px solid rgba(244,241,234,0.22); }
.seg button { min-width: 64px; min-height: 42px; padding: 0 14px; border: none; background: transparent; color: var(--cream-dim); font-family: var(--mono); font-size: 13px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--orange); color: var(--navy-900); font-weight: 700; }
.result-grid { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.pv { flex: 3 1 560px; min-width: 0; border: 1px solid var(--border); background: var(--navy-800); }
.pv-bar { display: flex; flex-wrap: wrap; align-items: stretch; justify-content: space-between; border-bottom: 1px solid var(--border); }
.pv-tabs { display: flex; flex-wrap: wrap; }
.pv-tabs button { min-height: 48px; padding: 0 16px; background: none; border: none; border-bottom: 2px solid transparent; color: var(--cream-dim); font-family: var(--mono); font-size: 13px; cursor: pointer; }
.pv-tabs button[aria-selected="true"] { color: var(--cream); border-bottom-color: var(--orange); background: rgba(244,241,234,0.04); }
.pv-zoom { display: flex; align-items: center; gap: 2px; padding: 0 8px; }
.pv-zoom button { width: 44px; height: 44px; background: none; border: none; color: var(--cream-dim); font-family: var(--mono); font-size: 20px; cursor: pointer; }
.pv-zoom button.fit { width: auto; padding: 0 10px; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--tan); }
.pv-zoom span { min-width: 50px; text-align: center; font-family: var(--mono); font-size: 13px; color: var(--cream-dim); }
.pv-stage { position: relative; height: min(68vh, 640px); min-height: 360px; overflow: hidden; background: var(--navy-800); cursor: grab; touch-action: none; user-select: none; }
.pv-stage.dragging { cursor: grabbing; }
.pv-stage.comparing { cursor: ew-resize; }
.pv-canvas { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.pv-canvas > img, .pv-canvas > svg { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.pv-divider { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--orange); pointer-events: none; }
.pv-knob { position: absolute; top: 50%; left: 50%; width: 36px; height: 36px; margin: -18px 0 0 -18px; border-radius: 50%; background: var(--orange); color: var(--navy-900); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.pv-tag { position: absolute; top: 12px; padding: 3px 8px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; background: rgba(10,22,40,0.8); color: var(--cream); pointer-events: none; }
.pv-tag-l { left: 12px; } .pv-tag-r { right: 12px; }
.pv-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; padding: 14px 18px; border-top: 1px solid var(--border); font-family: var(--mono); font-size: 13px; color: var(--cream-dim); }
.split-ctl { display: flex; align-items: center; gap: 12px; flex: 1 1 260px; }
.split-ctl input { flex: 1; }
.conf { display: inline-flex; align-items: center; gap: 8px; }
.conf-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--good); }
.conf.medium .conf-dot { background: var(--warn); }
.conf.low .conf-dot { background: #ff6b6b; }

.side { flex: 2 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.card { padding: 22px; border: 1px solid var(--border); background: rgba(244,241,234,0.03); }
.card p { color: var(--cream-dim); font-size: 15px; }
.card-h { font-family: var(--mono); font-size: 13px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--tan); margin: 0 0 14px; }
.card-plain { font-family: var(--sans); font-size: 16px; font-weight: 600; margin: 0 0 10px; }
.card-tan { background: var(--tan); border-color: var(--tan); color: var(--navy-900); }
.card-tan .h3 { color: var(--navy-900); }
.card-tan p { color: #2b2116; }
.row-gap { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.ink-link { font-family: var(--mono); font-size: 13px; color: var(--navy-900); }
.ink-link:hover { color: var(--navy-900); text-decoration-thickness: 2px; }
.dl-all { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 62px; padding: 0 18px; margin-bottom: 10px; background: var(--orange); color: var(--navy-900); text-decoration: none; }
.dl-all:hover { background: #ff8259; color: var(--navy-900); }
.dl-all > span { display: flex; flex-direction: column; line-height: 1.3; }
.dl-all strong { font-family: var(--mono); font-size: 16px; }
.dl-all span span { font-size: 14px; }
.dl-three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.dl-three a { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 64px; border: 1px solid var(--tan); color: var(--cream); text-decoration: none; line-height: 1.3; }
.dl-three a:hover { background: var(--tan); color: var(--navy-900); }
.dl-three a:hover span { color: var(--navy-900); }
.dl-three strong { font-family: var(--mono); }
.dl-three span { font-size: 12px; color: var(--cream-dim); }
.dl-three a.disabled { opacity: 0.35; pointer-events: none; }
.thick { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; font-family: var(--mono); font-size: 13px; color: var(--cream-dim); }
.thick input { width: 76px; min-height: 34px; padding: 4px 6px; background: transparent; border: none; border-bottom: 1px solid var(--tan); color: var(--cream); font-family: var(--mono); font-size: 16px; text-align: right; }
.facts { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; font-size: 15px; }
.facts dt { color: var(--cream-dim); }
.facts dd { margin: 0; }
.fb-row { display: flex; gap: 10px; }
.fb-row button[aria-pressed="true"] { background: var(--orange); border-color: var(--orange); color: var(--navy-900); }
.fb-text { margin: 10px 0 0; }
.finetune { margin-top: 24px; }
.ft-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 24px; }
.ft-head span { font-family: var(--mono); font-size: 13px; color: var(--cream-dim); }

/* ---------- error tips ---------- */
.result > .alert { margin: 20px 0 16px; }
.tips { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin: 10px 0 32px; }
.tip { margin: 0; padding: 16px; border: 1px solid var(--border); background: var(--navy-800); }
.tip svg { display: block; width: 100%; height: auto; }
.tip figcaption { margin-top: 12px; font-size: 14px; color: var(--cream-dim); }
.tip strong { display: block; font-size: 16px; color: var(--cream); }
.tip-good { border-color: var(--orange); }

/* ---------- small screens ---------- */
@media (max-width: 1120px) {
  .menu-btn { display: inline-flex; }
  .nav-links { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; padding: 8px 16px 16px; background: var(--navy-900); border-bottom: 1px solid var(--border); }
  .nav-links.open { display: flex; }
  .nav-links a:not(.btn) { display: flex; align-items: center; min-height: 48px; border-bottom: 1px solid var(--border); }
  .nav-links .btn { margin-top: 12px; }
  .nav-links .nav-coffee { padding: 0; border: none; border-bottom: 1px solid var(--border); border-radius: 0; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .wrap-wide, .wrap, .topbar-in { padding-left: 16px; padding-right: 16px; }
  .brand { gap: 9px; }
  .brand-mark { height: 46px; }
  .brand-word { font-size: 27px; }
  .hero { padding-top: 28px; padding-bottom: 40px; gap: 28px; }
  .section { padding-top: 56px; padding-bottom: 56px; }
  .band.cream { padding: 56px 0; }
  .tool { padding: 18px 16px; }
  .desktop-only { display: none; }
  .award { margin-bottom: 16px; font-size: 11px; }
  .award-long { display: none; }
  .award-short { display: inline; }
  .display { font-size: 44px; margin-bottom: 14px; }
  .lede { font-size: 17px; margin-bottom: 16px; }
  .ticks { gap: 4px 16px; font-size: 12px; }
  .printband { padding: 28px 22px; }
  .pv-tabs button { padding: 0 10px; font-size: 12px; }
  .pv-stage { height: 62vh; }
}
@media (pointer: fine) { .touch-only { display: none !important; } }
