/* ============================================================================
   NoIDE Server — site styles
   Type set in Google Sans Code (Google Fonts). Dark, terminal-inspired theme.
   ========================================================================== */

/* --- Fonts: Google Sans Code (via Google Fonts) --------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Google+Sans+Code:wght@400;700&display=swap');

/* --- Root variables -------------------------------------------------------- */
:root {
  --font: 'Google Sans Code', ui-monospace, 'SF Mono', 'Cascadia Code', 'Cascadia Mono', Menlo, Consolas, monospace;
  --bg: #14161a;
  --bg-alt: #0c0e11;
  --bg-elev: #1b1f27;
  --panel: #161b22;
  --border: #30363d;
  --border-soft: #21262d;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #008080;
  --accent-dim: #006060;
  --gold: #f0a83e;
  --red: #f85149;
  --blue: #008080;
  --code-bg: #0d1117;
  --selection: #005f6b;
  --radius: 10px;
  --radius-sm: 6px;
  --maxw: 1080px;
}

/* --- Light theme ------------------------------------------------------------ */
[data-theme="light"] {
  --bg: #ffffff;
  --bg-alt: #f4f6f8;
  --bg-elev: #ffffff;
  --panel: #ffffff;
  --border: #d0d7de;
  --border-soft: #e6e8eb;
  --text: #1f2328;
  --muted: #656d76;
  --accent: #006060;
  --accent-dim: #004c4c;
  --gold: #9a6700;
  --red: #cf222e;
  --blue: #006060;
  --code-bg: #f6f8fa;
  --selection: #a8d8da;
}
[data-theme="light"] .site-nav {
  background: rgba(255, 255, 255, 0.92);
}

/* --- Reset / base ----------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-alt) 100%) fixed;
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.7;
}

::selection { background: var(--selection); color: #fff; }

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

h1, h2, h3, h4 { font-family: var(--font); font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.55rem, 3.5vw, 2.4rem); }
h2 { font-size: clamp(1.2rem, 2.6vw, 1.7rem); margin-top: 2.2rem; }
h3 { font-size: 1.02rem; }
h4 { font-size: 0.92rem; }

p { max-width: 68ch; }
code, pre, kbd { font-family: var(--font); font-size: 0.9em; }

/* --- Utilities -------------------------------------------------------------- */
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 1.75rem; }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 1000; }
.skip-link:focus {
  left: 0.5rem; top: 0.5rem; background: var(--accent); color: #000;
  padding: 0.5rem 1rem; border-radius: var(--radius-sm);
}
/* --- Site navigation -------------------------------------------------------- */
.site-nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 1rem;
  padding: 0.85rem 1.25rem;
  background: rgba(12, 14, 17, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(140%) blur(4px);
}
.brand { display: flex; align-items: center; gap: 0.55rem; font-weight: 700; color: var(--text); }
.brand-mark {
  display: grid; place-items: center;
  width: 26px; height: 26px; border-radius: 6px;
  overflow: hidden;
}
.brand-mark--sm { width: 22px; height: 22px; }
.brand-mark .brand-icon { width: 100%; height: 100%; }
.brand-name { font-size: 0.9rem; letter-spacing: 0.02em; }

.nav-links { margin-left: 1.25rem; }
.nav-links ul { list-style: none; display: flex; gap: 1.1rem; margin: 0; padding: 0; }
.nav-links a { color: var(--text); font-weight: 400; }
.nav-links a:hover { color: var(--accent); }

.nav-cta {
  margin-left: auto;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius-sm);
  color: var(--accent); font-weight: 700; font-size: 13px;
  transition: background 0.18s ease, color 0.18s ease;
}
.nav-cta:hover { background: var(--accent); color: #000; text-decoration: none; }

/* --- Theme toggle ----------------------------------------------------------- */
.theme-toggle {
  margin-left: 0.5rem; cursor: pointer;
  background: none; border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 40px; height: 40px; padding: 0;
  display: grid; place-items: center;
  color: var(--text);
  transition: border-color 0.18s ease, color 0.18s ease;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle__icon { display: none; width: 18px; height: 18px; }
.theme-toggle__icon svg { width: 100%; height: 100%; }
/* Show moon in dark mode (click to go light), sun in light mode (click to go dark) */
[data-theme="light"] .theme-toggle__icon--sun { display: block; }
[data-theme="light"] .theme-toggle__icon--moon { display: none; }
.theme-toggle__icon--moon { display: block; }
.theme-toggle__icon--sun { display: none; }

.nav-toggle {
  display: none; margin-left: auto; cursor: pointer;
  background: none; border: 1px solid var(--border); border-radius: var(--radius-sm);
  width: 40px; height: 40px; padding: 0;
}
.nav-toggle span { display: block; width: 18px; height: 2px; background: var(--text); margin: 4px auto; }

.mobile-menu { background: var(--bg-elev); border-bottom: 1px solid var(--border); }
.mobile-menu nav ul { list-style: none; display: flex; flex-direction: column; gap: 0.6rem; padding: 0.9rem 1.25rem; }
.mobile-menu a { display: block; color: var(--text); padding: 0.3rem 0; }

/* --- Page hero -------------------------------------------------------------- */
.hero { position: relative; padding: clamp(4rem, 10vw, 7rem) 0 clamp(2.5rem, 6vw, 4.5rem); overflow: hidden; }
.hero .overline { color: var(--muted); font-size: 0.9rem; }
.hero h1 { display: block; margin: 0.4rem 0; }
.hero .lede { font-size: 1.05rem; color: var(--text); max-width: 60ch; }
.hero .feature-list { color: var(--muted); font-size: 0.92rem; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; margin: 1.5rem 0 2rem; }
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.72rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 700; text-decoration: none; cursor: pointer;
  border: 1px solid var(--border);
}
.btn--primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn--primary:hover { background: var(--accent-dim); color: #fff; }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }

/* --- Sections ----------------------------------------------------------------- */
.section { padding-top: 3rem; padding-bottom: 3rem; }
.section--alt { background: var(--bg-alt); border-top: 1px solid var(--border); }

/* --- Terminal window (fake) ------------------------------------------------- */
.term {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--code-bg);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}
.term-bar { display: flex; gap: 0.45rem; padding: 0.55rem 0.9rem; background: var(--bg-elev); }
.term-bar i { width: 11px; height: 11px; border-radius: 50%; }
.term-bar i:nth-child(1) { background: var(--red); }
.term-bar i:nth-child(2) { background: var(--gold); }
.term-bar i:nth-child(3) { background: var(--accent); }
.term-title { margin-left: auto; color: var(--muted); font-size: 0.78rem; }
.term-body { padding: 1rem 1.1rem; overflow-x: auto; font-size: 0.88rem; }

/* --- Code blocks ------------------------------------------------------------- */
.codeblock { position: relative; margin: 1rem 0; }
.codeblock pre {
  padding: 1.4rem 4.6rem 1.4rem 1.3rem; border-radius: var(--radius);
  background: var(--code-bg); border: 1px solid var(--border);
  overflow-x: auto; font-size: 0.88rem; line-height: 1.6;
}
.codeblock code { font-family: var(--font); }

/* Inline code & kbd */
code:not(pre code) {
  background: var(--bg-elev); border: 1px solid var(--border-soft);
  padding: 0.12rem 0.4rem; border-radius: 4px; color: var(--accent);
}
kbd {
  background: var(--bg-elev); border: 1px solid var(--border-soft);
  border-bottom: 2px solid var(--border); padding: 0.1rem 0.4rem; border-radius: 4px;
}

/* --- Copy button ------------------------------------------------------------- */
.copy-btn {
  position: absolute; right: 0.6rem; top: 0.55rem;
  background: var(--bg-elev); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 0.75rem; padding: 0.25rem 0.6rem; cursor: pointer;
}
.copy-btn:hover { color: var(--accent); }
/* --- Tables (protocol) -------------------------------------------------------- */
.tbl-wrap { overflow-x: auto; margin: 1.2rem 0; }
table { border-collapse: collapse; width: 100%; font-size: 0.86rem; }
thead th {
  text-align: left; padding: 0.6rem 0.9rem;
  background: var(--bg-elev); color: var(--text);
  border-bottom: 2px solid var(--border);
}
tbody td { padding: 0.6rem 0.9rem; border-bottom: 1px solid var(--border-soft); color: var(--text); }
td code, th code { font-size: 0.84em; }

/* --- Callouts ----------------------------------------------------------------- */
.callout { border: 1px solid var(--border); border-left: 4px solid var(--accent-dim); border-radius: var(--radius-sm); padding: 0.9rem 1.1rem; margin: 1.2rem 0; background: var(--panel); }
.callout--warn { border-left-color: var(--gold); }
.callout--danger { border-left-color: var(--red); }

/* --- Interior page header ----------------------------------------------------- */
.page-head { padding: 3.2rem 0 1.5rem; border-bottom: 1px solid var(--border); }
.page-head p { color: var(--muted); }

/* --- Feature grid -------------------------------------------------------------- */
.grid { display: grid; gap: 1.6rem; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); margin-top: 1.8rem; }
.card {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel); padding: 1.6rem 1.5rem;
}
.card:hover { border-color: var(--accent-dim); transform: translateY(-2px); }
.card-icon {
  display: grid; place-items: center; width: 40px; height: 40px;
  border: 1px solid var(--border-soft); border-radius: 8px;
  color: var(--accent);
}
.card-icon svg { width: 24px; height: 24px; }
.card h3 { margin: 0.9rem 0 0.4rem; }
.card p { color: var(--muted); font-size: 0.95rem; }

/* --- Steps / how it works ------------------------------------------------------ */
.steps { counter-reset: step; list-style: none; padding: 0; }
.steps li {
  position: relative; padding: 1.1rem 0 1.1rem 3.2rem;
  border-bottom: 1px solid var(--border-soft); counter-increment: step;
}
.steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute; left: 0; top: 1.1rem;
  display: grid; place-items: center;
  width: 2rem; height: 2rem; border-radius: 6px;
  border: 1px solid var(--accent-dim); color: var(--accent);
  font-weight: 700; font-size: 0.85rem;
}
.steps li b { color: var(--text); }
.steps li span { color: var(--muted); }
/* --- Footer -------------------------------------------------------------------- */
.site-footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  margin-top: 3rem; padding: 3rem 1.75rem 2.75rem;
}
.footer-grid { display: grid; gap: 1.6rem; grid-template-columns: 2fr 1fr 1fr; }
.footer-brand p { color: var(--muted); }
.footer-col h4 { margin: 0 0 0.5rem; color: var(--muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li + li { margin-top: 0.35rem; }
.footer-col a { color: var(--muted); }
.footer-col a:hover { color: var(--accent); }
.footer-legal { color: var(--muted); font-size: 0.8rem; margin-top: 1.6rem; }

/* --- Responsive ---------------------------------------------------------------- */
@media (max-width: 760px) {
  .nav-links { display: none; }
  .nav-cta { display: none; }
  .theme-toggle { display: none; }
  .nav-toggle { display: inline-flex; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero { padding: 3rem 0 3rem; }
  body { font-size: 13px; }
}

@media print {
  .site-nav, .site-footer, .nav-toggle, .copy-btn { display: none; }
  body { background: #fff; color: #000; }
}
.copy-btn[data-copied] { color: var(--accent); border-color: var(--accent-dim); }