/* =========================================================================
 * ON1 // landing
 * aesthetic: scandinavian operations console
 * fonts: Major Mono Display, Familjen Grotesk, IBM Plex Mono
 * ========================================================================= */

:root {
  /* surfaces */
  --bg-0: #0c1014;
  --bg-1: #11161c;
  --bg-2: #1a2128;
  --bg-elev: #20282f;

  /* ink */
  --ink-0: #dde2e8;
  --ink-1: #8b96a3;
  --ink-2: #5b6470;
  --ink-3: #3a424c;

  /* lines */
  --rule: #1d2632;
  --rule-strong: #2a3441;

  /* signals */
  --amber:    #f5b541;   /* active / live */
  --copper:   #e07b3a;   /* highlight / accent */
  --cyan:     #5ad4d4;   /* info / structure */
  --sage:     #87a87f;   /* ok / healthy */
  --vermil:   #d94d3a;   /* warn / gated */

  --hair: 1px;
  --tick: 14px;
  --pad: clamp(16px, 2.4vw, 32px);
  --container: 1280px;

  --font-display: 'Major Mono Display', 'IBM Plex Mono', monospace;
  --font-sans:    'Familjen Grotesk', system-ui, sans-serif;
  --font-mono:    'IBM Plex Mono', 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg-0);
  color: var(--ink-0);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  /* drafting-paper grid + soft radial */
  background-image:
    radial-gradient(1200px 800px at 10% -20%, rgba(245, 181, 65, 0.04), transparent 60%),
    radial-gradient(900px 700px at 110% 110%, rgba(90, 212, 212, 0.04), transparent 65%),
    linear-gradient(var(--rule) var(--hair), transparent var(--hair)),
    linear-gradient(90deg, var(--rule) var(--hair), transparent var(--hair));
  background-size: 100% 100%, 100% 100%, 56px 56px, 56px 56px;
  background-position: 0 0, 0 0, -1px -1px, -1px -1px;
  background-attachment: fixed;
  background-color: var(--bg-0);
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* =========================================================================
 * top strip
 * ========================================================================= */

.strip {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px var(--pad);
  border-bottom: var(--hair) solid var(--rule);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-1);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: linear-gradient(180deg, var(--bg-1) 0%, var(--bg-0) 100%);
}

.strip-l, .strip-r { display: flex; gap: 14px; align-items: center; }

.brand-mark {
  color: var(--ink-0);
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.08em;
}
.brand-mark::before {
  content: "◈";
  color: var(--amber);
  margin-right: 8px;
}

.strip-sep { color: var(--ink-3); }

.strip-stamp {
  color: var(--ink-2);
}

#server-time { color: var(--cyan); }
#server-time::before { content: "● "; color: var(--sage); }

/* =========================================================================
 * layout container
 * ========================================================================= */

main {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--pad);
}

/* corner-tick decoration — applied to .panel */
.panel {
  position: relative;
  padding: 24px;
  border: var(--hair) solid var(--rule);
  background: linear-gradient(180deg, var(--bg-1) 0%, var(--bg-0) 100%);
}
.panel::before, .panel::after,
.panel > .corner-tl, .panel > .corner-tr,
.panel > .corner-bl, .panel > .corner-br {
  position: absolute;
  width: var(--tick); height: var(--tick);
  pointer-events: none;
  content: "";
}
.panel::before {  /* top-left */
  top: -1px; left: -1px;
  border-top: 2px solid var(--amber);
  border-left: 2px solid var(--amber);
}
.panel::after {   /* bottom-right */
  bottom: -1px; right: -1px;
  border-bottom: 2px solid var(--amber);
  border-right: 2px solid var(--amber);
}
.panel > .corner-tr {
  top: -1px; right: -1px;
  border-top: 2px solid var(--cyan);
  border-right: 2px solid var(--cyan);
}
.panel > .corner-bl {
  bottom: -1px; left: -1px;
  border-bottom: 2px solid var(--cyan);
  border-left: 2px solid var(--cyan);
}

/* =========================================================================
 * hero
 * ========================================================================= */

.hero {
  margin: 56px 0 80px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
  align-items: stretch;
}

@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-2);
  margin: 0 0 24px;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(96px, 16vw, 220px);
  line-height: 0.9;
  letter-spacing: -0.04em;
  margin: 0 0 28px;
  color: var(--ink-0);
  user-select: none;
  /* glyph fallback while font loads */
  font-feature-settings: "ss01" 1;
  position: relative;
}
.hero-title .scrambled { color: var(--copper); opacity: 0.6; }
.hero-title .settled   { color: var(--ink-0); }
.hero-title::after {
  content: "_";
  color: var(--amber);
  margin-left: 8px;
  animation: blink 1.05s steps(2, end) infinite;
}

@keyframes blink {
  to { visibility: hidden; }
}

.hero-sub {
  font-size: clamp(15px, 1.4vw, 18px);
  line-height: 1.6;
  color: var(--ink-1);
  max-width: 56ch;
  margin: 0 0 36px;
}
.hero-sub em {
  font-style: normal;
  color: var(--copper);
  font-family: var(--font-mono);
  font-size: 0.92em;
  padding: 0 4px;
  border-bottom: 1px dashed var(--copper);
}

.hero-actions {
  display: flex; gap: 14px; flex-wrap: wrap;
}

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: var(--hair) solid var(--rule-strong);
  background: var(--bg-1);
  color: var(--ink-0);
  cursor: pointer;
  transition: 160ms cubic-bezier(0.2, 0, 0, 1);
  position: relative;
}
.btn:hover {
  border-color: var(--amber);
  color: var(--amber);
  background: var(--bg-2);
}
.btn-primary {
  background: var(--amber);
  color: var(--bg-0);
  border-color: var(--amber);
}
.btn-primary:hover {
  background: var(--copper);
  color: var(--bg-0);
  border-color: var(--copper);
}
.btn-key {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 6px;
  background: rgba(12, 16, 20, 0.18);
  border: 1px solid currentColor;
  border-radius: 2px;
  opacity: 0.75;
}
.btn-ghost { background: transparent; }

/* readout panel on right */
.readout {
  display: flex; flex-direction: column;
  font-family: var(--font-mono);
  font-size: 12px;
  gap: 0;
}
.readout-head {
  display: flex; justify-content: space-between;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: var(--hair) solid var(--rule);
  color: var(--ink-2);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 10px;
}
.readout-row {
  display: grid;
  grid-template-columns: 80px 1fr;
  padding: 7px 0;
  border-bottom: var(--hair) dashed var(--rule);
}
.readout-row:last-child { border-bottom: none; }
.readout-k {
  color: var(--ink-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
  align-self: center;
}
.readout-v {
  color: var(--ink-0);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* status dots + hex */
.dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}
.dot-ok    { background: var(--sage);   box-shadow: 0 0 12px var(--sage); animation: pulse-ok 2.4s ease-in-out infinite; }
.dot-warn  { background: var(--amber);  box-shadow: 0 0 12px var(--amber); }
.dot-err   { background: var(--vermil); box-shadow: 0 0 12px var(--vermil); }
.dot-mute  { background: var(--ink-3); }

@keyframes pulse-ok {
  0%,100% { opacity: 0.7; }
  50%     { opacity: 1; }
}

.hex {
  display: inline-block;
  width: 10px; height: 11px;
  background: currentColor;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  vertical-align: middle;
}

/* =========================================================================
 * sections
 * ========================================================================= */

.section-head {
  display: flex; align-items: baseline; gap: 18px;
  margin: 56px 0 28px;
  padding-bottom: 14px;
  border-bottom: var(--hair) solid var(--rule);
}
.section-idx {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-2);
  letter-spacing: 0.16em;
}
.section-idx::before { content: "// "; color: var(--ink-3); }
.section-head h2 {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 400;
  margin: 0;
  letter-spacing: -0.01em;
}
.section-meta {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-2);
  letter-spacing: 0.06em;
}

/* =========================================================================
 * N0d grid
 * ========================================================================= */

.n0d-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1px;                     /* hairline gutter — looks like a single sheet */
  background: var(--rule);
  border: var(--hair) solid var(--rule);
}

.n0d-tile {
  background: var(--bg-1);
  padding: 22px 22px 18px;
  position: relative;
  display: flex; flex-direction: column;
  gap: 12px;
  min-height: 180px;
  cursor: pointer;
  transition: 160ms ease;
  overflow: hidden;
}
.n0d-tile:hover {
  background: var(--bg-2);
}
.n0d-tile::before {  /* corner brackets, hidden until hover */
  content: "";
  position: absolute;
  inset: 6px;
  pointer-events: none;
  background:
    linear-gradient(to right,  var(--amber), var(--amber)) top    left  / 14px 1px no-repeat,
    linear-gradient(to bottom, var(--amber), var(--amber)) top    left  / 1px  14px no-repeat,
    linear-gradient(to right,  var(--amber), var(--amber)) top    right / 14px 1px no-repeat,
    linear-gradient(to bottom, var(--amber), var(--amber)) top    right / 1px  14px no-repeat,
    linear-gradient(to right,  var(--amber), var(--amber)) bottom left  / 14px 1px no-repeat,
    linear-gradient(to bottom, var(--amber), var(--amber)) bottom left  / 1px  14px no-repeat,
    linear-gradient(to right,  var(--amber), var(--amber)) bottom right / 14px 1px no-repeat,
    linear-gradient(to bottom, var(--amber), var(--amber)) bottom right / 1px  14px no-repeat;
  opacity: 0;
  transition: 200ms ease;
}
.n0d-tile:hover::before { opacity: 1; }

.n0d-tile[data-status="deferred"] {
  background:
    repeating-linear-gradient(
      45deg,
      var(--bg-1) 0 22px,
      var(--bg-2) 22px 23px
    );
}
.n0d-tile[data-status="deferred"] .n0d-glyph,
.n0d-tile[data-status="deferred"] .n0d-title {
  color: var(--ink-2);
}

.n0d-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px;
}
.n0d-idx {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-2);
  letter-spacing: 0.16em;
}
.n0d-glyph {
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 1;
  color: var(--copper);
  margin-top: 4px;
}
.n0d-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  margin: 4px 0 2px;
  letter-spacing: 0;
  color: var(--ink-0);
}
.n0d-tag {
  font-family: var(--font-sans);
  color: var(--ink-1);
  font-size: 13px;
  margin: 0;
  flex-grow: 1;
}
.n0d-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px dashed var(--rule);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.n0d-status {
  display: inline-flex; align-items: center; gap: 6px;
}
.n0d-host {
  color: var(--cyan);
  text-transform: lowercase;
  letter-spacing: 0;
}
.n0d-host::before { content: "→ "; color: var(--ink-3); }

/* category accent stripe at left */
.n0d-tile[data-cat="lab"]   { box-shadow: inset 3px 0 0 0 var(--cyan); }
.n0d-tile[data-cat="ai"]    { box-shadow: inset 3px 0 0 0 var(--copper); }
.n0d-tile[data-cat="reg"]   { box-shadow: inset 3px 0 0 0 var(--sage); }
.n0d-tile[data-cat="net"]   { box-shadow: inset 3px 0 0 0 var(--amber); }
.n0d-tile[data-cat="data"]  { box-shadow: inset 3px 0 0 0 var(--cyan); }
.n0d-tile[data-cat="virt"]  { box-shadow: inset 3px 0 0 0 var(--copper); }
.n0d-tile[data-cat="chat"]  { box-shadow: inset 3px 0 0 0 var(--amber); }
.n0d-tile[data-cat="esp"]   { box-shadow: inset 3px 0 0 0 var(--sage); }
.n0d-tile[data-cat="sim"]   { box-shadow: inset 3px 0 0 0 var(--cyan); }
.n0d-tile[data-cat="sec"]   { box-shadow: inset 3px 0 0 0 var(--vermil); }
.n0d-tile[data-cat="cash"]  { box-shadow: inset 3px 0 0 0 var(--vermil); }

/* =========================================================================
 * system-line readout
 * ========================================================================= */

.sysline {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-1);
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border: var(--hair) solid var(--rule);
  padding: 12px 18px;
  background: var(--bg-1);
  letter-spacing: 0.04em;
  margin-bottom: 36px;
  overflow-x: auto;
}
.sysline-cell {
  padding: 0 14px;
  border-right: 1px dashed var(--rule);
  white-space: nowrap;
}
.sysline-cell:last-child { border-right: none; }
.sysline-k { color: var(--ink-2); text-transform: uppercase; }
.sysline-v { color: var(--ink-0); margin-left: 6px; }
.sysline-v.ok  { color: var(--sage); }
.sysline-v.hot { color: var(--amber); }
.sysline-v.alt { color: var(--cyan); }

/* =========================================================================
 * footer
 * ========================================================================= */

footer {
  margin-top: 96px;
  padding: 28px var(--pad) 36px;
  border-top: var(--hair) solid var(--rule);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-2);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
footer a:hover { color: var(--amber); }
.foot-art {
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.05;
  color: var(--ink-3);
  white-space: pre;
  margin: 16px 0 0;
}

/* =========================================================================
 * misc
 * ========================================================================= */

.muted { color: var(--ink-2); }
.kbd {
  font-family: var(--font-mono);
  background: var(--bg-2);
  padding: 1px 6px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  color: var(--ink-1);
  font-size: 11px;
}

/* page-load reveal */
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
.reveal { animation: rise 600ms cubic-bezier(0.2, 0, 0, 1) both; }
.reveal-d1  { animation-delay:  60ms; }
.reveal-d2  { animation-delay: 140ms; }
.reveal-d3  { animation-delay: 230ms; }
.reveal-d4  { animation-delay: 320ms; }
.reveal-d5  { animation-delay: 410ms; }

/* selection */
::selection { background: var(--amber); color: var(--bg-0); }

/* scrollbar — narrow, ink-2 thumb */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-0); }
::-webkit-scrollbar-thumb { background: var(--rule-strong); }
::-webkit-scrollbar-thumb:hover { background: var(--ink-3); }

/* quick-signup — inline access-request form on the #enter panel.
 * POSTs to usergaten0d /signup cross-origin; CORS allow-* on that side.
 * Strict createElement on the JS side (no innerHTML). */
.quick-signup {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px dashed var(--rule);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.quick-signup-label {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-2);
  letter-spacing: 0.04em;
}
.quick-signup-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: stretch;
}
.quick-signup-row input[type="email"] {
  flex: 1 1 220px;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 13.5px;
  padding: 9px 12px;
  background: var(--bg-0);
  border: 1px solid var(--rule);
  border-radius: 4px;
  color: var(--ink-0);
  outline: none;
  transition: border-color 0.15s;
}
.quick-signup-row input[type="email"]:focus { border-color: var(--accent); }
.quick-signup-row .btn { flex: 0 0 auto; }
.quick-signup-hint {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.6;
  padding: 8px 10px;
  border-radius: 4px;
}
.quick-signup-hint[data-tone="ok"]  { color: #6ec79a; background: rgba(110,199,154,0.06); }
.quick-signup-hint[data-tone="bad"] { color: #c66961; background: rgba(198,105,97,0.06); }

/* ---------- entry-key — replaces sign-in button with a key that
   ejects a 3-field email row (a @ b . c). The shaft slides 50px to
   the right when the form opens; the form fades+expands in beside it. */

.entry-key-wrap {
  --keyfade-bg: rgba(0,0,0,0.0);
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 26px;
  flex-wrap: wrap;
}

.entry-key {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  background: rgba(255, 181, 71, 0.05);
  color: var(--ink-1, #cbd0d8);
  border: 1px solid var(--amber, #ffb547);
  border-radius: 999px;
  font: inherit;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  flex-shrink: 0;
  /* Blinking glow at 2.2s pulse — single CTA, draws the eye */
  animation: entry-key-pulse 2.2s ease-in-out infinite;
}
@keyframes entry-key-pulse {
  0%, 100% {
    box-shadow:
      0 0 14px rgba(255, 181, 71, 0.30),
      inset 0 0 6px rgba(255, 181, 71, 0.10);
    background: rgba(255, 181, 71, 0.05);
  }
  50% {
    box-shadow:
      0 0 0 6px rgba(255, 181, 71, 0.10),
      0 0 28px 4px rgba(255, 181, 71, 0.55),
      inset 0 0 12px rgba(255, 181, 71, 0.18);
    background: rgba(255, 181, 71, 0.18);
  }
}
.entry-key:hover,
.entry-key:focus {
  background: rgba(255, 181, 71, 0.22);
  outline: none;
}
.entry-key:active { transform: scale(0.985); }
.entry-key-wrap[data-state="open"] .entry-key {
  animation: none;
  background: rgba(255, 181, 71, 0.22);
  box-shadow: 0 0 16px rgba(255, 181, 71, 0.40);
}
@media (prefers-reduced-motion: reduce) {
  .entry-key { animation: none; }
}

.entry-key-svg {
  width: 56px;
  height: 28px;
  display: block;
  overflow: visible;
}
.entry-key-bow,
.entry-key-pin,
.entry-key-shaft,
.entry-key-bit1,
.entry-key-bit2 {
  fill: var(--amber, #ffb547);
  stroke: none;
  transition: transform 0.28s cubic-bezier(0.4, 0.1, 0.2, 1);
  transform-origin: 13px 16px;
}
.entry-key-pin   { fill: var(--bg-1, #14171c); }
.entry-key-bow   { fill: none; stroke: var(--amber, #ffb547); stroke-width: 2; }

.entry-key-label {
  color: var(--ink-1, #cbd0d8);
}

/* OPEN state: the key's shaft slides right as if ejecting; bow rotates. */
.entry-key-wrap[data-state="open"] .entry-key-shaft,
.entry-key-wrap[data-state="open"] .entry-key-bit1,
.entry-key-wrap[data-state="open"] .entry-key-bit2 {
  transform: translateX(8px);
}
.entry-key-wrap[data-state="open"] .entry-key-bow,
.entry-key-wrap[data-state="open"] .entry-key-pin {
  transform: rotate(-12deg);
}

/* the ejected form */
.entry-keyform {
  display: none;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.28s ease, transform 0.28s ease;
  flex: 1 1 480px;
  min-width: 280px;
  margin: 0;
}
.entry-key-wrap[data-state="open"] .entry-keyform {
  display: block;
  opacity: 1;
  transform: translateX(0);
}

.entry-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  background: var(--bg-1, #14171c);
  border: 1px solid var(--border, #2a2f37);
  border-radius: 4px;
}
.entry-row input[type="text"] {
  flex: 1 1 0;
  min-width: 60px;
  background: transparent;
  border: none;
  color: var(--ink-0, #e7eaee);
  font: inherit;
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: 14px;
  padding: 6px 8px;
  outline: none;
}
.entry-row input[type="text"]::placeholder {
  color: var(--ink-3, #5a626e);
  font-style: italic;
}
.entry-row input[type="text"]:focus {
  background: rgba(255, 181, 71, 0.05);
}
.entry-row input#entry-a { flex-basis: 32%; }
.entry-row input#entry-b { flex-basis: 32%; }
.entry-row input#entry-c { flex-basis: 14%; }

.entry-sep {
  color: var(--amber, #ffb547);
  font-family: var(--font-mono, monospace);
  font-size: 16px;
  font-weight: 600;
  padding: 0 2px;
  user-select: none;
}

.entry-row .btn {
  margin-left: auto;
  padding: 6px 14px;
  font-size: 12px;
}

.entry-hint {
  margin: 8px 2px 0 2px;
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  color: var(--ink-3, #8a9098);
  letter-spacing: 0.02em;
}
.entry-hint[data-tone="ok"]  { color: #6ed46a; }
.entry-hint[data-tone="bad"] { color: #f06c6c; }

@media (max-width: 720px) {
  .entry-key-wrap { gap: 12px; }
  .entry-row { flex-wrap: wrap; }
  .entry-row .btn { margin-left: 0; width: 100%; margin-top: 4px; }
}
