@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700;900&family=JetBrains+Mono:wght@400;700&display=swap');

:root {
    --bg-color: #0c0c0c;
    --surface-color: #1a1a1a;
    --accent-color: #ff8c00; /* Signal Orange */
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    
    --spacing-unit: 8px;
    
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;
    
    /* Fluid Typography Scale */
    --step--2: clamp(0.69rem, calc(0.66rem + 0.18vw), 0.80rem);
    --step--1: clamp(0.83rem, calc(0.78rem + 0.29vw), 1.00rem);
    --step-0: clamp(1.00rem, calc(0.91rem + 0.43vw), 1.25rem);
    --step-1: clamp(1.20rem, calc(1.07rem + 0.63vw), 1.56rem);
    --step-2: clamp(1.44rem, calc(1.26rem + 0.89vw), 1.95rem);
    --step-3: clamp(1.73rem, calc(1.48rem + 1.24vw), 2.44rem);
    --step-4: clamp(2.07rem, calc(1.73rem + 1.70vw), 3.05rem);
    --step-5: clamp(2.49rem, calc(2.03rem + 2.31vw), 3.82rem);
    
    /* Extreme Hero Size */
    --hero-size: clamp(4rem, 15vw, 12rem);
}

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

html {
    color-scheme: dark;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Typography Bricks */
h1, h2, h3, h4 {
    line-height: 1.1;
    text-transform: uppercase;
    font-weight: 900;
}

.mono {
    font-family: var(--font-mono);
    text-transform: none;
    font-weight: 400;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

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

ul {
    list-style: none;
}

/* Base Layout */
.section-padding {
    padding: calc(var(--spacing-unit) * 10) 5%;
}

@media (min-width: 1024px) {
    .section-padding {
        padding: calc(var(--spacing-unit) * 15) 10%;
    }
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    border: 1px solid var(--text-primary);
    background: transparent;
    color: var(--text-primary);
    text-transform: uppercase;
    font-weight: 700;
    font-size: var(--step--1);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.320, 1);
    position: relative;
    overflow: hidden;
}

.btn:hover {
    background: var(--text-primary);
    color: var(--bg-color);
    transform: translateY(-2px);
}

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

.btn.primary:hover {
    background: transparent;
    color: var(--accent-color);
}

/* Background Texture */
.background-grain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.05;
    pointer-events: none;
    z-index: 9999;
}

/* Header */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 5%;
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(12, 12, 12, 0.8);
    backdrop-filter: blur(10px);
}

.nav-links {
    display: flex;
    gap: 2rem;
    font-size: var(--step--1);
}

/* Hero Section */
.hero {
    min-height: 90vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.hero-tagline {
    color: var(--accent-color);
    margin-bottom: 1rem;
    font-size: var(--step-0);
}

.hero-title {
    font-size: var(--hero-size);
    margin-bottom: 2rem;
    letter-spacing: -0.04em;
    color: var(--text-primary);
}

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

.hero-subline {
    max-width: 600px;
    margin-left: auto;
    text-align: right;
}

.hero-subline p {
    font-size: var(--step-1);
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Projects Section */
.section-title {
    color: var(--accent-color);
    margin-bottom: 4rem;
    font-size: var(--step-1);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 2rem;
}

.project-card {
    grid-column: span 12;
    background: var(--surface-color);
    padding: 3rem;
    border: 1px solid #333;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.320, 1), border-color 0.3s;
}

.project-card:hover {
    border-color: var(--accent-color);
    transform: translateY(-10px);
}

.project-card.large {
    grid-column: span 12;
}

@media (min-width: 768px) {
    .project-card { grid-column: span 6; }
    .project-card.large { grid-column: span 8; }
}

.project-num {
    color: var(--accent-color);
    font-size: var(--step-2);
    margin-bottom: 1rem;
}

.project-card h3 {
    font-size: var(--step-3);
    margin-bottom: 1rem;
}

.project-card p {
    color: var(--text-secondary);
    font-size: var(--step-0);
    margin-bottom: 2rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: var(--step--2);
    color: var(--accent-color);
}

/* About Section */
.about-content {
    max-width: 800px;
}

.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin: 3rem 0;
}

.skill-item {
    font-size: var(--step-2);
    font-weight: 900;
    text-transform: uppercase;
    color: #666;
    transition: color 0.3s, transform 0.3s;
}

.skill-item:hover {
    color: var(--text-primary);
}

.about-text {
    font-size: var(--step-1);
    color: var(--text-secondary);
}

/* Contact Section */
.contact-container {
    display: flex;
    flex-direction: column;
    gap: 4rem;
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    font-size: var(--step-3);
}

.contact-links a {
    width: fit-content;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.hero-tagline {
    animation: fadeInUp 0.8s ease forwards;
}

.hero-title {
    animation: fadeInUp 1s ease 0.2s forwards;
    opacity: 0;
}

.hero-subline {
    animation: fadeInUp 1s ease 0.4s forwards;
    opacity: 0;
}

/* Scroll-Driven Reveals (Pure CSS) */
@supports (view-timeline: --section) {
    .project-card, .skill-item, .section-title {
        view-timeline-name: --item;
        view-timeline-axis: block;
        animation-timeline: --item;
        animation-name: fadeInUp;
        animation-range: entry 10% cover 30%;
        animation-fill-mode: both;
    }
}

/* Fallback for browsers without view-timeline */
@media (prefers-reduced-motion: no-preference) {
    .project-card:nth-child(even) { animation-delay: 0.2s; }
}

/* Micro-interactions */
.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300%;
    height: 300%;
    background: rgba(255, 255, 255, 0.1);
    transition: transform 0.6s;
    transform: translate(-50%, -50%) rotate(45deg) scale(0);
    pointer-events: none;
}

.btn:hover::after {
    transform: translate(-50%, -50%) rotate(45deg) scale(1);
}

.skill-item:hover {
    color: var(--accent-color);
    transform: skewX(-10deg);
}

/* Responsive Fixes */
@media (max-width: 768px) {
    .hero-title { font-size: 3.5rem; }
    .hero-subline { text-align: left; margin-left: 0; }
    .hero-actions { justify-content: flex-start; }
    .contact-links { font-size: var(--step-1); }
}

/* Main Footer */
.main-footer {
    padding: 4rem 5%;
    border-top: 1px solid #333;
    text-align: center;
    color: var(--text-secondary);
    font-size: var(--step--2);
}
