/* ============================================================
   THE ORDER OF THE KEYSTONE — theme layer
   Loads after keystone.css. The unifying fiction: Keystone is the
   secret of the true architects — the one wedge that makes every
   structure stand. Blueprint draughtsmanship · the keystone seal ·
   sacred geometry · gold-on-void. One feel, every section.
   ============================================================ */

/* ---------- the keystone glyph (recurring motif) ---------- */
.kw { display: inline-block; background: currentColor; -webkit-clip-path: polygon(15% 0, 85% 0, 68% 100%, 32% 100%); clip-path: polygon(15% 0, 85% 0, 68% 100%, 32% 100%); }

/* ---------- blueprint atmosphere (section background) ---------- */
.blueprint { position: relative; isolation: isolate; }
.blueprint::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .6;
  background-image:
    linear-gradient(rgba(var(--gold-rgb), .03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--gold-rgb), .03) 1px, transparent 1px);
  background-size: 52px 52px;
  -webkit-mask-image: radial-gradient(ellipse 100% 78% at 50% 32%, #000 28%, transparent 82%);
          mask-image: radial-gradient(ellipse 100% 78% at 50% 32%, #000 28%, transparent 82%);
}
/* faint construction arc — sacred geometry, drifts behind a section */
.blueprint.arc::after {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  width: min(760px, 84vw); aspect-ratio: 2 / 1; left: 50%; top: 8%; transform: translateX(-50%);
  border: 1px solid rgba(var(--gold-rgb), .12); border-bottom: 0;
  border-radius: 50% 50% 0 0 / 100% 100% 0 0; opacity: .5;
}

/* ---------- plate marker (architect's folio — replaces the eyebrow) ---------- */
.plate { display: inline-flex; align-items: center; gap: .7rem; font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--gold); }
.plate::before { content: ""; width: 28px; height: 1px; background: linear-gradient(90deg, var(--gold), transparent); }
.plate .kw { width: 11px; height: 11px; color: var(--gold); }
.plate .n { color: var(--dim); }

/* ---------- arch divider (the motif, recurring between sections) ---------- */
.archrule { position: relative; display: block; width: min(820px, 86vw); height: 64px; margin: 1rem auto -1rem; }
.archrule i { position: absolute; inset: 0 0 auto 0; height: 64px; border: 1px solid rgba(var(--gold-rgb), .22); border-bottom: 0; border-radius: 50% 50% 0 0 / 100% 100% 0 0; opacity: .6; }
.archrule b { position: absolute; top: -7px; left: 50%; transform: translateX(-50%); width: 15px; height: 15px; color: var(--gold); }
.archrule b .kw { width: 100%; height: 100%; color: inherit; box-shadow: 0 0 14px rgba(var(--gold-rgb), .5); }
.archrule::before, .archrule::after { content: ""; position: absolute; bottom: 0; width: 5px; height: 5px; border-radius: 50%; background: rgba(var(--gold-rgb), .5); }
.archrule::before { left: calc(50% - min(410px, 43vw)); }
.archrule::after { left: calc(50% + min(410px, 43vw)); }

/* ---------- dimension annotation (draughtsman's measure) ---------- */
.dim { display: inline-flex; align-items: center; gap: .5rem; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.dim::before, .dim::after { content: ""; width: 1px; height: 9px; background: currentColor; opacity: .6; }
.dim i { display: block; height: 1px; width: 30px; background: currentColor; opacity: .4; }

/* ---------- the Keystone Seal (the order's emblem) ---------- */
.seal { position: relative; width: var(--seal, 150px); aspect-ratio: 1; color: var(--gold); display: grid; place-items: center; }
.seal svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.seal .spin { transform-origin: 50% 50%; animation: sealspin 44s linear infinite; }
.seal .ring { fill: none; stroke: rgba(var(--gold-rgb), .55); stroke-width: 1; }
.seal .ticks { stroke: rgba(var(--gold-rgb), .4); stroke-width: 1; }
.seal .txt { fill: var(--gold); font-family: var(--font-mono); font-size: 7px; font-weight: 700; letter-spacing: 3px; }
.seal .core { width: 42%; aspect-ratio: 1; position: relative; z-index: 1; display: grid; place-items: center; }
.seal .core .kw { width: 46%; height: 56%; color: var(--gold); filter: drop-shadow(0 0 12px rgba(var(--gold-rgb), .5)); }
@keyframes sealspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .seal .spin { animation: none; } }

/* ---------- credibility strip ---------- */
.cred { display: flex; align-items: center; justify-content: center; gap: 1.4rem 2rem; flex-wrap: wrap; padding: 1.5rem 1.6rem; border-radius: var(--r-lg); }
.cred .av { width: 38px; height: 38px; border-radius: 10px; background: linear-gradient(135deg, var(--gold), #d97706); color: #100a02; display: grid; place-items: center; font-family: var(--font-mono); font-weight: 700; font-size: 13px; flex: none; }
.cred .by { font-size: 14.5px; color: var(--text2); max-width: 52ch; }
.cred .by b { color: var(--foreground); }
.cred a { color: var(--gold); border-bottom: 1px solid rgba(var(--gold-rgb), .35); white-space: nowrap; }
.cred a:hover { border-bottom-color: var(--gold); }

/* ---------- rebuild-cost calculator ---------- */
.calc { display: grid; grid-template-columns: 1.05fr .95fr; gap: 2.4rem; align-items: center; padding: clamp(1.6rem, 4vw, 2.6rem); }
.calc .ctrls { display: grid; gap: 1.6rem; }
.calc .field { display: grid; gap: .6rem; }
.calc .lab { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.calc .lab b { color: var(--gold); font-size: 13px; }
.calc input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 4px; border-radius: 999px; background: linear-gradient(90deg, var(--gold) var(--p, 40%), rgba(var(--gold-rgb), .14) var(--p, 40%)); outline: none; cursor: pointer; }
.calc input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px rgba(var(--gold-rgb), .16), 0 2px 8px rgba(0, 0, 0, .4); transition: box-shadow .2s; }
.calc input[type=range]::-webkit-slider-thumb:hover { box-shadow: 0 0 0 6px rgba(var(--gold-rgb), .22), 0 2px 8px rgba(0, 0, 0, .4); }
.calc input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border: 0; border-radius: 50%; background: var(--gold); }
.calc .out { text-align: center; padding: 1.6rem 1rem; border-left: 1px solid var(--border-soft); }
@media (max-width: 760px) { .calc { grid-template-columns: 1fr; } .calc .out { border-left: 0; border-top: 1px solid var(--border-soft); } }
.calc .out .cap { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }
.calc .out .big { font-family: var(--font-mono); font-weight: 700; font-size: clamp(2.6rem, 7vw, 3.8rem); color: var(--gold); font-variant-numeric: tabular-nums; letter-spacing: -.02em; text-shadow: 0 0 24px rgba(var(--gold-rgb), .28); line-height: 1.05; margin: .3rem 0; }
.calc .out .days { font-family: var(--font-mono); font-size: 1.05rem; font-weight: 600; color: var(--green); }
.calc .out .days b { font-weight: 700; }
.calc .out .note { margin-top: 1rem; font-size: 13px; color: var(--muted); max-width: 28ch; margin-inline: auto; }

/* ---------- interactive arch (the spine, as an arch you can read) ---------- */
.archw { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }
@media (max-width: 900px) { .archw { grid-template-columns: 1fr; } }
.archw .stage { position: relative; }
.archw svg { width: 100%; height: auto; display: block; overflow: visible; }
.archw .stone { cursor: pointer; transition: fill .22s ease, stroke .22s ease, filter .22s ease; }
.archw .stone .face { fill: rgba(var(--gold-rgb), .05); stroke: rgba(var(--gold-rgb), .42); stroke-width: 1.4; }
.archw .stone .lbl { fill: var(--dim); font-family: var(--font-mono); font-size: 8.5px; font-weight: 700; letter-spacing: .5px; text-anchor: middle; pointer-events: none; }
.archw .stone:hover .face, .archw .stone.on .face { fill: rgba(var(--gold-rgb), .2); stroke: var(--gold); filter: drop-shadow(0 0 8px rgba(var(--gold-rgb), .4)); }
.archw .stone:hover .lbl, .archw .stone.on .lbl { fill: var(--foreground); }
.archw .stone.key .face { fill: rgba(var(--green-rgb), .14); stroke: var(--green); }
.archw .stone.key.on .face, .archw .stone.key:hover .face { fill: rgba(var(--green-rgb), .28); stroke: var(--green); filter: drop-shadow(0 0 10px rgba(var(--green-rgb), .5)); }
.archw .stone.key .lbl { fill: var(--green); }
.archw .ground { stroke: rgba(var(--gold-rgb), .3); stroke-width: 1.5; stroke-dasharray: 3 4; }
.archw .panel { border-radius: var(--r-md); border: 1px solid var(--border-soft); background: var(--card-grad); padding: 1.5rem 1.6rem; min-height: 188px; }
.archw .panel .tag { display: inline-flex; align-items: center; gap: .5rem; font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.archw .panel .tag .kw { width: 11px; height: 11px; color: inherit; }
.archw .panel.key .tag { color: var(--green); }
.archw .panel h3 { margin: .8rem 0 .4rem; font-size: 1.3rem; }
.archw .panel p { font-size: 14.5px; line-height: 1.6; color: var(--text2); }
.archw .panel .st { margin-top: 1rem; font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--green); display: inline-flex; gap: .5rem; align-items: center; }
.archw .panel .st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: pulse 2s infinite; }
.archw .hint { margin-top: 1rem; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }

/* ---------- product preview mockup (show, don't tell) ---------- */
.mock { border-radius: var(--r-lg); border: 1px solid var(--border-bright); background: var(--bg2); overflow: hidden; box-shadow: var(--shadow-card), 0 0 70px rgba(var(--gold-rgb), .05); }
.mock .top { display: flex; align-items: center; gap: .8rem; padding: .7rem 1rem; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg2) 70%, transparent); }
.mock .top .tl { display: flex; gap: 6px; }
.mock .top .tl i { width: 10px; height: 10px; border-radius: 50%; background: var(--border-bright); }
.mock .top .url { flex: 1; max-width: 280px; font-family: var(--font-mono); font-size: 11px; color: var(--dim); background: var(--bg); border: 1px solid var(--border); border-radius: 999px; padding: .3rem .8rem; text-align: center; }
.mock .top .url b { color: var(--gold); }
.mock .grid { display: grid; grid-template-columns: 168px 1fr; min-height: 320px; }
@media (max-width: 620px) { .mock .grid { grid-template-columns: 1fr; } .mock .side { display: none; } }
.mock .side { border-right: 1px solid var(--border); padding: 1.1rem .9rem; display: grid; gap: .3rem; align-content: start; }
.mock .side .brand { display: flex; align-items: center; gap: .5rem; font-family: var(--font-display); font-weight: 700; font-size: .95rem; margin-bottom: 1rem; }
.mock .side .brand .kw { width: 14px; height: 16px; color: var(--gold); }
.mock .side a { display: flex; align-items: center; gap: .6rem; padding: .5rem .6rem; border-radius: 8px; font-family: var(--font-mono); font-size: 12px; letter-spacing: .04em; color: var(--muted); }
.mock .side a.on { background: rgba(var(--gold-rgb), .1); color: var(--gold); }
.mock .side a .d { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .6; }
.mock .main { padding: 1.4rem; display: grid; gap: 1.1rem; grid-template-columns: 1fr 1fr; align-content: start; }
.mock .main .row { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; }
.mock .main .row .h { font-family: var(--font-mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }
.mock .main .row .pill { font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--green); border: 1px solid rgba(var(--green-rgb), .35); background: rgba(var(--green-rgb), .1); border-radius: 999px; padding: .2rem .55rem; }
.mock .card { border: 1px solid var(--border-soft); border-radius: 10px; background: var(--card-grad); padding: 1rem 1.1rem; }
.mock .card .k { font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.mock .meter { display: flex; align-items: center; gap: 1rem; }
.mock .ring { --pct: 64; width: 70px; height: 70px; border-radius: 50%; flex: none; background: radial-gradient(closest-side, var(--bg2) 78%, transparent 79%), conic-gradient(var(--gold) calc(var(--pct) * 1%), rgba(var(--gold-rgb), .12) 0); display: grid; place-items: center; font-family: var(--font-mono); font-weight: 700; font-size: 15px; color: var(--gold); }
.mock .meter .mm .v { font-family: var(--font-mono); font-weight: 700; font-size: 1.25rem; color: var(--foreground); }
.mock .meter .mm .s { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); margin-top: .2rem; }
.mock .bars { display: flex; align-items: flex-end; gap: 5px; height: 56px; margin-top: .7rem; }
.mock .bars i { flex: 1; background: linear-gradient(180deg, var(--gold), rgba(var(--gold-rgb), .15)); border-radius: 2px 2px 0 0; opacity: .85; }
.mock .stream { grid-column: 1 / -1; border: 1px solid var(--border-soft); border-radius: 10px; background: var(--code-bg); padding: .9rem 1.1rem; font-family: var(--font-mono); font-size: 12px; line-height: 1.7; color: var(--code-text); }
.mock .stream .u { color: var(--cyan); } .mock .stream .a { color: var(--text2); } .mock .stream .cur { color: var(--gold); animation: termblink 1.05s step-end infinite; }
.mock .tier { display: flex; align-items: center; justify-content: space-between; }
.mock .tier .b { font-family: var(--font-mono); font-weight: 700; color: var(--gold); }

/* ---------- FAQ (native <details>, the architect answers) ---------- */
.faq { display: grid; gap: .6rem; max-width: 840px; margin: 0 auto; }
.faq details { border: 1px solid var(--border-soft); border-radius: var(--r-md); background: var(--card-grad); overflow: hidden; transition: border-color .25s; }
.faq details[open] { border-color: rgba(var(--gold-rgb), .3); }
.faq summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 1rem; padding: 1.15rem 1.3rem; font-weight: 600; color: var(--foreground); font-size: 1.04rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .kw { width: 13px; height: 14px; color: var(--gold); flex: none; transition: transform .3s ease; }
.faq details[open] summary .kw { transform: rotate(180deg); }
.faq summary:hover { color: var(--gold); }
.faq .a { padding: 0 1.3rem 1.3rem 3.3rem; color: var(--text2); font-size: 15px; line-height: 1.68; }
.faq .a code { font-family: var(--font-mono); font-size: .9em; color: var(--gold); }

/* ---------- the Order / initiation (cohort, elevated) ---------- */
.order { position: relative; text-align: center; }
.order .glass { padding: clamp(2.6rem, 6vw, 4.6rem) clamp(1.4rem, 5vw, 3rem); border-radius: var(--r-xl); position: relative; overflow: hidden; }
.order .seal { margin: 0 auto 1.6rem; }
.order h2 { max-width: 22ch; margin: 0 auto; }
.order p { max-width: 56ch; margin: 1.2rem auto 0; }
.order .btn { margin-top: 2.3rem; }
.order .sub { margin-top: 1.1rem; font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.order .seats { display: inline-flex; gap: .5rem; align-items: center; margin-top: 1.4rem; font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.order .seats .bar { width: 120px; height: 4px; border-radius: 999px; background: rgba(var(--gold-rgb), .15); overflow: hidden; }
.order .seats .bar i { display: block; height: 100%; width: 38%; background: var(--gold); }

/* ---------- section rhythm helpers ---------- */
.tight { padding-block: clamp(3rem, 6vh, 4.5rem); }
.center-head { text-align: center; max-width: 60ch; margin: 0 auto 2.6rem; }
.center-head .plate { justify-content: center; }
