/* ══════════════════════════════════════════════════
   Niklas Lissjos — Personal Site
   Glitchy dark minimal · Courier monospace · Orange accent
   ══════════════════════════════════════════════════ */

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

/* ── Tokens ──────────────────────────────────────── */
:root {
    --bg:           #0a0a0a;
    --bg-alt:       #0e0e0e;
    --bg-card:      #111111;
    --bg-card-h:    #161616;
    --border:       rgba(255, 255, 255, 0.06);
    --border-h:     rgba(255, 255, 255, 0.12);
    --text:         #e8e8e8;
    --text-sec:     #888888;
    --text-muted:   #555555;
    --accent:       #ff6a00;
    --accent-dim:   rgba(255, 106, 0, 0.08);
    --accent-glow:  rgba(255, 106, 0, 0.2);
    --font:         'Courier New', Courier, monospace;
    --ease:         cubic-bezier(0.16, 1, 0.3, 1);
    --max-w:        1040px;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 72px;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: var(--accent);
    color: var(--bg);
}

.accent { color: var(--accent); }

/* ── Scanline Overlay ────────────────────────────── */
.scanlines {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.scan-line {
    position: absolute;
    left: 0;
    right: 0;
    background: var(--accent);
    animation: scanMove 0.2s linear;
}

@keyframes scanMove {
    from { transform: translateX(-100%); }
    to   { transform: translateX(100%); }
}

/* ── Layout ──────────────────────────────────────── */
.container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 32px;
}

/* ── Navigation ──────────────────────────────────── */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 32px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 0.9rem;
    font-weight: normal;
    color: var(--text);
    text-decoration: none;
    letter-spacing: 0.02em;
}

.nav-links {
    display: flex;
    gap: 28px;
}

.nav-links a {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s;
}

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

/* ── Hero ────────────────────────────────────────── */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 100px 0 60px;
}

.hero-container {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 60px;
    align-items: center;
}

.hero-label {
    font-size: 0.8rem;
    color: var(--accent);
    margin-bottom: 20px;
    opacity: 0.9;
}

.hero h1 {
    font-family: var(--font);
    font-size: clamp(2.8rem, 6vw, 4.5rem);
    font-weight: normal;
    letter-spacing: -0.02em;
    line-height: 1.05;
    margin-bottom: 24px;
    position: relative;
}

/* Glitch text effect */
.glitch-text {
    position: relative;
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.glitch-text::before {
    color: var(--accent);
    clip-path: inset(0 0 85% 0);
    animation: glitch1 4s infinite;
}

.glitch-text::after {
    color: #00e5ff;
    clip-path: inset(85% 0 0 0);
    animation: glitch2 4s infinite;
}

@keyframes glitch1 {
    0%, 92%, 100% { transform: translate(0); }
    93% { transform: translate(-3px, 1px); }
    95% { transform: translate(2px, -1px); }
    97% { transform: translate(-1px, 2px); }
}

@keyframes glitch2 {
    0%, 90%, 100% { transform: translate(0); }
    91% { transform: translate(3px, -1px); }
    94% { transform: translate(-2px, 1px); }
    96% { transform: translate(1px, -2px); }
}

.hero-sub {
    font-size: 1rem;
    color: var(--text-sec);
    max-width: 480px;
    line-height: 1.7;
    margin-bottom: 40px;
}

.hero-cta {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

/* Terminal box */
.terminal-box {
    background: #0d0d0d;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    font-size: 0.8rem;
}

.terminal-header {
    display: flex;
    gap: 7px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border);
}

.terminal-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.terminal-dot.red    { background: #ff5f56; }
.terminal-dot.yellow { background: #ffbd2e; }
.terminal-dot.green  { background: #27c93f; }

.terminal-body {
    padding: 20px;
    color: var(--text-sec);
    line-height: 1.8;
    white-space: pre;
    overflow-x: auto;
}

.t-accent { color: var(--accent); }
.t-muted  { color: var(--text-muted); }

.cursor {
    animation: blink 1s step-end infinite;
    color: var(--accent);
}

@keyframes blink {
    50% { opacity: 0; }
}

/* ── Buttons ─────────────────────────────────────── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    padding: 12px 28px;
    background: var(--accent);
    color: var(--bg);
    border: none;
    border-radius: 6px;
    font-family: var(--font);
    font-size: 0.85rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.25s var(--ease);
}

.btn-primary:hover {
    background: #ff8533;
    transform: translateY(-2px);
    box-shadow: 0 6px 24px var(--accent-glow);
}

.btn-lg {
    padding: 14px 32px;
    font-size: 0.9rem;
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    padding: 12px 4px;
    color: var(--text-sec);
    font-family: var(--font);
    font-size: 0.85rem;
    text-decoration: none;
    transition: color 0.2s;
}

.btn-ghost:hover {
    color: var(--accent);
}

/* ── Sections ────────────────────────────────────── */
.section {
    padding: 120px 0;
}

.section-alt {
    background: var(--bg-alt);
}

.section-label {
    font-size: 0.75rem;
    color: var(--accent);
    letter-spacing: 0.06em;
    margin-bottom: 20px;
    opacity: 0.8;
}

h2 {
    font-family: var(--font);
    font-size: clamp(1.6rem, 3.5vw, 2.2rem);
    font-weight: normal;
    line-height: 1.25;
    margin-bottom: 48px;
    letter-spacing: -0.01em;
}

/* ── About ───────────────────────────────────────── */
.about-layout {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 80px;
    align-items: start;
}

.about-text p {
    color: var(--text-sec);
    font-size: 0.95rem;
    line-height: 1.75;
    margin-bottom: 18px;
}

.inline-link {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.inline-link:hover {
    border-bottom-color: var(--accent);
}

.about-sidebar {
    /* nothing special */
}

.detail-block {
    margin-bottom: 32px;
}

.detail-block h4 {
    font-size: 0.7rem;
    font-weight: normal;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.detail-text {
    font-size: 0.85rem;
    color: var(--text-sec);
    line-height: 1.6;
}

.tag-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-list li {
    padding: 5px 12px;
    font-size: 0.75rem;
    color: var(--text-sec);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    transition: border-color 0.2s;
}

.tag-list li:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ── Projects ────────────────────────────────────── */
.project-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 28px;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: all 0.3s var(--ease);
}

.project-card:hover {
    border-color: var(--border-h);
    background: var(--bg-card-h);
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.project-card.featured {
    border-color: rgba(255, 106, 0, 0.15);
}

.project-card.featured:hover {
    border-color: rgba(255, 106, 0, 0.35);
    box-shadow: 0 12px 40px rgba(255, 106, 0, 0.06);
}

.project-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.project-number {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.project-external {
    font-size: 1rem;
    color: var(--text-muted);
    transition: all 0.2s;
}

.project-card:hover .project-external {
    color: var(--accent);
    transform: translate(2px, -2px);
}

.project-card h3 {
    font-size: 1.1rem;
    font-weight: normal;
    margin-bottom: 10px;
}

.project-card p {
    font-size: 0.85rem;
    color: var(--text-sec);
    line-height: 1.6;
    margin-bottom: 18px;
    flex-grow: 1;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.project-tech span {
    font-size: 0.65rem;
    color: var(--text-muted);
    padding: 3px 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 3px;
}

/* ── Timeline ────────────────────────────────────── */
.timeline {
    position: relative;
    padding-left: 28px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 6px;
    bottom: 6px;
    width: 1px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    padding-bottom: 44px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: -28px;
    top: 7px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--bg);
    box-shadow: 0 0 0 1px var(--accent);
}

.timeline-marker.faded {
    background: var(--text-muted);
    box-shadow: 0 0 0 1px var(--text-muted);
}

.timeline-header {
    display: flex;
    align-items: baseline;
    gap: 14px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.timeline-header h3 {
    font-size: 1rem;
    font-weight: normal;
}

.timeline-date {
    font-size: 0.7rem;
    color: var(--accent);
}

.timeline-company {
    font-size: 0.85rem;
    color: var(--text-sec);
    margin-bottom: 10px;
}

.timeline-desc {
    font-size: 0.9rem;
    color: var(--text-sec);
    line-height: 1.7;
    max-width: 540px;
}

.timeline-desc.muted {
    color: var(--text-muted);
}

/* ── Contact ─────────────────────────────────────── */
.contact-container {
    max-width: 580px;
    text-align: center;
}

.contact-container h2 {
    margin-bottom: 16px;
}

.contact-sub {
    font-size: 0.95rem;
    color: var(--text-sec);
    line-height: 1.7;
    margin-bottom: 36px;
}

.social-row {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 36px;
}

.social-row a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    border: 1px solid var(--border);
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.25s var(--ease);
}

.social-row a:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-dim);
    transform: translateY(-2px);
}

.social-row svg {
    width: 18px;
    height: 18px;
}

/* ── Footer ──────────────────────────────────────── */
footer {
    border-top: 1px solid var(--border);
    padding: 28px 0;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

footer p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.footer-note {
    font-style: italic;
    opacity: 0.6;
}

/* ── Animations ──────────────────────────────────── */
.fade-target {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

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

.project-card.fade-target { transition-delay: calc(var(--i, 0) * 0.08s); }
.project-card:nth-child(1) { --i: 0; }
.project-card:nth-child(2) { --i: 1; }
.project-card:nth-child(3) { --i: 2; }
.project-card:nth-child(4) { --i: 3; }

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 768px) {
    .container { padding: 0 20px; }
    .hero-container { grid-template-columns: 1fr; gap: 40px; }
    .about-layout { grid-template-columns: 1fr; gap: 48px; }
    .project-grid { grid-template-columns: 1fr; }
    .section { padding: 80px 0; }
    .nav-links { gap: 16px; }
    .footer-inner { flex-direction: column; gap: 6px; text-align: center; }
}

@media (max-width: 480px) {
    .hero { min-height: auto; padding: 100px 0 60px; }
    .nav-links a { font-size: 0.7rem; }
    .nav-links { gap: 12px; }
    .hero-cta { flex-direction: column; align-items: flex-start; }
    .timeline-header { flex-direction: column; gap: 2px; }
}
