/* Squatch Mesh site. Dark, precise, terminal-adjacent.
   Palette matches the firmware's Squatch theme so the site and the device agree. */

:root {
  --bg: #060a09;
  --panel: #0b120e;
  --line: #16241c;
  --accent: #3dffa8;
  --accent-dim: #1f6f4e;
  --text: #b9d4c6;
  --muted: #6f9384;
  --amber: #e6b955;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --display: "Space Grotesk", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* The living mesh sits behind everything and never intercepts clicks. */
#mesh-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* Faint grid + scanlines for texture. Deliberately under 3% so text stays readable. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(61, 255, 168, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(61, 255, 168, 0.025) 1px, transparent 1px);
  background-size: 32px 32px;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg, rgba(0, 0, 0, 0.22) 0px, rgba(0, 0, 0, 0.22) 1px, transparent 1px, transparent 3px);
  opacity: 0.35;
}

.wrap { position: relative; z-index: 2; max-width: 1060px; margin: 0 auto; padding: 0 22px; }

/* ---- nav ------------------------------------------------------------- */
header.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid transparent;
  transition: background 0.25s, border-color 0.25s, backdrop-filter 0.25s;
}
header.nav.stuck {
  background: rgba(6, 10, 9, 0.82);
  backdrop-filter: blur(9px);
  border-bottom-color: var(--line);
}
.nav-inner { display: flex; align-items: center; gap: 26px; height: 60px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 700; letter-spacing: 0.08em; }
.logo .dots { display: grid; grid-template-columns: repeat(3, 5px); gap: 3px; }
.logo .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent-dim); display: block; }
.logo .dots i:nth-child(1), .logo .dots i:nth-child(5) { background: var(--accent); box-shadow: 0 0 7px var(--accent); }
.nav a.link { color: var(--muted); text-decoration: none; font-size: 13px; letter-spacing: 0.04em; }
.nav a.link:hover, .nav a.link[aria-current="page"] { color: var(--accent); }
.nav .spacer { flex: 1; }
.nav-links { display: flex; gap: 18px; }

.btn {
  display: inline-block;
  border: 1px solid var(--accent-dim);
  color: var(--accent);
  background: rgba(61, 255, 168, 0.05);
  padding: 9px 16px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 0.05em;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.25s, border-color 0.25s;
}
.btn:hover { border-color: var(--accent); box-shadow: 0 0 18px rgba(61, 255, 168, 0.18); }
.btn:active { transform: scale(0.97); }
.btn.solid { background: var(--accent); color: #04120c; border-color: var(--accent); font-weight: 700; }
.btn.solid:hover { box-shadow: 0 0 26px rgba(61, 255, 168, 0.4); }
/* mint sweep on hover */
.btn::after {
  content: "";
  position: absolute;
  top: 0; left: -60%;
  width: 40%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(61, 255, 168, 0.28), transparent);
  transform: skewX(-20deg);
  transition: left 0.5s;
}
.btn:hover::after { left: 120%; }

/* ---- type ------------------------------------------------------------ */
h1, h2, h3 { font-family: var(--display); color: #e8f2ed; letter-spacing: -0.01em; line-height: 1.15; }
h1 { font-size: clamp(30px, 5.2vw, 52px); margin: 0 0 14px; }
h2 { font-size: clamp(22px, 3.2vw, 32px); margin: 54px 0 16px; }
h3 { font-size: 18px; margin: 0 0 8px; }
p { margin: 0 0 14px; }
a { color: var(--accent); }
.sub { color: var(--muted); font-size: 16px; max-width: 60ch; }
.tag { color: var(--accent-dim); font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; }

/* ---- panels / cards -------------------------------------------------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px 22px;
}
.grid { display: grid; gap: 16px; }
.grid.c2 { grid-template-columns: repeat(2, 1fr); }
.grid.c3 { grid-template-columns: repeat(3, 1fr); }
.grid.c4 { grid-template-columns: repeat(4, 1fr); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 18px; text-decoration: none; color: inherit; display: block; position: relative; transition: border-color 0.25s, transform 0.25s; }
.card:hover { border-color: var(--accent-dim); transform: translateY(-2px); }
.card .k { color: var(--accent); font-size: 13px; letter-spacing: 0.06em; }
.card p { color: var(--muted); font-size: 13px; margin: 6px 0 0; }

/* ---- device screen frame --------------------------------------------- */
.screen {
  display: block;
  width: 100%;
  aspect-ratio: 480 / 222;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #000;
  image-rendering: pixelated;
  box-shadow: 0 0 34px rgba(61, 255, 168, 0.09);
  transition: box-shadow 0.3s;
}
.screen:hover { box-shadow: 0 0 46px rgba(61, 255, 168, 0.2); }
figure { margin: 0; }
figcaption { color: var(--muted); font-size: 12px; margin-top: 7px; letter-spacing: 0.05em; }

/* ---- hero ------------------------------------------------------------ */
.hero { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 44px; align-items: center; padding: 66px 0 34px; }
.hero .meta { color: var(--muted); font-size: 12px; margin-top: 16px; letter-spacing: 0.06em; }
.hero-art { position: relative; }
.hero-art .pager { position: absolute; right: -6%; bottom: -14%; width: 62%; opacity: 0.5; transform: rotate(6deg); border-radius: 10px; filter: saturate(0.85); }
.float { animation: float 7s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }

/* ---- ticker ---------------------------------------------------------- */
.ticker { border-block: 1px solid var(--line); background: rgba(11, 18, 14, 0.6); overflow: hidden; white-space: nowrap; padding: 7px 0; position: relative; z-index: 2; }
.ticker .run { display: inline-block; animation: run 46s linear infinite; color: var(--muted); font-size: 12px; letter-spacing: 0.04em; }
.ticker .run span { margin-right: 34px; }
.ticker .run b { color: var(--accent-dim); font-weight: 400; }
@keyframes run { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---- misc ------------------------------------------------------------ */
.kbd { display: inline-block; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 1px 7px; font-size: 12px; color: var(--text); background: #0d1712; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--accent-dim); font-weight: 400; letter-spacing: 0.06em; }
code { background: #0d1712; border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; font-size: 12.5px; color: var(--accent); }
.warn { border-color: #3a3012; background: rgba(230, 185, 85, 0.06); }
.warn b { color: var(--amber); }
footer { border-top: 1px solid var(--line); margin-top: 70px; padding: 26px 0 44px; color: var(--muted); font-size: 12.5px; }
footer a { color: var(--muted); }
footer a:hover { color: var(--accent); }
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s, transform 0.6s; }
.reveal.in { opacity: 1; transform: none; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 26px; padding-top: 34px; }
  .grid.c2, .grid.c3, .grid.c4 { grid-template-columns: 1fr; }
  .nav-links { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .float, .ticker .run { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* Keyboard users need to see where they are. */
a:focus-visible, button:focus-visible, .btn:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px;
}

/* Privacy notice */
.notice {
  position: fixed; left: 50%; bottom: 18px; z-index: 50;
  width: min(560px, calc(100% - 28px));
  /* Visible by default: the slide-in is decoration, so the notice never depends
     on an animation frame arriving (a hidden tab may never deliver one). */
  transform: translate(-50%, 0);
  animation: notice-in .3s ease-out;
  transition: opacity .25s ease, transform .25s ease;
  background: var(--panel); border: 1px solid var(--accent-dim); border-radius: 12px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, .55);
  padding: 14px 18px 16px; text-align: center; font-size: 13.5px; color: var(--text);
}
@keyframes notice-in { from { transform: translate(-50%, 16px); } to { transform: translate(-50%, 0); } }
.notice.gone { opacity: 0; transform: translate(-50%, 16px); }
.notice p { margin: 0 0 12px; line-height: 1.55; }
.notice b { color: var(--accent); font-weight: 600; }
.notice .btn { padding: 7px 22px; }
@media (prefers-reduced-motion: reduce) { .notice { transition: none; animation: none; } }
