/* ============================================
   CTC Arch Estimation — Design System
   Premium Neomorphic + 3D Aesthetic
   ============================================ */

/* --- CSS Variables --- */
:root {
    /* Primary Palette */
    --color-primary: #0c1d36;
    --color-primary-light: #1a3358;
    --color-primary-rgb: 12, 29, 54;
    --color-accent: #d4a843;
    --color-accent-light: #e8c76a;
    --color-accent-dark: #b8912e;
    --color-accent-rgb: 212, 168, 67;
    --color-secondary: #3aafa9;
    --color-secondary-light: #5ec4bf;
    --color-dark: #0a1628;
    --color-dark-rgb: 10, 22, 40;

    /* Neomorphic Surface */
    --neo-bg: #e8ecf1;
    --neo-shadow-dark: #c5cad3;
    --neo-shadow-light: #ffffff;
    --neo-shadow: 6px 6px 14px var(--neo-shadow-dark), -6px -6px 14px var(--neo-shadow-light);
    --neo-shadow-sm: 3px 3px 8px var(--neo-shadow-dark), -3px -3px 8px var(--neo-shadow-light);
    --neo-shadow-inset: inset 3px 3px 8px var(--neo-shadow-dark), inset -3px -3px 8px var(--neo-shadow-light);
    --neo-shadow-hover: 8px 8px 20px var(--neo-shadow-dark), -8px -8px 20px var(--neo-shadow-light);

    /* Text */
    --text-primary: #1a2744;
    --text-secondary: #4a5568;
    --text-muted: #8896ab;
    --text-light: #f7fafc;
    --text-on-dark: #cbd5e0;

    /* Surfaces */
    --surface-white: #ffffff;
    --surface-light: #f7f9fc;
    --surface-card: #edf0f5;

    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'Space Grotesk', monospace;

    /* Spacing */
    --section-pad: clamp(60px, 8vw, 120px);
    --container-max: 1280px;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    /* Transitions */
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out: cubic-bezier(0, 0, 0.2, 1);
    --transition-fast: 0.2s var(--ease-smooth);
    --transition-mid: 0.4s var(--ease-smooth);
    --transition-slow: 0.6s var(--ease-out);

    /* Header */
    --header-height: 80px;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; overflow-x: hidden; width: 100%; }
body { font-family: var(--font-body); color: var(--text-primary); background: var(--neo-bg); line-height: 1.7; overflow-x: hidden; width: 100%; position: relative; }
img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; transition: color var(--transition-fast); }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; }

/* --- Container --- */
.container { width: 100%; max-width: var(--container-max); margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); }

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 { font-family: var(--font-heading); font-weight: 700; line-height: 1.2; color: var(--text-primary); }
h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.8rem, 4vw, 3rem); letter-spacing: -0.02em; }
h3 { font-size: clamp(1.3rem, 2.5vw, 1.8rem); }
h4 { font-size: clamp(1.1rem, 2vw, 1.35rem); }
p { color: var(--text-secondary); line-height: 1.8; }
.text-accent { color: var(--color-accent); }
.text-gradient { background: linear-gradient(135deg, var(--color-accent), var(--color-secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

/* --- Section Helpers --- */
.section { padding: var(--section-pad) 0; position: relative; }
.section-dark { background: var(--color-dark); color: var(--text-light); }
.section-dark h2, .section-dark h3, .section-dark h4 { color: var(--text-light); }
.section-dark p { color: var(--text-on-dark); }
.section-header { text-align: center; max-width: 700px; margin: 0 auto clamp(40px, 5vw, 70px); }
.section-header .label { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.15em; color: var(--color-accent); margin-bottom: 14px; }
.section-header .label::before { content: ''; width: 28px; height: 2px; background: var(--color-accent); border-radius: 2px; }
.section-header h2 { margin-bottom: 16px; }
.section-header p { font-size: 1.05rem; }

/* ============================================
   NEO BUTTONS
   ============================================ */
.neo-btn { display: inline-flex; align-items: center; gap: 8px; padding: 14px 32px; border-radius: var(--radius-md); font-family: var(--font-heading); font-weight: 600; font-size: 0.95rem; letter-spacing: 0.02em; transition: all 0.35s var(--ease-spring); position: relative; overflow: hidden; }
.neo-btn::before { content: ''; position: absolute; inset: 0; border-radius: inherit; opacity: 0; transition: opacity 0.3s; }
.neo-btn-primary { background: linear-gradient(135deg, var(--color-accent), var(--color-accent-dark)); color: var(--color-dark); box-shadow: 0 4px 15px rgba(var(--color-accent-rgb), 0.35); }
.neo-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(var(--color-accent-rgb), 0.45); }
.neo-btn-primary::before { background: linear-gradient(135deg, var(--color-accent-light), var(--color-accent)); }
.neo-btn-primary:hover::before { opacity: 1; }
.neo-btn-primary span, .neo-btn-primary i { position: relative; z-index: 1; }

.neo-btn-outline { background: transparent; color: var(--color-accent); border: 2px solid var(--color-accent); }
.neo-btn-outline:hover { background: var(--color-accent); color: var(--color-dark); transform: translateY(-2px); }

.neo-btn-accent { background: linear-gradient(135deg, var(--color-secondary), #2d9a94); color: #fff; box-shadow: 0 4px 15px rgba(58, 175, 169, 0.35); }
.neo-btn-accent:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(58, 175, 169, 0.45); }

.neo-btn-dark { background: var(--color-primary); color: var(--text-light); box-shadow: var(--neo-shadow-sm); }
.neo-btn-dark:hover { background: var(--color-primary-light); transform: translateY(-2px); }

.neo-btn-lg { padding: 18px 40px; font-size: 1.05rem; border-radius: var(--radius-lg); }

/* ============================================
   NEO CARDS
   ============================================ */
.neo-card { background: var(--neo-bg); border-radius: var(--radius-lg); box-shadow: var(--neo-shadow); padding: clamp(24px, 3vw, 40px); transition: all 0.4s var(--ease-spring); position: relative; overflow: hidden; }
.neo-card:hover { box-shadow: var(--neo-shadow-hover); transform: translateY(-4px); }
.neo-card-flat { background: var(--surface-white); border: 1px solid rgba(0,0,0,0.06); box-shadow: 0 2px 12px rgba(0,0,0,0.06); border-radius: var(--radius-lg); padding: clamp(24px, 3vw, 40px); transition: all 0.4s var(--ease-spring); }
.neo-card-flat:hover { box-shadow: 0 12px 40px rgba(0,0,0,0.1); transform: translateY(-4px); }
.neo-card-glass { background: rgba(255,255,255,0.15); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(255,255,255,0.2); border-radius: var(--radius-lg); padding: clamp(24px, 3vw, 40px); }

/* ============================================
   HEADER / NAV
   ============================================ */
.main-header { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; height: var(--header-height); transition: all 0.4s var(--ease-smooth); }
.main-header::before { content: ''; position: absolute; inset: 0; background: rgba(232, 236, 241, 0.85); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-bottom: 1px solid rgba(0,0,0,0.06); transition: all 0.4s; }
.main-header.scrolled::before { background: rgba(232, 236, 241, 0.95); box-shadow: 0 4px 30px rgba(0,0,0,0.08); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: var(--header-height); position: relative; z-index: 2; }

/* Logo */
.logo { display: flex; align-items: center; }
.logo-mark { display: flex; align-items: center; gap: 10px; }
.logo-icon { color: var(--color-accent); display: flex; }
.logo-text { display: flex; flex-direction: column; }
.logo-name { font-family: var(--font-heading); font-weight: 800; font-size: 1.4rem; color: var(--color-primary); line-height: 1.1; letter-spacing: -0.02em; }
.logo-sub { font-family: var(--font-mono); font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.15em; }
.logo-mark.light .logo-name { color: var(--text-light); }
.logo-mark.light .logo-sub { color: var(--text-on-dark); }

/* Desktop Nav */
.nav-list { display: flex; align-items: center; gap: 4px; }
.nav-link { display: flex; align-items: center; gap: 5px; padding: 10px 18px; font-family: var(--font-heading); font-weight: 500; font-size: 0.92rem; color: var(--text-secondary); border-radius: var(--radius-sm); transition: all var(--transition-fast); }
.nav-link:hover, .nav-link.active { color: var(--color-primary); background: rgba(0,0,0,0.04); }
.nav-link .dropdown-arrow { transition: transform 0.3s; }

/* Mega Dropdown */
.has-dropdown { position: relative; }
.dropdown-mega { position: absolute; top: 100%; left: 50%; transform: translateX(-50%) translateY(10px); width: 580px; opacity: 0; visibility: hidden; pointer-events: none; transition: all 0.35s var(--ease-spring); z-index: 100; }
.has-dropdown:hover .dropdown-mega { opacity: 1; visibility: visible; pointer-events: all; transform: translateX(-50%) translateY(0); }
.has-dropdown:hover .dropdown-arrow { transform: rotate(180deg); }
.dropdown-inner { background: var(--surface-white); border-radius: var(--radius-lg); box-shadow: 0 20px 60px rgba(0,0,0,0.12), 0 0 0 1px rgba(0,0,0,0.04); padding: 24px; overflow: hidden; }
.dropdown-header { padding-bottom: 16px; border-bottom: 1px solid rgba(0,0,0,0.06); margin-bottom: 16px; }
.dropdown-header h3 { font-size: 1rem; color: var(--text-primary); margin-bottom: 2px; }
.dropdown-header p { font-size: 0.82rem; color: var(--text-muted); }
.dropdown-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.dropdown-item { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: var(--radius-sm); transition: all var(--transition-fast); }
.dropdown-item:hover { background: var(--surface-light); }
.dropdown-icon { width: 40px; height: 40px; border-radius: 10px; background: linear-gradient(135deg, rgba(var(--color-accent-rgb), 0.12), rgba(var(--color-accent-rgb), 0.04)); color: var(--color-accent); display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; }
.dropdown-item strong { display: block; font-size: 0.88rem; color: var(--text-primary); font-weight: 600; }
.dropdown-item span { font-size: 0.78rem; color: var(--text-muted); }
.dropdown-footer { padding-top: 16px; border-top: 1px solid rgba(0,0,0,0.06); margin-top: 16px; text-align: center; }
.dropdown-cta { font-family: var(--font-heading); font-weight: 600; font-size: 0.88rem; color: var(--color-accent); display: inline-flex; align-items: center; gap: 6px; transition: gap 0.3s; }
.dropdown-cta:hover { gap: 10px; color: var(--color-accent-dark); }

/* Header CTA */
.header-cta { padding: 10px 24px; font-size: 0.88rem; }

/* Mobile Toggle */
.mobile-toggle { display: none; width: 44px; height: 44px; align-items: center; justify-content: center; border-radius: var(--radius-sm); z-index: 10; }
.hamburger { display: flex; flex-direction: column; gap: 5px; width: 22px; }
.hamburger span { display: block; height: 2px; background: var(--text-primary); border-radius: 2px; transition: all 0.35s var(--ease-spring); transform-origin: center; }
.mobile-toggle.active .hamburger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-toggle.active .hamburger span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.mobile-toggle.active .hamburger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile Nav */
.mobile-nav { position: fixed; top: var(--header-height); left: 0; right: 0; bottom: 0; background: var(--neo-bg); z-index: 999; opacity: 0; visibility: hidden; transform: translateY(-20px); transition: all 0.4s var(--ease-spring); overflow-y: auto; }
.mobile-nav.open { opacity: 1; visibility: visible; transform: translateY(0); }
.mobile-nav-inner { padding: 30px 24px; }
.mobile-nav-list > li > a { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; font-family: var(--font-heading); font-size: 1.15rem; font-weight: 600; color: var(--text-primary); border-bottom: 1px solid rgba(0,0,0,0.06); }
.mobile-dropdown-toggle i { transition: transform 0.3s; }
.mobile-dropdown.open .mobile-dropdown-toggle i { transform: rotate(180deg); }
.mobile-dropdown-list { display: none; padding: 8px 0 8px 20px; }
.mobile-dropdown.open .mobile-dropdown-list { display: block; }
.mobile-dropdown-list a { display: block; padding: 10px 0; font-size: 0.95rem; color: var(--text-secondary); }
.mobile-cta { display: block; text-align: center; margin-top: 30px; width: 100%; justify-content: center; }

/* ============================================
   FOOTER
   ============================================ */
.site-footer { position: relative; margin-top: 60px; }
.footer-wave { position: relative; top: 2px; }
.footer-wave svg { display: block; width: 100%; height: 80px; }
.footer-main { background: var(--color-dark); padding: 60px 0 40px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.2fr; gap: 40px; }
.footer-tagline { color: var(--text-on-dark); font-size: 0.9rem; margin: 16px 0 24px; line-height: 1.7; }
.footer-social { display: flex; gap: 10px; }
.footer-social a { width: 40px; height: 40px; border-radius: 10px; background: rgba(255,255,255,0.06); color: var(--text-on-dark); display: flex; align-items: center; justify-content: center; font-size: 0.95rem; transition: all var(--transition-fast); }
.footer-social a:hover { background: var(--color-accent); color: var(--color-dark); transform: translateY(-2px); }
.footer-heading { color: var(--text-light); font-size: 1rem; font-weight: 700; margin-bottom: 20px; position: relative; padding-bottom: 12px; }
.footer-heading::after { content: ''; position: absolute; bottom: 0; left: 0; width: 30px; height: 2px; background: var(--color-accent); border-radius: 2px; }
.footer-links li { margin-bottom: 10px; }
.footer-links a { color: var(--text-on-dark); font-size: 0.9rem; transition: all var(--transition-fast); display: inline-flex; align-items: center; gap: 0; }
.footer-links a:hover { color: var(--color-accent); gap: 4px; }
.footer-links a::before { content: ''; width: 0; height: 1px; background: var(--color-accent); transition: width 0.3s; }
.footer-links a:hover::before { width: 12px; }
.footer-contact li { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; color: var(--text-on-dark); font-size: 0.9rem; }
.footer-contact i { color: var(--color-accent); width: 18px; text-align: center; font-size: 0.95rem; }
.footer-contact a { color: var(--text-on-dark); }
.footer-contact a:hover { color: var(--color-accent); }
.footer-cta { margin-top: 20px; padding: 12px 24px; font-size: 0.85rem; }
.footer-bottom { background: rgba(255, 255, 255, 0.3); padding: 20px 0; }
.footer-bottom-inner { display: flex; justify-content: space-between; align-items: center; }
.footer-bottom p { color: var(--text-muted); font-size: 0.82rem; }
.footer-bottom-links { display: flex; gap: 24px; }
.footer-bottom-links a { color: var(--text-muted); font-size: 0.82rem; }
.footer-bottom-links a:hover { color: var(--color-accent); }

/* ============================================
   PAGE LOADER
   ============================================ */
.page-loader { position: fixed; inset: 0; background: var(--color-dark); z-index: 9999; display: flex; align-items: center; justify-content: center; transition: opacity 0.6s, visibility 0.6s; }
.page-loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-inner { text-align: center; }
.loader-cube { width: 50px; height: 50px; margin: 0 auto 20px; perspective: 200px; }
.cube-face { position: absolute; width: 50px; height: 50px; border: 2px solid var(--color-accent); border-radius: 4px; }
.loader-cube { animation: cubeRotate 2s infinite linear; transform-style: preserve-3d; position: relative; }
@keyframes cubeRotate { 0%{transform:rotateX(0) rotateY(0)} 100%{transform:rotateX(360deg) rotateY(360deg)} }
.cube-face.front{transform:translateZ(25px)} .cube-face.back{transform:rotateY(180deg) translateZ(25px)}
.cube-face.right{transform:rotateY(90deg) translateZ(25px)} .cube-face.left{transform:rotateY(-90deg) translateZ(25px)}
.cube-face.top{transform:rotateX(90deg) translateZ(25px)} .cube-face.bottom{transform:rotateX(-90deg) translateZ(25px)}
.loader-text { font-family: var(--font-heading); font-size: 1.2rem; font-weight: 800; color: var(--color-accent); letter-spacing: 0.2em; }

/* Scroll to Top */
.scroll-top-btn { position: fixed; bottom: 30px; right: 30px; width: 48px; height: 48px; border-radius: 14px; background: var(--color-primary); color: var(--color-accent); box-shadow: 0 4px 20px rgba(0,0,0,0.2); display: flex; align-items: center; justify-content: center; z-index: 90; opacity: 0; visibility: hidden; transform: translateY(20px); transition: all 0.4s var(--ease-spring); }
.scroll-top-btn.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.scroll-top-btn:hover { transform: translateY(-4px); background: var(--color-accent); color: var(--color-dark); }

/* ============================================
   PAGE HERO (reusable for inner pages)
   ============================================ */
.page-hero { padding: calc(var(--header-height) + 60px) 0 60px; background: var(--color-dark); position: relative; overflow: hidden; width: 100%; }
.page-hero::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 20% 50%, rgba(var(--color-accent-rgb), 0.08) 0%, transparent 60%), radial-gradient(ellipse at 80% 80%, rgba(58, 175, 169, 0.06) 0%, transparent 50%); }
.page-hero .container { position: relative; z-index: 2; }
.page-hero .breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 16px; }
.page-hero .breadcrumb a { color: var(--color-accent); }
.page-hero .breadcrumb a:hover { text-decoration: underline; }
.page-hero h1 { color: var(--text-light); margin-bottom: 16px; }
.page-hero p { color: var(--text-on-dark); font-size: 1.1rem; max-width: 600px; }
.page-hero-wave { position: absolute; bottom: -2px; left: 0; right: 0; width: 100%; overflow: hidden; }
.page-hero-wave svg { display: block; width: 100%; height: 60px; min-width: 1440px; margin-left: 50%; transform: translateX(-50%); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .main-nav, .header-cta { display: none; }
    .mobile-toggle { display: flex; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 30px; }
}
@media (max-width: 768px) {
    .footer-grid { grid-template-columns: 1fr; gap: 30px; }
    .footer-bottom-inner { flex-direction: column; gap: 12px; text-align: center; }
    .page-hero { padding-top: calc(var(--header-height) + 40px); padding-bottom: 50px; }
}
@media (max-width: 480px) {
    :root { --header-height: 64px; }
}
