/*
Theme Name: My Final Custom Theme
Author: Your Name
Description: A performance optimized custom theme built from scratch with Elementor support.
Version: 1.0.0
Text Domain: my-final-custom-theme
*/

/* ============================================================
   MASTER CSS TOKENS & STYLES (Performance Optimized)
============================================================ */
/* Fast Native System Font Stack */
body, h1, h2, h3, h4, h5, h6, input, button, textarea, select {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif !important;
  font-display: swap !important;
}

:root {
  --ink: #14151A;
  --ink-2: #2A2C35;
  --paper: #FBFAF7;
  --paper-2: #F3F1EA;
  --paper-3: #F3F1EA;
  --line: #E4E1D8;
  --line-2: #EAE7DE;
  --muted: #6B6A63;
  --muted-2: #6B7488;
  --cobalt: #1E3AF0;
  --cobalt-deep: #1730C4;
  --cobalt-tint: #E8ECFF;
  --forest: #1F8A4C;
  --forest-deep: #165E34;
  --forest-tint: #E4F0EA;
  --amber: #D97706;
  --amber-deep: #B45309;
  --amber-tint: #FEF3C7;
  --r-sm: 8px;
  --r-md: 18px;
  --r-lg: 24px;
  --r-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(20,21,26,.06);
  --shadow-md: 0 4px 12px rgba(20,21,26,.08);
  --shadow-lg: 0 12px 32px rgba(20,21,26,.12);
  --fs-h1: clamp(2.4rem, 1.8rem + 3vw, 4.2rem);
  --fs-h2: clamp(1.8rem, 1.4rem + 2vw, 2.8rem);
  --fs-h3: clamp(1.2rem, 1.1rem + .5vw, 1.5rem);
  --fs-body: clamp(1rem, .95rem + .3vw, 1.15rem);
  --fs-small: .88rem;
  --fs-xs: .78rem;
  --container: 1200px;
  --pad-x: clamp(12px, 4vw, 32px);
  --gap: 2rem;
  --ease: cubic-bezier(.22,.61,.36,1);
}

/* Fast Rendering & Reflow Fix */
html {
  box-sizing: border-box;
  overflow-x: hidden;
}

*, *:before, *:after {
  box-sizing: inherit;
}

body {
  margin: 0;
  padding-top: 80px !important;
  overflow-x: hidden;
}

/* Container Utility */
.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--pad-x);
}

/* Optimized Glassmorphism */
.glass {
  background: rgba(251,250,247,.85) !important;
  backdrop-filter: blur(12px) saturate(140%) !important;
  -webkit-backdrop-filter: blur(12px) saturate(140%) !important;
  border: 1px solid rgba(255,255,255,.6) !important;
  will-change: transform;
}

/* Header Styles - Layering Optimized */
.header-wrap {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  z-index: 1000 !important;
  padding-top: clamp(.6rem, .5rem + .5vw, 1.1rem);
  padding-bottom: .6rem;
  background: linear-gradient(var(--paper) 55%, transparent);
}

.site-header {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--pad-x);
}

.site-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 60px;
  padding-inline: clamp(.85rem, .6rem + 1vw, 1.5rem);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-sm);
}

.brand {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  flex-shrink: 0;
  min-width: 0;
  text-decoration: none;
  color: var(--ink);
}

.brand__mark {
  width: 28px; 
  height: 28px;
  border-radius: 9px;
  background: linear-gradient(155deg, var(--cobalt) 0%, var(--cobalt-deep) 100%);
  display: flex; 
  align-items: center; 
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}

.brand__mark svg { width: 15px; height: 15px; }
.brand span { color: var(--cobalt-deep); }
.brand__full { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nav {
  display: flex;
  align-items: center;
  gap: clamp(.75rem, .4rem + 1.2vw, 1.6rem);
  flex: 1;
  justify-content: center;
  min-width: 0;
}

.nav a {
  font-size: .86rem;
  font-weight: 600;
  color: var(--muted);
  padding: .4rem 0;
  position: relative;
  white-space: nowrap;
  text-decoration: none;
}

.nav a::after {
  content: "";
  position: absolute; 
  left: 0; 
  right: 0; 
  bottom: 0;
  height: 2px; 
  background: var(--cobalt);
  transform: scaleX(0); 
  transform-origin: right;
  transition: transform .25s var(--ease);
}

.nav a:hover { color: var(--ink); }
.nav a:hover::after { transform: scaleX(1); transform-origin: left; }

.header-right { 
  display: flex; 
  align-items: center; 
  gap: .6rem; 
  flex-shrink: 0; 
}

.btn {
  display: inline-flex; 
  align-items: center; 
  justify-content: center; 
  gap: .5rem;
  min-height: 40px; 
  font-size: .88rem; 
  font-weight: 700;
  padding: .5rem 1.2rem; 
  border-radius: var(--r-pill);
  text-decoration: none; 
  cursor: pointer; 
  transition: transform .2s var(--ease), background .2s var(--ease);
  border: 1px solid transparent;
}

.btn svg { width: 14px; height: 14px; }
.btn--lg { padding: .8rem 1.6rem; font-size: 1rem; min-height: 48px; }
.btn--primary { background: var(--cobalt); color: #ffffff !important; border-color: var(--cobalt); }
.btn--primary:hover { background: var(--cobalt-deep); border-color: var(--cobalt-deep); transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--ink) !important; border-color: var(--line); }
.btn--ghost:hover { background: rgba(20,21,26,.04); border-color: var(--ink); }

.menu-toggle {
  display: none;
  width: 44px; 
  height: 44px;
  align-items: center; 
  justify-content: center;
  background: transparent;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.menu-toggle span { 
  display: block; 
  position: relative; 
  width: 16px; 
  height: 1.5px; 
  background: var(--ink); 
  transition: background-color .2s var(--ease); 
}

.menu-toggle span::before, .menu-toggle span::after { 
  content: ""; 
  position: absolute; 
  left: 0; 
  width: 16px; 
  height: 1.5px; 
  background: var(--ink); 
  transition: transform .25s var(--ease), top .25s var(--ease); 
}

.menu-toggle span::before { top: -5px; }
.menu-toggle span::after { top: 5px; }
.menu-toggle[aria-expanded="true"] span { background: transparent; }
.menu-toggle[aria-expanded="true"] span::before { top: 0; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] span::after { top: 0; transform: rotate(-45deg); }

.mobile-panel {
  max-height: 0;
  overflow: hidden;
  margin-top: 0;
  transition: max-height .32s var(--ease), margin-top .32s var(--ease);
}

.mobile-panel.is-open { max-height: 560px; margin-top: .6rem; }
.mobile-panel__inner {
  display: flex; 
  flex-direction: column;
  padding: .75rem clamp(.85rem, .6rem + 1vw, 1.5rem) 1.3rem;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
}

.mobile-panel a {
  font-size: 1rem; 
  font-weight: 700; 
  color: var(--ink);
  padding: .85rem 0;
  min-height: 44px;
  display: flex; 
  align-items: center;
  border-bottom: 1px solid var(--line-2);
  text-decoration: none;
}

.mobile-panel a:last-of-type { border-bottom: none; }
.mobile-panel .btn { margin-top: 1rem; width: 100%; }

@media (max-width: 1079px) {
  .nav { display: none; }
  .menu-toggle { display: inline-flex; }
}

@media (max-width: 380px) {
  .btn--cta .btn__label { display: none; }
  .btn--cta { width: 44px; height: 44px; padding: 0; border-radius: 50%; }
}

/* ============================================================
   CUSTOM FOOTER STYLES (Performance & Mobile Optimized)
============================================================ */
.site-footer {
  background: var(--ink);
  color: #9AA3B7;
  margin-top: auto;
  border-top: 1px solid var(--line-2);
}

.footer__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap);
  padding-block: clamp(2.5rem, 2rem + 3vw, 5rem);
}

@media (min-width: 768px) {
  .footer__inner {
    grid-template-columns: 2fr 1fr 1fr;
  }
}

.footer__brand .brand {
  color: #ffffff;
  margin-bottom: 1rem;
}

.footer__brand p {
  font-size: var(--fs-small);
  line-height: 1.6;
  max-width: 38ch;
  color: #8E97AB;
  margin: 0;
}

.footer__col h4 {
  color: #ffffff;
  font-size: var(--fs-small);
  font-weight: 800;
  margin-top: 0;
  margin-bottom: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer__col {
  display: flex;
  flex-direction: column;
}

.footer__col a {
  font-size: var(--fs-small);
  color: #9AA3B7;
  margin-bottom: 0.85rem;
  min-height: 24px;
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

.footer__col a:hover {
  color: #ffffff;
}

.footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-block: 1.5rem;
}

.footer__bottom-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

@media (min-width: 480px) {
  .footer__bottom-inner {
    flex-direction: row;
  }
}

.footer__bottom p {
  font-size: var(--fs-xs);
  color: #6B7488;
  margin: 0;
}

.back-to-top {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: #9AA3B7;
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

.back-to-top:hover {
  color: #ffffff;
}

.back-to-top svg {
  width: 12px;
  height: 12px;
}
