/* ============================================
   PORTFOLIO SITE - MAIN STYLES
   John-Erik Jordan - UX Designer
   ============================================ */

/* ============================================
   CSS VARIABLES & DESIGN TOKENS
   ============================================ */
:root {
    /* Colors */
    --color-primary: #E63946;          /* Red accent */
    --color-text-dark: #1a1a1a;        /* Almost black */
    --color-text-medium: #4a4a4a;      /* Medium gray */
    --color-text-light: #6a6a6a;       /* Light gray */
    --color-background: #ffffff;        /* White */
    --color-background-alt: #f8f8f8;   /* Off-white */
    --color-border: #e0e0e0;           /* Light border */

    /* Typography - Font Families */
    --font-primary: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Playfair Display', Georgia, serif;

    /* Typography - Type Scale */
    --text-xs: 0.75rem;      /* 12px */
    --text-sm: 0.875rem;     /* 14px */
    --text-base: 1rem;       /* 16px */
    --text-lg: 1.125rem;     /* 18px */
    --text-xl: 1.25rem;      /* 20px */
    --text-2xl: 1.5rem;      /* 24px */
    --text-3xl: 2rem;        /* 32px */
    --text-4xl: 2.5rem;      /* 40px */
    --text-5xl: 3rem;        /* 48px */
    --text-6xl: 3.5rem;      /* 56px */
    --text-7xl: 4rem;        /* 64px */

    /* Typography - Line Heights */
    --leading-tight: 0.9;    /* Display text, large headings */
    --leading-snug: 1.1;     /* Headings, UI text */
    --leading-normal: 1.3;   /* Short paragraphs, cards */
    --leading-relaxed: 1.5;  /* Long-form body text */

    /* Typography - Font Weights */
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;

    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 4rem;
    --space-xl: 6rem;
    --space-xxl: 8rem;

    /* Layout */
    --max-width: 1200px;
    --content-width: 800px;
    --border-radius: 8px;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ============================================
   RESET & BASE STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    font-size: var(--text-lg);
    line-height: var(--leading-snug);
    color: var(--color-text-dark);
    background-color: var(--color-background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-semibold);
    line-height: var(--leading-tight);
    margin-bottom: var(--space-xs);
}

h1 {
    font-size: clamp(var(--text-3xl), 5vw, var(--text-5xl));
    font-weight: var(--font-normal);
}

h2 {
    font-size: clamp(var(--text-2xl), 4vw, var(--text-4xl));
}

h3 {
    font-size: clamp(var(--text-xl), 3vw, var(--text-2xl));
}

p {
    margin-bottom: var(--space-md);
}

p:last-child {
    margin-bottom: 0;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: opacity var(--transition-fast);
}

a:hover {
    opacity: 0.7;
}

strong {
    font-weight: var(--font-semibold);
}

/* ============================================
   LAYOUT UTILITIES
   ============================================ */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-md);
}

section {
    padding: var(--space-xl) 0;
}

@media (min-width: 768px) {
    section {
        padding: var(--space-xxl) 0;
    }
}

/* ============================================
   RED THREAD SVG
   ============================================ */
.red-thread {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    pointer-events: none;
    z-index: -1;
    opacity: 0.3;
    transform: translateY(150px);
}

.red-thread path {
    animation: threadFlow 20s ease-in-out infinite;
}

@keyframes threadFlow {
    0%, 100% {
        d: path("M-50,100 C200,50 300,80 400,100 S600,110 800,120 C900,125 1000,140 1200,100 S1400,130 1600,150");
    }
    50% {
        d: path("M-50,120 C200,80 300,100 400,110 S600,95 800,100 C900,105 1000,120 1200,140 S1400,120 1600,130");
    }
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */
.site-header {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border);
    z-index: 1000;
    padding: var(--space-md) 0;
}

.main-nav {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-weight: var(--font-semibold);
    font-size: var(--text-base);
    letter-spacing: 0.05em;
    color: var(--color-text-dark);
    transition: color var(--transition-fast);
    line-height: var(--leading-tight);
}

.logo:hover {
    color: var(--color-primary);
    opacity: 1;
}

.nav-links {
    display: flex;
    gap: var(--space-md);
    list-style: none;
}

.nav-links a {
    color: var(--color-text-medium);
    font-weight: var(--font-medium);
    transition: color var(--transition-fast);
    line-height: var(--leading-tight);
}

.nav-links a:hover {
    color: var(--color-primary);
    opacity: 1;
}

/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: var(--color-text-dark);
    margin: 3px 0;
    transition: all 0.3s ease;
    border-radius: 3px;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    padding-top: var(--space-xxl);
    padding-bottom: var(--space-xl);
}

.hero-title {
    max-width: 900px;
    margin-bottom: var(--space-md);
    line-height: var(--leading-tight);
    letter-spacing: -0.02em;
}

.hero-title .hero-accent {
    color: var(--color-primary);
    font-weight: var(--font-bold);
}

.hero-description {
    font-size: var(--text-xl);
    line-height: var(--leading-snug);
    color: var(--color-text-medium);
    max-width: 800px;
    margin-bottom: var(--space-md);
}

.accent-text {
    color: var(--color-text-dark);
    font-weight: var(--font-medium);
    background: linear-gradient(120deg, rgba(230, 57, 70, 0.1) 0%, rgba(230, 57, 70, 0.1) 100%);
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
}

.hero-specialty {
    font-size: var(--text-xl);
    color: var(--color-text-dark);
    max-width: 800px;
}

/* ============================================
   RED THREAD STATEMENT
   ============================================ */
.red-thread-statement {
    background: var(--color-background-alt);
    padding: var(--space-xxl) 0;
    text-align: right;
}

.statement-text {
    font-family: var(--font-display);
    font-size: clamp(var(--text-2xl), 5vw, var(--text-6xl));
    font-weight: var(--font-normal);
    line-height: var(--leading-tight);
    letter-spacing: -0.02em;
    max-width: 900px;
    margin: 0 0 0 auto;
}

.red-highlight {
    color: var(--color-primary);
    font-style: italic;
}

/* ============================================
   PORTFOLIO SECTION
   ============================================ */
.portfolio {
    background: var(--color-background);
}

.section-title {
    margin-bottom: var(--space-md);
    font-weight: var(--font-semibold);
}

.portfolio-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    margin-top: var(--space-lg);
}

@media (min-width: 768px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .portfolio-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================
   PROJECT CARDS
   ============================================ */
.project-card {
    background: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
    border-color: var(--color-primary);
}

.card-link {
    display: block;
    color: inherit;
}

.card-image {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    background: var(--color-background-alt);
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.project-card:hover .card-image img {
    transform: scale(1.05);
}

.card-image.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
}

.coming-soon {
    color: var(--color-text-light);
    font-weight: var(--font-medium);
    font-size: var(--text-base);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(230, 57, 70, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.project-card:hover .card-overlay {
    opacity: 1;
}

.view-project {
    color: white;
    font-weight: var(--font-semibold);
    font-size: var(--text-lg);
}

.card-content {
    padding: var(--space-md);
}

.card-title {
    font-size: var(--text-2xl);
    margin-bottom: var(--space-xs);
    color: var(--color-text-dark);
    line-height: var(--leading-snug);
}

.card-client {
    font-size: var(--text-sm);
    color: var(--color-primary);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-xs);
}

.card-description {
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--color-text-medium);
    margin-bottom: var(--space-md);
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.tag {
    font-size: var(--text-xs);
    padding: 0.25rem 0.75rem;
    background: var(--color-background-alt);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    color: var(--color-text-medium);
    font-weight: var(--font-medium);
}

/* ============================================
   ABOUT SECTION
   ============================================ */
.about {
    background: var(--color-background-alt);
    padding: var(--space-md) 0;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    margin-top: var(--space-lg);
}

@media (min-width: 768px) {
    .about-grid {
        grid-template-columns: 2fr 1fr;
    }
}

.about-content {
    position: relative;
}

.about-content p {
    font-size: var(--text-xl);
    line-height: var(--leading-snug);
    color: var(--color-text-medium);
}

/* Red Thread Mini Animation */
.red-thread-mini {
    display: none;
}

@media (min-width: 768px) {
    .red-thread-mini {
        display: block;
        width: 100%;
        height: auto;
        margin-top: var(--space-lg);
        opacity: 0.4;
    }

    .red-thread-mini path {
        animation: threadFlowMini 18s ease-in-out infinite;
    }
}

@keyframes threadFlowMini {
    0%, 100% {
        d: path("M-20,50 C80,30 120,40 160,50 S240,55 320,60 C360,62 400,70 480,50 S560,65 640,75");
    }
    50% {
        d: path("M-20,60 C80,45 120,50 160,55 S240,47 320,50 C360,52 400,60 480,70 S560,60 640,65");
    }
}

.about-skills h3 {
    margin-bottom: var(--space-sm);
}

.skills-category {
    margin-bottom: var(--space-md);
}

.skills-category:last-child {
    margin-bottom: 0;
}

.skills-category-title {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-xs);
    padding-bottom: var(--space-xs);
    border-bottom: 2px solid var(--color-primary);
}

.skills-list {
    list-style: none;
}

.skills-list li {
    padding: 0.275rem 0;
    padding-left: var(--space-md);
    color: var(--color-text-medium);
    font-weight: var(--font-medium);
    position: relative;
    line-height: var(--leading-tight);
    font-size: var(--text-base);
}

.skills-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--color-primary);
    font-weight: bold;
}

.skills-list li:last-child {
    padding-bottom: 0;
}

/* ============================================
   CONTACT SECTION
   ============================================ */
.contact {
    padding: 1.8rem 0;
}

@media (min-width: 768px) {
    .contact {
        padding: 2.4rem 0;
    }
}

.contact .container {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    align-items: center;
}

@media (min-width: 768px) {
    .contact .container {
        flex-direction: row;
        justify-content: center;
        align-items: center;
        gap: var(--space-lg);
    }
}

.contact .section-title {
    margin-bottom: 0;
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    align-items: center;
}

@media (min-width: 768px) {
    .contact-links {
        flex-direction: row;
    }
}

.contact-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    background: var(--color-primary);
    color: white;
    border-radius: var(--border-radius);
    font-weight: var(--font-semibold);
    transition: all var(--transition-fast);
}

.contact-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(230, 57, 70, 0.3);
    opacity: 1;
    background: #d62839;
}

.contact-link .icon {
    font-size: var(--text-xl);
}

.contact-link.email {
    background: var(--color-text-dark);
}

.contact-link.email:hover {
    background: #2a2a2a;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

@media (max-width: 767px) {
    .contact-link.email {
        max-width: calc(100vw - 5rem);
        word-break: break-word;
    }

    .email-text-desktop {
        display: none;
    }
}

@media (min-width: 768px) {
    .email-text-mobile {
        display: none;
    }
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
    background: var(--color-text-dark);
    color: white;
    padding: var(--space-lg) 0;
    text-align: center;
}

.site-footer p {
    margin: 0;
    font-size: var(--text-sm);
    opacity: 0.7;
}

/* ============================================
   RESPONSIVE UTILITIES
   ============================================ */
@media (max-width: 999px) {
    /* Show hamburger on mobile */
    .hamburger {
        display: flex;
    }

    /* Hide nav links by default on mobile */
    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        gap: 0;
        padding: var(--space-md) 0;
        border-bottom: 1px solid var(--color-border);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: all 0.3s ease;
    }

    .nav-links.active {
        max-height: 300px;
        opacity: 1;
    }

    .nav-links li {
        width: 100%;
        text-align: center;
    }

    .nav-links a {
        display: block;
        padding: var(--space-sm) var(--space-md);
        line-height: 1.5;
    }

    .red-thread-statement {
        padding: var(--space-lg) 0;
    }

    .portfolio {
        padding: var(--space-md) 0;
    }

    .portfolio .section-title {
        margin-bottom: 0;
    }

    .portfolio .portfolio-grid {
        margin-top: var(--space-sm);
    }
}

@media (max-width: 767px) {
    .hero {
        padding-top: var(--space-lg);
    }

    .hero-title,
    .hero-description,
    .hero-specialty {
        font-size: var(--text-base);
    }

    .hero-title {
        font-size: var(--text-2xl);
    }

    .nav-links {
        gap: var(--space-sm);
    }

    .nav-links a {
        font-size: var(--text-sm);
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .site-header,
    .site-footer,
    .red-thread {
        display: none;
    }
    
    body {
        font-size: 12pt;
    }
    
    section {
        page-break-inside: avoid;
    }
}
