@import url('./typography.css');

/* ==========================================================================
   Base & Variables (Assumed to be defined in your main CSS)
   ========================================================================== */
/* Ensure you have these variables defined in your :root somewhere */
/* 
:root {
  --line: #e2e8f0;
  --line-hi: #cbd5e1;
  --text-hi: #0f172a;
  --text-mid: #475569;
  --text-low: #94a3b8;
  --amber: #f59e0b;
  --cyan: #06b6d4;
  --ink-on-amber: #ffffff;
  --radius: 6px;
} 
*/

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg-void);
  color: var(--text-hi);
  font-family: var(--font-body, 'IBM Plex Sans', sans-serif);
  font-size: var(--text-body, 17px);
  line-height: var(--lh-body, 1.65);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

main {
  flex: 1;
}

/* ==========================================================================
   Header Container & Layout
   ========================================================================== */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  max-width: 1380px;
  margin: 0 auto;
  width: 100%;
}

/* ==========================================================================
   Logo Styles
   ========================================================================== */
.logo {
  display: flex;
  align-items: baseline;
  gap: 2px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  flex-shrink: 0;
  text-decoration: none;
}

.logo .techno {
  color: var(--text-hi);
}

.logo .intel {
  color: var(--amber);
}

/* ==========================================================================
   Primary Navigation & Dropdown Styling
   ========================================================================== */
nav.primary-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  /* Equal horizontal spacing between all nav items */
  margin: 0 24px;
  flex-shrink: 1;
}

/* Shared styling for standard links and the dropdown trigger */
nav.primary-nav a,
.nav-dropdown-trigger {
  font-size: 0.82rem;
  color: var(--text-mid);
  font-weight: 500;
  letter-spacing: 0.01em;
  padding: 6px 0;
  border-bottom: 1px solid transparent;
  transition: color 0.18s ease, border-color 0.18s ease;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}

nav.primary-nav a:hover,
.nav-dropdown-trigger:hover {
  color: var(--text-hi);
  border-color: var(--cyan);
}

/* Dropdown Container */
.nav-dropdown {
  position: relative;
  display: flex;
  align-items: center;
}

/* Dropdown Menu Box */
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  /* perfectly centers dropdown under parent */
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  min-width: 220px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--line);
  border-radius: var(--radius, 4px);
  padding: 8px 0;
  z-index: 100;
  margin-top: 16px;
  /* Gap between header and dropdown box */
}

/* Invisible bridge to keep hover active between trigger and menu */
.nav-dropdown::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 16px;
}

/* Show on hover */
.nav-dropdown:hover .nav-dropdown-menu {
  display: flex;
  flex-direction: column;
}

/* Dropdown Item Styling */
.nav-dropdown-menu a {
  padding: 10px 20px !important;
  border-bottom: none !important;
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  text-align: left;
}

.nav-dropdown-menu a:hover {
  background: var(--line);
  color: var(--text-hi);
  border-color: transparent;
}

/* ==========================================================================
   Header CTA & Actions
   ========================================================================== */
.header-cta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.header-cta a.assess {
  font-size: 0.8rem;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--ink-on-amber, #fff);
  background: var(--amber);
  padding: 10px 18px;
  /* Slightly larger clickable area */
  border-radius: var(--radius);
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: filter 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.header-cta a.assess:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

/* Responsive Toggle (Hidden by default) */
.nav-toggle {
  display: none;
}

/* ==========================================================================
   Footer Styling
   ========================================================================== */
footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--line);
  padding: 56px 0 34px;
  margin-top: 40px;
}

/* Assuming a wrap container exists inside footer */
footer .wrap {
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 24px;
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 32px;
  padding-bottom: 32px;
}

.footer-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 26px;
  /* 12px vertical gap, 26px horizontal gap */
}

.footer-links a,
.footer-links .nav-dropdown-trigger {
  font-size: 0.82rem;
  color: var(--text-mid);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.18s ease;
}

.footer-links a:hover,
.footer-links .nav-dropdown-trigger:hover {
  color: var(--cyan);
}

/* Footer-specific Dropdown Overrides (Opens Upwards) */
footer .nav-dropdown-menu {
  top: auto;
  bottom: 100%;
  margin-top: 0;
  margin-bottom: 16px;
}

footer .nav-dropdown::after {
  top: auto;
  bottom: 100%;
  height: 16px;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: var(--text-mono-label, 12px);
  color: var(--text-low);
  font-family: var(--font-mono, 'IBM Plex Mono', monospace);
}

/* ==========================================================================
   Responsive Queries
   ========================================================================== */
@media (max-width: 1240px) {
  nav.primary-nav {
    display: none;
  }

  nav.primary-nav.is-open {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    margin: 0;
    padding: 12px 24px 18px;
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  }

  nav.primary-nav.is-open a {
    width: 100%;
    padding: 10px 0;
  }

  .nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid var(--line-hi);
    color: var(--text-hi);
    width: 38px;
    height: 38px;
    border-radius: var(--radius);
    font-family: 'IBM Plex Mono', monospace;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
  }
}

@media (max-width: 768px) {
  .footer-bottom {
    flex-direction: column;
    text-align: center;
    justify-content: center;
  }
}

/* ==========================================================================
   Section Headings & Global Spacing Standards
   ========================================================================== */
.section {
  padding: 36px 0 40px;
}

.page-hero {
  position: relative;
  padding: 48px 0 32px;
}

/* Common light overlay for all hero sections with background */
.hero,
.page-hero {
  position: relative;
}

.hero > .wrap,
.page-hero > .wrap {
  position: relative;
  z-index: 2;
}

.hero .hero-bg,
.page-hero .hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  overflow: hidden;
}

.hero .hero-bg::after,
.page-hero .hero-bg::after {
  content: "" !important;
  display: block !important;
  position: absolute !important;
  inset: 0 !important;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0.35) 45%, rgba(255, 255, 255, 0.10) 100%) !important;
  pointer-events: none !important;
  z-index: 1 !important;
}

@media (max-width: 768px) {
  .hero .hero-bg::after,
  .page-hero .hero-bg::after {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.58) 0%, rgba(255, 255, 255, 0.32) 100%) !important;
  }
}

.section-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.section-head .index {
  font-family: var(--font-display, 'Space Grotesk', sans-serif) !important;
  font-size: 1.25rem !important;
  font-weight: 700 !important;
  color: var(--amber, #DD8E22) !important;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.2;
}

.section-head .rule {
  flex: 1;
  height: 2px;
  background: var(--line, #E3E6DF);
}

.story-index {
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--amber, #DD8E22);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: 12px;
}