/* PureCut CNC User Guide — shared styles */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0e0e10;
  --bg2:       #141416;
  --bg3:       #1a1a1e;
  --border:    #2a2a30;
  --text:      #e2e2e6;
  --muted:     #888896;
  --accent:    #00c8ff;
  --accent2:   #0090c0;
  --green:     #00e090;
  --yellow:    #f0c040;
  --radius:    6px;
  --font:      -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono:      "SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", monospace;
  --content-width: 860px;
  --sidebar-width: 240px;
}

html { scroll-behavior: smooth; }

body {
  background-color: #090c10;
  background:
    radial-gradient(circle at top, rgba(28, 184, 255, 0.12), transparent 34%),
    #090c10;
  background-attachment: fixed, fixed;
  background-repeat: no-repeat, no-repeat;
  background-size: 100% 100vh, auto;
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

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

/* ── NAV ── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(14,14,16,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.nav-logo span { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  align-items: center;
}
.nav-links a {
  color: var(--muted);
  font-size: 0.875rem;
  transition: color 0.15s;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); text-decoration: none; }

.github-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.github-icon svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.nav-cta {
  background: var(--accent);
  color: #000 !important;
  font-weight: 600;
  font-size: 0.8rem;
  padding: 0.4rem 1rem;
  border-radius: var(--radius);
  transition: background 0.15s;
}
.nav-cta:hover { background: var(--accent2); text-decoration: none !important; color: #fff !important; }

/* ── PAGE HEADER ── */
.page-header {
  position: relative;
  overflow: hidden;
  padding: 3.5rem 2rem 2.5rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.page-header-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.28;
  mask-image: radial-gradient(ellipse 70% 80% at 50% 0%, black, transparent 100%);
}
.page-label {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
  position: relative;
}
.page-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 0.75rem;
  position: relative;
}
.page-header h1 em { font-style: normal; color: var(--accent); }
.page-header p {
  font-size: 1rem;
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.65;
  position: relative;
}

/* ── LAYOUT ── */
.guide-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 2rem 6rem;
  gap: 3rem;
  align-items: start;
}

/* ── SIDEBAR ── */
.guide-sidebar {
  position: sticky;
  top: 72px;
  padding-top: 2.5rem;
}
.sidebar-section { margin-bottom: 1.75rem; }
.sidebar-section-title {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
  padding-left: 1rem;
}
.sidebar-nav {
  list-style: none;
  border-left: 2px solid var(--border);
}
.sidebar-nav li { font-size: 0.85rem; }
.sidebar-nav a {
  display: block;
  padding: 0.3rem 1rem;
  color: var(--muted);
  border-left: 2px solid transparent;
  margin-left: -2px;
  transition: color 0.15s, border-color 0.15s;
  line-height: 1.4;
}
.sidebar-nav a:hover, .sidebar-nav a.active {
  color: var(--text);
  border-left-color: var(--accent);
  text-decoration: none;
}
.sidebar-nav a.active { color: var(--accent); }

/* ── CONTENT ── */
.guide-content {
  padding-top: 2.5rem;
  min-width: 0;
}

/* ── SECTIONS ── */
.guide-section {
  margin-bottom: 3.5rem;
  scroll-margin-top: 72px;
}
.guide-section h2 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.guide-section h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 1.5rem 0 0.5rem;
  color: var(--text);
}
.guide-section p {
  color: var(--muted);
  line-height: 1.7;
  max-width: 680px;
  margin-bottom: 0.75rem;
}
.guide-section ul, .guide-section ol {
  padding-left: 1.4rem;
  color: var(--muted);
  line-height: 1.7;
  max-width: 680px;
  margin-bottom: 0.75rem;
}
.guide-section li { margin-bottom: 0.3rem; }
.guide-section li strong { color: var(--text); }

/* ── CALLOUT ── */
.callout {
  margin: 1.25rem 0;
  padding: 0.9rem 1.2rem;
  border-radius: var(--radius);
  border-left: 3px solid var(--accent);
  background: rgba(0,200,255,0.05);
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.65;
  max-width: 680px;
}
.callout strong { color: var(--text); }
.callout--warn {
  border-left-color: var(--yellow);
  background: rgba(240,192,64,0.05);
}
.callout--tip {
  border-left-color: var(--green);
  background: rgba(0,224,144,0.05);
}

/* ── UI TERM / KBD ── */
.ui { font-weight: 600; color: var(--text); }
kbd {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.78rem;
  padding: 0.15em 0.5em;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
}
code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.1em 0.4em;
  color: var(--accent);
}

/* ── SCREENSHOT ── */
.screenshot {
  display: inline-block;
  width: fit-content;
  max-width: min(100%, 680px);
  margin: 1.5rem 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}
.screenshot img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
}

.screenshot-placeholder {
  background: var(--bg2);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  margin: 1.5rem 0;
  padding: 2.5rem 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  max-width: 680px;
}
.screenshot-placeholder .ph-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.04em;
  font-family: var(--mono);
}
.screenshot-placeholder .ph-desc { font-size: 0.78rem; color: var(--border); }

/* ── PROP TABLE ── */
.prop-table {
  width: 100%;
  max-width: 680px;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 0.875rem;
}
.prop-table th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.prop-table td {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  color: var(--muted);
  vertical-align: top;
  line-height: 1.55;
}
.prop-table td:first-child { color: var(--text); font-weight: 500; white-space: nowrap; }
.prop-table tr:nth-child(even) td { background: rgba(255,255,255,0.015); }

/* ── OP GRID ── */
.op-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 1rem 0 1.5rem;
  max-width: 680px;
}
.op-card {
  background: var(--bg2);
  padding: 1.2rem 1.4rem;
}
.op-card h4 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--text);
}
.op-card p { font-size: 0.82rem; color: var(--muted); line-height: 1.55; margin: 0; }

/* ── TOOLBAR REFERENCE ── */
.toolbar-ref {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 1rem 0 1.5rem;
  max-width: 680px;
}
.toolbar-ref-row {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
}
.toolbar-ref-row .tr-name {
  font-weight: 600;
  color: var(--text);
  min-width: 160px;
  flex-shrink: 0;
}
.toolbar-ref-row .tr-desc { color: var(--muted); line-height: 1.5; }

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--muted);
  flex-wrap: wrap;
  gap: 1rem;
}
footer a { color: var(--muted); }
footer a:hover { color: var(--text); text-decoration: none; }

/* ── DOWNLOAD BUTTON ── */
.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  color: var(--accent);
  transition: border-color 0.15s, background 0.15s;
}
.btn-download:hover {
  background: var(--bg3);
  border-color: var(--accent);
  text-decoration: none;
}

/* ── TOOLBAR ICON ── */
.tool-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 5px;
  vertical-align: middle;
  flex-shrink: 0;
}
.tool-icon svg {
  width: 18px;
  height: 18px;
  color: var(--text);
  overflow: visible;
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  body {
    background-attachment: scroll, fixed;
    background-size: 100% 24rem, auto;
  }
  nav {
    height: auto;
    padding: 0.9rem 1rem 0.8rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .nav-links {
    gap: 1rem;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 0.1rem;
    scrollbar-width: none;
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links li { flex: 0 0 auto; }
  .nav-cta { align-self: stretch; text-align: center; }
  .desktop-web-link { display: none !important; }

  .guide-layout {
    grid-template-columns: 1fr;
    padding: 0 1rem 4rem;
    gap: 0;
  }
  .guide-sidebar {
    position: static;
    padding-top: 1.5rem;
    padding-bottom: 0;
  }
  .page-header { padding: 2.5rem 1rem 1.8rem; }
}
