/* ──────────────────────────────────────────────────────────────────
   Black Vault — shared stylesheet
   ────────────────────────────────────────────────────────────────── */

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

:root {
  --bg-primary:    #0A0F1A;
  --bg-secondary:  #0F1623;
  --text-primary:  #F5F6F8;
  --text-muted:    #8A92A1;
  --text-faint:    #5A6275;
  --accent-gold:   #D4AF37;
  --accent-gold-hi:#E8C654;
  --accent-deep:   #1B3A5C;
  --border-subtle: #1F2A3E;
  --grain:         0.020;
  --ease-vault:    cubic-bezier(0.16, 1, 0.3, 1);

  --container-max: 1280px;
  --container-pad: 24px;
}

@media (min-width: 768px)  { :root { --container-pad: 48px; } }
@media (min-width: 1280px) { :root { --container-pad: 80px; } }

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg-primary);
  color: var(--text-muted);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  position: relative;
}

/* Subtle film grain — adds analog tactility without distraction */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: var(--grain);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  mix-blend-mode: overlay;
}

/* Scroll progress bar (1 px gold, very subtle) */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 1px;
  width: 0%;
  background: var(--accent-gold);
  z-index: 1000;
  transition: width 80ms linear;
  will-change: width;
}

/* CJK & Arabic font stacks */
[lang|="zh"] {
  font-family: 'Inter', 'PingFang SC', 'Microsoft YaHei',
               'Hiragino Sans GB', 'Source Han Sans SC',
               'Noto Sans SC', system-ui, sans-serif;
}

[lang|="ar"] {
  font-family: 'Inter', 'SF Arabic', 'Geeza Pro',
               'Noto Sans Arabic', 'Tahoma', 'Arial',
               system-ui, sans-serif;
}

/* mono utility class — kept consistent across scripts */
.mono,
.eyebrow,
.hero-pillar,
.hero-pillar-sep,
.hero-meta,
.platform-num,
.platform-tag,
.disc-num,
.disc-stamp,
.pgp-note {
  font-family: 'JetBrains Mono', 'SF Mono', 'Menlo', 'Courier New', monospace;
}

/* ── Skip link ───────────────────────────────────────────────── */

.skip-link {
  position: absolute;
  top: -9999px;
  left: 16px;
  z-index: 9999;
  background: var(--accent-gold);
  color: var(--bg-primary);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 16px;
  text-decoration: none;
}
.skip-link:focus { top: 0; }
[dir="rtl"] .skip-link { left: auto; right: 16px; }

/* ── Container ───────────────────────────────────────────────── */

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
  position: relative;
  z-index: 2;
}

/* ── Eyebrow / labels ────────────────────────────────────────── */

.eyebrow {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-gold);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 24px;
  display: inline-block;
}

[lang|="ar"] .eyebrow,
[lang|="zh"] .eyebrow { text-transform: none; }

/* ── Reveal-on-scroll ────────────────────────────────────────── */

.will-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 700ms var(--ease-vault),
              transform 700ms var(--ease-vault);
  will-change: opacity, transform;
}
.will-reveal.revealed {
  opacity: 1;
  transform: none;
}

/* ── Header ──────────────────────────────────────────────────── */

#site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 80px;
  display: flex;
  align-items: center;
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 100;
  transition: background-color 300ms ease, border-color 300ms ease;
}
#site-header.scrolled {
  background-color: rgba(10, 15, 26, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: rgba(31, 42, 62, 0.7);
}
.header-inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.logo {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-decoration: none;
  flex-shrink: 0;
}
.logo-name {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: var(--text-primary);
  line-height: 1;
}
.logo-tagline {
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.10em;
  color: var(--text-faint);
  line-height: 1;
  text-transform: uppercase;
}
[lang|="ar"] .logo-name,
[lang|="zh"] .logo-name { letter-spacing: 0.10em; }
[lang|="ar"] .logo-tagline,
[lang|="zh"] .logo-tagline { text-transform: none; letter-spacing: 0.06em; }

.header-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  position: relative;
  padding-bottom: 2px;
  transition: color 200ms ease;
  white-space: nowrap;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0;
  height: 1px;
  background: var(--accent-gold);
  transition: width 220ms var(--ease-vault);
}
.nav-link:hover, .nav-link:focus-visible { color: var(--accent-gold); }
.nav-link:hover::after, .nav-link:focus-visible::after { width: 100%; }
[dir="rtl"] .nav-link::after { left: auto; right: 0; }

@media (max-width: 767px) {
  #site-header { height: 60px; }
  .logo-name   { font-size: 14px; }
  .logo-tagline{ font-size: 9px; }
  .header-right { gap: 12px; }
  .nav-link.contact-link { display: none; }
}

/* ── Language switcher ───────────────────────────────────────── */

.lang-switcher details {
  position: relative;
}
.lang-switcher summary {
  cursor: pointer;
  list-style: none;
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 0.10em;
  font-family: 'JetBrains Mono', 'SF Mono', 'Menlo', monospace;
  padding: 7px 12px;
  border: 1px solid var(--border-subtle);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  user-select: none;
  text-transform: uppercase;
  transition: color 200ms ease, border-color 200ms ease;
}
.lang-switcher summary::-webkit-details-marker { display: none; }
.lang-switcher summary::marker { content: ''; }

.lang-switcher summary:hover,
.lang-switcher summary:focus-visible {
  color: var(--accent-gold);
  border-color: var(--accent-gold);
  outline: none;
}
.lang-switcher details[open] summary {
  color: var(--accent-gold);
  border-color: var(--accent-gold);
}
.lang-caret {
  width: 8px; height: 8px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform 220ms var(--ease-vault);
  display: inline-block;
}
.lang-switcher details[open] .lang-caret {
  transform: rotate(-135deg) translate(-2px, -2px);
}

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  padding: 4px 0;
  display: flex;
  flex-direction: column;
  z-index: 200;
  box-shadow: 0 12px 40px -16px rgba(0,0,0,0.6);
}
[dir="rtl"] .lang-menu { right: auto; left: 0; }

.lang-menu a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 0.05em;
  transition: color 180ms ease, background 180ms ease;
}
.lang-menu a:hover,
.lang-menu a:focus-visible {
  color: var(--accent-gold);
  background: rgba(212, 175, 55, 0.06);
  outline: none;
}
.lang-menu a[aria-current="true"] { color: var(--accent-gold); }
.lang-menu a .lang-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-faint);
  letter-spacing: 0.10em;
}
.lang-menu a:hover .lang-code,
.lang-menu a:focus-visible .lang-code,
.lang-menu a[aria-current="true"] .lang-code { color: var(--accent-gold); }

/* ── Main / sections ─────────────────────────────────────────── */

main { padding-top: 80px; }
@media (max-width: 767px) { main { padding-top: 60px; } }

section { position: relative; }

/* ── Hero ────────────────────────────────────────────────────── */

#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 96px 0;
}
.hero-inner {
  position: relative;
  width: 100%;
}
.hero-accent-line {
  display: block;
  width: 2px;
  height: 80px;
  background: var(--accent-gold);
  margin-bottom: 40px;
  box-shadow: 0 0 32px -8px rgba(212, 175, 55, 0.6);
}
.hero-h1 {
  font-size: clamp(36px, 5.5vw, 72px);
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin-bottom: 24px;
}
[lang|="zh"] .hero-h1,
[lang|="ar"] .hero-h1 { letter-spacing: 0; line-height: 1.2; }
.hero-subhead {
  font-size: clamp(15px, 1.4vw, 18px);
  font-weight: 400;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 600px;
  margin-bottom: 48px;
}
.hero-pillars {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 40px;
  row-gap: 8px;
}
.hero-pillar {
  font-size: 10px;
  color: var(--text-faint);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
[lang|="ar"] .hero-pillar,
[lang|="zh"] .hero-pillar { text-transform: none; letter-spacing: 0.06em; }
.hero-pillar-sep {
  font-size: 10px;
  color: var(--border-subtle);
  margin: 0 10px;
}
.hero-meta {
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.10em;
  line-height: 1.8;
}

@media (min-width: 1024px) {
  .hero-inner { padding-left: 20px; }
  .hero-accent-line {
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    margin-bottom: 0;
  }
  .hero-content { max-width: 60%; }

  [dir="rtl"] .hero-inner { padding-left: 0; padding-right: 20px; }
  [dir="rtl"] .hero-accent-line { left: auto; right: 0; }
}

/* ── Thesis ──────────────────────────────────────────────────── */

#thesis {
  min-height: 100vh;
  display: flex;
  align-items: center;
  border-top: 1px solid var(--border-subtle);
  padding: 96px 0;
}
.thesis-h2 {
  font-size: clamp(30px, 4vw, 56px);
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.15;
  letter-spacing: -0.02em;
  max-width: 880px;
  margin-bottom: 48px;
}
[lang|="zh"] .thesis-h2,
[lang|="ar"] .thesis-h2 { letter-spacing: 0; line-height: 1.25; }
.thesis-body p {
  font-size: 17px;
  color: var(--text-muted);
  line-height: 1.75;
  max-width: 720px;
}
.thesis-body p + p { margin-top: 24px; }

/* ── Platform ────────────────────────────────────────────────── */

#platform {
  min-height: 100vh;
  display: flex;
  align-items: center;
  border-top: 1px solid var(--border-subtle);
  padding: 96px 0;
  background-color: var(--bg-secondary);
}
.platform-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 64px;
}
@media (min-width: 1024px) {
  .platform-layout {
    grid-template-columns: 5fr 7fr;
    gap: 96px;
    align-items: start;
  }
}
.platform-h2 {
  font-size: clamp(32px, 4.5vw, 60px);
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin-bottom: 24px;
}
[lang|="zh"] .platform-h2,
[lang|="ar"] .platform-h2 { letter-spacing: 0; line-height: 1.2; }
.platform-sub {
  font-size: clamp(16px, 1.5vw, 18px);
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 24px;
}
.platform-body {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 380px;
}
.platform-list { display: contents; }
.platform-item {
  display: flex;
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border-subtle);
  align-items: flex-start;
  transition: background-color 280ms ease;
}
.platform-item:first-child { border-top: 1px solid var(--border-subtle); }
.platform-item:hover { background-color: rgba(212, 175, 55, 0.025); }
.platform-num {
  font-size: 11px;
  color: var(--accent-gold);
  letter-spacing: 0.15em;
  min-width: 26px;
  padding-top: 3px;
  flex-shrink: 0;
  direction: ltr;
}
.platform-name {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}
.platform-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
  margin-top: 4px;
}
.platform-tag {
  font-size: 10px;
  color: var(--accent-gold);
  letter-spacing: 0.10em;
  margin-top: 6px;
  display: block;
  opacity: 0.78;
}

/* ── Disciplines ─────────────────────────────────────────────── */

#disciplines {
  min-height: 100vh;
  display: flex;
  align-items: center;
  border-top: 1px solid var(--border-subtle);
  padding: 96px 0;
}
.disciplines-h2 {
  font-size: clamp(26px, 3.2vw, 44px);
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin-bottom: 64px;
}
[lang|="zh"] .disciplines-h2,
[lang|="ar"] .disciplines-h2 { letter-spacing: 0; line-height: 1.3; }
.disc-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
}
@media (min-width: 768px)  { .disc-grid { grid-template-columns: repeat(2, 1fr); gap: 40px; } }
@media (min-width: 1280px) { .disc-grid { grid-template-columns: repeat(4, 1fr); gap: 32px; } }

.disc-col {
  display: flex;
  flex-direction: column;
}
.disc-num {
  font-size: 14px;
  color: var(--accent-gold);
  letter-spacing: 0.20em;
  line-height: 1;
  direction: ltr;
}
.disc-rule {
  display: block;
  width: 24px;
  height: 1px;
  background: var(--accent-gold);
  margin-top: 12px;
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 700ms 200ms var(--ease-vault);
}
[dir="rtl"] .disc-rule { transform-origin: right center; }
.will-reveal.revealed .disc-rule { transform: scaleX(1); }

.disc-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  margin-top: 16px;
}
.disc-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-top: 12px;
  flex: 1;
}
.disc-stamp {
  font-size: 10px;
  color: var(--accent-gold);
  letter-spacing: 0.08em;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
  line-height: 1.6;
}

/* ── Posture ─────────────────────────────────────────────────── */

#posture {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  padding: 96px 0;
  min-height: 50vh;
  display: flex;
  align-items: center;
}
.posture-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-top: 48px;
}
@media (min-width: 1024px) { .posture-grid { grid-template-columns: repeat(4, 1fr); } }

.posture-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-faint);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  line-height: 1;
}
[lang|="zh"] .posture-label,
[lang|="ar"] .posture-label { text-transform: none; letter-spacing: 0.06em; }
.posture-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 8px;
  line-height: 1.3;
}

/* ── Contact ─────────────────────────────────────────────────── */

#contact {
  min-height: 100vh;
  display: flex;
  align-items: center;
  border-top: 1px solid var(--border-subtle);
  padding: 96px 0;
}
.contact-inner {
  width: 100%;
  text-align: center;
}
.contact-h2 {
  font-size: clamp(30px, 3.8vw, 48px);
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 32px;
}
[lang|="zh"] .contact-h2,
[lang|="ar"] .contact-h2 { letter-spacing: 0; line-height: 1.3; }
.contact-body {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 600px;
  margin: 0 auto 64px;
}
.contact-body p + p { margin-top: 16px; }
.contact-email-link {
  display: inline-block;
  font-size: clamp(22px, 2.5vw, 28px);
  font-weight: 700;
  color: var(--accent-gold);
  text-decoration: none;
  position: relative;
  padding-bottom: 4px;
  direction: ltr;
  transition: color 200ms ease;
}
.contact-email-link::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 1px;
  background: var(--accent-gold-hi);
  transition: width 320ms var(--ease-vault);
}
.contact-email-link:hover,
.contact-email-link:focus-visible { color: var(--accent-gold-hi); }
.contact-email-link:hover::after,
.contact-email-link:focus-visible::after { width: 100%; }

.pgp-note {
  display: block;
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.10em;
  margin-top: 16px;
}
.contact-rule {
  width: 80px;
  height: 1px;
  background: var(--accent-gold);
  opacity: 0.5;
  margin: 64px auto 0;
}

/* ── Footer ──────────────────────────────────────────────────── */

footer {
  background-color: var(--bg-primary);
  border-top: 1px solid var(--border-subtle);
  padding: 64px 0 80px;
  text-align: center;
}
.footer-co {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
[lang|="zh"] .footer-co,
[lang|="ar"] .footer-co { text-transform: none; letter-spacing: 0.06em; }
.footer-addr {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 8px;
}
.footer-impressum {
  font-size: 11px;
  color: var(--text-faint);
  line-height: 1.6;
  margin: 24px auto 0;
  max-width: 720px;
}
.footer-impressum a { color: inherit; text-decoration: none; }
.footer-impressum a:hover { color: var(--accent-gold); }
.footer-legal {
  font-size: 10px;
  color: var(--text-faint);
  line-height: 1.5;
  margin: 24px auto 0;
  max-width: 720px;
}

/* ── Focus & accessibility ──────────────────────────────────── */

a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .will-reveal { opacity: 1; transform: none; transition: none; }
  .disc-rule { transform: scaleX(1); transition: none; }
  .scroll-progress { transition: none; }
}

/* ── 404 page ────────────────────────────────────────────────── */

.notfound {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 96px 0;
  text-align: center;
}
.notfound-code {
  font-size: clamp(72px, 12vw, 144px);
  font-weight: 800;
  color: var(--accent-gold);
  line-height: 1;
  letter-spacing: -0.04em;
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
}
.notfound-title {
  font-size: clamp(20px, 2vw, 28px);
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 24px;
}
.notfound-body {
  font-size: 15px;
  color: var(--text-muted);
  margin-top: 16px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}
.notfound-back {
  display: inline-block;
  margin-top: 40px;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-gold);
  text-decoration: none;
  border: 1px solid var(--accent-gold);
  padding: 14px 28px;
  transition: color 200ms ease, background 200ms ease;
}
.notfound-back:hover,
.notfound-back:focus-visible {
  color: var(--bg-primary);
  background: var(--accent-gold);
}
