/* ─────────────────────────────────────────────────────────────
   GRAFOMEM Blog — Shared Stylesheet
   Used by individual article pages in blog/
   ───────────────────────────────────────────────────────────── */

:root {
  --cyan:        #0099cc;
  --cyan2:       #00bbee;
  --cyan-dim:    rgba(0,153,204,.08);
  --cyan-border: rgba(0,153,204,.2);
  --green:       #00c853;
  --green-dim:   rgba(0,200,83,.08);
  --green-border:rgba(0,200,83,.2);
  --purple:      #7c3aed;
  --purple-dim:  rgba(124,58,237,.08);
  --purple-border:rgba(124,58,237,.22);
  --red:         #e30613;
  --bg:          #06090f;
  --bg2:         #0c1219;
  --bg3:         #121a25;
  --border:      rgba(255,255,255,.07);
  --text:        #c8d6e5;
  --text2:       #8fa3b8;
  --text3:       #5a7290;
  --muted:       #8a9ab0;
  --nav-bg:      rgba(6,9,15,.88);
  --white:       #ffffff;
  --sans:        'DM Sans', sans-serif;
  --mono:        'Space Mono', monospace;
  --surface:     #0c1219;
}

/* ── LIGHT THEME ── */
[data-theme="light"] {
  --bg:          #f4f6fa;
  --bg2:         #eaecf2;
  --bg3:         #e0e3ec;
  --border:      rgba(0,0,0,.09);
  --text:        #1a2233;
  --text2:       #4a5568;
  --text3:       #718096;
  --muted:       #5a6a7e;
  --white:       #1a2233;
  --nav-bg:      rgba(244,246,250,.92);
  --cyan-dim:    rgba(0,153,204,.1);
  --cyan-border: rgba(0,153,204,.3);
  --green-dim:   rgba(0,200,83,.1);
  --green-border:rgba(0,200,83,.3);
  --purple-dim:  rgba(124,58,237,.08);
  --purple-border:rgba(124,58,237,.25);
}
[data-theme="light"] body::before { opacity: .15; }
[data-theme="light"] nav { background: var(--nav-bg); border-bottom-color: rgba(0,0,0,.08); }
[data-theme="light"] .nav-brand-name { color: #0d1a2d; }
[data-theme="light"] .mobile-menu { background: rgba(244,246,250,.98); border-color: rgba(0,0,0,.08); }
[data-theme="light"] .mobile-menu a { color: var(--text2); border-color: rgba(0,0,0,.06); }
[data-theme="light"] footer { background: var(--bg2); }
[data-theme="light"] .footer-col a { color: var(--text3); }
[data-theme="light"] .footer-meta a, [data-theme="light"] .footer-meta span { color: var(--text3); }
[data-theme="light"] section { border-top-color: rgba(0,0,0,.07); }
[data-theme="light"] .article-code { background: #f8f9fc; }
[data-theme="light"] .article-code pre { color: #2d4a6a; }
[data-theme="light"] .cap-table thead th { background: #f0f2f6; color: #006699; }
[data-theme="light"] .cap-table tbody td:first-child { color: #0d1a2d; }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  font-size: 16px;
}

/* ── NOISE OVERLAY ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: .4;
}

/* ── NAV ── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: background .4s, border-color .4s;
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--white);
  flex-shrink: 0;
}
.nav-brand-mark { width: 26px; height: 26px; display: block; }
.nav-brand-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.3px;
  color: var(--white);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
}
.nav-links a {
  color: var(--text2);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  padding: 7px 13px;
  border-radius: 8px;
  transition: all .2s;
  white-space: nowrap;
}
.nav-links a:hover { color: var(--white); background: rgba(255,255,255,.05); }
[data-theme="light"] .nav-links a:hover { background: rgba(0,0,0,.04); color: #0d1a2d; }
.nav-links a.active { color: var(--cyan); }
.nav-links a.oss-link {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--cyan);
  border: 1px solid var(--cyan-border);
  border-radius: 20px;
  padding: 6px 13px;
  letter-spacing: .4px;
}
.nav-links a.oss-link:hover { background: var(--cyan-dim); color: var(--cyan); }
.nav-links a.cta-nav {
  background: var(--cyan);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  padding: 8px 18px;
  border-radius: 9px;
  margin-left: 4px;
  box-shadow: 0 2px 10px rgba(0,153,204,.28);
  transition: all .2s;
}
.nav-links a.cta-nav:hover {
  background: var(--cyan2);
  box-shadow: 0 4px 18px rgba(0,153,204,.42);
  transform: translateY(-1px);
}
.nav-links a.cloud-cta {
  background: transparent;
  border: 1px solid var(--green-border);
  color: var(--green);
  box-shadow: none;
}
.nav-links a.cloud-cta:hover {
  background: var(--green-dim);
  border-color: var(--green);
  box-shadow: 0 4px 14px rgba(0,200,83,.2);
  transform: translateY(-1px);
}
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text3);
  font-size: 15px;
  padding: 5px 10px;
  border-radius: 8px;
  cursor: pointer;
  margin-left: 4px;
  transition: all .2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.theme-toggle:hover { color: var(--white); border-color: rgba(255,255,255,.2); }
[data-theme="light"] .theme-toggle:hover { color: #0d1a2d; }
.theme-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-sun { display: none; }
.icon-moon { display: block; }
[data-theme="light"] .icon-sun { display: block; }
[data-theme="light"] .icon-moon { display: none; }
.hamburger {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text2);
  width: 38px;
  height: 38px;
  border-radius: 8px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}
.hamburger span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--text2);
  transition: all .2s;
}
@media (max-width: 880px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
}

/* ── CONTAINER ── */
.container { max-width: 1160px; margin: 0 auto; padding: 0 28px; }

/* ── SECTIONS ── */
section { padding: 96px 0; border-top: 1px solid var(--border); }
.doc-section .container { max-width: 880px; }

/* ── ARTICLE ── */
.article-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--cyan);
  text-decoration: none;
  padding: 28px 0 20px;
  transition: color .2s;
}
.article-back:hover { color: var(--cyan2); }
.article-back::before { content: '← '; }

.article-body { max-width: 780px; margin: 0 auto; }
.article-body h2 { font-size: clamp(26px, 3vw, 36px); margin: 56px 0 18px; letter-spacing: -.3px; font-weight: 800; color: var(--white); }
.article-body h3 { font-size: clamp(20px, 2.5vw, 26px); color: var(--white); margin: 40px 0 14px; font-weight: 700; }
.article-body p { font-size: 18px; color: var(--text2); line-height: 1.75; margin-bottom: 20px; }
.article-body strong { color: var(--white); }
.article-body em { color: var(--text); }
.article-body a { color: var(--cyan); text-decoration: none; border-bottom: 1px solid var(--cyan-border); }
.article-body a:hover { border-color: var(--cyan); }
.article-body ul, .article-body ol { margin: 16px 0 24px 24px; }
.article-body li { font-size: 17px; color: var(--text2); line-height: 1.7; margin-bottom: 8px; }
.article-body li strong { color: var(--white); }
.article-meta { display: flex; align-items: center; gap: 16px; margin-bottom: 48px; flex-wrap: wrap; }
.article-meta .date { font-family: var(--mono); font-size: 13px; color: var(--text3); }
.article-meta .author { font-size: 14px; color: var(--text2); }
.article-meta .reading { font-family: var(--mono); font-size: 11px; color: var(--text3); background: var(--bg3); border: 1px solid var(--border); padding: 3px 10px; border-radius: 20px; }
.article-quote { background: var(--cyan-dim); border: 1px solid var(--cyan-border); border-radius: 12px; padding: 20px 24px; margin: 24px 0; font-family: var(--mono); font-size: 15px; color: var(--cyan); line-height: 1.65; }
.article-code { background: #0a0f1a; border: 1px solid var(--border); border-radius: 12px; padding: 22px 26px; margin: 24px 0; overflow-x: auto; }
.article-code pre { font-family: var(--mono); font-size: 14px; color: #8ab4c8; line-height: 1.7; margin: 0; white-space: pre; }
.article-code .cm { color: #4a5568; }
.article-code .kw { color: #569cd6; }
.article-code .str { color: #ce9178; }
.article-hr { border: none; border-top: 1px solid var(--border); margin: 48px 0; }
.article-footer { font-size: 16px; color: var(--text3); line-height: 1.7; font-style: italic; margin-top: 32px; }
.article-footer a { color: var(--cyan); text-decoration: none; }
.cap-table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--border); margin: 24px 0; }
.cap-table { width: 100%; border-collapse: collapse; min-width: 500px; }
.cap-table th, .cap-table td { padding: 12px 18px; text-align: left; font-size: 14px; border-bottom: 1px solid var(--border); }
.cap-table thead th { font-family: var(--mono); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--cyan); background: var(--bg2); }
.cap-table tbody td:first-child { font-family: var(--mono); font-weight: 700; color: var(--white); font-size: 13px; white-space: nowrap; }
.cap-table tbody td { color: var(--text2); }
.cap-table tbody tr:last-child td { border-bottom: none; }
.cap-table tbody tr:hover td { background: rgba(255,255,255,.02); }

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--border);
  padding: 56px 28px 40px;
}
.footer-inner {
  max-width: 1160px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 40px;
}
@media (max-width: 800px) { .footer-inner { grid-template-columns: 1fr 1fr; gap: 28px; } }
@media (max-width: 480px) { .footer-inner { grid-template-columns: 1fr; } }
.footer-desc { font-size: 14px; color: var(--text3); line-height: 1.6; margin-top: 14px; max-width: 320px; }
.footer-meta { margin-top: 14px; display: flex; gap: 10px; font-size: 12px; flex-wrap: wrap; }
.footer-meta span, .footer-meta a { color: var(--text3); text-decoration: none; }
.footer-meta a:hover { color: var(--cyan); }
.footer-meta .sep { color: var(--border); }
.footer-col h4 { font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--text2); margin-bottom: 16px; }
.footer-col a { display: block; color: var(--text3); text-decoration: none; font-size: 14px; padding: 4px 0; transition: color .2s; }
.footer-col a:hover { color: var(--white); }
.footer-bottom {
  max-width: 1160px; margin: 28px auto 0; padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.footer-bottom span { font-size: 13px; color: var(--text3); }

/* ── SCROLL REVEAL ── */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .6s ease, transform .6s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ── MOBILE MENU ── */
.mobile-menu {
  display: none;
  flex-direction: column;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 16px 28px 20px;
  gap: 4px;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  color: var(--text2);
  text-decoration: none;
  font-size: 17px;
  font-weight: 500;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.mobile-menu a:last-child { border-bottom: none; }
.mobile-menu a.cta-mobile { color: var(--cyan); }
