/* NOMAD — the common ground.
 *
 * The violet is the one in the mark, the cream is the footprint, the dune
 * tones are sampled from the published plates. What changed: the page is not
 * a polite wash any more. Violet is used filled and lit, surfaces are real
 * surfaces, and the display face is a bitmap — because the mark itself is a
 * footprint coming apart into pixels, and the wind in the hero blows those
 * same pixels away.
 */

@import url('https://fonts.googleapis.com/css2?family=Silkscreen:wght@400;700&family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  /* night */
  --void: #05040a;
  --void-2: #0a0714;
  --panel: #120d20;
  --panel-2: #181128;

  /* the mark */
  --violet: #7865fd;
  --violet-hot: #9d8cff;
  --violet-deep: #4a3bc4;
  --violet-wash: rgba(120, 101, 253, 0.14);
  --violet-line: rgba(120, 101, 253, 0.34);

  /* the dunes */
  --dune: #6b57a8;
  --dune-lo: #342a56;

  /* light */
  --sand: #fefbf2;
  --sand-2: rgba(254, 251, 242, 0.76);
  --sand-3: rgba(254, 251, 242, 0.52);
  --sand-4: rgba(254, 251, 242, 0.26);

  /* the sun — the second accent, for what is happening right now */
  --ember: #ff9a4d;
  --ember-wash: rgba(255, 154, 77, 0.14);

  --glow: 0 0 0 1px rgba(120, 101, 253, 0.26), 0 14px 44px -18px rgba(120, 101, 253, 0.65);
  --glow-hot: 0 0 0 1px rgba(157, 140, 255, 0.5), 0 18px 56px -16px rgba(120, 101, 253, 0.9);

  --wide: 1280px;
  --gut: 26px;
  --r: 10px;

  --pixel: 'Silkscreen', ui-monospace, monospace;
  --ui: 'Space Grotesk', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--void);
  color: var(--sand);
  font-family: var(--ui);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* The page sits on a dune field, not on a flat fill. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(128% 44% at 10% 102%, rgba(107, 87, 168, 0.4), transparent 66%),
    radial-gradient(92% 36% at 86% 98%, rgba(120, 101, 253, 0.26), transparent 70%),
    radial-gradient(54% 26% at 72% 2%, rgba(120, 101, 253, 0.14), transparent 72%),
    linear-gradient(to bottom, #05040a 0%, #0b0817 52%, #160f26 100%);
}

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

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.02;
}

/* Display is bitmap. Short lines only — it is a sign, not a paragraph. */
h1 {
  font-family: var(--pixel);
  font-weight: 700;
  font-size: clamp(2.5rem, 6.6vw, 5.2rem);
  letter-spacing: -0.012em;
  line-height: 1.08;
  text-transform: uppercase;
}

h2 {
  font-family: var(--pixel);
  font-weight: 700;
  font-size: clamp(1.55rem, 3.1vw, 2.3rem);
  line-height: 1.12;
  text-transform: uppercase;
}

h3 {
  font-family: var(--ui);
  font-weight: 600;
  font-size: 1.08rem;
  letter-spacing: -0.012em;
}

p {
  margin: 0 0 1em;
  color: var(--sand-2);
  max-width: 64ch;
}

.wrap {
  width: 100%;
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 var(--gut);
}

/* ------------------------------------------------------------------ the mark */

.mark {
  width: 24px;
  height: 24px;
  display: block;
  color: var(--sand);
  flex: none;
}

.mark svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* --------------------------------------------------------------------- chrome */

.top {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(18px) saturate(140%);
  background: linear-gradient(to bottom, rgba(5, 4, 10, 0.94), rgba(5, 4, 10, 0.6));
  border-bottom: 1px solid rgba(120, 101, 253, 0.2);
}

.top-in {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 70px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-family: var(--pixel);
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: 0.02em;
}

/* The nav is a pill group: the page you are on is filled, not underlined. */
.nav {
  display: flex;
  align-items: center;
  gap: 3px;
  margin: 0 auto;
  padding: 4px;
  border: 1px solid rgba(120, 101, 253, 0.2);
  border-radius: 999px;
  background: rgba(18, 13, 32, 0.7);
  font-size: 0.92rem;
  font-weight: 500;
}

.nav a {
  color: var(--sand-3);
  padding: 8px 16px;
  border-radius: 999px;
  transition: color 0.15s, background 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}

.nav a:hover,
.nav a:focus-visible {
  color: var(--sand);
  background: rgba(120, 101, 253, 0.14);
}

.nav a[aria-current='page'] {
  color: var(--sand);
  background: var(--violet);
  box-shadow: 0 6px 20px -8px rgba(120, 101, 253, 0.9);
}

.nav-toggle {
  display: none;
}

/* ------------------------------------------------------------------- controls */

button,
.btn {
  font: inherit;
  font-family: var(--ui);
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 24px;
  border-radius: var(--r);
  border: 1px solid var(--violet);
  background: var(--violet);
  color: #fff;
  font-weight: 700;
  font-size: 0.97rem;
  letter-spacing: -0.005em;
  box-shadow: 0 10px 30px -12px rgba(120, 101, 253, 0.95);
  transition: transform 0.14s, box-shadow 0.14s, background 0.14s, border-color 0.14s;
}

.btn:hover:not(:disabled) {
  background: var(--violet-hot);
  border-color: var(--violet-hot);
  transform: translateY(-1px);
  box-shadow: 0 16px 38px -12px rgba(157, 140, 255, 1);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  box-shadow: none;
}

.btn.ghost {
  background: rgba(24, 17, 40, 0.8);
  color: var(--sand);
  border-color: rgba(120, 101, 253, 0.34);
  box-shadow: none;
}

.btn.ghost:hover:not(:disabled) {
  background: rgba(120, 101, 253, 0.16);
  border-color: var(--violet);
  box-shadow: 0 10px 30px -16px rgba(120, 101, 253, 0.9);
}

.btn.quiet {
  background: transparent;
  border-color: transparent;
  color: var(--sand-3);
  padding: 7px 10px;
  box-shadow: none;
}

.btn.quiet:hover:not(:disabled) {
  color: var(--sand);
  background: rgba(254, 251, 242, 0.06);
}

:focus-visible {
  outline: 2px solid var(--violet-hot);
  outline-offset: 2px;
}

input,
select,
textarea {
  font: inherit;
  font-family: var(--mono);
  font-size: 0.95rem;
  color: var(--sand);
  background: rgba(5, 4, 10, 0.72);
  border: 1px solid rgba(120, 101, 253, 0.26);
  border-radius: 8px;
  padding: 13px 15px;
  width: 100%;
  transition: border-color 0.14s, box-shadow 0.14s;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--violet);
  outline: none;
  box-shadow: 0 0 0 3px rgba(120, 101, 253, 0.18);
}

input::placeholder {
  color: var(--sand-4);
}

label {
  display: block;
  font-size: 0.85rem;
  color: var(--sand-3);
  margin-bottom: 7px;
  font-weight: 500;
}

/* ------------------------------------------------------------------- pieces */

/* A chip: bitmap type, a border, a job. Used for facts, never for decoration. */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--pixel);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--sand-2);
  background: rgba(24, 17, 40, 0.8);
  border: 1px solid rgba(120, 101, 253, 0.3);
  border-radius: 999px;
  padding: 7px 14px;
  white-space: nowrap;
}

.chip.hot {
  color: var(--ember);
  border-color: rgba(255, 154, 77, 0.42);
  background: var(--ember-wash);
}

.chip.on {
  color: #fff;
  background: var(--violet);
  border-color: var(--violet);
}

.chip i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  display: block;
  flex: none;
}

/* A panel: a real surface, lit along the top edge, with a violet halo. */
.panel {
  background: linear-gradient(to bottom, rgba(24, 17, 40, 0.92), rgba(18, 13, 32, 0.92));
  border: 1px solid rgba(120, 101, 253, 0.2);
  border-radius: var(--r);
  padding: 24px;
  position: relative;
}

.panel::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(157, 140, 255, 0.55), transparent);
}

.panel.lift {
  transition: transform 0.16s, box-shadow 0.16s, border-color 0.16s;
}

.panel.lift:hover {
  transform: translateY(-2px);
  border-color: rgba(120, 101, 253, 0.46);
  box-shadow: var(--glow);
}

.num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  font-weight: 500;
}

.hex {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--sand-3);
  word-break: break-all;
}

.dim {
  color: var(--sand-3);
}

.live {
  color: var(--violet-hot);
}

/* ---------------------------------------------------------------- the footer */

.foot {
  border-top: 1px solid rgba(120, 101, 253, 0.2);
  margin-top: 90px;
  padding: 36px 0 64px;
  color: var(--sand-3);
  font-size: 0.92rem;
  background: rgba(5, 4, 10, 0.72);
}

.foot-in {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 32px;
  align-items: center;
}

.foot a {
  transition: color 0.14s;
}

.foot a:hover {
  color: var(--violet-hot);
}

.foot .spacer {
  margin-left: auto;
}

/* ------------------------------------------------------------------- toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(14px);
  background: var(--panel-2);
  border: 1px solid var(--violet-line);
  border-radius: var(--r);
  padding: 14px 20px;
  font-size: 0.94rem;
  max-width: min(560px, calc(100vw - 32px));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 200;
  box-shadow: var(--glow);
}

.toast.on {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.bad {
  border-color: rgba(255, 154, 77, 0.5);
  box-shadow: 0 0 0 1px rgba(255, 154, 77, 0.2), 0 14px 44px -18px rgba(255, 154, 77, 0.6);
}

@media (max-width: 900px) {
  :root {
    --gut: 18px;
  }

  .top-in {
    height: 62px;
  }

  .nav {
    position: fixed;
    inset: 62px 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    background: var(--void-2);
    padding: 10px var(--gut) 16px;
    display: none;
    margin: 0;
  }

  .nav.open {
    display: flex;
  }

  .nav a {
    padding: 13px 14px;
    border-radius: 8px;
  }

  .nav-toggle {
    display: inline-flex;
    margin-left: auto;
    background: rgba(24, 17, 40, 0.8);
    border: 1px solid rgba(120, 101, 253, 0.3);
    border-radius: 8px;
    color: var(--sand);
    padding: 8px 13px;
    font-family: var(--pixel);
    font-size: 0.74rem;
    text-transform: uppercase;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
