/*
* Horizon Frontier Corporate Website
* Hybrid Design: Institutional Authority + Modern Visual Clarity
*
* style.css
* Version: 3.1
*/

/* 1. FONT IMPORT
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Overpass:wght@400;700;900&display=swap');

/* 2. CSS VARIABLE ARCHITECTURE
   ========================================================================== */
:root {
    --bg-primary: #0E110C; 
    --bg-secondary: #161A14;
    --text-primary: #FAFAFA; 
    --text-secondary: #B8BCBA;

    --hfr-teal: #3BA38E;
    --teal-dark: #2D7C6C;
    --teal-tint: rgba(59, 163, 142, 0.1);

    --border-color: #242926;
    
    --font-main: 'Overpass', sans-serif;
    
    --container-width: 1200px;
    --header-height: 90px;
    --section-spacing: 100px;

    --transition-standard: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 3. BASE & RESET STYLES
   ========================================================================== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { 
    overflow-x: hidden; 
    width: 100%;
    position: relative;
}

html { scroll-behavior: smooth; font-size: 16px; }

body { 
    background-color: var(--bg-primary); 
    color: var(--text-primary); 
    font-family: var(--font-main); 
    line-height: 1.6; 
    -webkit-font-smoothing: antialiased;
    transition: background-color var(--transition-standard), color var(--transition-standard);
}

/* Light Mode Overrides */
body.light-mode {
    --bg-primary: #FAFAFA;
    --bg-secondary: #F0F2F0;
    --text-primary: #0E110C;
    --text-secondary: #4A4F4C;
    --border-color: #D1D5D2;
}

body.light-mode .service-card, 
body.light-mode .card {
    background: var(--bg-secondary);
}

body.light-mode .global-header {
    background: rgba(250, 250, 250, 0.95);
}

body.light-mode .nav-menu {
    background: var(--bg-primary);
}

/* 4. TYPOGRAPHY
   ========================================================================== */
h1, h2, h3, h4 { 
    font-weight: 400; 
    text-transform: uppercase; 
    letter-spacing: 0.05em; 
    line-height: 1.1; 
    margin-bottom: 1.5rem;
}

h1 { font-size: clamp(2.5rem, 5vw, 3.5rem); }
h2 { 
    font-size: 2rem; 
    display: inline-block; 
    border-bottom: 2px solid var(--hfr-teal);
    padding-bottom: 8px;
    margin-bottom: 2.5rem; 
}
h3 { font-size: 1.25rem; color: var(--text-primary); }
h4 { font-size: 0.85rem; font-weight: 700; color: var(--hfr-teal); letter-spacing: 2px; }

p {
  margin-bottom: 1.25rem;
  color: var(--text-secondary);
}

.text-lead {
  font-size: 1.25rem;
  color: var(--text-primary);
  max-width: 800px;
}

/* 5. LAYOUT & GRID
   ========================================================================== */
.container { 
    max-width: var(--container-width); 
    margin: 0 auto; 
    padding: 0 30px; 
}

.section {
    padding: var(--section-spacing) 0;
}

.section-alt {
    background-color: var(--bg-secondary);
}

.grid-12 {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 30px;
}

.col-span-12 { grid-column: span 12; }
.col-span-8 { grid-column: span 8; }
.col-span-6 { grid-column: span 6; }
.col-span-4 { grid-column: span 4; }

@media (max-width: 992px) {
    .col-span-8, .col-span-6, .col-span-4 { grid-column: span 12; }
    .grid-12 { gap: 20px; }
}

/* 6. GLOBAL HEADER
   ========================================================================== */
.global-header {
  height: var(--header-height);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  background: rgba(14, 17, 12, 0.95);
  backdrop-filter: blur(10px);
  z-index: 1000;
}

.global-header .container {
    max-width: var(--container-width);
    width: 100%;
    padding: 0 30px;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: 15px;
  text-decoration: none;
}

.logo svg {
    height: 38px;
    width: auto;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    gap: 8px;
}

.logo-text .horizon { color: var(--text-primary); }
.logo-text .frontier { color: var(--hfr-teal); }

.nav-menu {
  list-style: none;
  display: flex;
  gap: 2.5rem;
  align-items: center;
}

#theme-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    padding: 5px;
    transition: color var(--transition-standard);
}

#theme-toggle:hover {
    color: var(--hfr-teal);
}

body.light-mode #theme-toggle .ph-sun { display: none; }
body:not(.light-mode) #theme-toggle .ph-moon { display: none; }

.nav-link {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-primary);
  text-decoration: none;
  transition: color var(--transition-standard);
  padding: 10px 0;
}

.nav-link:hover, .nav-link.active {
  color: var(--hfr-teal);
}

.tagline-sub {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--hfr-teal);
    margin-bottom: 1rem;
    display: block;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1001;
    padding: 10px;
}

.hamburger-icon {
    width: 24px;
    height: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hamburger-icon span {
    width: 100%;
    height: 2px;
    background-color: var(--text-primary);
    transition: all var(--transition-standard);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    :root {
        --header-height: 70px;
        --section-spacing: 60px;
    }

    .container { padding: 0 20px; }
    .section { padding: var(--section-spacing) 0; }
    .mobile-menu-toggle { display: block; }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background: var(--bg-primary);
        flex-direction: column;
        justify-content: center;
        gap: 2rem;
        transition: right 0.4s ease;
        visibility: hidden;
    }

    .nav-menu.is-active {
        right: 0;
        visibility: visible;
    }

    .logo-text { font-size: 1rem; }
    .logo svg { height: 30px; }
    h1 { font-size: 2.25rem; }
    h2 { font-size: 1.75rem; }

    .mobile-menu-toggle.is-active .hamburger-icon span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .mobile-menu-toggle.is-active .hamburger-icon span:nth-child(2) { opacity: 0; }
    .mobile-menu-toggle.is-active .hamburger-icon span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
}

/* 7. GLOBAL FOOTER
   ========================================================================== */
.global-footer {
  padding: 80px 0 40px;
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
}

@media (max-width: 768px) {
    .footer-grid { grid-template-columns: 1fr; gap: 40px; }
}

.footer-info h4 { margin-bottom: 0.5rem; }
.footer-info p { margin-bottom: 0.2rem; font-size: 0.9rem; }

.footer-contact-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.8rem;
}

@media (max-width: 768px) {
    .footer-contact-list { align-items: flex-start; }
}

.footer-contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-standard);
}

.footer-contact-item:hover {
    color: var(--hfr-teal);
    transform: translateX(-5px);
}

.footer-contact-item i {
    font-size: 1.1rem;
    color: var(--hfr-teal);
}

.footer-tagline {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--hfr-teal);
    margin-bottom: 1rem;
    display: block;
}

/* 8. UI ELEMENTS
   ========================================================================== */
.btn { 
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 32px; 
    font-size: 0.75rem; 
    font-weight: 700; 
    text-transform: uppercase; 
    letter-spacing: 2px;
    border: 1px solid var(--hfr-teal);
    transition: all var(--transition-standard);
    cursor: pointer;
    background: transparent;
    color: var(--text-primary);
    text-decoration: none;
}

.btn:hover {
    background: var(--hfr-teal);
    color: var(--bg-primary);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(59, 163, 142, 0.2);
}

/* Loading Spinner */
.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
    display: none;
}

@keyframes spin { to { transform: rotate(360deg); } }

.btn.is-loading .spinner { display: block; }
.btn.is-loading .btn-text { display: none; }

.service-card {
    padding: 50px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    transition: all var(--transition-standard);
    height: 100%;
}

.service-card:hover {
    border-color: var(--hfr-teal);
    transform: translateY(-10px);
    background: var(--bg-secondary);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

body.light-mode .service-card:hover {
    box-shadow: 0 20px 40px rgba(0,0,0,0.05);
}

.divider {
    height: 1px;
    background: var(--border-color);
    margin: 60px 0;
    border: none;
}

.divider-numbered { display: flex; align-items: center; margin: 4rem 0; }
.divider-numbered .number { font-size: 0.9rem; font-weight: 700; color: var(--hfr-teal); margin-right: 2rem; }
.divider-numbered .line { height: 1px; flex-grow: 1; background-color: var(--border-color); }

/* Error Page */
.error-page {
    height: calc(100vh - var(--header-height));
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* 10. ANIMATIONS
   ========================================================================== */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

/* 11. COOKIE BANNER
   ========================================================================== */
#cookie-banner {
    position: fixed;
    bottom: 30px;
    left: 30px;
    right: 30px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 30px;
    z-index: 10000;
    display: none; /* Controlled by JS */
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    max-width: 500px;
}

@media (max-width: 768px) {
    #cookie-banner {
        bottom: 0;
        left: 0;
        right: 0;
        max-width: 100%;
    }
}

#cookie-banner h4 {
    margin-bottom: 1rem;
    color: var(--hfr-teal);
}

#cookie-banner p {
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
}
