/* QuietForge 3D. Dark theme; the tokens block is shared (copied) with QuietForge API and the Portal. */
:root {
  color-scheme: dark;
  --bg: #0b0d12; --bg-2: #0f1219; --surface: #141821; --surface-2: #1a1f2b; --surface-3: #222836;
  --line: #252c3a; --line-2: #343d4f;
  --ink: #eef1f6; --ink-2: #c9cfda; --muted: #9ba4b4;
  --accent: #ff8a2a; --accent-hi: #ffb347; --accent-lo: #ff5f1f;
  --grad: linear-gradient(135deg, #ffc061 0%, #ff8a2a 48%, #ff5a1f 100%);
  --cool: #5fd6f5; --cool-2: #8b9dff; --ok: #34d6b0; --warn: #ffc061; --bad: #ff7b7b;
  --r: 14px; --r-sm: 10px; --r-lg: 20px;
  --shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 20px 50px -20px rgba(0,0,0,.7);
  --glow: 0 0 0 1px rgba(255,138,42,.35), 0 10px 40px -10px rgba(255,110,30,.45);
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Inter, Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2,.7,.2,1);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font: 16px/1.6 var(--sans); color: var(--ink-2); background: var(--bg);
  background-image:
    radial-gradient(1100px 520px at 78% -8%, rgba(255,122,26,.13), transparent 62%),
    radial-gradient(900px 480px at -12% 6%, rgba(95,214,245,.07), transparent 60%);
  background-repeat: no-repeat; -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
h1, h2, h3 { color: var(--ink); line-height: 1.15; letter-spacing: -.02em; margin: 0 0 .6em; }
h1 { font-size: clamp(2rem, 4.5vw, 2.6rem); font-weight: 800; }
h2 { font-size: clamp(1.35rem, 2.6vw, 1.7rem); font-weight: 750; margin-top: 2.2em; }
h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0 0 1em; }
a { color: var(--cool); text-decoration: none; transition: color .15s; }
a:hover { color: #9be6fa; text-decoration: underline; text-underline-offset: 3px; }
strong { color: var(--ink); }
code { font-family: var(--mono); font-size: .88em; background: var(--surface-2); border: 1px solid var(--line);
       border-radius: 6px; padding: .08em .4em; color: #ffd29a; overflow-wrap: anywhere; }
::selection { background: rgba(255,138,42,.35); color: #fff; }
:focus-visible { outline: 2px solid var(--cool); outline-offset: 2px; border-radius: 6px; }

/* Header */
.bar { position: sticky; top: 0; z-index: 20; display: flex; flex-wrap: wrap; gap: .5rem 1rem;
       justify-content: space-between; align-items: center; padding: .7rem max(1.25rem, calc((100% - 69.5rem) / 2));
       background: rgba(11,13,18,.72); backdrop-filter: saturate(160%) blur(14px);
       -webkit-backdrop-filter: saturate(160%) blur(14px); border-bottom: 1px solid rgba(255,255,255,.06); }
.brand { display: inline-flex; align-items: center; gap: .55rem; color: var(--ink); font-weight: 750;
         font-size: 1.12rem; letter-spacing: -.02em; }
.brand:hover { color: var(--ink); text-decoration: none; }
.brand svg { width: 30px; height: 30px; filter: drop-shadow(0 4px 12px rgba(255,110,30,.35)); }
.brand .sub { font-size: .68rem; font-weight: 800; letter-spacing: .08em; padding: .18rem .45rem; border-radius: 999px;
              color: #1b0e04; background: var(--grad); }
nav { display: flex; flex-wrap: wrap; gap: .35rem .9rem; align-items: center; font-size: .95rem; }
nav a, nav button.link { color: var(--ink-2); }
nav a:hover, nav button.link:hover { color: var(--ink); text-decoration: none; }
nav .pill { padding: .28rem .7rem; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); }
nav .pill strong { font-variant-numeric: tabular-nums; }

/* Layout */
main { width: 100%; max-width: 72rem; margin: 0 auto; padding: 2rem 1.25rem 3rem; flex: 1; }
.narrow { max-width: 46rem; }
section { scroll-margin-top: 5rem; }
footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; padding: 1.6rem 1.25rem 2rem;
         text-align: center; background: rgba(11,13,18,.6); }
footer a { color: var(--ink-2); }
footer .foot-brand { display: flex; justify-content: center; align-items: center; gap: .4rem; color: var(--ink);
                     font-weight: 700; margin-bottom: .5rem; }
footer .foot-brand svg { width: 18px; height: 18px; }

/* Buttons */
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  font: inherit; font-weight: 650; line-height: 1.2; cursor: pointer; text-decoration: none; white-space: nowrap;
  padding: .7rem 1.25rem; border-radius: 999px; border: 1px solid transparent; color: #1b0e04;
  background: var(--grad); box-shadow: 0 8px 24px -10px rgba(255,110,30,.7), inset 0 1px 0 rgba(255,255,255,.35);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), filter .18s, background-color .18s; }
button:hover, .button:hover { color: #1b0e04; text-decoration: none; transform: translateY(-1px); filter: brightness(1.06);
  box-shadow: 0 14px 34px -12px rgba(255,110,30,.85), inset 0 1px 0 rgba(255,255,255,.4); }
button:active, .button:active { transform: translateY(0); }
.button.ghost { color: var(--ink); background: rgba(255,255,255,.03); border-color: var(--line-2); box-shadow: none; }
.button.ghost:hover { color: var(--ink); border-color: var(--cool); background: rgba(95,214,245,.08); filter: none; }
.button.small, nav .button { padding: .42rem .95rem; font-size: .9rem; }
button.link { background: none; border: 0; padding: 0; box-shadow: none; color: var(--cool); font-weight: inherit; }
button.link:hover { transform: none; filter: none; box-shadow: none; text-decoration: underline; }
button:disabled, button:disabled:hover { cursor: not-allowed; transform: none; filter: grayscale(.85) brightness(.7);
  box-shadow: none; opacity: .6; }
form.inline { display: inline; }

/* Forms */
.stack { display: grid; gap: 1rem; max-width: 30rem; }
label { color: var(--ink-2); font-size: .95rem; }
.stack label:not(.check):not(.tier) { display: grid; gap: .4rem; }
input, textarea, select { font: inherit; color: var(--ink); }
.stack input:not([type=checkbox]):not([type=radio]), .stack textarea {
  width: 100%; padding: .7rem .85rem; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-sm);
  transition: border-color .15s, box-shadow .15s, background-color .15s; }
.stack input:hover, .stack textarea:hover { border-color: #48536a; }
.stack input:focus, .stack textarea:focus { outline: none; border-color: var(--cool); background: #0d1118;
  box-shadow: 0 0 0 4px rgba(95,214,245,.16); }
input[type=file] { padding: .55rem !important; cursor: pointer; }
input[type=file]::file-selector-button { font: inherit; font-weight: 600; color: var(--ink); background: var(--surface-3);
  border: 1px solid var(--line-2); border-radius: 999px; padding: .4rem .9rem; margin-right: .8rem; cursor: pointer; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 1.05rem; height: 1.05rem; margin: 0; flex: none; }
.check { display: flex !important; gap: .6rem; align-items: center; }
.stack button { justify-self: start; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { color: var(--ink); font-weight: 650; margin-bottom: .55rem; padding: 0; }

/* Notices */
.notice, .error { display: flex; gap: .6rem; align-items: flex-start; padding: .8rem 1rem; border-radius: var(--r-sm);
  border: 1px solid rgba(52,214,176,.35); background: rgba(52,214,176,.08); color: #c9f5ea; margin: 0 0 1.2rem; }
.notice::before, .error::before { content: ""; flex: none; width: .5rem; height: .5rem; margin-top: .55rem; border-radius: 50%;
  background: currentColor; box-shadow: 0 0 10px currentColor; }
.notice.intake, .notice.payments { border-color: rgba(255,192,97,.4); background: rgba(255,192,97,.08); color: #ffe0ad; }
.error { border-color: rgba(255,123,123,.4); background: rgba(255,123,123,.08); color: #ffd0d0; }
.notice p { margin: 0; }

/* Cards, tables */
.card { background: linear-gradient(180deg, rgba(255,255,255,.025), transparent 40%), var(--surface);
        border: 1px solid var(--line); border-radius: var(--r); padding: 1.4rem; box-shadow: var(--shadow); }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted);
     font-weight: 650; background: var(--surface-2); }
th, td { padding: .75rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) td { background: rgba(255,255,255,.015); }
tbody tr:hover td { background: rgba(255,255,255,.035); }
td.num { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
tr.blocked { color: var(--muted); }
.small, small { color: var(--muted); font-size: .88rem; }
.badge { display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .7rem; border-radius: 999px; font-size: .8rem;
         font-weight: 650; color: var(--ink-2); background: rgba(255,255,255,.04); border: 1px solid var(--line-2); }
.badge .dot { width: .45rem; height: .45rem; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.eyebrow { color: var(--accent-hi); font-size: .78rem; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Hero */
.hero { position: relative; display: grid; grid-template-columns: 1.1fr .9fr; gap: 3rem; align-items: center;
        padding: 3.5rem 0 3rem; }
.hero::before { content: ""; position: absolute; inset: -3rem 0 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 44px 44px; -webkit-mask-image: radial-gradient(60% 70% at 50% 30%, #000, transparent 75%);
  mask-image: radial-gradient(60% 70% at 50% 30%, #000, transparent 75%); }
.hero h1 { font-size: clamp(2.5rem, 5.6vw, 4.1rem); line-height: 1.02; letter-spacing: -.04em; margin: .9rem 0 1.1rem; }

.hero h1 .grad-text { white-space: nowrap; }
.hero .lede { font-size: clamp(1.05rem, 1.8vw, 1.22rem); color: var(--ink-2); max-width: 34rem; }
.cta { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.8rem; }
.cta .button { padding: .85rem 1.5rem; font-size: 1.02rem; }
.hero-meta { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; margin-top: 1.6rem; color: var(--muted); font-size: .9rem; }
.hero-meta span::before { content: "✓"; color: var(--ok); margin-right: .4rem; font-weight: 800; }

/* Hero visual: a mock app window */
.mock { position: relative; border-radius: var(--r-lg); background: linear-gradient(160deg, #1b2130, #11151d 60%);
        border: 1px solid var(--line-2); box-shadow: var(--shadow), 0 40px 120px -40px rgba(255,110,30,.4); overflow: hidden; }
.mock::after { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
               background: radial-gradient(500px 220px at 85% 0%, rgba(255,138,42,.16), transparent 70%); }
.mock-bar { display: flex; gap: .4rem; align-items: center; padding: .7rem .9rem; border-bottom: 1px solid var(--line);
            font-size: .78rem; color: var(--muted); }
.mock-bar i { width: .6rem; height: .6rem; border-radius: 50%; background: #ff6b5e; opacity: .8; }
.mock-bar i + i { background: #ffc061; }
.mock-bar i + i + i { background: #34d6b0; }
.mock-bar span { margin-left: auto; font-family: var(--mono); }
.mock-body { display: grid; grid-template-columns: 1fr auto 1.3fr; align-items: center; gap: .8rem; padding: 1.4rem; }
.mock-body svg { width: 100%; height: auto; display: block; }
.mock-photo { border-radius: 12px; overflow: hidden; border: 1px solid var(--line-2); }
.mock-arrow { color: var(--accent); font-size: 1.4rem; }
.mock-foot { padding: 0 1.4rem 1.4rem; }
.mock-foot .row { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); margin-bottom: .45rem; }
.mock-foot .row b { color: var(--ink); font-weight: 650; }

/* Sections */
.section-head { max-width: 40rem; margin: 4.5rem 0 1.6rem; }
.section-head h2 { margin: .4rem 0 .5rem; font-size: clamp(1.6rem, 3.4vw, 2.2rem); }
.section-head p { color: var(--muted); margin: 0; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.step { position: relative; padding: 1.5rem; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface);
        transition: border-color .2s, transform .2s var(--ease); }
.step:hover { border-color: var(--line-2); transform: translateY(-2px); }
.step .ico { display: grid; place-items: center; width: 2.8rem; height: 2.8rem; border-radius: 12px; margin-bottom: 1rem;
             background: rgba(255,138,42,.1); border: 1px solid rgba(255,138,42,.3); color: var(--accent-hi); }
.step .ico svg { width: 1.4rem; height: 1.4rem; }
.step .num { position: absolute; top: 1.2rem; right: 1.3rem; font: 700 .8rem var(--mono); color: var(--muted); }
.step h3 { margin-bottom: .35rem; }
.step p { margin: 0; color: var(--muted); font-size: .95rem; }

/* Tier cards */
.tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1rem; }
.tier-card { position: relative; display: flex; flex-direction: column; gap: .8rem; padding: 1.6rem; border-radius: var(--r);
  background: linear-gradient(180deg, rgba(255,255,255,.03), transparent 50%), var(--surface); border: 1px solid var(--line);
  transition: border-color .2s, transform .2s var(--ease), box-shadow .2s; }
.tier-card:hover { transform: translateY(-3px); border-color: rgba(255,138,42,.45); box-shadow: var(--glow); }
.tier-card.blocked { opacity: .55; filter: saturate(.4); }
.tier-card.blocked:hover { transform: none; border-color: var(--line); box-shadow: none; }
.tier-card h3 { margin: 0; font-size: 1.25rem; }
.tier-card .price { font-size: 2.4rem; font-weight: 800; color: var(--ink); letter-spacing: -.03em; line-height: 1; }
.tier-card .price small { font-size: .9rem; font-weight: 500; letter-spacing: 0; }
.tier-card p { margin: 0; color: var(--ink-2); }
.tier-card .note { color: var(--warn); font-size: .85rem; }
.tier-top { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.meter { display: inline-flex; gap: 3px; }
.meter i { width: 6px; height: 14px; border-radius: 2px; background: var(--surface-3); }
.meter i.on { background: var(--grad); }
.addon { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; align-items: center; justify-content: space-between;
         margin-top: 1rem; padding: 1.1rem 1.4rem; border-radius: var(--r); border: 1px dashed var(--line-2);
         background: rgba(95,214,245,.04); }
.addon strong { margin-right: .5rem; }
.price-pill { display: inline-block; padding: .25rem .75rem; border-radius: 999px; font-weight: 750; color: #1b0e04;
              background: var(--grad); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fine { margin-top: 1rem; }

/* Make form */
.make { margin-top: 1rem; }
.make .card { padding: 1.8rem; border-color: rgba(255,138,42,.25); }
.make .stack { max-width: none; }
.make h2 { margin-top: 0; }
.tier-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: .75rem; }
label.tier { display: grid; grid-template-columns: auto 1fr; gap: .2rem .7rem; align-items: start; padding: 1rem 1.1rem;
             border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--bg-2); cursor: pointer;
             transition: border-color .15s, background-color .15s, box-shadow .15s; }
label.tier input { margin-top: .25rem; grid-row: span 3; }
label.tier:hover { border-color: #4b5670; }
label.tier:has(input:checked) { border-color: var(--accent); background: rgba(255,138,42,.07); box-shadow: 0 0 0 3px rgba(255,138,42,.15); }
label.tier.blocked { opacity: .5; cursor: not-allowed; }
label.tier .tp { color: var(--accent-hi); font-weight: 700; font-variant-numeric: tabular-nums; }
.make-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: end; }
.make .check { padding: .8rem 1rem; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--bg-2); }
.make button[type=submit] { padding: .85rem 1.8rem; font-size: 1.02rem; }

/* Auth */
.auth { max-width: 27rem; margin: 2.5rem auto; }
.auth .card { padding: 2rem; }
.auth h1 { font-size: 1.8rem; margin-bottom: .3rem; }
.auth .sub { color: var(--muted); margin-bottom: 1.5rem; }
.auth .stack { max-width: none; }
.auth .stack button { justify-self: stretch; }
.auth .alt { text-align: center; margin: 1.2rem 0 0; color: var(--muted); }

/* Account */
.balance-card { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; }
.balance-card .label { color: var(--muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 650; }
.balance-card .amount { font-size: clamp(2.4rem, 6vw, 3.2rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.05; }
.balance-card .amount strong { color: inherit; }
.packs { display: flex; gap: .6rem; flex-wrap: wrap; margin: .2rem 0 .8rem; }
.packs button { min-width: 6.5rem; font-variant-numeric: tabular-nums; }

/* Job page */
.crumb { display: inline-flex; align-items: center; gap: .3rem; color: var(--muted); font-size: .92rem; }
.job-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: .5rem 1rem; margin: .6rem 0 1.4rem; }
.job-head h1 { margin: 0; }
.job-head p { margin: 0; }
.job-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 1.2rem; align-items: start; margin-top: 1.2rem; }
.job-grid h2 { margin-top: 0; }
.job-grid > * { min-width: 0; }
.stack button { max-width: 100%; white-space: normal; text-align: center; }
.files { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .5rem; }
.files li { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .7rem; padding: .7rem .9rem; border-radius: var(--r-sm);
            background: var(--bg-2); border: 1px solid var(--line); }
.files a { font-family: var(--mono); font-size: .92rem; font-weight: 600; }
.files a::before { content: "↓ "; color: var(--accent-hi); }
.progress-wrap { padding: 1.4rem; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); }
.progress { height: .65rem; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.progress > div { position: relative; height: 100%; min-width: 4%; background: var(--grad); border-radius: inherit;
                  transition: width .5s var(--ease); box-shadow: 0 0 16px rgba(255,138,42,.6); overflow: hidden; }
.progress > div::after { content: ""; position: absolute; inset: 0; animation: shimmer 1.6s linear infinite;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent); transform: translateX(-100%); }
@keyframes shimmer { to { transform: translateX(100%); } }
.viewer { position: relative; height: 30rem; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line-2);
  background: radial-gradient(70% 60% at 50% 40%, #1f2633, #0d1016 75%); box-shadow: var(--shadow); }
.viewer canvas { width: 100%; height: 100%; display: block; cursor: grab; }
.viewer .error { position: absolute; left: 1rem; right: 1rem; bottom: 1rem; margin: 0; }
.ai-label { position: absolute; top: .8rem; left: .8rem; z-index: 1; padding: .25rem .7rem; border-radius: 999px; font-size: .78rem;
  font-weight: 650; color: var(--ink); background: rgba(11,13,18,.7); border: 1px solid var(--line-2); backdrop-filter: blur(6px); }
.status { font-weight: 650; }

/* Prose (terms) */
.prose { max-width: 46rem; }
.prose h2 { font-size: 1.25rem; margin-top: 2em; padding-top: 1.2em; border-top: 1px solid var(--line); }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: .5rem; }
.prose li::marker { color: var(--accent); }

@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 2.2rem; padding-top: 2rem; }
  .job-grid { grid-template-columns: minmax(0, 1fr); }
  .hero.signed .mock { display: none; }
}
@media (max-width: 640px) {
  main { padding: 1.4rem 1rem 2.5rem; }
  .bar { padding: .6rem 1rem; }
  nav { gap: .3rem .75rem; font-size: .9rem; }
  .steps { grid-template-columns: 1fr; }
  .make-row { grid-template-columns: 1fr; }
  .make .card, .card { padding: 1.15rem; }
  .cta .button { flex: 1 1 auto; }
  .mock-body { padding: 1rem; gap: .5rem; }
  .viewer { height: 22rem; }
  th, td { padding: .6rem .7rem; }
  .section-head { margin-top: 3.2rem; }
  .auth { margin-top: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
