/* ==========================================================================
   DAILYCHEATCODES.COM — neutral glass theme, one terminal-green accent
   ----------------------------------------------------------------------
    1. Tokens          6. Article             11. Buttons
    2. Base            7. Prose               12. Sidebar
    3. Backdrop        8. Cards & callouts    13. Footer & social
    4. Header          9. Tables & figures    14. Fallbacks & motion
    5. Layout         10. Tool workbenches    15. Responsive
   ========================================================================== */

/* 1. Tokens ----------------------------------------------------------- */
:root {
  --bg: #0a0d11;

  --ink: #eef0f3;
  --ink-body: #c8ccd3;
  --ink-muted: #9aa0aa;
  --ink-subtle: #6e7480;

  /* One accent, used for interaction only (links, primary button, focus, active) */
  --accent: #5ee39f;
  --accent-hover: #93ecbe;
  --accent-ink: #052014;
  --accent-soft: rgba(94, 227, 159, 0.12);

  --glass: rgba(17, 20, 26, 0.52);
  --glass-lite: rgba(255, 255, 255, 0.035);
  --glass-hover: rgba(255, 255, 255, 0.065);
  --glass-border: rgba(255, 255, 255, 0.09);
  --glass-border-hi: rgba(255, 255, 255, 0.16);
  --glass-blur: blur(22px) saturate(140%);
  --glass-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 20px 50px rgba(0, 0, 0, 0.35);
  --inset: rgba(0, 0, 0, 0.24);
  --field: rgba(0, 0, 0, 0.35);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --font-display: var(--font-mono);

  --radius-lg: 18px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-pill: 999px;

  --page-w: 1220px;
  --header-h: 68px;
}

/* 2. Base ------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink-body);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; color: var(--ink); font-family: var(--font-display); font-weight: 700; line-height: 1.25; letter-spacing: -0.03em; }
p { margin: 0; }
img, svg { max-width: 100%; }

a { color: var(--accent); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

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

.container { width: 100%; max-width: var(--page-w); margin-inline: auto; padding-inline: 28px; }

/* 3. Backdrop: drifting haze + grid ---------------------------------- */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

body::before {
  inset: -20%;
  background:
    radial-gradient(36% 32% at 80% 16%, rgba(94, 227, 159, 0.08), transparent 70%),
    radial-gradient(38% 34% at 16% 24%, rgba(80, 104, 136, 0.16), transparent 70%),
    radial-gradient(40% 36% at 72% 84%, rgba(56, 72, 100, 0.16), transparent 70%),
    radial-gradient(28% 26% at 24% 88%, rgba(94, 227, 159, 0.04), transparent 70%);
  filter: blur(60px);
  animation: drift 32s ease-in-out infinite alternate;
}

body::after {
  background:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px) 0 0 / 56px 56px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px) 0 0 / 56px 56px,
    radial-gradient(ellipse at center, transparent 40%, rgba(5, 6, 9, 0.75) 100%);
}

@keyframes drift {
  from { transform: translate3d(0, 0, 0) rotate(0deg); }
  to { transform: translate3d(3%, -2%, 0) rotate(6deg); }
}

/* Shared glass surface: only top-level panels */
.site-header,
.article,
.side-box,
.site-footer {
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
}

/* 4. Header ----------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 13, 17, 0.62);
  border-width: 0 0 1px;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: var(--header-h);
}

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { color: var(--ink); text-decoration: none; }
.brand__mark { width: 32px; height: 32px; flex-shrink: 0; }
.brand__word { font-family: var(--font-display); font-size: 1.15rem; font-weight: 800; letter-spacing: -0.03em; }
.brand__accent { color: var(--accent); }

.nav { display: flex; flex-wrap: wrap; gap: 4px; }

.nav__link {
  padding: 7px 13px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-muted);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.nav__link:hover { color: var(--ink); background: var(--glass-hover); text-decoration: none; }
.nav__link.is-active { color: var(--ink); background: var(--glass-hover); border-color: var(--glass-border-hi); }

/* 5. Layout ----------------------------------------------------------- */
.page-main { flex: 1; padding-block: 24px 64px; }

.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 20px; font-size: 0.84rem; color: var(--ink-subtle); }
.breadcrumbs a { color: var(--ink-muted); }
.breadcrumbs span[aria-current] { color: var(--ink-body); }
.breadcrumbs__sep { font-family: var(--font-mono); }

.page-grid { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 28px; align-items: start; }

.hero { max-width: 900px; margin: 40px auto 56px; text-align: center; }
.hero__kicker,
.article__eyebrow {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-subtle);
}
.hero__kicker { margin-bottom: 16px; }
.hero__title { font-size: clamp(2.1rem, 4.6vw, 3.4rem); line-height: 1.1; letter-spacing: -0.04em; }
.hero__sub { max-width: 720px; margin: 22px auto 0; font-size: 1.1rem; color: var(--ink-muted); }
.hero__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 28px; }

/* 6. Article ---------------------------------------------------------- */
.article { padding: 40px 48px 44px; border-radius: var(--radius-lg); box-shadow: var(--glass-shadow); }

.article__header { margin-bottom: 28px; padding-bottom: 22px; border-bottom: 1px solid var(--glass-border); }
.article__eyebrow { margin-bottom: 12px; }
.article__title { font-size: clamp(1.7rem, 3vw, 2.3rem); line-height: 1.2; }
.article__lede { margin-top: 16px; font-size: 1.08rem; color: var(--ink-muted); }

.article__meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 16px 0 0; padding: 0; font-size: 0.86rem; color: var(--ink-subtle); list-style: none; }
.article__meta li + li::before { content: "\00b7"; margin-right: 18px; }

.verification-ledger {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 0 0 32px;
  overflow: hidden;
  background: var(--glass-border);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
}
.ledger-item { padding: 14px 16px; background: rgba(12, 15, 20, 0.92); }
.ledger-item dt { margin-bottom: 4px; font-family: var(--font-mono); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-subtle); }
.ledger-item dd { margin: 0; font-size: 0.88rem; line-height: 1.45; color: var(--ink); }

/* 7. Prose ------------------------------------------------------------ */
.prose > * + * { margin-top: 18px; }
.prose h2 { margin-top: 44px; font-size: 1.45rem; }
.prose h3 { margin-top: 30px; font-size: 1.12rem; }
.prose h2 + *,
.prose h3 + * { margin-top: 12px; }
.prose p,
.prose li { font-size: 1.02rem; }
.prose ul,
.prose ol { margin-bottom: 0; padding-left: 24px; }
.prose li + li { margin-top: 8px; }
.prose li::marker { color: var(--ink-subtle); }
.prose strong,
.prose em { color: var(--ink); }

code,
kbd { font-family: var(--font-mono); font-size: 0.84em; color: var(--ink); }
.prose code:not(.terminal-output-code),
.faq code { padding: 2px 6px; background: var(--inset); border: 1px solid var(--glass-border); border-radius: 6px; overflow-wrap: anywhere; }
kbd {
  display: inline-block;
  padding: 1px 6px;
  font-size: 0.8em;
  line-height: 1.5;
  white-space: nowrap;
  background: var(--glass-lite);
  border: 1px solid var(--glass-border-hi);
  border-bottom-width: 2px;
  border-radius: 5px;
}

.faq { margin-top: 48px; }
.faq h2 { margin-bottom: 16px; font-size: 1.45rem; }
.faq details { background: var(--inset); border: 1px solid var(--glass-border); border-radius: var(--radius); }
.faq details + details { margin-top: 10px; }
.faq summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 18px;
  font-weight: 700;
  color: var(--ink);
  list-style: none;
  cursor: pointer;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--font-mono); color: var(--ink-subtle); }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { padding: 0 18px 16px; }

/* 8. Cards & callouts (nested panels stay flat) ----------------------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.prose .card-grid { margin-top: 18px; }

.hub-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  padding: 20px;
  background: var(--inset);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  transition: border-color 0.2s, background 0.2s;
}
.hub-card:hover { background: var(--glass-lite); border-color: var(--glass-border-hi); }
.hub-card > div > * + * { margin-top: 8px; }
.prose .hub-card h3 { margin-top: 6px; font-size: 1.02rem; line-height: 1.35; }
.hub-card h3 a { color: var(--ink); }
.hub-card h3 a:hover { color: var(--ink); text-decoration: underline; }
.prose .hub-card p { font-size: 0.9rem; color: var(--ink-muted); }
.hub-card > a { font-size: 0.86rem; font-weight: 600; }

.silo-kicker {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-subtle);
}

.callout {
  padding: 18px 22px;
  font-size: 0.98rem;
  background: var(--inset);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
}
.callout-title { display: block; margin-bottom: 6px; font-weight: 700; color: var(--ink); }
.callout.warn .callout-title::before { content: "Warning: "; color: var(--ink-muted); }
.callout.danger .callout-title::before { content: "Caution: "; color: var(--ink-muted); }

/* 9. Tables & figures ------------------------------------------------- */
.table-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; font-size: 0.9rem; }
.table-toolbar strong { color: var(--ink); }
.table-filter-input { flex: 1; min-width: 220px; }
.prose .table-toolbar + .table-wrap { margin-top: 10px; }

.table-wrap {
  overflow-x: auto;
  background: var(--inset);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
}
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table-wrap th {
  padding: 13px 16px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: left;
  text-transform: uppercase;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid var(--glass-border-hi);
}
.table-wrap td { padding: 12px 16px; vertical-align: top; border-bottom: 1px solid var(--glass-border); }
.table-wrap tr:last-child td { border-bottom: 0; }
.table-wrap tbody tr:hover { background: var(--glass-hover); }

.tech-figure { margin-inline: 0; }
.tech-figure svg {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
}
.tech-figure figcaption { margin-top: 10px; font-size: 0.84rem; color: var(--ink-subtle); text-align: center; }

/* 10. Tool workbenches & form fields ---------------------------------- */
.tool-workbench {
  overflow: hidden;
  background: var(--inset);
  border: 1px solid var(--glass-border-hi);
  border-radius: var(--radius-lg);
}
.prose .tool-workbench { margin-block: 4px 32px; }

.tool-workbench-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 14px 22px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--glass-border);
}
.tool-workbench-title { font-family: var(--font-mono); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.02em; color: var(--ink); }
.tool-workbench-note { font-size: 0.78rem; color: var(--ink-subtle); }

.tool-workbench-body { padding: 22px; }
.tool-workbench-body > * + * { margin-top: 18px; }

.tool-controls-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.tool-field { display: flex; flex-direction: column; gap: 6px; }
.tool-field label,
.tool-label { font-size: 0.82rem; font-weight: 600; color: var(--ink-muted); }
.tool-workbench-body > .tool-label + .enchant-pills { margin-top: 8px; }

.tool-field input,
.tool-field select,
.tool-field textarea,
.table-filter-input {
  width: 100%;
  padding: 10px 13px;
  font: inherit;
  font-size: 0.93rem;
  color: var(--ink);
  background: var(--field);
  border: 1px solid var(--glass-border-hi);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.tool-field input:focus,
.tool-field select:focus,
.tool-field textarea:focus,
.table-filter-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.enchant-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.enchant-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  font-size: 0.84rem;
  color: var(--ink-body);
  background: var(--glass-lite);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  cursor: pointer;
}
.enchant-pill:hover { border-color: var(--glass-border-hi); }
.enchant-pill input,
.tool-workbench input[type="checkbox"] { accent-color: var(--accent); }

.terminal-output-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
}
.terminal-output-code {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--ink);
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.terminal-output-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.terminal-output-note { flex: 1; min-width: 220px; font-size: 0.8rem; color: var(--ink-muted); }

.platform-row + .platform-row { padding-top: 12px; border-top: 1px solid var(--glass-border); }
.platform-row__label { display: block; margin-bottom: 4px; font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.05em; color: var(--ink-subtle); }

.cadence-tester { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding-top: 18px; border-top: 1px solid var(--glass-border); }
.cadence-tester__readout { font-family: var(--font-mono); font-size: 0.82rem; color: var(--ink-muted); }

/* 11. Buttons --------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn:hover { text-decoration: none; }
.btn--primary { color: var(--accent-ink); background: var(--accent); border: 0; }
.btn--primary:hover { color: var(--accent-ink); background: var(--accent-hover); }
.btn--secondary { color: var(--ink); background: var(--glass-lite); border: 1px solid var(--glass-border-hi); }
.btn--secondary:hover { color: var(--ink); background: var(--glass-hover); border-color: var(--ink-subtle); }
.btn--sm { padding: 6px 14px; font-size: 0.8rem; }

/* 12. Sidebar --------------------------------------------------------- */
.sidebar { position: sticky; top: calc(var(--header-h) + 20px); display: flex; flex-direction: column; gap: 18px; }

.side-box { padding: 20px; border-radius: var(--radius-lg); box-shadow: var(--glass-shadow); }
.side-box__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  font-family: var(--font-display);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink);
}
.side-box__count {
  padding: 1px 9px;
  font-size: 0.72rem;
  color: var(--ink-muted);
  background: var(--glass-hover);
  border-radius: var(--radius-pill);
}

.side-nav { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
.side-nav a {
  display: block;
  padding: 8px 12px;
  font-size: 0.86rem;
  line-height: 1.35;
  color: var(--ink-muted);
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
}
.side-nav a:hover { color: var(--ink); background: var(--glass-hover); text-decoration: none; }
.side-nav a.is-current { font-weight: 700; color: var(--ink); background: var(--glass-hover); }

/* 13. Footer & social ------------------------------------------------- */
.site-footer {
  padding: 52px 0 28px;
  font-size: 0.88rem;
  color: var(--ink-subtle);
  background: rgba(7, 8, 11, 0.6);
  border-width: 1px 0 0;
}

.footer__grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 32px; margin-bottom: 32px; }
.footer__about { max-width: 380px; margin-top: 14px; }
.footer__email { font-family: var(--font-mono); font-size: 0.78rem; }

.footer__heading { margin-bottom: 14px; font-family: var(--font-display); font-size: 0.82rem; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; color: var(--ink); }
.footer__col ul { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.footer__col a { color: var(--ink-subtle); }
.footer__col a:hover { color: var(--ink); text-decoration: none; }

.social-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.social-link {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--ink-subtle);
  background: var(--inset);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  transition: color 0.2s, background 0.2s, border-color 0.2s, transform 0.2s;
}
.social-link svg { width: 17px; height: 17px; fill: currentColor; }
.social-link:hover { color: var(--ink); background: var(--glass-hover); border-color: var(--glass-border-hi); transform: translateY(-2px); }

.footer__disclaimer {
  margin-bottom: 20px;
  padding: 14px 18px;
  font-size: 0.78rem;
  line-height: 1.55;
  background: var(--inset);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
}
.footer__disclaimer strong { color: var(--ink-muted); }

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  padding-top: 18px;
  font-size: 0.78rem;
  border-top: 1px solid var(--glass-border);
}

/* 14. Fallbacks & motion ---------------------------------------------- */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header, .article, .side-box, .site-footer { background: rgba(16, 19, 25, 0.95); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body::before { animation: none; }
  *, *::before, *::after { transition: none; }
}

/* 15. Responsive ------------------------------------------------------ */
@media (max-width: 1100px) {
  .page-grid { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; }
  .verification-ledger { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .site-header { position: static; }
  .site-header__inner { flex-direction: column; align-items: flex-start; padding-block: 12px; }
}

@media (max-width: 640px) {
  .container { padding-inline: 16px; }
  .article { padding: 24px 20px 28px; }
  .tool-workbench-body { padding: 16px; }
  .verification-ledger,
  .footer__grid { grid-template-columns: 1fr; }
  .hero { margin-block: 16px 40px; }
}
