/* ═══════════════════════════════════════════════════════════
   HardenedVault — styles.css
   Shared by: index.html, best-practices.html, article pages
   ═══════════════════════════════════════════════════════════ */

/* ─── RESET ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ─── TOKENS ─── */
:root {
    --bg: #0a0c0f;
    --bg-2: #0f1115;
    --bg-3: #151820;
    --bg-card: #111419;
    --border: rgba(255,255,255,0.07);
    --border-accent: rgba(255,255,255,0.14);
    --text: #e8e9eb;
    --text-muted: #7a7e87;
    --text-dim: #4a4e57;
    --accent: #00d4aa;
    --accent-dim: rgba(0, 212, 170, 0.12);
    --accent-2: #3d7fff;
    --danger: #ff4d4d;
    --mono: 'IBM Plex Mono', monospace;
    --sans: 'IBM Plex Sans', sans-serif;
    --serif: 'IBM Plex Serif', serif;
}

/* ─── BASE ─── */
html { scroll-behavior: smooth; }

body {
    padding-top: 60px;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-weight: 400;
    line-height: 1.7;
    overflow-x: hidden;
}

/* scanline overlay */
body::before {
  content: '';
  position: fixed; inset: 0;
  background: repeating-linear-gradient(
    0deg, transparent, transparent 2px,
    rgba(0,0,0,0.06) 2px, rgba(0,0,0,0.06) 4px
  );
  pointer-events: none; z-index: 9999;
}

/* ─── LANG SWITCHING ─── */
.zh { display: none; }
.en { display: block; }
span.zh { display: none; }
span.en { display: inline; }

:lang(zh) .zh { display: block; }
:lang(zh) .en { display: none; }
:lang(zh) span.zh { display: inline; }
:lang(zh) span.en { display: none; }

/* ─── LANG TOGGLE BUTTON ─── */
.lang-toggle {
  font-family: var(--mono); font-size: 12px;
  background: transparent; border: 1px solid var(--border-accent);
  color: var(--text-muted); padding: 4px 10px; border-radius: 4px;
  cursor: pointer; letter-spacing: 0.08em;
  transition: border-color 0.2s, color 0.2s;
  line-height: 1;
}
.lang-toggle:hover { border-color: rgba(255,255,255,0.3); color: var(--text); }

/* ─── GRID BG ─── */
.grid-bg {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 48px 48px; pointer-events: none;
}

/* ─── NAV ─── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  border-bottom: 1px solid var(--border);
  background: rgba(10,12,15,0.88); backdrop-filter: blur(12px);
}
.nav-inner {
  max-width: 1160px; margin: 0 auto; padding: 0 2rem;
  height: 60px; display: flex; align-items: center; justify-content: space-between;
}
.logo {
  font-family: var(--mono); font-size: 15px; font-weight: 600;
  letter-spacing: 0.04em; color: var(--text); text-decoration: none;
  display: flex; align-items: center; gap: 8px;
}
.logo-mark {
  width: 22px; height: 22px; border: 1.5px solid var(--accent);
  border-radius: 4px; display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: var(--accent); font-weight: 600;
}
.nav-right { display: flex; align-items: center; gap: 1.5rem; }
nav ul { list-style: none; display: flex; gap: 1.75rem; align-items: center; }
nav ul li { display: flex; align-items: center; }
nav ul a {
  color: var(--text-muted); text-decoration: none; font-size: 13px;
  font-family: var(--mono); letter-spacing: 0.03em; transition: color 0.2s;
  display: flex; align-items: center; line-height: 1;
}
nav ul a span.en,
nav ul a span.zh { font-size: 13px; line-height: 1; }
nav ul a:hover { color: var(--text); }
nav ul a.active { color: var(--accent); }
.nav-cta {
  color: var(--accent) !important; border: 1px solid rgba(0,212,170,0.3);
  padding: 6px 14px; border-radius: 4px;
  transition: background 0.2s !important; line-height: 1;
}
.nav-cta:hover { background: var(--accent-dim) !important; }

/* ─── SECTION COMMON ─── */
section { position: relative; }
.section-inner { max-width: 1160px; margin: 0 auto; padding: 96px 2rem; }
.section-label {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--text-dim); margin-bottom: 1rem;
  display: flex; align-items: center; gap: 10px;
}
.section-label::after {
  content: ''; flex: 1; max-width: 48px; height: 1px; background: var(--border-accent);
}
h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 300;
  letter-spacing: -0.015em; margin-bottom: 3rem; color: var(--text);
}
h2 strong { font-weight: 600; }

/* ─── BUTTONS ─── */
.btn-primary {
  background: var(--accent); color: #000; font-family: var(--mono);
  font-size: 13px; font-weight: 600; padding: 12px 24px;
  border: none; border-radius: 4px; cursor: pointer; text-decoration: none;
  letter-spacing: 0.05em; transition: opacity 0.2s;
}
.btn-primary:hover { opacity: 0.88; }
.btn-ghost {
  background: transparent; color: var(--text-muted); font-family: var(--mono);
  font-size: 13px; padding: 12px 24px; border: 1px solid var(--border-accent);
  border-radius: 4px; cursor: pointer; text-decoration: none;
  letter-spacing: 0.03em; transition: border-color 0.2s, color 0.2s;
}
.btn-ghost:hover { border-color: rgba(255,255,255,0.3); color: var(--text); }

/* ─── FOOTER ─── */
footer { border-top: 1px solid var(--border); padding: 2rem; }
.footer-inner {
    max-width: 1160px; margin: 0 auto; display: flex;
    align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
}
.footer-inner p { font-family: var(--mono); font-size: 11px; color: var(--text-dim); letter-spacing: 0.05em; }
.footer-links { display: flex; gap: 1.5rem; list-style: none; }
.footer-links a { font-family: var(--mono); font-size: 11px; color: var(--text-dim); text-decoration: none; transition: color 0.2s; }
.footer-links a:hover { color: var(--text); }


/* ═══════════════════════════════════════════════════════════
   INDEX PAGE
   ═══════════════════════════════════════════════════════════ */

/* ─── HERO ─── */
.hero {
    position: relative; min-height: 80vh;
    display: flex; flex-direction: column; justify-content: center;
    overflow: hidden; padding: 10px 2rem 80px;
}
.hero-inner { max-width: 1160px; margin: 0 auto; width: 100%; }
.hero-eyebrow {
    font-family: var(--mono); font-size: 11px; color: var(--accent);
    letter-spacing: 0.15em; text-transform: uppercase; margin-bottom: 1.5rem;
    display: flex; align-items: center; gap: 12px;
}
.hero-eyebrow::before { content: ''; display: block; width: 24px; height: 1px; background: var(--accent); }
.hero h1 {
    font-family: var(--sans); font-size: clamp(2.6rem, 5.5vw, 4.4rem);
    font-weight: 300; line-height: 1.15; letter-spacing: -0.02em;
    color: var(--text); max-width: 820px; margin-bottom: 1.25rem;
}
.hero h1 em { font-style: normal; color: var(--accent); font-weight: 500; }
.hero-sub { font-size: 16px; color: var(--text-muted); max-width: 560px; margin-bottom: 3rem; line-height: 1.75; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

/* terminal widget */
.hero-terminal {
    position: absolute; right: 20%; top: 40%; transform: translateY(-50%);
    width: min(420px, 38vw); background: var(--bg-card);
    border: 1px solid var(--border-accent); border-radius: 8px; overflow: hidden; opacity: 0.75;
}
.terminal-bar {
    background: var(--bg-3); padding: 10px 14px;
    display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--border);
}
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot-r { background: #ff5f57; }
.dot-y { background: #ffbd2e; }
.dot-g { background: #28c840; }
.terminal-title { font-family: var(--mono); font-size: 11px; color: var(--text-dim); margin: 0 auto; }
.terminal-body { padding: 20px; font-family: var(--mono); font-size: 12px; line-height: 1.9; }
.t-prompt { color: var(--accent); }
.t-cmd { color: var(--text); }
.t-out { color: var(--text-muted); }
.t-out.hl { color: var(--accent-2); }
.t-cursor {
  display: inline-block; width: 8px; height: 14px; background: var(--accent);
  vertical-align: middle; animation: blink 1.1s step-end infinite;
}
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }

/* ─── SERVICES ─── */
.services-bg { background: var(--bg-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.services-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1px; background: var(--border); border: 1px solid var(--border);
  border-radius: 8px; overflow: hidden;
}
.service-card { background: var(--bg-card); padding: 2rem; transition: background 0.2s; }
.service-card:hover { background: var(--bg-3); }
.service-icon { font-family: var(--mono); font-size: 11px; color: var(--accent); margin-bottom: 1rem; letter-spacing: 0.1em; }
.service-card h3 { font-size: 16px; font-weight: 500; margin-bottom: 0.75rem; color: var(--text); }
.service-card p { font-size: 13.5px; color: var(--text-muted); line-height: 1.7; }

/* ─── INDUSTRIES ─── */
.industries-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.5rem;
}
.industry-card {
  border: 1px solid var(--border); border-radius: 6px; padding: 1.5rem;
  background: var(--bg-card); transition: border-color 0.2s; position: relative; overflow: hidden;
}
.industry-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 0.3s;
}
.industry-card:hover::before { transform: scaleX(1); }
.industry-card:hover { border-color: var(--border-accent); }
.industry-card.security-lab::before { background: var(--danger); }
.industry-num { font-family: var(--mono); font-size: 10px; color: var(--text-dim); letter-spacing: 0.1em; margin-bottom: 1rem; }
.industry-card h3 { font-size: 15px; font-weight: 500; margin-bottom: 0.75rem; }
.industry-card p { font-size: 13px; color: var(--text-muted); line-height: 1.65; }
.industry-link {
    display: inline-flex; align-items: center; gap: 6px; margin-top: 1rem;
    font-family: var(--mono); font-size: 11px; color: var(--danger);
    text-decoration: none; letter-spacing: 0.05em; transition: gap 0.2s;
}
.industry-link:hover { gap: 10px; }

/* ─── OPEN SOURCE ─── */
.oss-bg { background: var(--bg-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.oss-layout { display: grid; grid-template-columns: 1fr 1.6fr; gap: 4rem; align-items: start; }
.oss-projects {
    display: flex; flex-direction: column; gap: 1px;
    background: var(--border); border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
}
.project-card { background: var(--bg-card); padding: 1.5rem; transition: background 0.2s; }
.project-card:hover { background: var(--bg-3); }
.project-name { font-family: var(--mono); font-size: 14px; font-weight: 600; color: var(--accent-2); margin-bottom: 0.5rem; }
.project-card p { font-size: 13px; color: var(--text-muted); line-height: 1.65; }
.project-link {
    display: inline-flex; align-items: center; gap: 6px; margin-top: 0.75rem;
    font-family: var(--mono); font-size: 11px; color: var(--accent-2);
    text-decoration: underscore; letter-spacing: 0.04em; opacity: 0.7; transition: opacity 0.2s, gap 0.2s;
}
.project-link:hover { opacity: 1; gap: 10px; }
.oss-side h3 { font-size: 19px; font-weight: 300; margin-bottom: 1rem; line-height: 1.5; }
.oss-side p { font-size: 14px; color: var(--text-muted); line-height: 1.8; margin-bottom: 1rem; }
.hl-link {
    display: inline-flex; align-items: center; gap: 6px;
    font-family: var(--mono); font-size: 12px; color: var(--accent);
    text-decoration: none; border: 1px solid rgba(0,212,170,0.25);
    padding: 8px 16px; border-radius: 4px; transition: background 0.2s; margin-top: 0.5rem;
}
.hl-link:hover { background: var(--accent-dim); }

/* ─── ABOUT ─── */
.expertise-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; }
.expertise-item { display: flex; gap: 1rem; }
.exp-num { font-family: var(--mono); font-size: 12px; color: var(--accent); padding-top: 2px; flex-shrink: 0; }
.exp-body h4 { font-size: 14px; font-weight: 500; margin-bottom: 0.5rem; }
.exp-body p { font-size: 13px; color: var(--text-muted); line-height: 1.65; }
.about-lead { font-size: 15px; color: var(--text-muted); max-width: 640px; margin-bottom: 3rem; line-height: 1.8; }

/* ─── CONTACT FORM ─── */
.cta-bg { background: var(--bg-2); border-top: 1px solid var(--border); }
.cta-inner { max-width: 640px; margin: 0 auto; text-align: center; padding: 96px 2rem; }
.cta-inner h2 { margin-bottom: 1.25rem; }
.cta-inner > p { font-size: 15px; color: var(--text-muted); margin-bottom: 2.5rem; }

.contact-form { text-align: left; display: flex; flex-direction: column; gap: 1.25rem; margin-top: 2.5rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.form-field { display: flex; flex-direction: column; gap: 0.4rem; }
.form-label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--text-dim); }
.req { color: var(--danger); }
.form-input {
  background: var(--bg-card); border: 1px solid var(--border-accent);
  color: var(--text); font-family: var(--mono); font-size: 13px;
  padding: 10px 14px; border-radius: 4px; outline: none;
  transition: border-color 0.2s; width: 100%;
}
.form-input::placeholder { color: var(--text-dim); }
.form-input:focus { border-color: var(--accent); }
.form-textarea { resize: vertical; min-height: 110px; font-family: var(--sans); font-size: 14px; line-height: 1.6; }
.form-submit {
  align-self: flex-end; display: inline-flex; align-items: center; gap: 10px;
  background: var(--accent); color: #000; font-family: var(--mono);
  font-size: 13px; font-weight: 600; letter-spacing: 0.05em;
  padding: 12px 24px; border: none; border-radius: 4px; cursor: pointer; transition: opacity 0.2s;
}
.form-submit:hover { opacity: 0.88; }
.form-arrow { transition: transform 0.2s; }
.form-submit:hover .form-arrow { transform: translateX(4px); }


/* ═══════════════════════════════════════════════════════════
   BEST PRACTICES PAGE
   ═══════════════════════════════════════════════════════════ */

/* ─── PAGE HEADER ─── */
.page-header {
  padding: 120px 2rem 64px; border-bottom: 1px solid var(--border);
  background: var(--bg-2); position: relative; overflow: hidden;
}
.page-header-inner { max-width: 1160px; margin: 0 auto; position: relative; }
.page-eyebrow {
  font-family: var(--mono); font-size: 11px; color: var(--accent);
  letter-spacing: 0.15em; text-transform: uppercase; margin-bottom: 1.25rem;
  display: flex; align-items: center; gap: 12px;
}
.page-eyebrow::before { content: ''; display: block; width: 24px; height: 1px; background: var(--accent); }
.page-header h1 { font-size: clamp(1.8rem, 4vw, 3rem); font-weight: 300; letter-spacing: -0.02em; margin-bottom: 0.75rem; }
.page-header h1 strong { font-weight: 600; }
.page-header p { font-size: 15px; color: var(--text-muted); max-width: 560px; line-height: 1.75; }

/* ─── MAIN LAYOUT ─── */
.main-inner {
  max-width: 1160px; margin: 0 auto; padding: 64px 2rem 96px;
  display: grid; grid-template-columns: 1fr 220px; gap: 4rem; align-items: start;
}

/* ─── ARTICLE LIST ─── */
.article-group { margin-bottom: 3rem; }
.group-year {
  font-family: var(--mono); font-size: 11px; color: var(--text-dim);
  letter-spacing: 0.15em; margin-bottom: 1.25rem; padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.article-item {
    display: grid; grid-template-columns: 100px 1fr; gap: 1.5rem;
    padding: 1.25rem 0; border-bottom: 1px solid var(--border);
    text-decoration: none; color: inherit;
}
.article-item:last-child { border-bottom: none; }
.article-item:hover .article-title { color: var(--accent); }
.article-date {
    font-family: var(--mono); font-size: 11px; color: var(--text-dim);
    padding-top: 3px; letter-spacing: 0.04em; flex-shrink: 0;
}
.article-meta { display: flex; flex-direction: column; gap: 0.3rem; }
.article-title { font-size: 15px; font-weight: 500; color: var(--text); line-height: 1.4; transition: color 0.15s; }
.article-subtitle { font-size: 13px; color: var(--text-muted); line-height: 1.55; }
.article-cats {
    display: flex; gap: 8px; margin-top: 0.3rem; flex-wrap: wrap;
    justify-content: center;
}
.cat { font-family: var(--mono); font-size: 10px; color: var(--text-dim); letter-spacing: 0.06em; }
.cat::before { content: '#'; }

/* ─── SIDEBAR ─── */
.sidebar { position: sticky; top: 80px; }
.sidebar-block { margin-bottom: 2rem; }
.sidebar-label {
    font-family: var(--mono); font-size: 10px; letter-spacing: 0.15em;
    color: var(--text-dim); text-transform: uppercase; margin-bottom: 0.75rem;
}
.sidebar-links { list-style: none; }
.sidebar-links li { margin-bottom: 0.4rem; }
.sidebar-links a { font-size: 13px; color: var(--text-muted); text-decoration: none; font-family: var(--mono); transition: color 0.15s; }
.sidebar-links a:hover { color: var(--accent); }
.dl-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 11px; color: var(--text-dim);
  text-decoration: none; border: 1px solid var(--border);
  padding: 6px 12px; border-radius: 4px; transition: border-color 0.2s, color 0.2s; letter-spacing: 0.05em;
}
.dl-link:hover { border-color: var(--border-accent); color: var(--text-muted); }


/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 900px) {
    .hero-terminal { display: none; }
    .oss-layout { grid-template-columns: 1fr; gap: 2rem; }
}
@media (max-width: 800px) {
    .main-inner { grid-template-columns: 1fr; gap: 2rem; }
    .sidebar { position: static; }
}
@media (max-width: 640px) {
    .nav-right ul { display: none; }
    .hero h1 { font-size: 2.1rem; }
    .article-item { grid-template-columns: 1fr; gap: 0.25rem; }
    .form-row { grid-template-columns: 1fr; }
    .form-submit { align-self: stretch; justify-content: center; }
}

/* ─── org export title/subtitle ─── */
#content {
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

h1.title {
    font-family: var(--sans);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--text);
    text-align: center;
    padding-top: 20px;
    padding-bottom: 2rem;
    background: var(--bg-2);
    margin: 0;
}

.subtitle {
    font-family: var(--sans);
    font-size: 18px;
    font-weight: 300;
    color: var(--text-muted);
    line-height: 1.65;
    text-align: center;
    background: var(--bg-2);
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    margin: 0;
    display: block;
}

.prose-wrap {
    max-width: 1024px;
    margin: 0 auto;
    padding: 3rem clamp(1rem, 4vw, 2rem) 6rem;
}
