/* 3D viewer / print checker pages.
   Built on top of pair.css tokens so the new surfaces read as the same site. */

:root {
  --viewer-stage: #e8f5f1;
  --viewer-ink: #063b36;
  --viewer-line: rgba(13, 148, 136, .22);
}

.v-hero {
  position: relative;
  overflow: hidden;
  padding: 52px 0 46px;
  border-bottom: 1px solid var(--ln);
  background:
    radial-gradient(720px 340px at 78% 4%, rgba(45, 212, 191, .18), transparent 68%),
    linear-gradient(180deg, #f7fffc 0%, var(--bg) 100%);
}
.v-hero::before {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(13, 148, 136, .045) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(13, 148, 136, .045) 1px, transparent 1px);
  background-size: 52px 52px;
  -webkit-mask-image: radial-gradient(900px 430px at 20% 0%, #000 16%, transparent 76%);
  mask-image: radial-gradient(900px 430px at 20% 0%, #000 16%, transparent 76%);
}
.v-hero .wrap {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 640px);
  gap: 38px;
  align-items: start;
}
.v-copy { padding-top: 12px; }
.v-copy h1 { font-size: clamp(2rem, 4vw, 3.05rem); }
.v-copy .answer { margin: 18px 0 0; max-width: 54ch; font-size: 17px; line-height: 1.65; color: var(--ink-strong); font-weight: 600; }
.v-copy .answer b { color: var(--cy); }
.v-copy .lede { margin-top: 15px; max-width: 56ch; }
.v-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 22px; }
/* button baseline for pair.css pages (pair.css has no .btn component) */
.v-actions .btn, .cp-actions .btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 16px; border-radius: 10px;
  font: 600 13px/1 var(--sans); text-decoration: none;
}
.v-actions .btn-primary, .cp-actions .btn-primary { background: var(--cy); color: #fff; border: 1px solid var(--cy); }
.v-actions .btn-primary:hover, .cp-actions .btn-primary:hover { background: var(--cy2); border-color: var(--cy2); color: #fff; text-decoration: none; }
.v-actions .btn-ghost, .cp-actions .btn-ghost { background: #fff; color: var(--tx); border: 1px solid var(--ln); }
.v-actions .btn-ghost:hover, .cp-actions .btn-ghost:hover { border-color: var(--ln2); color: var(--cy2); text-decoration: none; }

/* keep the existing pair.css nav on one line when a 3D entry is added */
.top .nav { gap: 12px; font-size: 13.5px; }
.top .nav a { white-space: nowrap; }
.top .live { white-space: nowrap; }

.v-actions .btn-primary { background: var(--cy); color: #fff; border: 1px solid var(--cy); }
.v-actions .btn-primary:hover { background: var(--cy2); color: #fff; }
.v-actions .btn-ghost { background: var(--pn); color: var(--tx); border: 1px solid var(--ln); }
.v-actions .btn-ghost:hover { border-color: var(--ln2); color: var(--cy2); text-decoration: none; }
.v-trust { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.v-trust span { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border: 1px solid var(--ln); border-radius: 999px; background: rgba(255,255,255,.7); font: 500 12px/1 var(--mono); color: var(--muted); }
.v-trust span::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--cy); }

.viewer-shell {
  border: 1px solid var(--viewer-line);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.viewer-stage {
  position: relative;
  min-height: 320px;
  height: clamp(320px, 38vh, 430px);
  background: var(--viewer-stage);
  border-bottom: 1px solid var(--ln);
  overflow: hidden;
}
.viewer-stage canvas { display: block; width: 100%; height: 100%; outline: none; }
.viewer-stage.dragging { outline: 3px dashed var(--cy); outline-offset: -8px; }
.viewer-state {
  position: absolute; inset: 0; display: grid; place-items: center;
  pointer-events: none; color: var(--dim); background: rgba(232,245,241,.86);
  font: 500 13px/1.5 var(--mono); text-align: center; padding: 20px;
}
.viewer-state.loaded { display: none; }
.viewer-state .spinner {
  width: 26px; height: 26px; margin: 0 auto 12px; border: 3px solid rgba(13,148,136,.25);
  border-top-color: var(--cy); border-radius: 50%; animation: vspin .8s linear infinite;
}
@keyframes vspin { to { transform: rotate(360deg) } }
.viewer-topline {
  position: absolute; top: 12px; left: 12px; right: 12px;
  display: flex; align-items: center; gap: 8px; z-index: 3;
  pointer-events: none;
}
.viewer-topline > * { pointer-events: auto; }
.v-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 9px; border: 1px solid rgba(13,148,136,.24); border-radius: 8px;
  background: rgba(255,255,255,.88); backdrop-filter: blur(8px);
  font: 500 11px/1 var(--mono); color: var(--cy2); text-transform: uppercase; letter-spacing: .06em;
}
.v-chip .dot { width: 6px; height: 6px; }
.viewer-topline .spacer { flex: 1; }
.v-iconbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  width: 34px; height: 34px; padding: 0; border: 1px solid rgba(13,148,136,.24);
  border-radius: 8px; background: rgba(255,255,255,.9); color: var(--tx);
  cursor: pointer; font-size: 12px;
}
.v-iconbtn:hover { border-color: var(--cy); color: var(--cy2); }
.v-iconbtn svg { width: 16px; height: 16px; }

.viewer-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  padding: 10px 12px; background: #fff;
}
.v-seg { display: inline-flex; border: 1px solid var(--ln); border-radius: 9px; overflow: hidden; }
.v-seg button {
  border: 0; background: transparent; color: var(--dim); cursor: pointer;
  min-height: 34px; padding: 0 10px; font: 500 11.5px/1 var(--mono);
}
.v-seg button + button { border-left: 1px solid var(--ln); }
.v-seg button[aria-pressed="true"] { background: var(--cy); color: #fff; }
.v-switch {
  display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent;
  color: var(--dim); cursor: pointer; font: 500 11.5px/1 var(--mono); min-height: 34px;
}
.v-switch .track { width: 26px; height: 14px; border-radius: 999px; background: #cbd5e1; position: relative; transition: background .16s; }
.v-switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 10px; height: 10px; border-radius: 50%; background: #fff; transition: transform .16s; }
.v-switch[aria-pressed="true"] .track { background: var(--cy); }
.v-switch[aria-pressed="true"] .track::after { transform: translateX(12px); }
.v-tools-right { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.v-mini {
  border: 1px solid var(--ln); border-radius: 8px; background: #fff; color: var(--tx);
  min-height: 34px; padding: 0 10px; cursor: pointer; font: 500 11.5px/1 var(--mono);
}
.v-mini:hover { border-color: var(--cy); color: var(--cy2); }
.v-mini.primary { background: var(--cy); color: #fff; border-color: var(--cy); }

.v-metrics {
  display: grid; grid-template-columns: .9fr 1.35fr .75fr;
  gap: 0; border-top: 1px solid var(--ln); background: #fff;
}
.v-metric { padding: 10px 12px; min-width: 0; }
.v-metric + .v-metric { border-left: 1px solid var(--ln); }
.v-metric .k { display: block; font: 500 10.5px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.v-metric .val { display: block; margin-top: 6px; font: 600 13.5px/1.3 var(--mono); color: var(--ink-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v-metric .sub { display: block; margin-top: 3px; font: 500 11px/1.3 var(--mono); color: var(--muted); }
.v-unit-row { display: flex; align-items: center; gap: 6px 8px; margin-top: 6px; flex-wrap: wrap; }
.v-unit-row select { max-width: 82px; min-height: 28px; padding: 2px 6px; border: 1px solid var(--ln); border-radius: 6px; background: #fff; color: var(--tx); font: 500 11px var(--mono); }
.v-unit-row .hint { flex: 1 0 100%; font: 10.5px/1.35 var(--mono); color: var(--muted); }

.v-plate-panel {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  padding: 10px 14px; border-top: 1px solid var(--ln); background: var(--pn2);
  font: 500 11.5px/1.4 var(--mono); color: var(--dim);
}
.v-plate-panel select { min-height: 30px; padding: 2px 7px; border: 1px solid var(--ln); border-radius: 7px; background: #fff; color: var(--tx); font: 500 11.5px var(--mono); }
.v-fit { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 7px; background: #ecfdf8; color: #0f766e; font-weight: 600; }
.v-fit.warn { background: #fffbeb; color: #92400e; }
.v-fit.bad { background: #fff1f2; color: #9f1239; }
.v-fit.info { background: #eff6ff; color: #1d4ed8; }
.v-plate-note { color: var(--muted); font-weight: 400; }

.v-section { padding: 48px 0; border-bottom: 1px solid var(--ln); }
.v-section.tight { padding: 36px 0; }
.v-grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 26px; }
.v-card {
  border: 1px solid var(--ln); border-radius: 14px; background: #fff;
  padding: 18px 18px 16px; box-shadow: var(--shadow-sm);
}
.v-card .n { font: 600 12px/1 var(--mono); letter-spacing: .1em; color: var(--cy2); }
.v-card h3 { margin: 10px 0 6px; font-size: 16px; color: var(--ink-strong); }
.v-card p { margin: 0; font-size: 14px; line-height: 1.7; color: var(--dim); }
.v-card ul { margin: 8px 0 0; padding-left: 19px; font-size: 14px; line-height: 1.7; color: var(--dim); }

.v-format-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 24px; }
.v-format {
  display: block; padding: 16px; border: 1px solid var(--ln); border-radius: 13px;
  background: #fff; text-decoration: none; color: var(--tx); box-shadow: var(--shadow-sm);
  transition: border-color .16s, transform .16s, box-shadow .16s;
}
.v-format:hover { border-color: var(--ln2); transform: translateY(-2px); box-shadow: var(--shadow); text-decoration: none; color: var(--tx); }
.v-format b { display: block; font: 600 16px/1.2 var(--mono); color: var(--ink-strong); }
.v-format span { display: block; margin-top: 7px; font-size: 13px; line-height: 1.55; color: var(--dim); }
.v-format .go { display: inline-block; margin-top: 10px; font: 600 11.5px/1 var(--mono); color: var(--cy2); }

.v-related { margin-top: 22px; }
.v-related a { font-size: 13.5px; }

.conversion-preview {
  padding: 38px 0;
  border-bottom: 1px solid var(--ln);
  background:
    radial-gradient(640px 280px at 84% 0%, rgba(45,212,191,.14), transparent 70%),
    linear-gradient(180deg, #fbfffd, var(--pn2));
}
.conversion-preview .wrap {
  display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr);
  gap: 26px; align-items: center;
}
.cp-copy .eyebrow { margin-bottom: 10px; }
.cp-copy h2 { margin: 0; font-size: clamp(1.35rem, 2.2vw, 1.8rem); letter-spacing: -.02em; }
.cp-copy p { margin: 10px 0 0; font-size: 14px; line-height: 1.7; color: var(--dim); max-width: 52ch; }
.cp-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 16px; }
.cp-actions .btn { min-height: 42px; padding: 0 15px; display: inline-flex; align-items: center; justify-content: center; }
.cp-media {
  position: relative; display: block; aspect-ratio: 16 / 9;
  border: 1px solid var(--ln); border-radius: 15px; overflow: hidden;
  background: #eef7f4; box-shadow: var(--shadow);
}
.cp-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s var(--ease); }
.cp-media:hover img { transform: scale(1.025); }
.cp-media:hover { text-decoration: none; }
.cp-tag {
  position: absolute; left: 12px; top: 12px; z-index: 2;
  padding: 7px 9px; border: 1px solid rgba(13,148,136,.24); border-radius: 8px;
  background: rgba(255,255,255,.9); color: var(--cy2);
  font: 600 10.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase;
}
.cp-go {
  position: absolute; right: 12px; bottom: 12px; z-index: 2;
  padding: 9px 11px; border-radius: 8px; background: rgba(6,78,59,.9); color: #fff;
  font: 600 11px/1 var(--mono);
}
.cp-caption { margin: 7px 0 0; font: 500 11px/1.45 var(--mono); color: var(--muted); }
@media (max-width: 860px) {
  .conversion-preview .wrap { grid-template-columns: 1fr; }
  .cp-media { order: 2; }
}

.checker-layout {
  display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(320px, .7fr);
  gap: 22px; align-items: start;
}
body.checker-page .v-hero .wrap { grid-template-columns: 1fr; }
body.checker-page .v-copy { max-width: 860px; }
body.checker-page .checker-layout { margin-top: 26px; }
body.checker-page .v-hero { padding-bottom: 40px; }
body.static-page .v-hero .wrap { grid-template-columns: 1fr; }
body.static-page .v-copy { max-width: 900px; padding-top: 4px; }
body.static-page .v-hero { padding: 56px 0 46px; }
body.guide-page .v-section { padding: 26px 0; }
body.guide-page .prose h2 { margin: 0 0 10px; padding-top: 0; border-top: 0; font-size: 1.35rem; }
body.guide-page .prose h2::before { content: none; }
body.guide-page .prose h2:first-child { margin-top: 0; }
body.guide-page .prose { max-width: 860px; }

.check-panel {
  border: 1px solid var(--ln); border-radius: 16px; background: #fff;
  padding: 18px; box-shadow: var(--shadow-sm);
}
.check-panel h2 { margin: 0 0 4px; font-size: 1.2rem; }
.check-panel .sub { margin: 0 0 14px; font-size: 13.5px; line-height: 1.6; color: var(--muted); }
.check-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--ln); font-size: 13.5px; color: var(--dim); }
.check-row:last-child { border-bottom: 0; }
.check-row b { font: 600 12.5px var(--mono); color: var(--ink-strong); text-align: right; }
.check-row .ok { color: #0f766e; }
.check-row .warn { color: #92400e; }
.check-row .bad { color: #9f1239; }
.check-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.check-note { margin: 12px 0 0; padding: 10px 12px; border: 1px dashed var(--ln2); border-radius: 9px; background: rgba(45,212,191,.07); font-size: 12.5px; line-height: 1.6; color: var(--muted); }
.check-panel select { width: 100%; min-height: 38px; border: 1px solid var(--ln); border-radius: 8px; background: #fff; font: 500 12px var(--mono); color: var(--tx); padding: 4px 9px; }

.plate-visual {
  margin-top: 22px; border: 1px solid var(--ln); border-radius: 14px;
  background: linear-gradient(180deg, #fff, #f8fafc); padding: 18px; box-shadow: var(--shadow-sm);
}
.plate-visual .plate {
  position: relative; width: 100%; max-width: 520px; margin: 0 auto; aspect-ratio: 1.38;
  border: 2px solid var(--cy); border-radius: 8px;
  background: repeating-linear-gradient(0deg, rgba(13,148,136,.05), rgba(13,148,136,.05) 1px, transparent 1px, transparent 20px),
              repeating-linear-gradient(90deg, rgba(13,148,136,.05), rgba(13,148,136,.05) 1px, transparent 1px, transparent 20px);
}
.plate-visual .plate::before {
  content: ""; position: absolute; inset: 12px; border: 1px dashed rgba(13,148,136,.35); border-radius: 5px;
}
.plate-visual .plate .ghost {
  position: absolute; left: 22%; right: 22%; top: 24%; bottom: 26%;
  border: 1px solid var(--am); border-radius: 4px;
  background: rgba(234,88,12,.10);
}
.plate-visual .plate .dim-x { position: absolute; left: 50%; bottom: -24px; transform: translateX(-50%); font: 500 11px var(--mono); color: var(--muted); white-space: nowrap; }
.plate-visual .plate .dim-y { position: absolute; right: -8px; top: 50%; transform: translateY(-50%) rotate(90deg); transform-origin: center; font: 500 11px var(--mono); color: var(--muted); white-space: nowrap; }
.plate-visual .plate-legend { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: 28px; font: 500 11.5px var(--mono); color: var(--muted); }
.plate-visual .plate-legend i { display: inline-block; width: 9px; height: 9px; margin-right: 5px; border-radius: 2px; background: var(--cy); }
.plate-visual .plate-legend .m { background: var(--am); }

.v-table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-top: 16px; background: #fff; border: 1px solid var(--ln); border-radius: 12px; overflow: hidden; }
.v-table th, .v-table td { padding: 10px 12px; border-bottom: 1px solid var(--ln); text-align: left; vertical-align: top; }
.v-table thead th { background: var(--pn2); font: 600 12px var(--mono); color: var(--ink-strong); }
.v-table tbody th { font: 500 12px var(--mono); color: var(--tx); }
.v-table tr:last-child th, .v-table tr:last-child td { border-bottom: 0; }

.v-faq { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 22px; }
.v-faq .faq-item { border: 1px solid var(--ln); border-radius: 12px; background: #fff; padding: 16px 18px; }
.v-faq .faq-item h3 { margin: 0 0 6px; font-size: 15px; }
.v-faq .faq-item p { margin: 0; font-size: 13.5px; line-height: 1.7; }

.v-note { display: flex; gap: 10px; padding: 12px 14px; margin: 18px 0 0; border: 1px dashed var(--ln2); border-radius: 10px; background: rgba(45,212,191,.08); font-size: 13px; line-height: 1.6; color: var(--dim); }
.v-note b { color: var(--cy2); }

.home-preview {
  padding: 46px 0; border-bottom: 1px solid var(--ln);
  background: linear-gradient(180deg, #fff, var(--bg));
}
.home-preview .wrap { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 28px; align-items: center; }
.home-preview h2 { margin: 0; font-size: clamp(1.5rem, 2.5vw, 2rem); }
.home-preview p { margin: 10px 0 0; max-width: 52ch; color: var(--dim); line-height: 1.7; }
.home-preview .hp-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 18px; }
.home-preview .hp-stage { position: relative; min-height: 320px; height: 360px; border: 1px solid var(--ln); border-radius: 16px; overflow: hidden; background: var(--viewer-stage); box-shadow: var(--shadow); }
.home-preview .hp-stage canvas { display: block; width: 100%; height: 100%; }
.home-preview .hp-state { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(232,245,241,.9); color: var(--dim); font: 500 12.5px var(--mono); text-align: center; padding: 20px; }
.home-preview .hp-state.loaded { display: none; }
.home-preview .hp-tag { position: absolute; left: 12px; top: 12px; z-index: 2; }

@media (max-width: 980px) {
  .v-hero .wrap { grid-template-columns: 1fr; gap: 26px; }
  .v-copy { order: 1 }
  .viewer-shell { order: 2 }
  .v-format-grid { grid-template-columns: 1fr 1fr; }
  .checker-layout { grid-template-columns: 1fr; }
  .home-preview .wrap { grid-template-columns: 1fr; }
  .home-preview .hp-stage { order: 2 }
}
@media (max-width: 640px) {
  .v-hero { padding: 36px 0 38px; }
  .v-copy h1 { font-size: 1.85rem; }
  .v-copy .answer { font-size: 15.5px; }
  .viewer-stage { min-height: 300px; height: 48vh; max-height: 420px; }
  .v-metrics { grid-template-columns: 1fr 1fr; }
  .v-metric:nth-child(3) { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--ln); }
  .v-grid3, .v-faq { grid-template-columns: 1fr; }
  .v-format-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .v-format { padding: 13px; }
  .v-format b { font-size: 14px; }
  .v-format span { font-size: 12px; }
  .viewer-toolbar { gap: 7px 9px; }
  .v-tools-right { margin-left: 0; width: 100%; }
  .v-tools-right .v-mini { flex: 1; }
  .home-preview { padding: 34px 0; }
  .home-preview .hp-stage { height: 300px; min-height: 260px; }
}
