/* VIRTUAL mint 頁（10/31）：3D 建模視窗的語彙——淡灰藍畫布、格線、線框字。
   唯一的亮點是首頁的 VIRTUAL 線框字隨 mint 進度被填滿（藍＝免費、洋紅＝付費），其他地方保持安靜 */
/* 填色進度（app.js 設）：--pf＝免費份佔 4,000 的比例、--pp＝付費份的比例；註冊成百分比才能做漸變 */
@property --pf { syntax: "<percentage>"; inherits: true; initial-value: 0%; }
@property --pp { syntax: "<percentage>"; inherits: true; initial-value: 0%; }

:root {
  --canvas: #e4e6ee;
  --grid: #cdd1de;
  --panel: #f2f3f7;
  --ink: #1b1e3a;
  --ink-2: #4a4f72;
  --free: #3346ff;
  --paid: #d6246e;
  --warn: #b5121b;
  --ok: #0f7a4f;
  --line: #b9bed0;
  --display: "Archivo", "Arial Black", system-ui, sans-serif;
  --text: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--text);
}
a { color: var(--free); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--free); outline-offset: 2px; }
code { font: 500 0.92em/1 ui-monospace, Consolas, monospace; background: var(--panel); padding: 0.1em 0.35em; border-radius: 3px; }
h2, h3 { font-family: var(--display); font-stretch: 112%; line-height: 1.15; margin: 0; }
h2 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.25rem); font-weight: 800; }
h3 { font-size: 1.15rem; font-weight: 700; }

.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: 16px; top: 12px; z-index: 10; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 4px; }

/* ------------------------------------------------------------ header */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  max-width: 1180px; margin: 0 auto; padding: 18px 16px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 800 1rem/1 var(--display); font-stretch: 125%; letter-spacing: 0.02em; }
.top nav { display: flex; gap: 4px 20px; flex-wrap: wrap; }
.top nav a { color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 0.95rem; }
.top nav a:hover { color: var(--ink); text-decoration: underline; }

main > section { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* ------------------------------------------------------------ hero：線框字 */
.hero { padding-top: 8px; padding-bottom: 72px; }
.viewport {
  position: relative;
  padding: clamp(28px, 5vw, 64px) clamp(12px, 3vw, 40px) 22px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background-color: var(--panel);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: -1px -1px;
  overflow: hidden;
  container-type: inline-size;
}
.word {
  position: relative; margin: 0;
  /* 字寬約 5.9em：用視窗框的寬度（cqi）算字級，任何螢幕都剛好塞滿一行 */
  font: 900 min(16.4vw, 12.6rem)/0.86 var(--display);
  font-size: 16.4cqi;
  font-stretch: 125%;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.word span { display: block; }
.word-wire {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--ink);
}
/* 填色那層疊在線框上，背景漸層只露在字的形狀裡：0～free 藍、free～free+paid 洋紅、其餘透明 */
.word-fill {
  position: absolute; inset: 0;
  color: transparent;
  background: linear-gradient(90deg,
    var(--free) 0 var(--pf),
    var(--paid) var(--pf) calc(var(--pf) + var(--pp)),
    transparent calc(var(--pf) + var(--pp)));
  -webkit-background-clip: text; background-clip: text;
  transition: --pf 1.4s cubic-bezier(.2,.7,.2,1), --pp 1.2s cubic-bezier(.2,.7,.2,1) 1.1s;
}
@media (prefers-reduced-motion: reduce) { .word-fill { transition: none; } }

/* 字和尺寸標註包在 .model 裡、寬度貼齊字：漸層的 0～100% 和標註的 75%／25% 才會對到字的左右兩端 */
.model { width: fit-content; max-width: 100%; }
/* 尺寸標註：免費 3,000（75%）、付費 1,000（25%） */
.dims { display: flex; margin-top: 14px; font-size: 0.85rem; color: var(--ink-2); }
.dim { position: relative; display: block; padding-top: 12px; }
.dim-free { width: 75%; }
.dim-paid { width: 25%; }
.dim i { position: absolute; top: 4px; left: 0; right: 0; height: 1px; background: currentColor; }
.dim i::before, .dim i::after { content: ""; position: absolute; top: -4px; width: 1px; height: 9px; background: currentColor; }
.dim i::before { left: 0; }
.dim i::after { right: 0; }
.dim b { font-weight: 600; padding-left: 6px; }
.dim-free b { color: var(--free); }
.dim-paid b { color: var(--paid); }
.fill-caption { margin: 18px 0 0; font-size: 0.9rem; color: var(--ink-2); }

.hero-copy { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px 56px; margin-top: 36px; }
.lede { margin: 0; font-size: clamp(1.1rem, 1rem + 0.5vw, 1.35rem); line-height: 1.5; max-width: 34em; }
.readout { margin: 0; display: grid; gap: 14px; align-content: start; }
.readout div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.readout dt { color: var(--ink-2); }
.readout dd { margin: 0; font: 800 1.6rem/1 var(--display); font-stretch: 112%; font-variant-numeric: tabular-nums; }
.readout small { font: 500 0.9rem/1 var(--text); color: var(--ink-2); }
.status { grid-column: 1 / -1; margin: 0; font-weight: 500; }
.status.warn { color: var(--warn); }
.trade { grid-column: 1 / -1; margin: 0; }

/* ------------------------------------------------------------ 按鈕、欄位 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px;
  border: 1.5px solid var(--ink); border-radius: 4px;
  background: var(--ink); color: #fff;
  font: 600 1rem/1 var(--text); text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--free); border-color: var(--free); color: #fff; }
.btn:disabled { opacity: 0.6; cursor: progress; }
.btn.ghost { background: transparent; color: var(--ink); min-width: 44px; padding: 0; font-size: 1.3rem; }
.btn.ghost:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
input {
  width: 100%; min-height: 44px; padding: 0 12px;
  border: 1.5px solid var(--line); border-radius: 4px; background: #fff; color: var(--ink);
  font: 400 1rem/1 var(--text);
}
input:focus { border-color: var(--free); outline: none; box-shadow: 0 0 0 3px rgba(51, 70, 255, 0.25); }

/* ------------------------------------------------------------ 三個步驟（真的有先後順序，所以編號） */
.get { padding-top: 24px; padding-bottom: 72px; }
.sub { margin: 8px 0 0; color: var(--ink-2); max-width: 44em; }
.steps { list-style: none; margin: 28px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; counter-reset: step; border-top: 1.5px solid var(--ink); }
.step { counter-increment: step; padding: 22px 24px 8px 0; display: flex; flex-direction: column; gap: 14px; }
.step + .step { padding-left: 24px; border-left: 1px solid var(--line); }
.step h3::before { content: counter(step); display: inline-block; width: 1.7em; color: var(--free); font-stretch: 125%; }
.lookup label { display: block; font-weight: 500; margin-bottom: 6px; }
.row { display: flex; gap: 8px; }
.look-who { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.facts { margin: 0; display: grid; gap: 4px; }
.facts div { display: flex; justify-content: space-between; gap: 12px; font-size: 0.95rem; }
.facts dt { color: var(--ink-2); }
.facts dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.facts .yes { color: var(--ok); }
.facts .no { color: var(--warn); }
.err { margin: 0; color: var(--warn); font-weight: 500; }

.routes { display: grid; gap: 10px; }
.route {
  text-align: left; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 4px;
  background: var(--panel); color: var(--ink); cursor: pointer; font: inherit;
}
.route:hover { border-color: var(--ink); }
.route.on { border-color: var(--ink); background: #fff; box-shadow: inset 4px 0 0 var(--free); }
.route[data-route="paid"].on { box-shadow: inset 4px 0 0 var(--paid); }
.route-name { display: block; font-weight: 600; }
.route-desc { display: block; font-size: 0.92rem; color: var(--ink-2); margin-top: 2px; }
.paid-opts { display: grid; gap: 12px; }
.stepper { display: flex; align-items: center; gap: 12px; }
.stepper output { min-width: 2ch; text-align: center; font: 800 1.6rem/1 var(--display); font-variant-numeric: tabular-nums; }
.pay { display: flex; gap: 8px; }
.chip { min-height: 40px; padding: 0 16px; border: 1.5px solid var(--line); border-radius: 4px; background: var(--panel); color: var(--ink); font: 600 0.95rem/1 var(--text); cursor: pointer; }
.chip.on { border-color: var(--ink); background: var(--ink); color: #fff; }
.cost { margin: 0; font-size: 0.95rem; }

.route-note { margin: 0; padding: 10px 12px; border-left: 3px solid var(--warn); background: #fff; color: var(--warn); font-size: 0.95rem; }
.copytext { margin: 0; padding: 14px 16px; background: #fff; border: 1.5px dashed var(--ink-2); border-radius: 4px; font-size: 0.95rem; line-height: 1.55; overflow-wrap: anywhere; user-select: all; }
.hint { margin: 0; font-size: 0.88rem; color: var(--ink-2); }

/* ------------------------------------------------------------ 規則、合約 */
.rules, .contracts { padding-bottom: 64px; }
.rules { padding-top: 24px; border-top: 1px solid var(--line); }
.notice { margin: 24px 0 0; padding: 18px 20px; background: #fff; border: 1.5px solid var(--warn); border-radius: 4px; max-width: 760px; }
.notice p { margin: 0; }
.notice-title { font-weight: 700; color: var(--warn); margin-bottom: 6px !important; }
.rule-list { margin: 24px 0 0; padding: 0 0 0 1.1em; max-width: 760px; display: grid; gap: 12px; }
.rule-list li::marker { color: var(--free); }
.fine { margin: 24px 0 0; font-size: 0.88rem; color: var(--ink-2); max-width: 760px; }
.contracts { padding-top: 24px; border-top: 1px solid var(--line); }
.addrs { margin: 20px 0 0; display: grid; gap: 10px; }
.addrs div { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 4px 16px; }
.addrs dt { color: var(--ink-2); }
.addrs dd { margin: 0; overflow-wrap: anywhere; font: 500 0.95rem/1.5 ui-monospace, Consolas, monospace; }

.foot { max-width: 1180px; margin: 0 auto; padding: 24px 16px 40px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: 0.9rem; }
.foot p { margin: 0; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 4px; font-weight: 500; z-index: 20; max-width: calc(100% - 32px); }

/* ------------------------------------------------------------ 窄螢幕 */
@media (max-width: 860px) {
  .hero-copy { grid-template-columns: minmax(0, 1fr); }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .step { padding-right: 0; }
  .step + .step { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 520px) {
  .word-wire { -webkit-text-stroke-width: 1px; }
  .dims { font-size: 0.75rem; }
  .addrs div { grid-template-columns: minmax(0, 1fr); }
  .row { flex-direction: column; }
}
