/* =========================================
   1. VARIABLER & RESET
   ========================================= */
:root {
    --primary: #FFFFF8;
    --primary-dim: #7B899D;
    --dark: #0d0d0d;
    --bg-main: #7B899D;
    --text: #FFFFF8;
    --accent: #ffffff;
    --terminal-green: #4ade80;
    --mono-font: 'JetBrains Mono', monospace;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg-main);
    transition: background-color 0.3s, color 0.3s;
}

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

/* =========================================
   2. NAVIGATION
   ========================================= */
nav {
    padding: 1.2rem 0;
    position: sticky;
    top: 0;
    background: rgba(13, 13, 13, 0.9);
    backdrop-filter: blur(12px);
    z-index: 1000;
    border-bottom: 1px solid var(--primary);
}

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

.logo {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--primary);
    text-decoration: none;
    letter-spacing: -1px;
}

.logo span {
    color: var(--primary-dim);
}

nav ul {
    display: flex;
    list-style: none;
    align-items: center;
}

nav ul li {
    margin-left: 2rem;
}

nav ul li a {
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    font-size: 0.95rem;
    transition: 0.2s;
}

nav ul li a:hover {
    opacity: 0.7;
}

.terminal-btn {
    background: transparent;
    border: 1.5px solid var(--primary);
    color: var(--primary);
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-family: var(--mono-font);
    font-size: 0.8rem;
    margin-left: 20px;
    transition: all 0.3s;
}

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

/* =========================================
   3. HERO SEKTION
   ========================================= */
header {
    padding: 10rem 0 8rem;
}

.tagline {
    font-family: var(--mono-font);
    font-size: 1rem;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

h2 {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -2px;
}

.bio {
    max-width: 600px;
    font-size: 1.15rem;
    margin-bottom: 2.5rem;
}

/* Knappar */
.cta-buttons {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.btn {
    padding: 0.8rem 1.8rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-block;
}

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

.btn.secondary {
    border: 1px solid var(--primary);
    color: var(--primary);
}

.btn.link-btn {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 4px;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

/* =========================================
   4. SEKTIONER & GRIDS
   ========================================= */
section {
    padding: 7rem 0;
}

.bg-light {
    background-color: rgba(255, 255, 248, 0.05);
}

.border-y {
    border-top: 1px solid var(--primary);
    border-bottom: 1px solid var(--primary);
}

.section-title {
    font-size: 2rem;
    margin-bottom: 3.5rem;
    font-weight: 700;
}

/* Skills */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.skill-card {
    padding: 2.5rem;
    border-radius: 12px;
    border: 1px solid var(--primary);
    transition: all 0.3s;
}

.skill-card:hover {
    background: rgba(255, 255, 248, 0.1);
}

/* Roadmap */
.roadmap-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.roadmap-item {
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--primary);
}

.roadmap-item.active {
    border-left: 5px solid var(--accent);
}

/* Projects */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.project-card {
    padding: 2.5rem;
    border-radius: 12px;
    border: 1px solid var(--primary);
    display: flex;
    flex-direction: column;
}

.badge {
    font-family: var(--mono-font);
    font-size: 0.7rem;
    background: var(--primary);
    color: var(--bg-main);
    padding: 4px 10px;
    border-radius: 20px;
}

.tech-stack {
    font-family: var(--mono-font);
    font-size: 0.85rem;
    margin: 1rem 0;
    opacity: 0.8;
}

.project-link {
    margin-top: auto;
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
}

/* =========================================
   5. FOOTER & KONTAKT
   ========================================= */
footer {
    padding: 5rem 0;
    background: var(--dark);
    text-align: center;
}

.copy-email-container {
    display: inline-flex;
    align-items: center;
    background: rgba(255,255,255,0.05);
    padding: 0.5rem 1.5rem;
    border-radius: 30px;
    margin: 2rem 0;
    gap: 10px;
}

.copy-btn {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.social-links a {
    color: var(--primary);
    text-decoration: none;
    opacity: 0.6;
}

/* =========================================
   6. INTERACTIVE TERMINAL (WilliamOS)
   ========================================= */
#interactive-terminal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #0d0d0d;
    color: var(--terminal-green);
    font-family: var(--mono-font);
    z-index: 10000;
    padding: 2rem;
    overflow-y: auto;
}

#interactive-terminal.hidden {
    display: none;
}

.terminal-input-wrapper {
    display: flex;
    margin-top: 1rem;
}

#cmd-input {
    background: transparent;
    border: none;
    color: var(--terminal-green);
    font-family: var(--mono-font);
    outline: none;
    flex: 1;
}

/* =========================================
   7. TERMINAL MODE (THEME SWITCH)
   ========================================= */
body.terminal-mode {
    background-color: #050505 !important;
    color: var(--terminal-green) !important;
}

body.terminal-mode * {
    border-color: var(--terminal-green) !important;
    color: var(--terminal-green) !important;
    background-color: transparent !important;
    text-shadow: 0 0 5px rgba(74, 222, 128, 0.5);
}

/* Responsivitet */
@media (max-width: 768px) {
    h2 { font-size: 2.5rem; }
    .roadmap-grid, .cta-buttons { grid-template-columns: 1fr; flex-direction: column; }
    nav ul { display: none; }
}