@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&display=swap');

:root {
    --color-bg: #121212;
    --color-surface: #1C1C1C;
    --color-surface-hover: #252525;
    --color-primary: #D4AF37;
    /* Gold */
    --color-primary-hover: #b5952f;
    --color-text: #F4F1EA;
    /* Cream */
    --color-text-muted: #A1A1AA;

    --font-serif: 'Playfair Display', serif;
    --font-sans: 'Montserrat', sans-serif;

    --container-width: 1200px;
    --header-height: 80px;

    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.4);

    --tr-fast: 0.3s ease;
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Typography */
h1,
h2,
h3,
h4 {
    font-family: var(--font-serif);
    color: var(--color-primary);
    line-height: 1.1;
    font-weight: 700;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--tr-fast);
}

ul {
    list-style: none;
}

strong {
    color: var(--color-primary);
}

/* Layout Utilities */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    padding: 6rem 0;
}

.text-center {
    text-align: center;
}

.hidden {
    display: none;
}

/* Components: Buttons */
.btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    border: 1px solid var(--color-primary);
    background: transparent;
    color: var(--color-primary);
    font-family: var(--font-sans);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn:hover {
    background: var(--color-primary);
    color: var(--color-bg);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
}

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

.btn-primary:hover {
    background: #fff;
    border-color: #fff;
    color: var(--color-bg);
}

/* Components: Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    height: var(--header-height);
    background: rgba(18, 18, 18, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid rgba(212, 175, 55, 0.1);
}

.nav-container {
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-logo {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    color: var(--color-primary);
    font-weight: 700;
    letter-spacing: 1px;
}

.nav-links {
    display: flex;
    gap: 3rem;
}

.nav-link {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--color-text);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--color-primary);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link.active {
    color: var(--color-primary);
}

.mobile-toggle {
    display: none;
    font-size: 1.5rem;
    color: var(--color-primary);
    cursor: pointer;
}

/* Components: Card */
.card {
    background: var(--color-surface);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--tr-fast);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-primary);
}

/* Animations */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

/* Alpstone Back Button */
.alpstone-back-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    height: 50px;
    background: rgb(67, 141, 215);
    color: white;
    text-decoration: none;
    border-radius: 999px;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 4px 16px rgba(67, 141, 215, 0.25);
    z-index: 10000;

    /* Flexbox & Layout */
    display: flex;
    align-items: center;
    overflow: hidden;

    /* Stabilized Layout */
    padding: 0 20px 0 13px;
    /* Constant Left Padding of 13px */
    gap: 0;
    /* Removing gap to manual margin */

    /* Initial Expanded State */
    max-width: 250px;
    min-width: 50px;

    /* Smooth, Clean Transition */
    transition: max-width 0.5s ease, padding 0.5s ease, background-color 0.5s ease,
        box-shadow 0.5s ease, transform 0.5s ease;
}

.alpstone-btn-logo {
    height: 24px;
    width: 24px;
    object-fit: contain;
    filter: brightness(0) invert(1);
    flex-shrink: 0;
}

.alpstone-btn-text {
    white-space: nowrap;
    opacity: 1;
    max-width: 150px;
    margin-left: 12px;
    /* Replaces gap for separation */
    transition: max-width 0.5s ease, opacity 0.5s ease, margin-left 0.5s ease;
}

/* Collapsed State */
.alpstone-back-btn.collapsed:not(:hover) {
    max-width: 50px;
    /* Maintain 13px padding on both sides for 50px total width (13+24+13=50) */
    padding: 0 13px;

    background: rgba(67, 141, 215, 0.9);
    backdrop-filter: blur(5px);
}

.alpstone-back-btn.collapsed:not(:hover) .alpstone-btn-text {
    opacity: 0;
    max-width: 0;
    margin-left: 0;
    /* Remove margin so it doesn't push width */
}

.alpstone-back-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(67, 141, 215, 0.35);
    background: rgb(32, 55, 93);
    color: white;
}

/* ==========================================
   RESPONSIVE - TABLET (768px)
   ========================================== */

@media (max-width: 768px) {
    /* Container */
    .container {
        padding: 0 1.5rem;
    }

    /* Section padding */
    .section {
        padding: 4rem 0;
    }

    /* Navigation */
    .mobile-toggle {
        display: block;
        font-size: 1.8rem;
        cursor: pointer;
        z-index: 1001;
        padding: 8px;
        margin: -8px;
    }

    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--color-bg);
        flex-direction: column;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease, padding 0.3s ease;
        box-shadow: none;
        gap: 0;
        border-bottom: 1px solid rgba(212, 175, 55, 0.1);
    }

    .nav-links.open {
        max-height: 350px;
        padding: 1.5rem;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    }

    .nav-links li {
        text-align: center;
        padding: 0.75rem 0;
    }

    .nav-link {
        font-size: 1.1rem;
        display: block;
        padding: 0.5rem 0;
    }

    /* Typography */
    h1 {
        font-size: clamp(2.5rem, 5vw, 4rem) !important;
    }

    h2 {
        font-size: 1.8rem;
    }

    h3 {
        font-size: 1.3rem;
    }

    /* Buttons */
    .btn {
        padding: 0.9rem 2rem;
        font-size: 0.85rem;
    }

    /* Hero actions */
    .hero-actions {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }

    .hero-actions .btn {
        margin-left: 0 !important;
        width: 100%;
        max-width: 280px;
        text-align: center;
    }

    /* Cards grid */
    .card {
        margin-bottom: 1.5rem;
    }

    /* Footer */
    footer .container > div:first-child {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
        text-align: center;
    }

    footer ul {
        text-align: center;
    }

    /* Alpstone back button */
    .alpstone-back-btn {
        bottom: 15px;
        left: 15px;
    }
}

/* ==========================================
   RESPONSIVE - INTERMEDIATE (600px)
   ========================================== */

@media (max-width: 600px) {
    h1 {
        font-size: 2.2rem !important;
    }

    h2 {
        font-size: 1.6rem;
    }

    .section {
        padding: 3.5rem 0;
    }

    .btn {
        padding: 0.85rem 1.8rem;
    }
}

/* ==========================================
   RESPONSIVE - MOBILE (480px)
   ========================================== */

@media (max-width: 480px) {
    /* Container */
    .container {
        padding: 0 1rem;
    }

    /* Section */
    .section {
        padding: 3rem 0;
    }

    /* Navigation */
    .brand-logo {
        font-size: 1.4rem;
    }

    /* Hero */
    .hero {
        min-height: 100vh;
        height: auto !important;
    }

    .hero .container {
        padding: 2rem 1rem;
    }

    /* Typography */
    h1 {
        font-size: clamp(1.8rem, 8vw, 2.5rem) !important;
        line-height: 1.2 !important;
    }

    h2 {
        font-size: 1.4rem;
        margin-bottom: 0.8rem;
    }

    h3 {
        font-size: 1.15rem;
    }

    p {
        font-size: 0.95rem;
    }

    /* Decorative frames on hero */
    .hero > div[style*="position: absolute"][style*="inset"] {
        inset: 1rem !important;
    }

    /* Buttons */
    .btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.8rem;
        letter-spacing: 1px;
    }

    .btn-primary {
        width: 100%;
        max-width: 250px;
    }

    /* Hero actions */
    .hero-actions {
        flex-direction: column;
        gap: 0.8rem;
    }

    .hero-actions .btn {
        width: 100%;
        max-width: 250px;
    }

    /* Cards */
    .card > div:first-child {
        height: 200px !important;
    }

    .card > div:last-child {
        padding: 1.5rem !important;
    }

    .card h3 {
        font-size: 1.2rem !important;
    }

    .card p {
        font-size: 0.9rem !important;
    }

    /* Specialty cards grid */
    [style*="grid-template-columns: repeat(auto-fit, minmax(300px, 1fr))"] {
        grid-template-columns: 1fr !important;
    }

    /* Footer */
    footer {
        padding: 3rem 0 1.5rem !important;
    }

    footer h4 {
        font-size: 1.1rem;
        margin-bottom: 1rem !important;
    }

    footer ul li {
        font-size: 0.9rem;
    }

    /* Alpstone back button */
    .alpstone-back-btn {
        height: 44px;
        font-size: 0.85rem;
        bottom: 12px;
        left: 12px;
        min-width: 44px;
    }

    .alpstone-btn-logo {
        height: 20px;
        width: 20px;
    }

    .alpstone-back-btn.collapsed:not(:hover) {
        max-width: 44px;
        width: 44px;
        padding: 0 12px;
    }
}

/* ==========================================
   RESPONSIVE - SMALL MOBILE (360px)
   ========================================== */

@media (max-width: 360px) {
    .container {
        padding: 0 0.75rem;
    }

    h1 {
        font-size: 1.6rem !important;
    }

    h2 {
        font-size: 1.2rem;
    }

    h3 {
        font-size: 1.05rem;
    }

    .brand-logo {
        font-size: 1.1rem;
    }

    .btn {
        padding: 0.7rem 1.2rem;
        font-size: 0.75rem;
    }

    .card > div:first-child {
        height: 180px !important;
    }

    .card h3 {
        font-size: 1.1rem !important;
    }
}

/* ==========================================
   LANDSCAPE MODE
   ========================================== */

@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        height: auto !important;
        min-height: 100vh;
        padding: 3rem 0;
    }

    .nav-links.open {
        max-height: none;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        padding: 1rem 1.5rem;
        gap: 1.5rem;
    }

    .nav-links li {
        padding: 0;
    }
}
