/* ============================================================
   DIEGEX CORPORATION — Territories
   Extends the master design system. Tokens inherited from style.css
   ============================================================ */

/* ---------- territory rows ---------- */
.terr{ border-top:1px solid var(--line); }
.terr__row{
  display:grid; grid-template-columns:70px 1fr minmax(0,1.05fr) 190px;
  gap:clamp(18px,3vw,46px); align-items:start;
  padding:clamp(34px,4.4vh,54px) clamp(10px,1.6vw,26px);
  border-bottom:1px solid var(--line);
  transition:background .4s ease, padding-left .4s ease;
}
.terr__row:hover{ background:rgba(36,83,166,.07); }
.terr__num{ font-family:var(--serif); font-size:20px; color:var(--blue-hi); padding-top:8px; }
.terr__id h3{ font-size:clamp(25px,2.5vw,36px); }
.terr__coord{
  margin-top:10px; font-size:11px; letter-spacing:.22em; text-transform:uppercase;
  color:var(--mist-2); font-variant-numeric:tabular-nums;
}
.terr__row p{ color:var(--mist); font-weight:400; line-height:1.85; font-size:15.5px; }
.terr__row p + p{ margin-top:12px; }
.terr__act{ display:flex; flex-direction:column; align-items:flex-start; gap:14px; padding-top:6px; }
.chip{
  display:inline-flex; align-items:center; gap:9px;
  font-size:10px; letter-spacing:.26em; text-transform:uppercase; font-weight:600;
  color:var(--mist); border:1px solid var(--line); border-radius:2px; padding:6px 11px;
}
.chip i{ width:6px; height:6px; border-radius:50%; background:var(--mist-2); flex:none; }
.chip--live{ color:#8FE3B0; border-color:rgba(143,227,176,.34); }
.chip--live i{ background:#8FE3B0; box-shadow:0 0 9px rgba(143,227,176,.9); }
.chip--base{ color:var(--blue-hi); border-color:rgba(79,130,232,.36); }
.chip--base i{ background:var(--blue-hi); box-shadow:0 0 9px rgba(79,130,232,.9); }
.chip--gated{ color:#F0C070; border-color:rgba(240,192,112,.36); }
.chip--gated i{ background:#F0C070; box-shadow:0 0 9px rgba(240,192,112,.9); }
.terr__enter{
  display:inline-flex; align-items:center; gap:10px;
  font-size:11px; letter-spacing:.28em; text-transform:uppercase; font-weight:600;
  color:var(--white); border-bottom:1px solid var(--blue-hi); padding-bottom:5px;
  transition:gap .3s ease, color .3s ease;
}
.terr__enter:hover{ gap:16px; color:var(--blue-hi); }
@media (max-width:1020px){
  .terr__row{ grid-template-columns:46px 1fr; row-gap:16px; }
  .terr__row > p{ grid-column:2; }
  .terr__act{ grid-column:2; flex-direction:row; align-items:center; flex-wrap:wrap; }
}

/* ---------- access gate ---------- */
.gate{ min-height:100vh; min-height:100svh; display:flex; align-items:center; position:relative; isolation:isolate; }
.gate__media{ position:absolute; inset:0; z-index:-2; overflow:hidden; }
.gate__media img{ width:100%; height:100%; object-fit:cover; filter:grayscale(38%) brightness(.52); }
.gate__scrim{ position:absolute; inset:0; z-index:-1;
  background:linear-gradient(180deg,rgba(7,9,13,.86) 0%,rgba(7,9,13,.68) 45%,rgba(7,9,13,.96) 100%); }
.gate__inner{ width:100%; max-width:var(--max); margin:0 auto; padding:clamp(120px,16vh,180px) var(--pad) clamp(70px,10vh,110px); }
.gate__card{ max-width:560px; }
.gate__card .kicker{ display:block; margin-bottom:24px; }
.gate__card h1{ font-size:clamp(40px,5.6vw,74px); }
.gate__card .lede{ margin-top:26px; max-width:480px; }
.gate__form{ margin-top:44px; display:flex; gap:0; max-width:440px; border:1px solid var(--line); background:rgba(255,255,255,.04); }
.gate__form input{
  flex:1; min-width:0; background:none; border:0; outline:0; color:var(--white);
  font-family:var(--sans); font-size:14px; letter-spacing:.24em; text-transform:uppercase;
  padding:17px 20px;
}
.gate__form input::placeholder{ color:rgba(255,255,255,.30); letter-spacing:.24em; }
.gate__form button{
  background:var(--blue); border:0; color:#fff; cursor:pointer;
  font-family:var(--sans); font-size:11px; font-weight:600; letter-spacing:.28em; text-transform:uppercase;
  padding:0 26px; transition:background .3s ease;
}
.gate__form button:hover{ background:var(--blue-hi); }
.gate__form button:disabled{ opacity:.55; cursor:default; }
.gate__msg{ margin-top:18px; font-size:12px; letter-spacing:.14em; text-transform:uppercase; min-height:18px; color:var(--mist-2); }
.gate__msg.err{ color:#F08A8A; }
.gate__msg.ok{ color:#8FE3B0; }
.gate__note{ margin-top:34px; font-size:12.5px; line-height:1.8; color:rgba(255,255,255,.40); max-width:430px; }
.gate__note a{ color:var(--mist); border-bottom:1px solid var(--line); }

/* ---------- access badge, shown once unlocked ---------- */
.badge{
  position:fixed; right:var(--pad); bottom:20px; z-index:90;
  display:inline-flex; align-items:center; gap:10px;
  font-size:10px; letter-spacing:.26em; text-transform:uppercase; font-weight:600;
  color:rgba(255,255,255,.62); background:rgba(7,9,13,.78); backdrop-filter:blur(9px);
  border:1px solid var(--line); border-radius:2px; padding:8px 13px;
}
.badge i{ width:6px; height:6px; border-radius:50%; background:#8FE3B0; box-shadow:0 0 9px rgba(143,227,176,.9); }
.badge button{ background:none; border:0; color:rgba(255,255,255,.42); cursor:pointer;
  font:inherit; letter-spacing:.26em; padding:0 0 0 6px; border-left:1px solid var(--line); margin-left:4px; }
.badge button:hover{ color:#fff; }
@media (max-width:700px){ .badge{ left:var(--pad); right:var(--pad); justify-content:center; } }

/* ---------- data tables ---------- */
.dtable{ overflow-x:auto; margin-top:34px; }
.dtable table{ width:100%; border-collapse:collapse; min-width:520px; font-variant-numeric:tabular-nums; }
.dtable th{
  text-align:left; font-size:10px; font-weight:600; letter-spacing:.26em; text-transform:uppercase;
  color:var(--blue-hi); padding:0 22px 13px 0; border-bottom:1px solid var(--line); white-space:nowrap;
}
.dtable td{ padding:15px 22px 15px 0; border-bottom:1px solid var(--line); font-size:15px; color:var(--mist); font-weight:400; vertical-align:top; }
.dtable td:first-child{ color:var(--white); }
.dtable .n{ text-align:right; padding-right:0; }
.dtable td.n:not(:last-child), .dtable th.n:not(:last-child){ padding-right:24px; }
.dtable tr.tot td{ border-bottom:0; border-top:1px solid var(--blue-hi); color:var(--white); }
.section--paper .dtable th{ color:var(--blue); border-bottom-color:var(--line-d); }
.section--paper .dtable td{ color:#4a4f59; border-bottom-color:var(--line-d); }
.section--paper .dtable td:first-child{ color:#14171d; }

/* ---------- figure blocks ---------- */
.fig{ margin-top:44px; }
.fig svg{ width:100%; height:auto; display:block; }
.fig figcaption{ margin-top:16px; font-size:12.5px; line-height:1.75; color:rgba(255,255,255,.42); max-width:74ch; }
.section--paper .fig figcaption{ color:#6b707a; }

/* ---------- metric strip ---------- */
.metrics{ display:grid; grid-template-columns:repeat(auto-fit,minmax(168px,1fr)); gap:1px; background:var(--line); border:1px solid var(--line); margin-top:44px; }
.metric{ background:var(--ink-2); padding:30px 26px 32px; }
.metric .lab{ font-size:10px; letter-spacing:.26em; text-transform:uppercase; color:var(--mist-2); }
.metric .val{ font-family:var(--serif); font-size:clamp(30px,3.4vw,44px); color:var(--white); margin-top:12px; line-height:1; }
.metric .sub{ font-size:12.5px; color:var(--mist); margin-top:10px; }

/* ---------- terrain entry card ---------- */
.enter{ position:relative; isolation:isolate; overflow:hidden; border:1px solid var(--line); background:var(--ink-2); }
.enter__grid{ display:grid; grid-template-columns:1.15fr .85fr; align-items:center; }
.enter__media{ position:relative; min-height:420px; overflow:hidden; }
.enter__media img{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; transition:transform 1.3s ease; }
.enter:hover .enter__media img{ transform:scale(1.045); }
.enter__media::after{ content:''; position:absolute; inset:0;
  background:linear-gradient(90deg,rgba(7,9,13,0) 40%,rgba(11,14,20,.95) 100%); }
.enter__body{ padding:clamp(38px,4.4vw,66px); }
.enter__body .kicker{ display:block; margin-bottom:20px; }
.enter__body h3{ font-size:clamp(28px,3vw,42px); }
.enter__body p{ color:var(--mist); font-weight:400; line-height:1.85; font-size:15.5px; margin-top:20px; }
.enter__body .btn{ margin-top:34px; }
.enter__specs{ display:flex; gap:26px; flex-wrap:wrap; margin-top:30px; padding-top:24px; border-top:1px solid var(--line); }
.enter__specs div{ font-size:11px; letter-spacing:.2em; text-transform:uppercase; color:var(--mist-2); }
.enter__specs b{ display:block; font-family:var(--serif); font-size:22px; letter-spacing:0; text-transform:none; color:var(--white); margin-top:7px; }
@media (max-width:980px){ .enter__grid{ grid-template-columns:1fr; } .enter__media{ min-height:280px; } }

/* ---------- the dossier, scoped ---------- */
.doc{ max-width:960px; }
.doc section{ padding:0 0 clamp(46px,6vh,74px); }
.doc section + section{ padding-top:clamp(40px,5vh,60px); border-top:1px solid var(--line-d); }
.doc h2{ font-family:var(--serif); font-size:clamp(27px,3vw,40px); font-weight:400; line-height:1.12; color:#14171d; margin-bottom:18px; }
.doc h3{ font-family:var(--sans); font-size:12px; font-weight:600; letter-spacing:.24em; text-transform:uppercase; color:var(--blue); margin:38px 0 14px; }
.doc p{ font-size:15.5px; line-height:1.9; color:#4a4f59; font-weight:400; max-width:74ch; }
.doc p + p{ margin-top:16px; }
.doc .lede{ font-size:clamp(17px,1.5vw,20px); line-height:1.7; color:#20242c; max-width:66ch; }
.doc strong{ color:#14171d; font-weight:500; }
.doc em{ font-style:italic; }
.doc ul{ list-style:none; margin:16px 0; max-width:74ch; }
.doc ul li{ position:relative; padding-left:22px; margin-bottom:10px; font-size:15.5px; line-height:1.85; color:#4a4f59; }
.doc ul li::before{ content:''; position:absolute; left:0; top:.85em; width:9px; height:1px; background:var(--blue); }
.doc .tablewrap{ overflow-x:auto; margin:26px 0 10px; }
.doc table{ width:100%; border-collapse:collapse; min-width:480px; font-variant-numeric:tabular-nums; }
.doc caption{ text-align:left; font-size:10px; letter-spacing:.26em; text-transform:uppercase; color:var(--blue); padding-bottom:11px; }
.doc th{ text-align:left; font-size:10px; font-weight:600; letter-spacing:.2em; text-transform:uppercase;
  color:#7b8089; border-bottom:1px solid rgba(7,9,13,.24); padding:0 20px 10px 0; white-space:nowrap; }
.doc td{ padding:13px 20px 13px 0; border-bottom:1px solid var(--line-d); font-size:14.5px; color:#4a4f59; vertical-align:top; }
.doc td:first-child{ color:#14171d; }
.doc .num{ text-align:right; padding-right:0; }
.doc td.num:not(:last-child), .doc th.num:not(:last-child){ padding-right:22px; }
.doc tr.total td{ border-bottom:0; border-top:1px solid #14171d; color:#14171d; }
.doc .note{ font-size:12.5px; line-height:1.75; color:#6b707a; margin-top:12px; max-width:74ch; }
.doc .chip{ display:inline-block; width:10px; height:10px; border-radius:2px; margin-right:9px;
  vertical-align:baseline; border:1px solid rgba(0,0,0,.14); padding:0; }
.doc .kv{ display:grid; grid-template-columns:minmax(150px,auto) 1fr; gap:0 26px; margin:18px 0; max-width:74ch; }
.doc .kv dt{ font-size:10px; letter-spacing:.2em; text-transform:uppercase; color:#7b8089; padding:12px 0; border-bottom:1px solid var(--line-d); }
.doc .kv dd{ padding:11px 0; border-bottom:1px solid var(--line-d); font-size:14.5px; color:#4a4f59; }
.doc .stream{ border-left:2px solid var(--blue); padding:2px 0 2px 24px; margin:0 0 30px; max-width:74ch; }
.doc .stream h3{ margin-top:0; }
.doc .authority{ display:inline-block; font-size:10px; letter-spacing:.2em; text-transform:uppercase;
  color:var(--blue); background:rgba(36,83,166,.09); padding:4px 9px; border-radius:2px; margin-bottom:10px; }
.doc figure{ margin:26px 0 8px; }
.doc figcaption{ font-size:12.5px; color:#6b707a; margin-top:12px; line-height:1.7; max-width:74ch; }
.doc .sectionsvg{ width:100%; height:auto; display:block; }
@media (max-width:640px){ .doc .kv{ grid-template-columns:1fr; } .doc .kv dt{ border-bottom:0; padding-bottom:0; } }

/* ---------- document toolbar ---------- */
.docbar{ display:flex; align-items:center; gap:18px; flex-wrap:wrap; margin-bottom:clamp(34px,5vh,56px);
  padding-bottom:22px; border-bottom:1px solid var(--line-d); }
.docbar .kicker{ color:var(--blue); }
.docbar .spacer{ flex:1; }

/* ---------- terrain page chrome ---------- */
body.terrainpage{ overflow:hidden; }
.terrbar{
  position:fixed; top:0; left:0; right:0; z-index:120;
  display:flex; align-items:center; gap:18px;
  padding:12px var(--pad);
  background:linear-gradient(180deg,rgba(5,7,10,.94),rgba(5,7,10,0));
  pointer-events:none;
}
.terrbar a, .terrbar span{ pointer-events:auto; }
.terrbar__back{
  display:inline-flex; align-items:center; gap:10px;
  font-family:var(--sans); font-size:10.5px; font-weight:600; letter-spacing:.26em; text-transform:uppercase;
  color:rgba(255,255,255,.66); transition:gap .3s ease,color .3s ease;
}
.terrbar__back:hover{ gap:15px; color:#fff; }
.terrbar__logo img{ height:26px; width:auto; opacity:.9; }
@media (max-width:700px){ .terrbar__logo{ display:none; } }

/* ---------- terrain model, hosted under the site bar ---------- */
body.terrainpage #top{ padding-top:56px; }
body.terrainpage #panel{ top:132px; max-height:calc(100vh - 224px); }
body.terrainpage #boot{ z-index:130; }
@media (max-width:820px){ body.terrainpage #panel{ top:124px; } }
@media (max-width:520px){ body.terrainpage #panel{ top:112px; } .terrbar{ padding:9px var(--pad); } }
