/* ============================================
   crystaria - Personal Website
   Global Styles + Dark/Light Mode
   ============================================ */

/* Font Faces */
@font-face {
    font-family: 'New Romantics';
    src: url('../fonts/New_Romantics/ROMANTIC.TTF') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Inconsolata LGC';
    src: url('../fonts/InconsolataLGC/InconsolataLGCNerdFont-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Inconsolata LGC';
    src: url('../fonts/InconsolataLGC/InconsolataLGCNerdFont-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: 'KG Happy';
    src: url('../fonts/kg_happy/KGHAPPY.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* CSS Variables - Dark Mode (Default) - HIGH CONTRAST */
:root {
    --bg-primary: #0d0d1a;
    --bg-secondary: #0d0d1aeb;
    --bg-card: #141423f2;
    --text-primary: #ffffff;
    --text-secondary: #c0c0c0;
    --accent: #bea9ff;
    --accent-hover: #bea9ff;
    --accent-glow: #a78bfa80;
    --border: #bea9ff;
    --link: #e0b0ff;
    --link-hover: #f0d0ff;
}

/* Light Mode - HIGH CONTRAST */
[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: rgba(255, 255, 255, 0.95);
    --bg-card: rgba(255, 255, 255, 0.98);
    --text-primary: #0d0d1a;
    --text-secondary: #3a3a5a;
    --accent: #6d28d9;
    --accent-hover: #4c1d95;
    --accent-glow: rgba(109, 40, 217, 0.3);
    --border: #c0c0d0;
    --link: #6d28d9;
    --link-hover: #4c1d95;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inconsolata LGC', 'Consolas', 'Monaco', monospace;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    background-image: url('../images/bg.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
}

/* Overlay for readability */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-secondary);
    z-index: -1;
}

/* Typography */
h1 {
    font-family: 'KG Happy', serif;
    font-weight: normal;
    color: var(--accent);
    text-shadow: 0 0 10px var(--accent-glow);
    margin-bottom: 1rem;
    text-align: center;
}
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Inconsolata LGC', monospace;
    font-weight: normal;
    margin-bottom: 1rem;
}

.title-main {
    font-family: 'KG Happy', serif;
    font-size: 3.5rem;
    color: #f3e3e3;
    text-shadow: 0 0 10px #7c7c9b, 0 0 20px #7c7c9b, 0 0 30px #7c7c9b;
    letter-spacing: 0.05em;
    line-height: 1;
    margin: 0;
    margin-bottom: 0.75rem;
}

.tagline {
    font-family: 'Inconsolata LGC', monospace;
    font-size: 1rem;
    color: #f3e3e3;
    margin: 0;
    margin-bottom: 0.75rem;
    letter-spacing: 0.05em;
    max-width: 350px;
}
a {
    color: var(--link);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

/* Layout */
.container {
    max-width: 750px;
    margin: 0 auto;
}

/* Header - Nav centered, Toggle theme on right */
header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.5rem 1.5rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    z-index: 100;
}

header .theme-toggle {
    position: absolute;
    right: 1.5rem;
}

.logo {
    display: flex;
    align-items: center;
}

.guestbook-button {
    display: block;
    margin: 0rem;
    margin-bottom: 4.5rem;
}

.guestbook-button img {
    height: auto;
    image-rendering: pixelated;
    display: block;
}

.logo img {
    height: 36px;
    width: auto;
    transition: transform 0.3s ease;
}

.logo img:hover {
    transform: scale(1.1);
}

/* Navigation */
nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

nav a {
    color: var(--text-primary);
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.25rem;
    margin: 0 0.5rem;
    border-bottom: 2px solid transparent;
    transition: all 0.25s ease;
}

nav a:hover,
nav a.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    text-decoration: none;
}

/* Nav Home with Logo */
.nav-home {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.nav-logo {
    height: 24px;
    width: auto;
}

/* Theme Toggle - Fixed Size */
.theme-toggle {
    background: none;
    border: 2px solid var(--border);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    min-width: 90px;
    text-align: center;
}

.theme-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Main Content */
main {
    margin-top: 56px;
    min-height: calc(100vh - 56px);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Hero Section */
.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: left;
    position: relative;
}

.hero-content {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0rem;
    max-width: 1200px;
    position: relative;
}

.hero-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    margin-top: 51px;
    margin-left: -50px;
    /* Negative margin to overlay on top of background image */
    position: relative;
    z-index: 10;
}

.homepage-bg {
    width: 450px;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
}

.guestbook-frame {
    width: 800px;
    height: 500px;
    max-width: 100%;
    margin-top: 0rem;
    border-radius: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5), 0 0 20px var(--accent-glow);
}

@media (max-width: 768px) {
    .hero-content {
        flex-direction: column;
        text-align: center;
    }

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

    .homepage-bg {
        width: 200px;
        order: -1;
        /* Image on top on mobile if desired, or remove to keep original order */
    }
}

/* Cards / Sections */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5), 0 0 20px var(--accent-glow);
}

.card h2 {
    color: var(--accent);
    /* border-bottom: 1px solid var(--border); */
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 100px #0000001a;
}

/* Skills Badges */
.skills-section {
    margin-bottom: 2rem;
}

.skills-section h3 {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 1rem;
}

.badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.badge {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.badge:hover {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
}

/* Social Links */
.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.social-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.social-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--accent-glow);
    text-decoration: none;
}

/* 88x31 Buttons */
.buttons-88x31 {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.buttons-88x31 img {
    width: 88px;
    height: 31px;
    image-rendering: pixelated;
}

.separator-centered {
    display: flex;
    justify-content: center;
    width: 100%;
    margin: 1rem 0;
}

/* Footer */
footer {
    text-align: center;
    padding: 1rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    background: var(--bg-card);
    position: relative;
}

.text-and-visitor {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .title-main {
        font-size: 2.5rem;
    }

    header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.75rem;
    }

    main {
        margin-top: 140px;
    }

    .container {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    nav a {
        font-size: 0.8rem;
        padding: 0.25rem;
    }

    .social-links {
        flex-direction: column;
    }
}