/* ===========================
   OPC Hub – Global Styles
   =========================== */

:root {
  --bg: #0d0f1a;
  --bg-card: #141727;
  --bg-card-hover: #1b2035;
  --border: #252b45;
  --accent: #7c6ef7;
  --accent-2: #4fc3f7;
  --accent-grad: linear-gradient(135deg, #7c6ef7, #4fc3f7);
  --text: #e8eaf6;
  --text-muted: #7b82a8;
  --text-dim: #4a5080;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --nav-h: 68px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ── Typography ── */
h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; line-height: 1.15; }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 700; }

.gradient-text {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Layout ── */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

section { padding: 80px 0; }

.section-label {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.section-header {
  margin-bottom: 48px;
}

.section-header p {
  color: var(--text-muted);
  max-width: 540px;
  margin-top: 8px;
  font-size: 1.05rem;
}

/* ── Navbar ── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(13, 15, 26, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;
  font-weight: 800;
}

.nav-logo .logo-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--accent-grad);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
}

.nav-links {
  display: flex;
  gap: 8px;
  align-items: center;
}

.nav-links a {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.93rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s, background 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  background: var(--bg-card);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
  border: none;
}

.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(124, 110, 247, 0.35); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--accent-grad);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}

.btn-outline:hover { border-color: var(--accent); color: var(--accent); box-shadow: none; }

.btn-sm { padding: 8px 16px; font-size: 0.82rem; }

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 6px;
}
.hamburger span {
  display: block;
  width: 24px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s;
}

.mobile-nav {
  display: none;
  position: fixed;
  inset: var(--nav-h) 0 0;
  background: var(--bg);
  z-index: 99;
  padding: 32px 24px;
  flex-direction: column;
  gap: 8px;
}

.mobile-nav.open { display: flex; }

.mobile-nav a {
  padding: 14px 16px;
  border-radius: 10px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: background 0.2s, color 0.2s;
}
.mobile-nav a:hover, .mobile-nav a.active {
  background: var(--bg-card);
  color: var(--text);
}

/* ── Hero ── */
.hero {
  padding: 100px 0 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -200px; left: 50%;
  transform: translateX(-50%);
  width: 800px; height: 800px;
  background: radial-gradient(circle, rgba(124,110,247,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(124, 110, 247, 0.1);
  border: 1px solid rgba(124, 110, 247, 0.3);
  border-radius: 50px;
  padding: 6px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 28px;
}

.hero h1 { margin-bottom: 20px; }

.hero p {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-muted);
  max-width: 580px;
  margin: 0 auto 40px;
}

.hero-cta {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-top: 72px;
  padding-top: 48px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 32px;
}

.stat { text-align: center; }
.stat .num {
  font-size: 2rem;
  font-weight: 800;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat .label { font-size: 0.85rem; color: var(--text-muted); margin-top: 4px; }

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(124, 110, 247, 0.4);
  box-shadow: var(--shadow);
}

/* ── Tool Cards ── */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.tool-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tool-card-top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.tool-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.tool-card h3 { font-size: 1rem; margin-bottom: 2px; }
.tool-card .tool-desc { font-size: 0.88rem; color: var(--text-muted); flex: 1; }

.tool-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(124, 110, 247, 0.12);
  color: var(--accent);
  border: 1px solid rgba(124, 110, 247, 0.2);
}

.tag.teal { background: rgba(79,195,247,0.12); color: var(--accent-2); border-color: rgba(79,195,247,0.2); }
.tag.green { background: rgba(72,199,142,0.12); color: #48c78e; border-color: rgba(72,199,142,0.2); }
.tag.orange { background: rgba(255,167,38,0.12); color: #ffa726; border-color: rgba(255,167,38,0.2); }
.tag.pink { background: rgba(240,98,146,0.12); color: #f06292; border-color: rgba(240,98,146,0.2); }

/* ── Blog Cards ── */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.blog-card {
  display: flex;
  flex-direction: column;
}

.blog-thumb {
  width: 100%;
  height: 180px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  margin-bottom: 20px;
  background: var(--bg-card-hover);
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem;
  border: 1px solid var(--border);
}

.blog-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.blog-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-dim); }
.blog-card h3 { margin-bottom: 8px; line-height: 1.4; }
.blog-card p { font-size: 0.9rem; color: var(--text-muted); flex: 1; }
.blog-card .read-more {
  margin-top: 16px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  display: inline-flex; align-items: center; gap: 4px;
  transition: gap 0.2s;
}
.blog-card:hover .read-more { gap: 8px; }

/* ── Newsletter ── */
.newsletter-section {
  padding: 80px 0;
}

.newsletter-box {
  background: linear-gradient(135deg, rgba(124,110,247,0.15), rgba(79,195,247,0.08));
  border: 1px solid rgba(124,110,247,0.3);
  border-radius: 24px;
  padding: 60px 48px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.newsletter-box::before {
  content: '';
  position: absolute;
  top: -100px; right: -100px;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(124,110,247,0.2), transparent 70%);
  pointer-events: none;
}

.newsletter-box h2 { margin-bottom: 12px; }
.newsletter-box p { color: var(--text-muted); max-width: 480px; margin: 0 auto 32px; }

.newsletter-form {
  display: flex;
  gap: 12px;
  max-width: 480px;
  margin: 0 auto;
  flex-wrap: wrap;
  justify-content: center;
}

.newsletter-form input {
  flex: 1;
  min-width: 240px;
  padding: 13px 20px;
  border-radius: 50px;
  border: 1.5px solid var(--border);
  background: rgba(255,255,255,0.05);
  color: var(--text);
  font-size: 0.93rem;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.2s;
}

.newsletter-form input::placeholder { color: var(--text-dim); }
.newsletter-form input:focus { border-color: var(--accent); }

.newsletter-success {
  display: none;
  color: #48c78e;
  font-weight: 700;
  margin-top: 16px;
  font-size: 0.95rem;
}

/* ── How it works ── */
.how-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
}

.how-card {
  text-align: center;
}

.how-icon {
  width: 64px; height: 64px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(124,110,247,0.2), rgba(79,195,247,0.1));
  border: 1px solid rgba(124,110,247,0.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto 16px;
}

.how-card h3 { margin-bottom: 8px; }
.how-card p { font-size: 0.9rem; color: var(--text-muted); }
.how-num {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.1em;
  margin-bottom: 14px;
}

/* ── Page Hero (inner pages) ── */
.page-hero {
  padding: 60px 0 48px;
  border-bottom: 1px solid var(--border);
}

.page-hero h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); margin-bottom: 12px; }
.page-hero p { color: var(--text-muted); max-width: 580px; font-size: 1.05rem; }

/* ── Filter bar ── */
.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 36px;
  align-items: center;
}

.filter-btn {
  padding: 8px 18px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font);
}

.filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.filter-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.search-wrap {
  margin-left: auto;
  position: relative;
}

.search-wrap input {
  padding: 9px 16px 9px 40px;
  border-radius: 50px;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.88rem;
  font-family: var(--font);
  outline: none;
  width: 220px;
  transition: border-color 0.2s, width 0.3s;
}

.search-wrap input:focus { border-color: var(--accent); width: 280px; }
.search-wrap .search-icon {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 0.9rem;
  pointer-events: none;
}

/* ── Blog page ── */
.blog-filters { margin-bottom: 40px; }
.featured-post {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  margin-bottom: 64px;
  padding-bottom: 64px;
  border-bottom: 1px solid var(--border);
}

.featured-post .blog-thumb {
  height: 280px;
  margin-bottom: 0;
  font-size: 5rem;
}

.featured-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.featured-post h2 {
  font-size: 1.6rem;
  margin-bottom: 12px;
  line-height: 1.35;
}
.featured-post p { color: var(--text-muted); margin-bottom: 20px; }

/* ── Footer ── */
.footer {
  border-top: 1px solid var(--border);
  padding: 48px 0 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 12px;
  max-width: 260px;
  line-height: 1.7;
}

.footer-col h4 {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 16px;
}

.footer-col ul { display: flex; flex-direction: column; gap: 10px; }
.footer-col ul li a {
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: color 0.2s;
}
.footer-col ul li a:hover { color: var(--text); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-dim);
}

.footer-social {
  display: flex;
  gap: 12px;
}

.social-link {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem;
  color: var(--text-muted);
  transition: all 0.2s;
}
.social-link:hover { border-color: var(--accent); color: var(--accent); }

/* ── Language Toggle ── */
.lang-toggle {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 3px;
  gap: 2px;
  margin-left: 4px;
}

.lang-btn {
  padding: 5px 12px;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 700;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.2s;
  line-height: 1;
}

.lang-btn.active {
  background: var(--accent-grad);
  color: #fff;
}

.lang-btn:not(.active):hover {
  color: var(--text);
}

/* Mobile lang toggle inside mobile nav */
.mobile-lang-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  margin-top: 8px;
  border-top: 1px solid var(--border);
}

.mobile-lang-toggle .lang-btn {
  flex: 1;
  text-align: center;
  padding: 10px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 0.9rem;
}

.mobile-lang-toggle .lang-btn.active {
  border-color: var(--accent);
}

/* ── Skill Stars ── */
.skill-stars {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}
.skill-stars strong { color: #ffa726; }

/* ── Stats Bar (opclaw) ── */
.stats-bar {
  display: flex;
  justify-content: center;
  gap: 48px;
  padding: 40px 0;
  flex-wrap: wrap;
}
.stat-big { text-align: center; }
.stat-big .num {
  font-size: 2.8rem;
  font-weight: 800;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}
.stat-big .label {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ── CLI Code Steps ── */
.code-steps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.code-step {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.code-step-num {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 10px;
  text-transform: uppercase;
}
.code-step h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
}
.code-step p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.code-block {
  background: #070910;
  border: 1px solid rgba(79,195,247,0.2);
  border-radius: 8px;
  padding: 12px 16px;
  font-family: 'Courier New', 'Consolas', monospace;
  font-size: 0.83rem;
  color: #4fc3f7;
  letter-spacing: 0.02em;
  word-break: break-all;
}

/* ── Utilities ── */
.view-all-wrap { text-align: center; margin-top: 48px; }
.hidden { display: none !important; }
.divider { height: 1px; background: var(--border); margin: 0 0 40px; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .featured-post { grid-template-columns: 1fr; }
  .featured-post .blog-thumb { height: 200px; }
}

@media (max-width: 640px) {
  section { padding: 56px 0; }
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .newsletter-box { padding: 40px 24px; }
  .footer-bottom { flex-direction: column; gap: 16px; text-align: center; }
  .hero { padding: 72px 0 56px; }
  .search-wrap { margin-left: 0; }
  .search-wrap input, .search-wrap input:focus { width: 100%; }
  .filter-bar { flex-direction: column; align-items: stretch; }
}

/* ── Auth navbar slot ── */
.nav-auth-slot { display: flex; align-items: center; gap: 8px; }
.nav-username {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  padding: 0 4px;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
