/* Ridz' // THE SENTINEL INITIATIVE — shared styles */
:root {
  --bg: #070b17;
  --bg-2: #0c1226;
  --panel: #111a35;
  --panel-2: #16214a;
  --line: #22305f;
  --text: #e6ebff;
  --muted: #8c97c2;
  --accent: #3ee8ff;      /* sentinel cyan */
  --pac: #ffd23f;         /* pac-man yellow */
  --brick: #ff4b4b;       /* lego red */
  --ok: #3ddc97;
  --low: #3ddc97;
  --med: #ffd23f;
  --high: #ff9f43;
  --crit: #ff4b4b;
  --radius: 14px;
  --mono: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(62,232,255,.08), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(255,210,63,.05), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.55;
  min-height: 100vh;
  display: flex; flex-direction: column;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
main { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 28px 20px 60px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* ---------- header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(7,11,23,.85); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav { max-width: 1180px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.brand { font-family: var(--mono); font-weight: 700; color: var(--text); letter-spacing: .02em; display: flex; align-items: center; gap: 10px; }
.brand:hover { text-decoration: none; }
.brand .slash { color: var(--accent); }
.brand .pac { width: 18px; height: 18px; border-radius: 50%; background: conic-gradient(from 120deg, transparent 0 60deg, var(--pac) 60deg 360deg); }
.nav-links { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.nav-links a { color: var(--muted); padding: 6px 10px; border-radius: 8px; font-size: .92rem; }
.nav-links a:hover { color: var(--text); background: var(--panel); text-decoration: none; }
.nav-links a.active { color: var(--bg); background: var(--accent); font-weight: 600; }
.nav-links a.soon { opacity: .55; }
.tag-soon { font-size: .65rem; font-family: var(--mono); color: var(--pac); margin-left: 4px; vertical-align: super; }

.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.site-footer .inner { max-width: 1180px; margin: 0 auto; padding: 18px 20px; display: flex; gap: 12px; flex-wrap: wrap; justify-content: space-between; }

/* ---------- panels / cards ---------- */
.panel { background: linear-gradient(180deg, var(--panel), var(--bg-2)); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 620px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
.section { margin-top: 40px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.kicker { font-family: var(--mono); color: var(--accent); font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; }

/* lego-stud tiles */
.tile { position: relative; display: block; color: var(--text); padding: 26px 20px 20px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); transition: transform .15s, border-color .15s; }
.tile:hover { transform: translateY(-3px); border-color: var(--accent); text-decoration: none; }
.tile .studs { position: absolute; top: 10px; left: 20px; display: flex; gap: 6px; }
.tile .studs i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); box-shadow: inset 0 -2px 0 rgba(0,0,0,.3); }
.tile:hover .studs i:nth-child(1) { background: var(--brick); }
.tile:hover .studs i:nth-child(2) { background: var(--pac); }
.tile:hover .studs i:nth-child(3) { background: var(--accent); }
.tile .ico { font-size: 1.6rem; }
.tile h3 { margin: 8px 0 4px; }
.tile p { margin: 0; color: var(--muted); font-size: .9rem; }
.tile.disabled { opacity: .55; pointer-events: none; }

/* ---------- hero ---------- */
.hero { padding: 40px 0 10px; display: grid; grid-template-columns: 1.4fr 1fr; gap: 30px; align-items: center; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; } }
.hero h1 { font-family: var(--mono); font-size: clamp(1.9rem, 4.4vw, 3.1rem); letter-spacing: -.01em; }
.hero h1 .who { color: var(--pac); }
.hero h1 .slash { color: var(--accent); }
.hero p.lead { font-size: 1.1rem; color: var(--muted); max-width: 60ch; }
.pac-trail { display: flex; align-items: center; gap: 14px; margin: 18px 0; height: 34px; overflow: hidden; }
.pac-trail .pacman { width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--pac); animation: chomp .35s infinite alternate; }
@keyframes chomp {
  from { clip-path: polygon(50% 50%, 100% 15%, 100% 0, 0 0, 0 100%, 100% 100%, 100% 85%); }
  to   { clip-path: polygon(50% 50%, 100% 48%, 100% 0, 0 0, 0 100%, 100% 100%, 100% 52%); }
}
.pac-trail .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); opacity: .8; flex: none; }
.pac-trail .ghost { font-size: 1.4rem; flex: none; }
.terminal { font-family: var(--mono); font-size: .85rem; background: #050811; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; color: #b9c4ee; }
.terminal .p { color: var(--ok); }
.terminal .c { color: var(--muted); }
.terminal .y { color: var(--pac); }

/* ---------- stats ---------- */
.stat { padding: 16px 18px; }
.stat .v { font-family: var(--mono); font-size: 1.8rem; font-weight: 700; }
.stat .l { color: var(--muted); font-size: .85rem; }

/* ---------- lists ---------- */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.feed li:last-child { border-bottom: 0; }
.feed .meta { font-size: .78rem; color: var(--muted); font-family: var(--mono); }
.feed .t { display: block; color: var(--text); font-weight: 500; }
.feed a.t:hover { color: var(--accent); }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; font-family: var(--mono); font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; border: 1px solid currentColor; white-space: nowrap; }
.b-low { color: var(--low); } .b-med { color: var(--med); } .b-high { color: var(--high); } .b-crit { color: var(--crit); }
.b-kev { color: var(--brick); background: rgba(255,75,75,.12); }
.b-info { color: var(--accent); }
.b-solid.b-low { background: var(--low); color: #04210f; border-color: var(--low); }
.b-solid.b-med { background: var(--med); color: #2a2000; border-color: var(--med); }
.b-solid.b-high { background: var(--high); color: #2a1300; border-color: var(--high); }
.b-solid.b-crit { background: var(--crit); color: #fff; border-color: var(--crit); }

.notice { border: 1px dashed var(--pac); color: var(--pac); background: rgba(255,210,63,.06); border-radius: 10px; padding: 10px 14px; font-size: .88rem; margin-bottom: 16px; }

/* ---------- forms ---------- */
label { display: block; font-weight: 600; font-size: .9rem; margin: 12px 0 6px; }
input[type=text], input[type=search], textarea, select {
  width: 100%; background: #070c1c; color: var(--text); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font: inherit; font-size: .95rem;
}
textarea { min-height: 72px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.hint { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1 1 180px; }
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); padding: 9px 14px; border-radius: 10px; font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; }
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn.primary { background: var(--accent); color: #021318; border-color: var(--accent); }
.btn.pac { background: var(--pac); color: #2a2000; border-color: var(--pac); }
.btn.danger { color: var(--crit); }
.btn.sm { padding: 5px 10px; font-size: .8rem; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { border: 1px solid var(--line); background: #0a1124; color: var(--muted); padding: 5px 10px; border-radius: 999px; font-size: .8rem; cursor: pointer; font-family: inherit; }
.chip:hover { color: var(--text); border-color: var(--accent); }
.chip.on { color: #021318; background: var(--accent); border-color: var(--accent); font-weight: 600; }
.checks { display: flex; gap: 14px; flex-wrap: wrap; }
.checks label { font-weight: 400; display: flex; gap: 6px; align-items: center; margin: 4px 0; }

/* ---------- builder ---------- */
.builder { display: grid; grid-template-columns: 1.25fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 960px) { .builder { grid-template-columns: 1fr; } }
.step { margin-bottom: 16px; }
.step-head { display: flex; align-items: center; gap: 10px; }
.step-num { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-family: var(--mono); font-weight: 700; background: var(--panel-2); border: 1px solid var(--line); color: var(--accent); flex: none; }
.step.done .step-num { background: var(--pac); color: #2a2000; border-color: var(--pac); }
.step-head h3 { margin: 0; }
.preview { position: sticky; top: 80px; }
.statement { font-size: 1.02rem; background: #050811; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 10px; padding: 16px; min-height: 120px; white-space: pre-wrap; }
.statement .ph { color: #55608c; font-style: italic; }
.statement b { color: var(--pac); font-weight: 600; }
.meta-list { list-style: none; padding: 0; margin: 12px 0; font-size: .88rem; }
.meta-list li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.meta-list li span:first-child { color: var(--muted); }

/* 5x5 matrix */
.matrix { display: grid; grid-template-columns: 28px repeat(5, 1fr); gap: 4px; font-family: var(--mono); font-size: .75rem; }
.matrix .cell { aspect-ratio: 1.4; border-radius: 6px; display: grid; place-items: center; color: rgba(0,0,0,.75); font-weight: 700; opacity: .4; border: 2px solid transparent; }
.matrix .cell.sel { opacity: 1; border-color: #fff; box-shadow: 0 0 0 3px rgba(62,232,255,.4); }
.matrix .cell.has { opacity: 1; }
.matrix .ax { display: grid; place-items: center; color: var(--muted); }
.c-low { background: var(--low); } .c-med { background: var(--med); } .c-high { background: var(--high); } .c-crit { background: var(--crit); color: #fff !important; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; cursor: pointer; white-space: nowrap; }
tr:hover td { background: rgba(62,232,255,.03); }
td .desc { color: var(--muted); font-size: .83rem; margin-top: 4px; }

/* tabs */
.tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs button { background: transparent; border: 1px solid var(--line); color: var(--muted); padding: 8px 14px; border-radius: 10px; font: inherit; cursor: pointer; }
.tabs button.on { background: var(--panel-2); color: var(--text); border-color: var(--accent); }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--pac); color: #2a2000; font-weight: 700; padding: 10px 18px; border-radius: 999px; opacity: 0; transition: .2s; z-index: 50; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.empty { color: var(--muted); text-align: center; padding: 28px 10px; }
