/* Escape The Matrix Wiki — dark terminal / cyberpunk theme */
:root {
  --bg: #04080a;
  --bg-2: #071009;
  --panel: #0a1410;
  --panel-2: #0d1a13;
  --line: #1d3a2a;
  --line-soft: #14291e;
  --green: #41ff8b;
  --green-soft: #22c968;
  --cyan: #53d7ff;
  --red: #ff5f6e;
  --amber: #ffc45e;
  --text: #d9e8de;
  --muted: #8fae9e;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 10px;
  --maxw: 880px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    repeating-linear-gradient(0deg, rgba(65, 255, 139, 0.022) 0 1px, transparent 1px 4px),
    radial-gradient(1100px 500px at 85% -5%, rgba(65, 255, 139, 0.07), transparent 60%),
    radial-gradient(900px 480px at -10% 12%, rgba(83, 215, 255, 0.05), transparent 55%),
    linear-gradient(var(--bg), var(--bg-2));
}
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 18px; }

a { color: var(--cyan); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--green); }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 4px; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 50;
  background: var(--panel-2); color: var(--green); padding: 8px 14px; border-radius: 6px; border: 1px solid var(--line);
}
.skip-link:focus { left: 8px; }

/* header */
.site-head {
  position: sticky; top: 0; z-index: 40;
  background: rgba(4, 8, 10, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.head-row { display: flex; align-items: center; gap: 12px; min-height: 56px; flex-wrap: wrap; }
.brand {
  font-family: var(--mono); font-weight: 700; font-size: 15.5px;
  color: var(--text); text-decoration: none; letter-spacing: 0.2px;
  display: inline-flex; align-items: center; gap: 8px;
}
.brand-prompt { color: var(--green); }
.brand:hover span:last-child { color: var(--green); }
.nav { display: none; margin-left: auto; gap: 4px; font-family: var(--mono); font-size: 13.5px; }
.nav a { color: var(--muted); text-decoration: none; padding: 7px 10px; border-radius: 6px; }
.nav a:hover { color: var(--green); background: rgba(65, 255, 139, 0.07); }
.nav-toggle {
  margin-left: auto; background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 6px; padding: 7px 12px;
  font-family: var(--mono); font-size: 13px; cursor: pointer;
}
body.nav-open .nav {
  display: flex; flex-direction: column; flex-basis: 100%;
  padding: 6px 0 12px;
}
@media (min-width: 720px) {
  .nav { display: flex; flex-direction: row; }
  .nav-toggle { display: none; }
}

/* hero */
.hero { padding: 34px 0 26px; }
.kicker { font-family: var(--mono); color: var(--green); font-size: 13px; margin: 0 0 10px; letter-spacing: 0.4px; }
.hero h1 {
  margin: 0 0 12px;
  font-family: var(--mono); font-weight: 800;
  font-size: clamp(30px, 7vw, 44px); line-height: 1.12;
  color: #f2fbf5;
  text-shadow: 0 0 24px rgba(65, 255, 139, 0.25);
}
.hero-sub { margin: 0 0 18px; color: var(--muted); max-width: 62ch; }
.status-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  font-family: var(--mono); font-size: 12.5px; color: var(--muted);
  border: 1px solid var(--line); background: var(--panel);
  padding: 5px 12px; border-radius: 999px;
}
.pill strong { color: var(--text); }
.pill-green { color: #bfffd9; border-color: rgba(65, 255, 139, 0.4); background: rgba(65, 255, 139, 0.08); }
.pill-green strong { color: var(--green); }
.pill-ghost { border-style: dashed; }

/* panels */
.panel {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 18px 18px;
  margin: 0 0 22px;
  overflow: hidden;
}
.panel-bar {
  display: flex; align-items: center; gap: 6px;
  margin: 0 -18px 14px; padding: 9px 14px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(65, 255, 139, 0.03);
}
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot-g { background: var(--green-soft); } .dot-c { background: var(--cyan); } .dot-r { background: var(--red); }
.panel-bar-label { margin-left: 8px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.panel h2 {
  margin: 4px 0 8px;
  font-family: var(--mono); font-size: clamp(20px, 4.4vw, 25px); line-height: 1.25;
  color: #eefaf3;
}
.panel-note { color: var(--muted); font-size: 15px; margin: 0 0 14px; }

/* code rows */
.code-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.code-row {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "tag dead" "reward dead" "btn dead";
  gap: 4px 10px;
  align-items: center;
  border: 1px solid var(--line);
  background: rgba(4, 8, 10, 0.55);
  border-radius: 8px;
  padding: 10px 12px;
}
.code-tag {
  grid-area: tag;
  font-family: var(--mono); font-weight: 700; font-size: 16.5px; letter-spacing: 0.6px;
  color: var(--green);
  background: rgba(65, 255, 139, 0.07);
  border: 1px dashed rgba(65, 255, 139, 0.35);
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  justify-self: start;
  overflow-wrap: anywhere;
}
.code-reward { grid-area: reward; color: var(--text); font-size: 14.5px; }
.copy-btn {
  grid-area: btn;
  justify-self: start;
  margin-top: 4px;
  font-family: var(--mono); font-size: 12.5px; font-weight: 700;
  color: #04170c; background: var(--green);
  border: none; border-radius: 6px; padding: 7px 16px; cursor: pointer;
}
.copy-btn:hover { background: #6effa8; }
.copy-btn.copied { background: var(--cyan); }
.code-dead {
  grid-area: dead; align-self: start;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.5px;
  color: var(--red); border: 1px solid rgba(255, 95, 110, 0.4);
  background: rgba(255, 95, 110, 0.08);
  border-radius: 999px; padding: 3px 10px;
}
.code-row.expired { opacity: 0.75; }
.code-row.expired .code-tag {
  color: var(--muted); border-color: var(--line); background: transparent; text-decoration: line-through;
  cursor: default;
}
@media (min-width: 640px) {
  .code-row { grid-template-columns: minmax(170px, 220px) 1fr auto; grid-template-areas: "tag reward btn"; }
  .code-dead { grid-area: btn; }
}

/* redeem steps */
.steps { margin: 0; padding: 0 0 0 4px; list-style: none; counter-reset: step; }
.steps li {
  counter-increment: step;
  position: relative; padding: 0 0 14px 44px;
}
.steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute; left: 0; top: 1px;
  font-family: var(--mono); font-weight: 700; font-size: 13px;
  color: var(--green); background: rgba(65, 255, 139, 0.09);
  border: 1px solid rgba(65, 255, 139, 0.35);
  border-radius: 6px; padding: 3px 7px;
}
.steps li:not(:last-child)::after {
  content: ""; position: absolute; left: 13px; top: 30px; bottom: 2px; width: 1px;
  background: linear-gradient(var(--line), transparent);
}

/* faq */
.faq-list { display: flex; flex-direction: column; gap: 8px; }
.faq-item { border: 1px solid var(--line); border-radius: 8px; background: rgba(4, 8, 10, 0.5); }
.faq-item summary {
  cursor: pointer; padding: 11px 14px;
  font-family: var(--mono); font-size: 14.5px; color: #e4f6ea; font-weight: 600;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before { content: "> "; color: var(--green); }
.faq-item[open] summary { color: var(--green); border-bottom: 1px dashed var(--line-soft); }
.faq-item p { margin: 10px 14px 12px; color: var(--muted); font-size: 15px; }

/* guide cards */
.guide-cards, .post-next { margin: 0 0 22px; }
.guide-cards h2, .post-next h2 {
  font-family: var(--mono); font-size: clamp(20px, 4.4vw, 25px); color: #eefaf3; margin: 0 0 14px;
}
.card-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 680px) { .card-grid { grid-template-columns: 1fr 1fr; } }
.card {
  display: flex; flex-direction: column; gap: 8px;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; text-decoration: none; color: var(--text);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.card:hover { border-color: var(--green); transform: translateY(-2px); }
.card h3 { margin: 0; font-family: var(--mono); font-size: 16.5px; line-height: 1.35; color: #f0faf4; }
.card p { margin: 0; color: var(--muted); font-size: 14.5px; flex-grow: 1; }
.card-tag {
  align-self: flex-start;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.6px; text-transform: uppercase;
  color: var(--cyan); border: 1px solid rgba(83, 215, 255, 0.35); border-radius: 999px; padding: 2px 10px;
}
.card-go { font-family: var(--mono); font-size: 13px; color: var(--green); }

/* article */
.post { padding: 28px 0 6px; }
.crumb { font-family: var(--mono); font-size: 12.5px; color: var(--muted); margin: 0 0 16px; }
.crumb a { color: var(--green); text-decoration: none; }
.crumb-sep { margin: 0 6px; color: var(--line); }
.post-head { margin-bottom: 20px; }
.post-head h1 {
  margin: 0 0 10px; font-family: var(--mono); font-weight: 800;
  font-size: clamp(27px, 6vw, 38px); line-height: 1.15; color: #f2fbf5;
  text-shadow: 0 0 22px rgba(65, 255, 139, 0.2);
}
.post-lead { color: var(--muted); margin: 0; max-width: 64ch; }
.post-body { font-size: 16.5px; }
.post-body h2 {
  font-family: var(--mono); font-size: clamp(20px, 4.4vw, 25px); line-height: 1.3;
  color: #eefaf3; margin: 34px 0 12px;
  padding-top: 14px; border-top: 1px solid var(--line-soft);
}
.post-body h2:first-child { border-top: none; padding-top: 0; margin-top: 0; }
.post-body h3 { font-family: var(--mono); font-size: 18px; color: #d9f4e4; margin: 24px 0 8px; }
.post-body p { margin: 0 0 14px; color: #cfe3d7; }
.post-body ul, .post-body ol { margin: 0 0 16px; padding-left: 22px; color: #cfe3d7; }
.post-body li { margin-bottom: 6px; }
.post-body a { color: var(--cyan); }
.post-body strong { color: #f0fbf4; }
.post-body code {
  font-family: var(--mono); font-size: 14.5px; color: var(--green);
  background: rgba(65, 255, 139, 0.08); border: 1px solid rgba(65, 255, 139, 0.22);
  border-radius: 5px; padding: 1px 6px;
}
.post-body table { width: 100%; border-collapse: collapse; margin: 0 0 18px; font-size: 14.5px; }
.post-body th, .post-body td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.post-body th { font-family: var(--mono); color: var(--green); background: rgba(65, 255, 139, 0.05); }
.post-body blockquote {
  margin: 0 0 16px; padding: 10px 16px; border-left: 3px solid var(--green);
  background: rgba(65, 255, 139, 0.05); color: var(--muted); border-radius: 0 8px 8px 0;
}
.post-body img { max-width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--line); }
.post-next { margin-top: 30px; }

/* codes terminal widget */
.widget-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.widget-head h2 { margin-bottom: 2px; }
.btn-fs { padding: 7px 14px; font-size: 12.5px; }
.stage {
  position: relative;
  height: 400px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(4, 8, 10, 0.6);
  overflow: hidden;
}
.stage iframe { width: 100%; height: 100%; border: 0; display: block; background: transparent; }
.stage[data-gf-state="playing"] .loader { display: none; }
.loader {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  color: var(--muted); font-family: var(--mono); font-size: 13px;
}
.loader-ring {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px dashed var(--green);
  animation: etm-spin 1.1s linear infinite;
}
@keyframes etm-spin { to { transform: rotate(360deg); } }

/* embed pages (framed widgets) */
body.embed-mode { background: transparent; }
body.embed-mode::before { display: none; }
body.embed-mode .site-head, body.embed-mode .site-foot, body.embed-mode .skip-link { display: none; }
body.embed-mode main.wrap { padding: 8px; max-width: none; }
.embed-root { display: flex; flex-direction: column; height: 100%; }
.embed-head {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 12px; color: var(--muted);
  border-bottom: 1px dashed var(--line-soft);
  padding-bottom: 8px; margin-bottom: 10px;
}
.embed-title { color: var(--green); font-weight: 700; }
.embed-rows { gap: 6px; flex: 1; overflow-y: auto; min-height: 0; }
.embed-rows .code-row { padding: 7px 9px; grid-template-columns: minmax(110px, 150px) 1fr auto; grid-template-areas: "tag reward btn"; }
.embed-rows .code-tag { font-size: 13.5px; padding: 4px 8px; }
.embed-rows .code-reward { font-size: 12.5px; color: var(--muted); }
.embed-rows .copy-btn { margin-top: 0; padding: 5px 12px; font-size: 11.5px; }
.embed-foot { text-align: center; margin: 10px 0 0; font-family: var(--mono); font-size: 12.5px; }

/* engage */
.engage { border-top: 1px solid var(--line); margin: 30px 0 26px; padding-top: 20px; }
.engage-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 18px; }
.btn {
  font-family: var(--mono); font-size: 13.5px; font-weight: 600;
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 16px; cursor: pointer;
}
.btn:hover { border-color: var(--green); color: var(--green); }
.btn-like[aria-pressed="true"] { background: rgba(255, 95, 110, 0.12); border-color: var(--red); color: var(--red); }
.like-count { font-weight: 700; }
.share-msg { font-family: var(--mono); font-size: 12.5px; color: var(--green); }
.engage-comments-count { font-family: var(--mono); font-size: 12.5px; color: var(--muted); margin-left: auto; }
.comments-title { font-family: var(--mono); font-size: 18px; color: #eefaf3; margin: 0 0 4px; }
.comments-hint { color: var(--muted); font-size: 14px; margin: 0 0 14px; }
.comment {
  border: 1px solid var(--line); border-radius: 8px; background: rgba(4, 8, 10, 0.5);
  padding: 10px 14px; margin-bottom: 10px;
}
.comment[data-gf-owner] { border-color: rgba(83, 215, 255, 0.45); }
.comment-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.c-name { font-family: var(--mono); font-weight: 700; font-size: 13.5px; color: var(--cyan); }
.c-owner-tag {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.5px; text-transform: uppercase;
  color: var(--cyan); border: 1px solid rgba(83, 215, 255, 0.4); border-radius: 999px; padding: 1px 8px;
}
.c-time { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.c-text { margin: 0 0 6px; color: #d5e6db; font-size: 15px; overflow-wrap: anywhere; }
.c-actions { display: flex; align-items: center; gap: 10px; }
.c-reply-btn {
  background: none; border: none; color: var(--muted); font-family: var(--mono);
  font-size: 12.5px; cursor: pointer; padding: 2px 0;
}
.c-reply-btn:hover { color: var(--green); }
.c-replying-to { font-family: var(--mono); font-size: 12px; color: var(--cyan); }
.c-replies { margin-top: 10px; padding-left: 14px; border-left: 2px solid var(--line-soft); }
.comment-reply .c-text { font-size: 14px; }
.comments-empty { color: var(--muted); font-size: 14px; font-style: italic; }
[data-gf-comments]:not([data-gf-empty]) .comments-empty { display: none; }
.comment-form { margin-top: 16px; }
.comment-form-row { margin-bottom: 10px; }
.comment-form input, .comment-form textarea {
  width: 100%; background: rgba(4, 8, 10, 0.6); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; font-family: var(--sans); font-size: 15px;
}
.comment-form input:focus, .comment-form textarea:focus { outline: none; border-color: var(--green); }
.comment-form-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.btn-post { background: var(--green); color: #04170c; border-color: var(--green); }
.btn-post:hover { background: #6effa8; color: #04170c; }
.c-reply-cancel { background: none; border: none; color: var(--muted); font-family: var(--mono); font-size: 12.5px; cursor: pointer; }
.c-reply-cancel:hover { color: var(--red); }
.comment-msg { font-family: var(--mono); font-size: 13px; color: var(--green); min-height: 1.2em; margin: 6px 0 0; }

/* 404 */
.notfound-panel { margin-top: 40px; }
.nf-title { color: var(--red); text-shadow: none; }
.nf-text { color: var(--muted); }

/* footer */
.site-foot { border-top: 1px solid var(--line); margin-top: 30px; padding: 26px 0 30px; background: rgba(7, 16, 9, 0.6); }
.foot-grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 680px) { .foot-grid { grid-template-columns: 1.4fr 1fr; } }
.brand-foot { font-family: var(--mono); font-weight: 700; color: var(--text); margin: 0 0 8px; }
.foot-note { color: var(--muted); font-size: 13.5px; margin: 0; max-width: 48ch; }
.foot-nav { display: flex; flex-wrap: wrap; gap: 6px 16px; font-family: var(--mono); font-size: 13px; align-content: start; }
.foot-nav a { color: var(--muted); text-decoration: none; }
.foot-nav a:hover { color: var(--green); }
.copyright { color: var(--muted); font-size: 12.5px; font-family: var(--mono); margin: 18px auto 0; }

main { padding-bottom: 10px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
