/* =============================================
   Terramar Software — Global Styles
   ============================================= */

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

html {
    height: 100%;
    scroll-behavior: smooth;
}

body {
    height: 100%;
    font-family: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    background: linear-gradient(160deg, #f8f6f2 0%, #faf8f3 40%, #fdfbf4 100%);
    color: #23272e;
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Typography --- */
h1, h2, h3, h4 {
    color: #23272e;
    line-height: 1.3;
}

h1 {
    font-size: 2.6rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

h2 {
    font-size: 1.8rem;
    font-weight: 600;
    letter-spacing: -0.005em;
}

h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

p {
    color: #4a4e57;
    font-size: 1.05rem;
    line-height: 1.7;
}

a {
    color: #c47f08;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #2ab5b1;
}

/* --- Layout --- */
.page-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.page-content {
    flex: 1;
    padding-top: 4.5rem; /* space for fixed nav */
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    padding: 4rem 0;
}

.section-header {
    margin-bottom: 2.5rem;
}

.section-header h2 {
    margin-bottom: 0.75rem;
}

.section-header p {
    color: #6b7080;
    font-size: 1.1rem;
    max-width: 600px;
}

/* --- Navigation --- */
.site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(248, 246, 242, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(36, 39, 46, 0.06);
    height: 4rem;
}

.nav-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.nav-brand {
    font-size: 1.15rem;
    font-weight: 700;
    color: #23272e;
    letter-spacing: 0.01em;
}

.nav-brand:hover {
    color: #23272e;
}

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

.nav-links a {
    color: #5a5e66;
    font-size: 0.92rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    padding: 0.4rem 0;
    position: relative;
    transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: #23272e;
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: #c47f08;
    border-radius: 1px;
}

/* Products dropdown */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
}

.nav-dropdown-toggle .chevron {
    font-size: 0.65rem;
    transition: transform 0.2s ease;
}

.nav-dropdown.open .chevron {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.75rem);
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 4px 24px rgba(36, 39, 46, 0.1), 0 1px 4px rgba(36, 39, 46, 0.06);
    padding: 0.5rem;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    transform: translateX(-50%) translateY(4px);
}

.nav-dropdown.open .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.nav-dropdown-menu a {
    display: block;
    padding: 0.6rem 1rem;
    border-radius: 0.5rem;
    color: #4a4e57;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
}

.nav-dropdown-menu a:hover {
    background: rgba(196, 127, 8, 0.06);
    color: #23272e;
}

.nav-dropdown-menu .product-label {
    font-weight: 600;
    color: #23272e;
}

.nav-dropdown-menu .product-desc {
    font-size: 0.8rem;
    color: #7a7e87;
    font-weight: 400;
    margin-top: 0.15rem;
}

/* Mobile nav toggle */
.nav-mobile-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: #23272e;
}

.nav-mobile-toggle svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
}

/* --- Footer --- */
.site-footer {
    border-top: 1px solid rgba(36, 39, 46, 0.06);
    padding: 2.5rem 0;
}

.footer-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-copy {
    color: #7a7e87;
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
}

.footer-links a {
    color: #7a7e87;
    font-size: 0.88rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: #23272e;
}

/* --- Utilities --- */
.text-muted {
    color: #7a7e87;
}

.text-accent {
    color: #c47f08;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }

    .container {
        padding: 0 1.5rem;
    }

    .section {
        padding: 3rem 0;
    }

    /* Mobile nav */
    .nav-mobile-toggle {
        display: block;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background: rgba(248, 246, 242, 0.98);
        backdrop-filter: blur(12px);
        padding: 1rem 2rem 1.5rem;
        gap: 0;
        border-bottom: 1px solid rgba(36, 39, 46, 0.06);
    }

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

    .nav-links li {
        border-bottom: 1px solid rgba(36, 39, 46, 0.04);
    }

    .nav-links li:last-child {
        border-bottom: none;
    }

    .nav-links a {
        display: block;
        padding: 0.75rem 0;
        font-size: 1rem;
    }

    .nav-dropdown-menu {
        position: static;
        transform: none;
        box-shadow: none;
        background: transparent;
        padding: 0 0 0 1rem;
        opacity: 1;
        visibility: visible;
    }

    .nav-dropdown.open .nav-dropdown-menu {
        transform: none;
    }

    .footer-inner {
        flex-direction: column;
        text-align: center;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .container {
        padding: 0 1.75rem;
    }
}
