/* ═══════════════════════════════════════════════════════════════
   style_common.css — Shared styles for Fractal CRE site
   ═══════════════════════════════════════════════════════════════ */

/* ── CSS VARIABLES ── */
:root {
  --black:       #0a0b0d;
  --deep:        #0f1014;
  --surface:     #141519;
  --panel:       #1a1c22;
  --panel-alt:   #1f2128;
  --border:      rgba(180,148,80,0.18);
  --border-dim:  rgba(180,148,80,0.09);
  --text:        #e8e2d6;
  --text-dim:    #8c8476;
  --text-muted:  #4a453e;
  --gold:        #c9a96e;
  --gold-bright: #e8c882;
  --gold-deep:   #9e7c45;
  --ivory:       #f4ede0;
  --slate:       #8fa0b4;
  --accent:      #4a7fa5;
  --danger:      #c45c3a;
  --success:     #4a9e6e;
  --glow-gold:   rgba(201,169,110,0.08);
  --glow-accent: rgba(74,127,165,0.10);
  --nav-bg:      rgba(10,11,13,0.88);
}

html.light {
  --black:       #f5f0e8;
  --deep:        #ede7dc;
  --surface:     #e4ddd2;
  --panel:       #dbd3c6;
  --panel-alt:   #d2c9bb;
  --border:      rgba(120,88,40,0.20);
  --border-dim:  rgba(120,88,40,0.12);
  --text:        #1c160e;
  --text-dim:    #5a4e3c;
  --text-muted:  #9a8e7a;
  --gold:        #8a6228;
  --gold-bright: #6b4c1c;
  --gold-deep:   #a87c38;
  --ivory:       #140f08;
  --slate:       #3a5272;
  --accent:      #2a5f85;
  --danger:      #9e3318;
  --success:     #2e7a4e;
  --glow-gold:   rgba(138,98,40,0.07);
  --glow-accent: rgba(42,95,133,0.08);
  --nav-bg:      rgba(245,240,232,0.92);
}

/* ── BASE TRANSITIONS ── */
body, nav, section, footer {
  transition: background 0.35s ease, color 0.25s ease,
              border-color 0.35s ease;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--black);
  color: var(--text);
  font-family: 'Karla', sans-serif;
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
}

/* ── GRAIN OVERLAY ── */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.035'/%3E%3C/svg%3E");
  opacity: 0.6;
}

/* ── GRID BACKGROUND ── */
.grid-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(180,148,80,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(180,148,80,0.025) 1px, transparent 1px);
  background-size: 80px 80px;
}

/* ── LAYOUT ── */
.page { position: relative; z-index: 1; }
.container { max-width: 1140px; margin: 0 auto; padding: 0 48px; }
.container-narrow { max-width: 820px; margin: 0 auto; padding: 0 48px; }

/* ── NAV ── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 20px 48px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border-dim);
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.nav-logo {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none;
}
.nav-logo-mark {
  width: 32px; height: 32px;
  border: 1px solid var(--gold-deep);
  display: grid; place-items: center;
  transform: rotate(45deg);
  flex-shrink: 0;
  transition: border-color 0.35s;
}
.nav-logo-mark::before {
  content: '';
  width: 12px; height: 12px;
  background: var(--gold);
  transform: rotate(-45deg);
  transition: background 0.35s;
}
.nav-logo-text {
  font-family: 'Karla', sans-serif;
  font-size: 13px; font-weight: 600;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--text);
}
.nav-cta {
  font-size: 11px; font-weight: 600; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--black);
  background: var(--gold); padding: 10px 22px;
  text-decoration: none; transition: background 0.2s, color 0.2s;
}
.nav-cta:hover { background: var(--gold-bright); }
.fLogo { height: 66px; position: relative; left: -12px; }

/* ── THEME TOGGLE ── */
.theme-toggle {
  display: flex; align-items: center; gap: 8px;
  background: none; border: 1px solid var(--border-dim);
  padding: 7px 14px 7px 10px; cursor: pointer;
  color: var(--text-dim); font-family: 'Karla', sans-serif;
  font-size: 11px; font-weight: 600; letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  white-space: nowrap;
}
.theme-toggle:hover {
  border-color: var(--gold-deep); color: var(--gold);
  background: var(--glow-gold);
}
.theme-toggle-icon { width: 18px; height: 18px; position: relative; flex-shrink: 0; }
.icon-sun, .icon-moon {
  position: absolute; inset: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; line-height: 1;
}
.icon-sun  { opacity: 1; transform: rotate(0deg) scale(1); }
.icon-moon { opacity: 0; transform: rotate(30deg) scale(0.7); }
html.light .icon-sun  { opacity: 0; transform: rotate(-30deg) scale(0.7); }
html.light .icon-moon { opacity: 1; transform: rotate(0deg) scale(1); }
.toggle-label-dark  { display: inline; }
.toggle-label-light { display: none; }
html.light .toggle-label-dark  { display: none; }
html.light .toggle-label-light { display: inline; }

/* ── BUTTONS ── */
.btn-primary {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--black);
  background: var(--gold); padding: 16px 32px;
  text-decoration: none; transition: background 0.2s;
}
.btn-primary:hover { background: var(--gold-bright); }
.btn-primary .arrow { font-size: 16px; transition: transform 0.2s; }
.btn-primary:hover .arrow { transform: translateX(4px); }
.btn-ghost {
  font-size: 12px; font-weight: 500; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--text-dim);
  text-decoration: none; border-bottom: 1px solid var(--border-dim);
  padding-bottom: 2px; transition: color 0.2s, border-color 0.2s;
}
.btn-ghost:hover { color: var(--gold); border-color: var(--gold-deep); }

/* ── REVEAL ANIMATIONS ── */
.reveal {
  opacity: 0; transform: translateY(24px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ── FOOTER ── */
footer {
  background: var(--deep);
  border-top: 1px solid var(--border-dim);
  padding: 48px 0;
}
.footer-inner {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 24px;
}
.footer-brand {
  font-family: 'Karla', sans-serif;
  font-size: 12px; font-weight: 600; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--text-muted);
}
.footer-brand span { color: var(--gold-deep); }
.footer-links { display: flex; gap: 28px; list-style: none; }
.footer-links a {
  font-size: 12px; color: var(--text-muted);
  text-decoration: none; transition: color 0.2s;
}
.footer-links a:hover { color: var(--gold); }
.footer-copy { font-size: 12px; color: var(--text-muted); font-weight: 300; }

/* ── RESPONSIVE BASE ── */
@media (max-width: 900px) {
  .container, .container-narrow { padding: 0 24px; }
  nav { padding: 16px 24px; }
  .theme-toggle { display: none; }
}
