/* ============================================
   GLOBAL.CSS — Premium Shared Design System
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600;700&family=Inter:wght@400;500;600;700&family=DM+Mono:wght@400;500&display=swap');

/* ── CSS Custom Properties ── */
:root {
  --navy: #0f1f38;
  --navy-deep: #0a1628;
  --navy-soft: #1b3358;
  --steel: #35527a;
  --accent: #c7a55b;
  --accent-soft: #d7b978;
  --accent-pale: #efe2bf;
  --ivory: #f7f4ee;
  --surface: #fcfbf8;
  --white: #ffffff;

  --text-dark: #13253f;
  --text-mid: #49617f;
  --text-soft: #6f829d;
  --text-faint: #97a7bc;

  --border: rgba(15, 31, 56, 0.10);
  --border-strong: rgba(15, 31, 56, 0.18);

  --shadow-xs: 0 2px 10px rgba(15, 31, 56, 0.04);
  --shadow-soft: 0 10px 30px rgba(15, 31, 56, 0.08);
  --shadow-card: 0 18px 50px rgba(15, 31, 56, 0.12);
  --shadow-hover: 0 22px 60px rgba(15, 31, 56, 0.16);

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --radius-xl: 30px;

  --transition: 0.32s cubic-bezier(0.4, 0, 0.2, 1);

  --font-display: 'Cormorant Garamond', serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'DM Mono', monospace;

  --max-width: 1200px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  /* Prevents fixed nav from covering section headings on anchor jump */
  scroll-padding-top: 96px;
}

body {
  font-family: var(--font-body);
  background: var(--ivory);
  color: var(--text-dark);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Ensures Cormorant Garamond applies to all headings,
   not only those carrying an explicit class */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transition), opacity var(--transition), transform var(--transition);
}

img {
  display: block;
  max-width: 100%;
}

ul {
  list-style: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

/* ── Global Layout ── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 40px;
}

.page-wrapper {
  padding-top: 76px;
}

section {
  position: relative;
}

/* ── Typography ── */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

.section-label::before {
  content: '';
  width: 30px;
  height: 1px;
  background: var(--accent);
  display: inline-block;
}

.section-heading {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--navy);
  margin-bottom: 22px;
}

.section-subtext {
  font-size: 1.06rem;
  line-height: 1.9;
  color: var(--text-mid);
  max-width: 720px;
}

/* ── Shared Page Hero ── */
.page-hero {
  padding: 120px 40px 80px;
  background:
    radial-gradient(circle at top right, rgba(199,165,91,0.10), transparent 30%),
    linear-gradient(180deg, #f9f7f2 0%, #f6f2ea 100%);
  border-bottom: 1px solid var(--border);
}

.page-hero-inner {
  max-width: 920px;
  margin: 0 auto;
  text-align: center;
}

.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 6vw, 4.8rem);
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -0.02em;
  color: var(--navy);
  margin-bottom: 20px;
}

.page-hero h1 em {
  font-style: italic;
  color: var(--accent);
}

.page-hero p {
  font-size: 1.08rem;
  line-height: 1.9;
  color: var(--text-mid);
  max-width: 760px;
  margin: 0 auto;
}

/* ── Navigation ── */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: 76px;
  display: flex;
  align-items: center;
  background: rgba(247, 244, 238, 0.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(15, 31, 56, 0.08);
}

.nav-inner {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--navy);
}

.nav-logo span {
  color: var(--accent);
}

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

.nav-links a {
  position: relative;
  font-size: 0.94rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-mid);
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -8px;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--navy);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  transform: scaleX(1);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--navy);
  color: var(--white) !important;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: var(--shadow-xs);
}

.nav-cta:hover {
  background: var(--navy-soft);
  transform: translateY(-1px);
}

.nav-cta::after {
  display: none !important;
}

/* Active state for Contact link when nav-cta and active both apply */
.nav-cta.active {
  background: var(--accent);
  color: var(--navy-deep) !important;
  border-color: transparent;
}

/* ── Mobile Nav ── */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  border-radius: 999px;
  background: var(--navy);
}

.nav-mobile {
  display: none;
  position: fixed;
  top: 76px;
  left: 0;
  right: 0;
  z-index: 999;
  padding: 24px 28px 28px;
  background: rgba(247, 244, 238, 0.98);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  flex-direction: column;
  gap: 18px;
}

.nav-mobile a {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-mid);
}

.nav-mobile.open {
  display: flex;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 14px 26px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: none;
}

.btn-primary {
  background: var(--navy);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--navy-soft);
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

.btn-outline {
  background: transparent;
  color: var(--navy);
  border-color: rgba(15, 31, 56, 0.22);
}

.btn-outline:hover {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

.btn-gold {
  background: var(--accent);
  color: var(--navy-deep);
  border-color: rgba(199,165,91,0.35);
}

.btn-gold:hover {
  background: var(--accent-soft);
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(199,165,91,0.24);
}

/* ── Tags / Pills ── */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(15, 31, 56, 0.05);
  border: 1px solid rgba(15, 31, 56, 0.08);
  color: var(--text-mid);
  font-size: 0.84rem;
  font-weight: 500;
}

.tag-gold {
  background: rgba(199,165,91,0.14);
  border-color: rgba(199,165,91,0.22);
  color: #8a6a24;
}

/* ── Shared Card Feel ── */
.card-surface,
.resume-sidebar-card,
.skills-sidebar-card,
.project-card,
.value-card,
.channel-card,
.skill-card,
.journey-step,
.about-visual-card {
  background: var(--surface);
  border: 1px solid rgba(15, 31, 56, 0.08);
  box-shadow: var(--shadow-soft);
}

/* ── Forms ── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

label {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--navy);
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid rgba(15, 31, 56, 0.14);
  background: var(--white);
  color: var(--text-dark);
  border-radius: 16px;
  padding: 15px 16px;
  font-size: 0.98rem;
  line-height: 1.5;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

textarea {
  min-height: 160px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-faint);
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(199,165,91,0.9);
  box-shadow: 0 0 0 4px rgba(199,165,91,0.12);
}

/* ── Accessibility — keyboard focus ring ── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ── Footer ── */
.site-footer {
  background:
    radial-gradient(circle at top right, rgba(199,165,91,0.10), transparent 28%),
    linear-gradient(180deg, var(--navy-deep) 0%, #0c1a30 100%);
  color: rgba(255,255,255,0.68);
  padding: 72px 40px 34px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 46px;
  padding-bottom: 34px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
}

.footer-logo {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 14px;
}

.footer-logo span {
  color: var(--accent);
}

.footer-brand p {
  max-width: 320px;
  font-size: 0.96rem;
  line-height: 1.85;
  color: rgba(255,255,255,0.62);
}

.footer-col h4 {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: 18px;
}

.footer-col a,
.footer-col p {
  display: block;
  margin-bottom: 12px;
  font-size: 0.95rem;
  line-height: 1.7;
  color: rgba(255,255,255,0.64);
}

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

.footer-bottom {
  max-width: var(--max-width);
  margin: 24px auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  font-size: 0.88rem;
  color: rgba(255,255,255,0.48);
}

/* ── Shared Utility ── */
.fade-up {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Mobile hero stats fallback ──
   Shown on small screens when the hero card sidebar is hidden.
   Add the matching HTML to index.html — see comment at bottom of file. */
.hero-stat-mobile {
  display: none;
}

/* ── Links in content ── */
.text-link {
  color: var(--navy);
  font-weight: 600;
}

.text-link:hover {
  color: var(--accent);
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .container,
  .nav-inner {
    padding-left: 24px;
    padding-right: 24px;
  }

  .page-wrapper {
    padding-top: 72px;
  }

  .site-nav {
    height: 72px;
  }

  .nav-mobile {
    top: 72px;
  }

  .nav-links {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .page-hero {
    padding: 100px 24px 64px;
  }

  .page-hero h1 {
    font-size: clamp(2.3rem, 10vw, 3.4rem);
  }

  .page-hero p,
  .section-subtext {
    font-size: 1rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Show the condensed inline stat strip in the hero on mobile */
  .hero-stat-mobile {
    display: flex;
    gap: 28px;
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid rgba(255,255,255,0.10);
  }

  .hero-stat-mobile .stat-num {
    font-family: var(--font-display);
    font-size: 1.9rem;
    font-weight: 600;
    color: var(--white);
    line-height: 1;
  }

  .hero-stat-mobile .stat-desc {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.52);
    margin-top: 4px;
    line-height: 1.4;
  }
}

@media (max-width: 640px) {
  /* Scope full-width buttons only to hero-actions and standalone form submits.
     This prevents CTA banner side-by-side buttons from breaking. */
  .hero-actions .btn,
  .form-submit .btn,
  .resume-dl-btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 15.5px;
  }

  .section-label {
    font-size: 0.74rem;
  }

  .footer-col a,
  .footer-col p,
  .footer-brand p {
    font-size: 0.92rem;
  }
}

/* ── Reduced motion — accessibility ── */
@media (prefers-reduced-motion: reduce) {
  .fade-up {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .hero-title,
  .hero-eyebrow,
  .hero-subtitle,
  .hero-actions,
  .hero-card {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .skill-bar-fill {
    transition: none;
  }

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

/*
  ── HTML ADDITION for mobile hero stats ──
  Add this block inside .hero-content in index.html,
  immediately after the closing </div> of .hero-actions:

  <div class="hero-stat-mobile">
    <div>
      <div class="stat-num">5+</div>
      <div class="stat-desc">Years Operational Experience</div>
    </div>
    <div>
      <div class="stat-num">3</div>
      <div class="stat-desc">Professional Certifications</div>
    </div>
  </div>

  ── FOOTER EMAIL — Fix in index.html, resume.html, projects.html ──
  Find:    your@email.com
  Replace: dereck@dereckmungoriwo.com

  Find:    linkedin.com/in/yourprofile
  Replace: linkedin.com/in/dereckmungoriwo
*/
