/* ============================================================
   nahianhasan.com — "Intelligence Bureau" design system
   Dark ops-room editorial / light paper-dossier variant.
   Fraunces (display) · Spline Sans (body) · Spline Sans Mono (labels)
   ============================================================ */

:root {
  --bg:        #0c0f0d;
  --bg-raise:  #12161310;
  --surface:   rgba(233, 228, 214, 0.03);
  --surface-2: rgba(233, 228, 214, 0.06);
  --line:      rgba(233, 228, 214, 0.14);
  --line-soft: rgba(233, 228, 214, 0.07);
  --text:      #e9e4d6;
  --text-dim:  #a59d89;
  --accent:    #f0a138;
  --accent-ink:#0c0f0d;
  --green:     #7fb98a;
  --glow:      rgba(240, 161, 56, 0.13);
  --grid-line: rgba(233, 228, 214, 0.045);

  --font-display: "Fraunces", "Georgia", serif;
  --font-body:    "Spline Sans", "Helvetica Neue", sans-serif;
  --font-mono:    "Spline Sans Mono", ui-monospace, "SF Mono", monospace;
}

html:not(.dark) {
  --bg:        #ece5d8;
  --bg-raise:  #e3dbcb;
  --surface:   rgba(26, 28, 24, 0.035);
  --surface-2: rgba(26, 28, 24, 0.07);
  --line:      rgba(26, 28, 24, 0.22);
  --line-soft: rgba(26, 28, 24, 0.10);
  --text:      #1c1e1a;
  --text-dim:  #5f5a4b;
  --accent:    #ad6b12;
  --accent-ink:#f4efe3;
  --green:     #3c7a4d;
  --glow:      rgba(173, 107, 18, 0.10);
  --grid-line: rgba(26, 28, 24, 0.05);
}

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

html { scroll-behavior: smooth; }

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

::selection { background: var(--accent); color: var(--accent-ink); }

/* ---- atmosphere: blueprint grid + grain + glow ---- */
.nh-atmosphere {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 120% 90% at 50% 0%, black 30%, transparent 85%);
  -webkit-mask-image: radial-gradient(ellipse 120% 90% at 50% 0%, black 30%, transparent 85%);
}
.nh-atmosphere::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 45% at 78% -8%, var(--glow), transparent 65%),
    radial-gradient(ellipse 45% 35% at 8% 28%, var(--glow), transparent 70%);
}
.nh-atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.48 0 0 0 0 0.42 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---- layout ---- */
.nh-container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* ---- type ---- */
.nh-display {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 560;
  letter-spacing: -0.015em;
  line-height: 1.02;
}
.nh-display em { font-style: italic; font-weight: 430; color: var(--accent); }

.nh-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}
.nh-tag::before { content: "[ "; color: var(--text-dim); }
.nh-tag::after  { content: " ]"; color: var(--text-dim); }

.nh-kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.nh-h2 {
  font-family: var(--font-display);
  font-weight: 560;
  font-size: clamp(30px, 4.5vw, 46px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 10px 0 14px;
}
.nh-h2 em { font-style: italic; font-weight: 430; color: var(--accent); }

.nh-lede { color: var(--text-dim); font-size: 17px; max-width: 56ch; }

/* ---- hairline rules with index numbers ---- */
.nh-rule {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 0;
}
.nh-rule::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---- header ---- */
.nh-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 60;
  border-bottom: 1px solid var(--line-soft);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
}
.nh-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
}
.nh-wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  text-decoration: none;
  color: var(--text);
  display: flex; align-items: baseline; gap: 8px;
}
.nh-wordmark .sig {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--accent);
}
.nh-nav { display: flex; align-items: center; gap: 26px; }
.nh-nav a {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text-dim);
  transition: color 0.18s;
  position: relative;
}
.nh-nav a:hover { color: var(--text); }
.nh-nav a.active { color: var(--accent); }
.nh-nav a.active::before { content: "▸ "; }
.nh-navsep { width: 1px; height: 14px; background: var(--line); }

.nh-iconbtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-dim);
  cursor: pointer;
  transition: color .18s, border-color .18s;
}
.nh-iconbtn:hover { color: var(--accent); border-color: var(--accent); }

/* mobile menu */
.nh-mobile-toggle { display: none; }
.nh-mobile-menu {
  display: none;
  border-top: 1px solid var(--line-soft);
  background: var(--bg);
  padding: 18px 24px 22px;
}
.nh-mobile-menu a {
  display: block;
  padding: 10px 0;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text-dim);
  border-bottom: 1px dashed var(--line-soft);
}
.nh-mobile-menu a:hover { color: var(--accent); }
.nh-mobile-menu.open { display: block; }

@media (max-width: 768px) {
  .nh-nav { display: none; }
  .nh-mobile-toggle { display: inline-flex; }
}

/* ---- cards: sharp corners, corner ticks ---- */
.nh-card {
  position: relative;
  border: 1px solid var(--line-soft);
  background: var(--surface);
  padding: 28px;
  transition: border-color 0.25s, background 0.25s, transform 0.25s;
}
.nh-card::before, .nh-card::after {
  content: "";
  position: absolute;
  width: 9px; height: 9px;
  border-color: var(--accent);
  border-style: solid;
  opacity: 0;
  transition: opacity 0.25s;
}
.nh-card::before { top: -1px; left: -1px; border-width: 1px 0 0 1px; }
.nh-card::after  { bottom: -1px; right: -1px; border-width: 0 1px 1px 0; }
.nh-card:hover {
  border-color: var(--line);
  background: var(--surface-2);
  transform: translateY(-3px);
}
.nh-card:hover::before, .nh-card:hover::after { opacity: 1; }

.nh-card h3 {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 560;
  margin-bottom: 10px;
}
.nh-card p { color: var(--text-dim); font-size: 15px; }

.nh-index {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--accent);
  display: block;
  margin-bottom: 14px;
}

/* ---- buttons ---- */
.nh-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 22px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.nh-btn:hover { box-shadow: 0 0 24px var(--glow), 0 0 0 1px var(--accent); }
.nh-btn.ghost { background: transparent; color: var(--accent); }
.nh-btn.ghost:hover { background: var(--accent); color: var(--accent-ink); }

/* ---- ticker strip ---- */
.nh-ticker {
  overflow: hidden;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  padding: 11px 0;
  white-space: nowrap;
}
.nh-ticker-track {
  display: inline-block;
  animation: nh-marquee 36s linear infinite;
}
.nh-ticker span {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-right: 18px;
}
.nh-ticker span::after { content: "·"; color: var(--accent); margin-left: 18px; }
@keyframes nh-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---- staggered reveal on load / scroll ---- */
.nh-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.nh-reveal.in { opacity: 1; transform: none; }
.nh-reveal.d1 { transition-delay: 0.08s; }
.nh-reveal.d2 { transition-delay: 0.16s; }
.nh-reveal.d3 { transition-delay: 0.26s; }
.nh-reveal.d4 { transition-delay: 0.38s; }

@media (prefers-reduced-motion: reduce) {
  .nh-reveal { opacity: 1; transform: none; transition: none; }
  .nh-ticker-track { animation: none; }
}

/* ---- scroll progress ---- */
.nh-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: var(--accent);
  z-index: 100;
}

/* ---- footer ---- */
.nh-footer {
  border-top: 1px solid var(--line-soft);
  padding: 34px 0;
  margin-top: 90px;
}
.nh-footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.nh-footer a { color: var(--text-dim); text-decoration: none; }
.nh-footer a:hover { color: var(--accent); }

/* ---- generic grids ---- */
.nh-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.nh-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media (max-width: 880px) { .nh-grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .nh-grid-2, .nh-grid-3 { grid-template-columns: 1fr; } }

/* ---- section spacing ---- */
.nh-section { padding: 96px 0 0; }
