@layer components {
/* ============================================================
   MyDev Codes — site layer (DEV-TOOLS archetype)
   Requires tokens.css + components.css. Brand: Space Grotesk
   display, Inter body, indigo / electric-blue.
   ============================================================ */

/* ---- Brand overrides ---- */
:root {
  --brand-600: #1d4ed8;   /* indigo — primary actions, links */
  --brand-700: #1638a6;   /* hover */
  --brand-50:  #eef4ff;
  --brand-100: #d9e6ff;
  --accent-500: #38bdf8;  /* electric blue — sparing highlights */
  --font-display: "Space Grotesk", "Inter", -apple-system, sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ---- Nav polish ---- */
.nav-links a[aria-current="page"] { color: var(--brand-700); font-weight: 700; }
.brandmark-mark { font-weight: 700; letter-spacing: -0.03em; }
@media (max-width: 55.99rem) {
  .nav-inner { flex-wrap: wrap; min-width: 0; }
  .nav-inner nav { width: 100%; min-width: 0; }
  .nav-links { display: flex; width: 100%; min-width: 0; max-width: 100%; overflow-x: auto; padding-bottom: var(--s1); }
  .nav-links a { white-space: nowrap; }
}
.footer h3 { font-size: var(--text-caption); text-transform: uppercase; letter-spacing: .1em; color: var(--ink-500); margin: 0 0 var(--s3); }
.footer-base { color: var(--ink-500); }

/* ---- Article layout (guide pages) ---- */
.article-wrap { max-width: 46rem; margin-inline: auto; }
.article-hero { padding-block: clamp(2.5rem, 1.5rem + 5vw, 4.5rem) var(--s8); }
.article-hero h1 { font-size: var(--text-h1); margin: 0 0 var(--s4); }
.article-hero .lead { margin: 0; }
.article-body { padding-bottom: var(--s4); }
.article-body h2 { margin-top: var(--s12); }
.article-body h3 { margin-top: var(--s8); }
.article-body p, .article-body ul, .article-body ol { color: var(--ink-700); }
.article-body strong { color: var(--ink-950); }
.breadcrumbs { font-size: var(--text-small); color: var(--ink-500); margin-bottom: var(--s4); }
.breadcrumbs a { color: var(--ink-500); }
.breadcrumbs a:hover { color: var(--brand-700); }

/* ---- Code / formula callouts (dev-tools flavor) ---- */
.formula, .example {
  background: var(--ink-950); color: #e8eefc;
  border: 1px solid var(--ink-900);
  border-left: 4px solid var(--accent-500);
  border-radius: var(--radius-md);
  padding: var(--s4) var(--s6); margin: var(--s6) 0;
  font-family: var(--font-mono);
  font-size: 0.9375rem; line-height: 1.7;
  overflow-x: auto;
}
.formula code, .example code { font-family: inherit; }
.example p { color: #c6d2ec; font-family: var(--font-body); font-size: var(--text-small); margin: 0 0 var(--s2); }
.example p:last-child { margin-bottom: 0; }
.example p strong { color: #fff; }
code.inline, .article-body code { font-family: var(--font-mono); font-size: 0.875em; background: var(--brand-50); color: var(--brand-700); padding: 0.1em 0.4em; border-radius: 4px; }

/* ---- Info panels ---- */
.panel {
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: var(--s6) var(--s8);
  margin-top: var(--s12);
}
.panel h2 { margin-top: 0; font-size: var(--text-h3); }
.panel ul { color: var(--ink-700); font-size: var(--text-small); }

/* ---- FAQ block ---- */
.faq-item { border-bottom: 1px solid var(--line); padding: var(--s4) 0; }
.faq-item h3 { margin: 0 0 var(--s2); }
.faq-item p { margin: 0; color: var(--ink-700); font-size: var(--text-small); }

.prepared { font-size: var(--text-small); color: var(--ink-500); margin-top: var(--s12); }

/* ---- Data table ---- */
.data-table { border-collapse: collapse; width: 100%; margin: var(--s6) 0; font-size: var(--text-small); }
.data-table th, .data-table td { border: 1px solid var(--line); padding: var(--s2) var(--s3); text-align: left; }
.data-table th { background: var(--paper-2); font-weight: 650; }
.data-table td { color: var(--ink-700); }

/* ---- Calculator (dark terminal-style card) ---- */
.calc {
  background: linear-gradient(160deg, #0c1222 0%, #0a0e1a 100%);
  color: #eef2ff;
  border: 1px solid #1e2a4a;
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 1rem + 3vw, 2.75rem);
  box-shadow: var(--shadow-lg);
  position: relative; overflow: clip;
  margin-top: var(--s8);
}
.calc::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(28rem 14rem at 90% -10%, rgb(56 189 248 / 0.16), transparent 65%);
}
.calc > * { position: relative; }
.calc-grid { display: grid; gap: var(--s6); grid-template-columns: 1fr; margin-top: var(--s6); }
@media (min-width: 56rem) { .calc-grid { grid-template-columns: 1.15fr 1fr; } }
.calc-field { margin-bottom: var(--s4); }
.calc-field label { display: block; font-size: var(--text-small); font-weight: 650; color: #c6d2ec; margin-bottom: var(--s2); }
.calc-field .hint { display: block; font-weight: 400; font-size: var(--text-caption); color: #8b96b3; margin-top: var(--s1); }
.calc-field input {
  width: 100%; font-family: var(--font-mono); font-size: 1.0625rem;
  color: #fff; background: rgb(255 255 255 / 0.05);
  border: 1px solid #2b3a63; border-radius: var(--radius-sm);
  padding: var(--s3) var(--s4);
}
.calc-field input:focus { outline: 2px solid var(--accent-500); outline-offset: 1px; border-color: var(--accent-500); }
.calc-results { background: rgb(255 255 255 / 0.03); border: 1px solid #1e2a4a; border-radius: var(--radius-md); padding: var(--s6); }
.calc-result-main { font-family: var(--font-display); font-size: clamp(2rem, 1.4rem + 3vw, 3rem); color: #fff; margin: 0; letter-spacing: -0.02em; }
.calc-result-label { font-size: var(--text-caption); text-transform: uppercase; letter-spacing: 0.12em; color: #8b96b3; margin: 0 0 var(--s1); }
.calc-result-row { display: flex; justify-content: space-between; gap: var(--s3); font-size: var(--text-small); color: #c6d2ec; padding: var(--s2) 0; border-top: 1px solid #1e2a4a; }
.calc-result-row strong { color: #fff; font-family: var(--font-mono); font-weight: 600; }
.calc-split { display: flex; height: 0.625rem; border-radius: var(--radius-pill); overflow: hidden; margin-top: var(--s4); background: #1e2a4a; }
.calc-split-in { background: var(--accent-500); }
.calc-split-out { background: var(--brand-600); }
.calc-legend { display: flex; gap: var(--s6); font-size: var(--text-caption); color: #8b96b3; margin-top: var(--s2); }
.calc-legend span::before { content: ""; display: inline-block; width: 0.625rem; height: 0.625rem; border-radius: 2px; margin-right: var(--s1); }
.calc-legend .in::before { background: var(--accent-500); }
.calc-legend .out::before { background: var(--brand-600); }
.calc-disclaimer { font-size: var(--text-caption); color: #8b96b3; margin-top: var(--s4); }

/* ---- Guide cards on homepage ---- */
.guide-card { display: flex; flex-direction: column; }
.guide-card .card-icon { font-weight: 700; font-family: var(--font-display); }
.guide-card .btn-row { margin-top: auto; padding-top: var(--s6); }

/* ---- Hero tweaks for dev-tools feel ---- */
.hero-terminal {
  margin-top: var(--s12);
  background: var(--ink-950); color: #d7e0f5;
  border-radius: var(--radius-lg); padding: var(--s4) var(--s6);
  font-family: var(--font-mono); font-size: 0.8125rem; line-height: 1.8;
  box-shadow: var(--shadow-lg); overflow-x: auto;
  max-width: 40rem;
}
.hero-terminal .t-comment { color: #5b6a8f; }
.hero-terminal .t-key { color: var(--accent-500); }
.hero-terminal .t-val { color: #a5f3c6; }
.hero-terminal .t-fn { color: #c4b5fd; }

/* ---- Footer brand ---- */
.footer .brandmark-mark { font-size: 0.95rem; }
.footer-powered { font-size: var(--text-caption); color: var(--ink-400); }

/* ---- Reduced motion already handled in tokens.css ---- */

}
