/* ==========================================================================
   NyxWorks — v4, "The Quote"
   The homepage is a working quotation document. The visitor puts their own
   company on it, ticks line items, and watches a real total assemble. The
   claim the studio makes everywhere else — fixed scope, published price, no
   guessing — is not written here, it is demonstrated.

   Visual language is therefore documentary rather than promotional: mono
   type, tabular figures, hairline rules, a serial number, a validity date
   and a stamp.

   STILL LOADED — not dead. Every other page moved to home-v5.css, but
   quote.html (and its nl/de/es/tr copies, built by tools/build_quote.py)
   keeps loading this file second, after home-v5.css, specifically for its
   own :root — --gold, --ink and the rest resolve to THIS file's values on
   the quote pages, not v5's. Deleting it or reordering the two <link>
   tags changes the quote builder's colours; re-point every selector at
   home-v5.css tokens first, then verify all 5 language pages, before this
   file goes away.
   ========================================================================== */

:root {
  --doc: #F7F4EC;
  --doc-2: #EFEADF;
  --doc-3: #E6E0D2;
  --ink: #131217;
  --ink-2: #4E4B55;
  --ink-3: #7A766F;
  --gold: #B38D1C;
  --gold-dim: #8A7327;
  --red: #C8102E;
  --green: #2F7D45;

  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Courier New", monospace;

  --line: rgba(19,18,23,0.14);
  --line-2: rgba(19,18,23,0.32);
  --pad: clamp(1rem, 3vw, 2.4rem);
  --sheet: min(1380px, 100% - (var(--pad) * 2));
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  background: var(--doc);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { background: none; border: none; cursor: pointer; }
::selection { background: var(--gold); color: var(--doc); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.sheet { width: var(--sheet); margin-inline: auto; }
.mono { font-family: var(--mono); }

.label {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ==========================================================================
   Letterhead
   ========================================================================== */
.letterhead {
  border-bottom: 1px solid var(--line-2);
  padding-block: clamp(1rem, 2.4vw, 1.8rem);
}
.letterhead-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.4rem;
}
.letterhead img { width: clamp(150px, 20vw, 230px); }
.letterhead-tag { margin-top: 0.6rem; font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }

.docmeta {
  display: grid;
  grid-template-columns: auto auto;
  gap: 0.25rem 1.2rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  text-align: right;
}
.docmeta dt { color: var(--ink-3); letter-spacing: 0.1em; text-transform: uppercase; font-size: 0.6rem; align-self: center; }
.docmeta dd { color: var(--ink); }
.docmeta dd.live { color: var(--gold); }
@media (max-width: 620px) { .docmeta { text-align: left; } }

/* "prepared for" — the visitor writes themselves onto the document */
.prepared {
  margin-top: clamp(1.2rem, 2.6vw, 1.8rem);
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.6rem 1rem;
}
.prepared .label { flex: 0 0 auto; }
.prepared-field {
  flex: 1 1 260px;
  min-width: 0;
  position: relative;
}
.prepared-field input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px dashed var(--line-2);
  padding: 0.3rem 0 0.4rem;
  font-family: var(--serif);
  font-size: clamp(1.15rem, 2.4vw, 1.7rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--gold);
}
.prepared-field input::placeholder { color: var(--ink-3); font-style: italic; }
.prepared-field input:focus { outline: none; border-bottom-color: var(--gold); }
.prepared-hint { font-family: var(--mono); font-size: 0.6rem; color: var(--ink-3); letter-spacing: 0.08em; }

/* ==========================================================================
   Statement
   ========================================================================== */
.statement { padding-block: clamp(2.4rem, 6vw, 4.6rem); border-bottom: 1px solid var(--line); }
.statement-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(1.4rem, 4vw, 4rem);
  align-items: start;
}
@media (max-width: 900px) { .statement-grid { grid-template-columns: 1fr; } }

.page-what {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.8rem;
}
.statement h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.3rem, 6vw, 4.6rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
  text-wrap: balance;
}
.statement h1 em { font-style: italic; color: var(--gold); }
.page-lede {
  margin-top: 1rem;
  font-size: clamp(1rem, 1.5vw, 1.18rem);
  line-height: 1.6;
  color: var(--ink);
  max-width: 44ch;
}

/* ---- Site bar: the way back out ---- */
.sitebar { border-bottom: 1px solid var(--line); }
.sitebar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 44px;
  flex-wrap: wrap;
}
.sitebar a {
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
  white-space: nowrap;
  transition: color 0.2s var(--ease);
}
.sitebar a:hover { color: var(--gold); }
.sitebar-back { color: var(--ink) !important; display: inline-flex; align-items: center; gap: 0.45rem; }
.sitebar-back span { transition: transform 0.2s var(--ease); }
.sitebar-back:hover span { transform: translateX(-3px); }
.sitebar-nav { display: flex; gap: clamp(0.8rem, 2vw, 1.8rem); }
.sitebar-langs { display: flex; gap: 0.8rem; }
.sitebar-langs a[aria-current="true"] { color: var(--gold); }
@media (max-width: 860px) { .sitebar-nav { display: none; } }
.statement-body { display: flex; flex-direction: column; gap: 0.9rem; }
.statement-body p { font-size: 0.95rem; line-height: 1.7; color: var(--ink-2); }
.statement-body p strong { color: var(--ink); font-weight: 600; }

.howto { margin-top: 1rem; display: grid; gap: 0.5rem; }
.howto li { display: grid; grid-template-columns: 1.6rem 1fr; gap: 0.6rem; font-family: var(--mono); font-size: 0.72rem; line-height: 1.6; color: var(--ink-2); list-style: none; }
.howto li b { color: var(--gold); font-weight: 400; }

/* The second route. A visitor whose project isn't on the price list needs to
   be told that at the top, not discover it after ticking enough boxes. */
.fork {
  margin-top: 1.4rem;
  padding: 0.95rem 1.05rem;
  border: 1px dashed var(--line-2);
  border-left: 2px solid var(--red);
}
.fork-head {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 0.45rem;
}
.fork p { font-size: 0.85rem; line-height: 1.65; color: var(--ink-2); }
.fork-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.7rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}
.fork-link span { transition: transform 0.2s var(--ease); }
.fork-link:hover span { transform: translateX(3px); }

/* ==========================================================================
   The document body: line items + running total
   ========================================================================== */
.doc {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(280px, 26vw, 360px);
  gap: clamp(1.4rem, 3vw, 3rem);
  align-items: start;
  padding-block: clamp(2rem, 4vw, 3.4rem);
}
@media (max-width: 1020px) { .doc { grid-template-columns: 1fr; } }

/* ---- Groups -------------------------------------------------------- */
.group { margin-bottom: clamp(1.8rem, 3.4vw, 2.8rem); }
.group-head {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--line-2);
}
.group-no { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.1em; color: var(--red); }
.group-name { font-family: var(--serif); font-size: clamp(1.15rem, 2.2vw, 1.5rem); font-weight: 600; letter-spacing: -0.025em; }
.group-note { margin-left: auto; font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }

/* ---- Line items ---------------------------------------------------- */
.item {
  display: grid;
  grid-template-columns: 1.6rem minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.2rem 0.9rem;
  padding: 0.85rem 0.7rem 0.85rem 0.55rem;
  border-bottom: 1px solid var(--line);
  border-left: 2px solid transparent;
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.item:hover { background: var(--doc-2); }
.item.on { background: var(--doc-2); border-left-color: var(--gold); }

.item input { position: absolute; opacity: 0; width: 1px; height: 1px; }
/* Every cell is placed explicitly: left to auto-placement the figure jumped
   ahead of the item name. */
.tick {
  grid-column: 1;
  grid-row: 1 / span 2;
  width: 17px; height: 17px;
  margin-top: 2px;
  border: 1px solid var(--line-2);
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 0.62rem;
  color: transparent;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease), color 0.18s var(--ease);
}
.item.on .tick { background: var(--gold); border-color: var(--gold); color: var(--doc); }

.item-name { grid-column: 2; grid-row: 1; font-size: 0.93rem; font-weight: 500; line-height: 1.35; }
.item-scope { grid-column: 2; grid-row: 2; font-family: var(--mono); font-size: 0.68rem; line-height: 1.6; color: var(--ink-3); }
.item-fig {
  grid-column: 3;
  grid-row: 1 / span 2;
  font-family: var(--mono);
  font-size: 0.92rem;
  white-space: nowrap;
  text-align: right;
  align-self: center;
}
.item-fig small { display: block; font-size: 0.6rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); margin-top: 0.15rem; }
.item.on .item-fig { color: var(--gold); }
@media (max-width: 520px) {
  .item { grid-template-columns: 1.4rem minmax(0, 1fr); }
  .item-fig { grid-column: 2; grid-row: 3; text-align: left; margin-top: 0.35rem; }
  .item-fig small { display: inline; margin-left: 0.4rem; }
}

/* The "not a line item" entry: same anatomy as a priced row so it reads as a
   real option, but dashed and without a figure — there is nothing honest to
   put in the price column yet. */
.item-custom {
  border: 1px dashed var(--line-2);
  border-left: 2px solid var(--red);
  cursor: pointer;
}
.item-custom:hover { background: var(--doc-2); border-color: var(--red); }
.tick-custom {
  border-color: var(--red);
  color: var(--red);
  font-size: 0.7rem;
  line-height: 1;
}
.item-custom .item-name { color: var(--ink); }
.item-fig-tbd {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--red);
  line-height: 1.3;
}
.item-fig-tbd small { color: var(--red); }

/* ==========================================================================
   Running total
   ========================================================================== */
.total-panel {
  position: sticky;
  top: 1rem;
  border: 1px solid var(--line-2);
  background: var(--doc-2);
}
@media (max-width: 1020px) {
  .total-panel { position: static; }
}
.total-head {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}
.total-head .label { color: var(--ink-2); }
.total-count { font-family: var(--mono); font-size: 0.66rem; color: var(--gold); }

.total-lines { padding: 0.4rem 1rem 0.8rem; max-height: 210px; overflow-y: auto; }
.total-lines:empty::after {
  content: "Nothing selected yet. Tick what you need on the left and this document fills itself in.";
  display: block;
  padding: 0.9rem 0;
  font-family: var(--mono);
  font-size: 0.68rem;
  line-height: 1.6;
  color: var(--ink-3);
}
.total-line {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.4rem 0;
  border-bottom: 1px dotted var(--line);
  font-family: var(--mono);
  font-size: 0.68rem;
}
.total-line span:first-child { color: var(--ink-2); min-width: 0; }
.total-line span:last-child { color: var(--ink); white-space: nowrap; }

.total-sums { padding: 0.8rem 1rem; border-top: 1px solid var(--line); display: grid; gap: 0.45rem; }
.sum-row { display: flex; align-items: baseline; justify-content: space-between; gap: 0.8rem; font-family: var(--mono); font-size: 0.7rem; }
/* `display: flex` above would otherwise beat the browser's [hidden] rule. */
.sum-row[hidden] { display: none; }
.sum-row span:first-child { color: var(--ink-3); letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.6rem; }
.sum-row.big { align-items: baseline; padding-top: 0.5rem; border-top: 1px solid var(--line); margin-top: 0.3rem; }
.sum-row.big b {
  font-family: var(--serif);
  font-size: clamp(1.7rem, 3.4vw, 2.3rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  color: var(--gold);
  line-height: 1;
}
.sum-note { padding: 0 1rem 0.9rem; font-family: var(--mono); font-size: 0.6rem; line-height: 1.6; color: var(--ink-3); }

.escalate {
  margin: 0 1rem 0.9rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid rgba(200,16,46,0.45);
  background: rgba(200,16,46,0.07);
  font-family: var(--mono);
  font-size: 0.66rem;
  line-height: 1.6;
  color: var(--ink-2);
}
.escalate b { display: block; color: var(--red); letter-spacing: 0.1em; text-transform: uppercase; font-size: 0.6rem; margin-bottom: 0.3rem; }
.escalate a { color: var(--gold); border-bottom: 1px solid currentColor; }

.total-act { padding: 0 1rem 1rem; display: grid; gap: 0.5rem; }
/* Always present, not just once a threshold trips. */
.panel-alt {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.2rem;
  font-family: var(--mono);
  font-size: 0.64rem;
  line-height: 1.5;
  color: var(--ink-3);
  text-align: left;
}
.panel-alt:hover { color: var(--gold); }
.panel-alt span { transition: transform 0.2s var(--ease); }
.panel-alt:hover span { transform: translateX(3px); }

/* ---- Buttons -------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 46px;
  padding: 0 1.2rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid var(--line-2);
  text-align: center;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease), opacity 0.2s;
}
.btn:hover { border-color: var(--ink); }
.btn-gold { background: var(--gold); border-color: var(--gold); color: #171307; font-weight: 500; }
.btn-gold:hover { background: #E7C55F; border-color: #E7C55F; }
.btn[disabled] { opacity: 0.4; pointer-events: none; }

/* ==========================================================================
   Sign-off — send the quote
   ========================================================================== */
.signoff { border-top: 1px solid var(--line-2); padding-block: clamp(2.4rem, 5vw, 4rem); }
.signoff-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(280px, 30vw, 420px);
  gap: clamp(1.6rem, 4vw, 4rem);
  align-items: start;
}
@media (max-width: 900px) { .signoff-grid { grid-template-columns: 1fr; } }

.signoff h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.9rem, 4.4vw, 3.2rem);
  line-height: 1;
  letter-spacing: -0.035em;
}
.signoff h2 em { font-style: italic; color: var(--gold); }
.signoff p { margin-top: 0.9rem; font-size: 0.92rem; line-height: 1.7; color: var(--ink-2); max-width: 48ch; }

.qform { display: grid; gap: 0.8rem; }
.qfield { display: grid; gap: 0.35rem; }
.qfield input {
  width: 100%;
  min-height: 46px;
  padding: 0 0.85rem;
  background: var(--doc-2);
  border: 1px solid var(--line-2);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.82rem;
}
.qfield input::placeholder { color: var(--ink-3); }
.qfield input:focus { outline: none; border-color: var(--gold); }
.qform-msg { font-family: var(--mono); font-size: 0.7rem; line-height: 1.6; }
.qform-msg.ok { color: var(--green); }
.qform-msg.bad { color: #FF8095; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ==========================================================================
   Terms + stamp
   ========================================================================== */
.terms { border-top: 1px solid var(--line); padding-block: clamp(1.8rem, 3.4vw, 2.6rem); }
.terms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem 2rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  line-height: 1.7;
  color: var(--ink-3);
}
.terms-grid b { display: block; color: var(--ink-2); letter-spacing: 0.1em; text-transform: uppercase; font-size: 0.6rem; margin-bottom: 0.25rem; }
.terms-grid a { color: var(--gold); border-bottom: 1px solid currentColor; }

.stampline {
  margin-top: clamp(1.6rem, 3vw, 2.4rem);
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.4rem;
}
.stamp { display: flex; align-items: center; gap: 0.9rem; }
.stamp-frame { position: relative; width: 108px; height: 34px; flex: 0 0 auto; }
.stamp-frame svg { position: absolute; top: 50%; left: 50%; width: 34px; height: 108px; transform: translate(-50%, -50%) rotate(90deg); }
.stamp-frame line { stroke: var(--red); stroke-width: 12; stroke-linecap: square; }
.stamp-text { font-family: var(--mono); font-size: 0.6rem; line-height: 1.7; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
.stamp-text b { display: block; color: var(--ink-2); }

.sigblock { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); text-align: right; }
.sigblock .sigline { display: block; width: 190px; margin-left: auto; margin-bottom: 0.4rem; border-bottom: 1px solid var(--line-2); height: 1.6rem; }
@media (max-width: 620px) { .sigblock { text-align: left; } .sigblock .sigline { margin-left: 0; } }

/* ==========================================================================
   Footer
   ========================================================================== */
.foot { border-top: 1px solid var(--line-2); padding-block: 1.6rem 2rem; }
.foot-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem 2rem;
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.foot-grid nav { display: flex; flex-wrap: wrap; gap: 0.9rem 1.4rem; }
.foot-grid a:hover { color: var(--gold); }

/* ==========================================================================
   Mobile total bar
   ========================================================================== */
.mobar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 120;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.65rem var(--pad);
  background: rgba(247,244,236,0.94);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line-2);
}
.mobar-sum { font-family: var(--mono); font-size: 0.68rem; color: var(--ink-2); line-height: 1.4; }
.mobar-sum b { display: block; font-family: var(--serif); font-size: 1.3rem; font-weight: 600; color: var(--gold); letter-spacing: -0.02em; }
.mobar .btn { min-height: 42px; padding-inline: 1rem; }
@media (max-width: 1020px) {
  .mobar.show { display: flex; }
  body.has-bar { padding-bottom: 76px; }
}

/* Launch-year pricing: standard price struck through above the real one */
.item-was { display: block; font-size: 0.8em; font-weight: 400; color: var(--ink-2); text-decoration: line-through; text-decoration-color: var(--red); text-decoration-thickness: 1.5px; margin-bottom: 0.1rem; }
.launch-tag { display: inline-block; margin-left: 0.7rem; padding: 0.2rem 0.5rem; border: 1px solid var(--red); color: #fff; background: var(--red); font-size: 0.62rem; letter-spacing: 0.12em; transform: rotate(-2deg); vertical-align: middle; }
.sum-was s { color: var(--ink-3); text-decoration-color: var(--red); }
.sum-save span:last-child { color: var(--gold); }
@media (max-width: 680px) { .item-was { display: inline; margin: 0 0.4rem 0 0; } }
