/* ============================================
   HFG CAPITAL — Layout (ICONIQ Design)
   ============================================ */

/* ---- Screen-reader only (visually hidden but accessible) ---- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Header slot placeholder (prevents flash while partial loads) ---- */
#header-slot {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: var(--z-nav);
  height: var(--nav-height);
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}

/* Dark mode #header-slot — uses var(--color-bg) and var(--color-border) which auto-switch */

/* ---- SPA content transition ---- */
#spa-content {
  transition: opacity 0.15s ease;
}

/* ---- Skip to content link (accessibility) ---- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 9999;
  padding: 12px 24px;
  background: var(--color-gold);
  color: var(--color-bg-dark);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 4px 4px;
}

.skip-link:focus {
  left: 50%;
  transform: translateX(-50%);
}

/* ---- NAVBAR ---- */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: var(--z-nav);
  padding: 0 60px;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  transition: background 0.4s, border-color 0.4s, box-shadow 0.4s;
}

.navbar.scrolled {
  background: rgba(250, 249, 247, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 20px rgba(0,0,0,0.04);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.15em;
  color: var(--color-text);
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 40px;
}

.nav-links a {
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.03em;
  color: var(--color-text-muted);
  transition: color var(--transition-base);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-gold);
  transition: width 0.4s ease;
}

.nav-links a:hover { color: var(--color-text); }
.nav-links a:hover::after { width: 100%; }
.nav-links a.active { color: var(--color-gold); }
.nav-links a.active::after { width: 100%; }

.nav-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-access {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-gold);
  background: none;
  border: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 10px 12px;
  transition: color var(--transition-base), opacity var(--transition-base);
  cursor: pointer;
  position: relative;
}

.nav-access::after {
  content: '';
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  height: 1px;
  background: var(--color-gold);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.nav-access:hover::after {
  transform: scaleX(1);
}

.nav-access:hover {
  color: var(--color-gold);
}

/* ---- HAMBURGER ---- */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 10px;
  background: none;
  border: none;
  min-height: 44px;
  min-width: 44px;
  align-items: center;
  justify-content: center;
}

.hamburger span {
  width: 22px;
  height: 1.5px;
  background: var(--color-text);
  transition: 0.3s;
}

.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 4px); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -4px); }

/* ---- MOBILE MENU OVERLAY ---- */
.main-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(250, 249, 247, 0.98);
  backdrop-filter: blur(20px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: var(--z-overlay);
}

.main-menu-overlay.open { display: flex; }

.main-menu {
  text-align: center;
}

.main-menu ul {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.main-menu a {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--color-text);
  transition: color var(--transition-base);
}

.main-menu a:hover { color: var(--color-gold); }
.main-menu a.active { color: var(--color-gold); }

/* ---- LANGUAGE SELECTOR ---- */
.lang-container { position: relative; }

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.75rem;
  font-family: var(--font-body);
  color: var(--color-text-muted);
  background: none;
  border: none;
  min-height: 44px;
  min-width: 44px;
  padding: 8px;
  transition: color var(--transition-base);
}

.lang-toggle:hover { color: var(--color-text); }

.lang-flag {
  width: 20px;
  height: 14px;
  object-fit: cover;
  border-radius: 2px;
}

.lang-arrow { font-size: 0.6rem; }

.lang-menu {
  position: absolute;
  top: 40px;
  right: 0;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 6px 0;
  display: none;
  flex-direction: column;
  width: max-content;
  min-width: 160px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.08);
  z-index: 200;
}

.lang-menu.show { display: flex; }

.lang-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  transition: var(--transition-fast);
}

.lang-option:hover { background: var(--color-gold-dim); color: var(--color-text); }

.lang-option img {
  width: 20px;
  height: 14px;
  object-fit: cover;
  border-radius: 2px;
}

/* ---- HERO ---- */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 120px 60px 80px;
  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--color-overlay-light);
  z-index: 1;
  pointer-events: none;
}

.hero-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
  filter: saturate(0.6);
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}

.hero-content {
  max-width: var(--container-max);
  margin: 0 auto;
  width: 100%;
  position: relative;
  z-index: 2;
}

.hero-eyebrow {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-gold);
  margin-bottom: 30px;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.8s ease forwards 0.2s;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5.5vw, 5rem);
  line-height: 1.1;
  font-weight: 400;
  color: var(--color-text);
  margin-bottom: 40px;
  max-width: 900px;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUp 1s ease forwards 0.4s;
}

.hero-title em {
  font-style: italic;
  color: var(--color-gold);
}

.hero-motto {
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.25em;
  color: var(--color-text-muted);
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.8s ease forwards 0.7s;
}

.hero-line {
  width: 0;
  height: 1px;
  background: var(--color-gold);
  margin-top: 50px;
  animation: expandLine 1.2s ease forwards 1s;
}

.hero-scroll-hint {
  position: absolute;
  bottom: 40px;
  left: 60px;
  z-index: 1;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0;
  animation: fadeUp 0.8s ease forwards 1.5s;
}

.scroll-line {
  width: 40px;
  height: 1px;
  background: var(--color-text-muted);
  animation: pulse 2s ease infinite;
}

/* ---- THEMED SECTIONS ---- */
.section-block {
  padding: 100px 60px;
  position: relative;
  overflow: hidden;
}

.section-block .container {
  max-width: var(--container-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
  position: relative;
  z-index: 2;
}

.section-block .container.reverse { direction: rtl; }
.section-block .container.reverse > * { direction: ltr; }

/* Background image inside section */
.section-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}

/* Color overlay on top of image */
.section-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.theme-custodire { background: var(--color-navy); color: var(--color-text-light); }
.theme-custodire .section-overlay { background: rgba(27, 42, 74, 0.78); }

.theme-augere { background: var(--color-deep-green); color: var(--color-text-light); }
.theme-augere .section-overlay { background: rgba(42, 61, 46, 0.78); }

.theme-tradere { background: var(--color-cream); color: var(--color-text); }
.theme-tradere .section-overlay { background: rgba(240, 235, 227, 0.78); }

.section-eyebrow {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-gold);
  margin-bottom: 20px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.5vw, 3.2rem);
  line-height: 1.15;
  font-weight: 400;
  margin-bottom: 25px;
}

.section-text {
  font-size: 0.9rem;
  line-height: 1.8;
  opacity: 0.85;
  margin-bottom: 35px;
}

.explore-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-gold);
  transition: gap var(--transition-base);
}

.explore-btn:hover { gap: 20px; }

.explore-btn .arrow {
  width: 32px;
  height: 32px;
  border: 1px solid var(--color-gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-base), transform var(--transition-base);
}

.explore-btn:hover .arrow {
  background: var(--color-gold);
  transform: translateX(4px);
}

.explore-btn .arrow svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: var(--color-gold);
  stroke-width: 2;
  transition: stroke var(--transition-base);
}

.explore-btn:hover .arrow svg { stroke: var(--color-text-light); }

/* Tradere section uses warm-taupe for explore btn */
.tradere-btn { color: var(--color-warm-taupe); }
.tradere-btn .arrow { border-color: var(--color-warm-taupe); }
.tradere-btn .arrow svg { stroke: var(--color-warm-taupe); }
.tradere-btn:hover .arrow { background: var(--color-warm-taupe); }
.tradere-btn:hover .arrow svg { stroke: var(--color-text-light); }

/* Visual block (section right side) */
.section-visual {
  position: relative;
  height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Roman numeral in visual block */
.section-numeral {
  font-family: 'Marcellus', serif;
  font-size: clamp(6rem, 12vw, 10rem);
  font-weight: 400;
  line-height: 1;
  color: rgba(181, 154, 92, 0.12);
  letter-spacing: 0.1em;
  user-select: none;
  transition: color 0.6s ease;
}

.section-block:hover .section-numeral {
  color: rgba(181, 154, 92, 0.2);
}

/* Tradere section numeral in darker tone for legibility on light bg */
.theme-tradere .section-numeral {
  color: rgba(26, 26, 26, 0.06);
}

.theme-tradere:hover .section-numeral {
  color: rgba(26, 26, 26, 0.1);
}

/* Keep old section-image styles for potential reuse */
.section-image {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  border-radius: 4px;
}

.section-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  filter: brightness(0.85) saturate(0.9);
}

.section-image:hover img {
  transform: scale(1.04);
  filter: brightness(0.9) saturate(1);
}

.section-image::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid rgba(181,154,92,0.25);
  border-radius: 4px;
  pointer-events: none;
}

/* ---- INFO SECTION ---- */
.info-section {
  padding: 120px 60px;
  background: var(--color-bg);
}

.info-container {
  max-width: var(--container-narrow);
  margin: 0 auto;
  text-align: center;
}

.info-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.5vw, 2.2rem);
  line-height: 1.5;
  font-weight: 400;
  color: var(--color-text);
  margin-bottom: 50px;
}

.info-title strong {
  font-weight: 400;
  color: var(--color-gold);
}

.stats-row {
  display: flex;
  justify-content: center;
  gap: 80px;
  padding-top: 50px;
  border-top: 1px solid var(--color-border);
}

.stat-item { text-align: center; }

.stat-number {
  font-family: var(--font-display);
  font-size: 2.5rem;
  color: var(--color-text);
  margin-bottom: 8px;
}

.stat-label {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

/* ---- VALUES SECTION ---- */
.values-section {
  padding: 100px 60px;
  background: var(--color-bg-dark);
  color: var(--color-text-light);
}

.values-container {
  max-width: var(--container-max);
  margin: 0 auto;
}

.values-header {
  text-align: center;
  margin-bottom: 70px;
}

.values-header h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 400;
  margin-bottom: 15px;
}

.values-header p {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.values-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: rgba(255,255,255,0.06);
}

.value-card {
  background: var(--color-bg-dark);
  padding: 45px 35px;
  transition: background 0.4s;
}

.value-card:hover { background: rgba(255,255,255,0.03); }

.value-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 400;
  margin-bottom: 15px;
  color: var(--color-gold-light);
}

.value-card p {
  font-size: 0.8rem;
  line-height: 1.8;
  color: rgba(255,255,255,0.6);
}

/* ---- FOOTER ---- */
.footer {
  padding: 60px 60px 40px;
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
}

.footer-container {
  max-width: var(--container-max);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.footer-brand-col {
  flex-shrink: 0;
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: 0.15em;
  margin-bottom: 15px;
}

.footer-motto {
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  max-width: 300px;
}

.footer-links {
  display: flex;
  gap: 50px;
}

.footer-col h4 {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-text);
  margin-bottom: 15px;
}

.footer-col a {
  display: block;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-bottom: 10px;
  transition: color var(--transition-base);
}

.footer-col a:hover { color: var(--color-gold); }

.footer-bottom {
  max-width: var(--container-max);
  margin: 40px auto 0;
  padding-top: 25px;
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  color: var(--color-text-muted);
}

/* ---- SCROLL REVEAL ---- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- KEYFRAMES ---- */
@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes expandLine {
  to { width: 120px; }
}

@keyframes pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

@keyframes shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-5px); }
  100% { transform: translateX(0); }
}

/* ============================================
   DARK MODE OVERRIDES
   ============================================ */

/* Navbar — uses var(--color-bg) and var(--color-border) which auto-switch */

[data-theme="dark"] .navbar.scrolled {
  background: rgba(15, 15, 17, 0.95);
  box-shadow: 0 1px 20px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .nav-logo { color: var(--color-gold); }

[data-theme="dark"] .nav-links a:hover { color: var(--color-text); }

/* Language menu — background uses var(--color-bg) which auto-switches */
[data-theme="dark"] .lang-menu {
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .lang-option:hover {
  background: rgba(181, 154, 92, 0.1);
  color: var(--color-text);
}

[data-theme="dark"] .lang-toggle:hover { color: var(--color-text); }

/* Mobile menu overlay */
[data-theme="dark"] .main-menu-overlay {
  background: rgba(15, 15, 17, 0.98);
}

[data-theme="dark"] .main-menu a { color: var(--color-text); }

/* Hero */
[data-theme="dark"] .hero-bg-img {
  opacity: 1;
  filter: saturate(0.4);
}

/* Hero overlay — uses var(--color-overlay-light) which auto-switches */

/* Section overlays in dark mode — deeper overlays */
[data-theme="dark"] .theme-custodire { background: #0D1520; }
[data-theme="dark"] .theme-custodire .section-overlay { background: rgba(13, 21, 32, 0.82); }

[data-theme="dark"] .theme-augere { background: #0D1A10; }
[data-theme="dark"] .theme-augere .section-overlay { background: rgba(13, 26, 16, 0.82); }

[data-theme="dark"] .theme-tradere { background: var(--color-bg-dark); color: var(--color-text); }
[data-theme="dark"] .theme-tradere .section-overlay { background: rgba(26, 26, 28, 0.82); }
[data-theme="dark"] .theme-tradere .section-numeral { color: rgba(181, 154, 92, 0.08); }
[data-theme="dark"] .theme-tradere:hover .section-numeral { color: rgba(181, 154, 92, 0.15); }
[data-theme="dark"] .tradere-btn { color: var(--color-gold); }
[data-theme="dark"] .tradere-btn .arrow { border-color: var(--color-gold); }
[data-theme="dark"] .tradere-btn .arrow svg { stroke: var(--color-gold); }
[data-theme="dark"] .tradere-btn:hover .arrow { background: var(--color-gold); }

/* Info section */
[data-theme="dark"] .info-section { background: var(--color-bg); }

/* Values section */
[data-theme="dark"] .values-section { background: var(--color-bg-dark); }
[data-theme="dark"] .values-grid { background: rgba(255, 255, 255, 0.04); }
[data-theme="dark"] .value-card { background: var(--color-bg-dark); }
[data-theme="dark"] .value-card:hover { background: rgba(255, 255, 255, 0.03); }

/* Footer — uses var(--color-bg) and var(--color-border) which auto-switch */

/* Theme toggle button */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 13px;
  min-height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  transition: color var(--transition-base);
  position: relative;
}

.theme-toggle:hover { color: var(--color-gold); }

.theme-toggle svg {
  width: 18px;
  height: 18px;
  transition: transform 0.4s ease, opacity 0.3s ease;
}

.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }

[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* Reduced motion: no highlight animation */
@media (prefers-reduced-motion: reduce) {
  /* Hero animations */
  .hero-eyebrow,
  .hero-title,
  .hero-motto,
  .hero-scroll-hint {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .hero-line {
    animation: none;
    width: 120px;
  }

  .scroll-line {
    animation: none;
    opacity: 0.6;
  }

  /* Reveal transitions */
  .reveal {
    transition: none;
    opacity: 1;
    transform: none;
  }

  /* General transitions */
  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ---- PAGE BACKGROUND (inner pages) ---- */
body.has-page-bg {
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
}

body.has-page-bg::after {
  content: '';
  position: fixed;
  inset: 0;
  background: var(--color-overlay-light);
  z-index: 0;
  pointer-events: none;
}

body.has-page-bg .page-header,
body.has-page-bg .manifesto-section,
body.has-page-bg .manifesto-intro-section,
body.has-page-bg .principles-section,
body.has-page-bg .pillars-section,
body.has-page-bg .contact-section,
body.has-page-bg .about-intro-section,
body.has-page-bg .philosophy-intro-section,
body.has-page-bg .admin-section,
body.has-page-bg #footer-slot {
  position: relative;
  z-index: 1;
}

/* body.has-page-bg::after — uses var(--color-overlay-light) which auto-switches */
