:root {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --sub-text-color: #9e9e9e;
    --accent-color: #ff5b32;
    --card-bg: #1a1a1a;
    --nav-bg: rgba(18, 18, 18, 0.95);
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Inter', sans-serif;
    --transition-speed: 0.3s;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
    /* Ensure anchor targets aren't hidden by fixed header */
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    overflow-x: hidden;
    cursor: auto;
    /* Hide default cursor */
    line-height: 1.6;
    text-align: justify;
    hyphens: auto;
}

p {
    text-align: justify;
    hyphens: auto;
}

/* Float Utility for Software Page */
.tstar-logo-float {
    float: left;
    margin-right: 40px;
    margin-bottom: 30px;
    border-radius: 10px;
}

@media (max-width: 900px) {
    .tstar-logo-float {
        float: none;
        display: block;
        margin: 0 auto 30px;
        width: 60% !important;
    }
}


/* Page Transitions */
body {
    opacity: 1;
    transition: opacity 0.4s ease;
    /* Global transition */
}

body.fade-out {
    opacity: 0;
}

/* Content Fade In Animation (Removed Float) */
.float-in {
    animation: fadeInOnly 0.8s ease-out forwards;
    opacity: 0;
}

@keyframes fadeInOnly {
    to {
        opacity: 1;
    }
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: #fff;
    margin-bottom: 1rem;
    font-weight: 700;
}

h1 {
    font-size: 3.5rem;
    line-height: 1.1;
}

h2 {
    font-size: 2.5rem;
    color: var(--accent-color);
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-speed);
    cursor: pointer;
}

a:hover {
    color: var(--accent-color);
}

/* Layout Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: 50px 0;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 20px 0;
    background: var(--nav-bg);
    /* Opaque dark for legibility */
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    /* Subtler border */
}


.navbar.scrolled {
    padding: 10px 0;
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--font-heading);
    letter-spacing: 1px;
}

.nav-links {
    display: flex;
    gap: 30px;
    list-style: none;
}

.nav-links a {
    font-weight: 500;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--accent-color);
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    padding-top: 60px;
    background-color: var(--bg-color);
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../images/nuberho.webp');
    background-size: cover;
    background-position: center;
    opacity: 0.35;
    z-index: 0;
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero h1 span {
    display: block;
    color: var(--accent-color);
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 10px;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.hero p {
    max-width: 600px;
    margin: 20px auto;
    font-size: 1.2rem;
    opacity: 0.8;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    margin-top: 30px;
    border-radius: 5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    cursor: pointer;
    background: transparent;
}

.btn:hover {
    background: rgba(255, 87, 34, 0.1);
    box-shadow: 0 5px 15px rgba(255, 87, 34, 0.1);
    color: #fff;
}

.btn:active {
    transform: scale(0.95);
    transition: transform 0.1s;
}


/* Dark Card Style */
.card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    overflow: hidden;
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.card:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    border-color: var(--accent-color);
}

.card img {
    width: 100%;
    aspect-ratio: 3/2;
    object-fit: cover;
    display: block;
    transition: filter 0.6s ease;
}

.card:hover img {
    filter: brightness(1.1);
}

/* Performance Optimization */
.card {
    will-change: transform;
}

.card-content {
    padding: 20px;
}

.card-title {
    font-size: 1.2rem;
    color: #fff;
    margin-bottom: 10px;
}

.card-desc {
    font-size: 0.9rem;
    color: #ccc;
    margin-bottom: 15px;
}

/* Footer */
footer {
    background: var(--nav-bg);
    /* Solid back - matched to navbar */
    padding: 60px 0 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Grid Layouts */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    align-items: start;
}

@media (max-width: 1200px) {
    .grid-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
        /* Two columns on mobile as requested */
    }
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #fff;
}

.footer-brand p {
    color: #888;
    line-height: 1.6;
    max-width: 300px;
}

.footer-links h4 {
    color: #fff;
    margin-bottom: 20px;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-links ul {
    list-style: none;
}

.footer-links ul li {
    margin-bottom: 12px;
}

.footer-links ul li a {
    color: #888;
    text-decoration: none;
    transition: 0.3s;
    font-size: 0.95rem;
}

.footer-links ul li a:hover {
    color: var(--accent-color);
    padding-left: 5px;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 30px;
    text-align: center;
    color: #666;
    font-size: 0.85rem;
}

/* Hamburger Menu (Hidden on Desktop) */
.hamburger {
    display: none;
    cursor: pointer;
    background: transparent;
    border: none;
    z-index: 1001;
}

.hamburger span,
.hamburger-inner {
    display: block;
    width: 25px;
    height: 2px;
    background-color: var(--text-color);
    border-radius: 2px;
    transition: all 0.3s ease;
    position: relative;
}

.hamburger-inner::before,
.hamburger-inner::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background-color: var(--text-color);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger-inner::before {
    top: -8px;
}

.hamburger-inner::after {
    top: 8px;
}

.hamburger.active .hamburger-inner {
    background-color: transparent;
}

.hamburger.active .hamburger-inner::before {
    top: 0;
    transform: rotate(45deg);
}

.hamburger.active .hamburger-inner::after {
    top: 0;
    transform: rotate(-45deg);
}

.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    display: none;
    backdrop-filter: blur(5px);
}

.mobile-nav-overlay.active {
    display: block;
}

/* Base Responsive Typography */
@media (max-width: 1024px) {
    h1 {
        font-size: 3rem;
    }

    h2 {
        font-size: 2.2rem;
    }

    .container {
        padding: 0 40px;
    }

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

/* Mobile & Tablet Responsiveness */
@media (max-width: 768px) {

    /* Global Adjustments */
    html {
        font-size: 15px;
    }

    /* Slightly smaller base text */

    .container {
        padding: 0 20px;
    }

    .section {
        padding: 60px 0;
    }

    h1 {
        font-size: 2.2rem;
        line-height: 1.2;
    }

    h2 {
        font-size: 1.8rem;
    }

    h3 {
        font-size: 1.4rem;
    }

    /* Navigation - Hamburger Mode */
    .nav-container {
        justify-content: space-between !important;
        padding: 0 35px;
    }

    .logo {
        font-size: 1.35rem;
        /* Reduced by 10% from 1.5rem */
    }

    .hamburger {
        display: block;
    }

    .nav-links {
        display: block;
        position: fixed;
        top: 0;
        right: -100%;
        /* Slide out */
        width: 70%;
        max-width: 300px;
        height: 100vh;
        background: rgba(10, 10, 15, 0.98);
        flex-direction: column;
        justify-content: center;
        /* Center items vertically */
        align-items: center;
        padding-top: 80px;
        transition: right 0.4s ease;
        z-index: 999;
        border-left: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links li {
        margin: 25px 0;
        text-align: center;
        width: 100%;
    }

    .nav-links a {
        font-size: 1.2rem;
        display: block;
        width: 100%;
        text-align: center;
    }

    /* Layout stacking */
    .grid-3 {
        grid-template-columns: 1fr !important;
        gap: 30px;
    }

    /* Detail Pages Grid (Text + Tech Data) */
    .grid-3[style*="2fr 1fr"],
    .grid-3[style*="1fr 1.5fr"] {
        display: flex !important;
        flex-direction: column;
        gap: 40px !important;
    }

    /* Hero adjustments */
    .hero {
        padding: 100px 0 60px;
        text-align: center;
    }

    .hero h1 span {
        display: block;
        margin-top: 5px;
    }

    .section-header {
        flex-direction: column;
        align-items: center !important;
        text-align: center;
        gap: 15px;
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 30px;
    }

    .footer-brand p {
        margin: 0 auto 20px;
    }

    /* Resize TStar Logo on Mobile */
    .tstar-logo {
        width: 50% !important;
        max-width: 180px;
    }

    /* Center TStar and Partner sections on Mobile */
    .software-content {
        text-align: center !important;
    }

    .software-content ul {
        display: inline-block;
        text-align: left;
        margin: 0 auto 30px !important;
    }

    .partner-text {
        text-align: center !important;
        margin: 0 auto;
    }
}

/* Button Variants */

/* Preloader */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--accent-color);
    animation: spin 1s ease-in-out infinite;
}

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