/*
 * RisaStack Main Stylesheet
 */

:root {
    --transition-speed: 0.3s;
    --font-primary: 'Inter', sans-serif;
    --font-heading: 'Outfit', sans-serif;
}

/* 
 * Dark Mode Theme (Deep Space) - DEFAULT
 */
[data-theme="dark"] {
    --bg-base: #05050A;
    /* Deep space black */
    --bg-surface: #0A0C16;
    /* Deep purple/blue tinted surface */
    --bg-glass: rgba(15, 20, 35, 0.6);
    --border-color: rgba(255, 255, 255, 0.1);

    --text-primary: #E2E8F0;
    --text-secondary: #94A3B8;

    --accent-primary: #FDB813;
    /* Glint of the Sun - Amber/Gold */
    --accent-glow: rgba(253, 184, 19, 0.5);

    --header-bg: rgba(5, 5, 10, 0.85);
}

/* 
 * Light Mode Theme (Tech Lab)
 */
[data-theme="light"] {
    --bg-base: #F8FAFC;
    --bg-surface: #FFFFFF;
    --bg-glass: rgba(255, 255, 255, 0.7);
    --border-color: rgba(0, 0, 0, 0.1);

    --text-primary: #0F172A;
    --text-secondary: #475569;

    --accent-primary: #EAB308;
    /* Sun glint works here too */
    --accent-glow: rgba(234, 179, 8, 0.3);

    --header-bg: rgba(248, 250, 252, 0.85);
}

/* =========================================================================
   Base Reset & Layout
   ========================================================================= */

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

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-primary);
    line-height: 1.6;
    transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color 0.2s ease, text-shadow 0.2s ease;
}

a:hover {
    text-shadow: 0 0 8px var(--accent-glow);
}

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

.container-narrow {
    max-width: 800px;
}

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

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

/* =========================================================================
   Glassmorphism & Accents
   ========================================================================= */

.glass-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-panel:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1), 0 0 15px var(--accent-glow);
}

.accent {
    color: var(--accent-primary);
    position: relative;
    display: inline-block;
}

.accent::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--accent-primary);
    box-shadow: 0 0 10px var(--accent-glow);
}

/* Primary Button */
.cta-button {
    display: inline-block;
    padding: 1rem 2.5rem;
    background-color: transparent;
    color: var(--accent-primary);
    border: 2px solid var(--accent-primary);
    border-radius: 30px;
    font-family: var(--font-heading);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    z-index: 1;
    transition: all 0.3s ease;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background-color: var(--accent-primary);
    z-index: -1;
    transition: width 0.3s ease;
}

.cta-button:hover {
    color: var(--bg-base);
    box-shadow: 0 0 20px var(--accent-glow);
}

.cta-button:hover::before {
    width: 100%;
}

/* =========================================================================
   Header & Navigation
   ========================================================================= */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: var(--header-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.site-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
}

.site-title a {
    color: var(--text-primary);
}

img.custom-logo {
    height: 48px;
    width: auto;
    display: block;
    border-radius: 8px;
    /* Slight rounding to match tech aesthetic */
}

.main-navigation ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.main-navigation a {
    color: var(--text-secondary);
    font-weight: 600;
}

.main-navigation a:hover {
    color: var(--accent-primary);
}

/* Theme Toggle Button */
.theme-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s, transform 0.3s, color 0.3s;
}

.theme-toggle:hover {
    background-color: var(--bg-surface);
    color: var(--accent-primary);
    transform: rotate(15deg);
}

[data-theme="dark"] .sun-icon {
    display: block;
}

[data-theme="dark"] .moon-icon {
    display: none;
}

[data-theme="light"] .sun-icon {
    display: none;
}

[data-theme="light"] .moon-icon {
    display: block;
}

/* =========================================================================
   Front Page Sections
   ========================================================================= */

.page-section {
    padding: 6rem 0;
}

.bg-secondary {
    background-color: var(--bg-surface);
}

/* Hero Section with Sun Glint */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding-top: 80px;
    /* Offset header */
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 10;
}

.hero-title {
    font-size: clamp(3rem, 8vw, 6rem);
    margin-bottom: 1rem;
    line-height: 1;
}

.hero-subtitle {
    font-size: clamp(1.2rem, 2vw, 1.5rem);
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    font-weight: 300;
}

/* Sun Glint Effect */
.sun-glint-effect {
    position: absolute;
    top: 10%;
    right: 15%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--accent-primary) 0%, transparent 60%);
    opacity: 0.15;
    filter: blur(50px);
    z-index: 1;
    pointer-events: none;
    animation: pulseGlint 8s infinite alternate;
}

[data-theme="light"] .sun-glint-effect {
    opacity: 0.25;
}

@keyframes pulseGlint {
    0% {
        transform: scale(1) translateX(0);
        opacity: 0.15;
    }

    100% {
        transform: scale(1.2) translateX(-20px);
        opacity: 0.25;
    }
}

/* Grids */
.grid-2-col {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.grid-3-col {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.service-item .service-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
}

/* =========================================================================
   Blog Index & Single
   ========================================================================= */

.blog-index {
    padding-top: 120px;
}

.posts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    margin-top: 3rem;
}

.post-card {
    display: flex;
    flex-direction: column;
}

.entry-meta {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.read-more-link {
    display: inline-block;
    margin-top: 1.5rem;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.single-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 0.5rem;
}

.title-underline {
    width: 60px;
    height: 4px;
    background-color: var(--accent-primary);
    margin: 1.5rem auto 2rem;
    border-radius: 2px;
    box-shadow: 0 0 10px var(--accent-glow);
}

.content-wrapper {
    margin-top: 3rem;
    font-size: 1.1rem;
}

.post-navigation-area {
    margin-top: 3rem;
}

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

.justify-between {
    justify-content: space-between;
    width: 100%;
}

/* =========================================================================
   Footer
   ========================================================================= */

.site-footer {
    background-color: var(--bg-surface);
    padding: 3rem 0;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.footer-note {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* =========================================================================
   Space Particles
   ========================================================================= */

#space-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
    background-image:
        radial-gradient(1px 1px at 20px 30px, var(--border-color), rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 40px 70px, var(--border-color), rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 50px 160px, var(--border-color), rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 90px 40px, var(--border-color), rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 130px 80px, var(--border-color), rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 160px 120px, var(--border-color), rgba(0, 0, 0, 0));
    background-repeat: repeat;
    background-size: 200px 200px;
    animation: drift 100s linear infinite;
    opacity: 0.6;
}

[data-theme="light"] #space-particles {
    opacity: 0.2;
}

@keyframes drift {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-200px);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .site-header .container {
        flex-direction: column;
        justify-content: center;
        gap: 1rem;
    }

    .site-header {
        height: auto;
        padding: 1rem 0;
    }

    .hero-section {
        padding-top: 120px;
    }

    .main-navigation ul {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .theme-toggle-container {
        position: absolute;
        top: 1rem;
        right: 1.5rem;
    }
}