/* ===== MINIMAL MONOCHROME DESIGN ===== */

/* Import fonts */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;700&family=Space+Mono:wght@400;700&display=swap');

/* Base styles - monochrome */
:root {
    /* Monochrome color palette */
    --color-background: #ffffff;
    --color-text: #000000;
    --color-text-muted: #666666;
    --color-border: #000000;
    
    /* Typography */
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Space Mono', monospace;
    
    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1.5rem;
    --space-md: 3rem;
    --space-lg: 6rem;
    --space-xl: 10rem;
    
    /* Transitions */
    --transition: 0.2s ease;
}

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

html {
    font-size: 62.5%; /* 10px = 1rem */
}

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

body {
    font-family: var(--font-body);
    background-color: var(--color-background);
    color: var(--color-text);
    font-size: var(--font-size-base);
    line-height: 1.5;
    min-height: 100vh;
}

/* Accessibility */
:focus-visible {
    outline: 2px solid var(--color-text);
    outline-offset: 4px;
}

/* Text selection — semi-opaque grey, works on light & dark themes */
::selection {
    background-color: rgba(128, 128, 128, 0.35);
}

/* Smooth theme switching — color properties only; respects reduced motion.
   Elements with their own transition declarations keep those (higher specificity). */
@media (prefers-reduced-motion: no-preference) {
    *, *::before, *::after {
        transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    }
}

/* ===== THEME TOGGLE ===== */
.theme-toggle {
    position: fixed;
    top: var(--space-sm);
    right: var(--space-sm);
    width: 4.4rem;
    height: 4.4rem;
    display: none; /* shown only when JS is active */
    align-items: center;
    justify-content: center;
    padding: 0;
    background-color: var(--color-background);
    border: 1.5px solid var(--color-border);
    color: var(--color-text);
    cursor: pointer;
    z-index: 100;
}

.js .theme-toggle {
    display: inline-flex;
}

.theme-toggle:hover {
    background-color: var(--color-text);
    color: var(--color-background);
}

.theme-toggle:focus-visible {
    outline: 2px solid var(--color-text);
    outline-offset: 4px;
}

.theme-toggle-icon {
    width: 2rem;
    height: 2rem;
}

/* Sun icon in light mode, moon icon in dark mode */
.theme-toggle-icon--moon {
    display: none;
}

[data-theme="dark"] .theme-toggle-icon--sun {
    display: none;
}

[data-theme="dark"] .theme-toggle-icon--moon {
    display: block;
}

/* Main container */
.main-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
}

/* Content wrapper */
.content {
    text-align: center;
    max-width: 700px;
}

/* Location */
.location {
    font-family: var(--font-body);
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--color-text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: var(--space-sm);
}

/* Headline */
.headline {
    font-family: var(--font-body);
    font-size: 1.3rem;
    font-weight: 400;
    color: var(--color-text-muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: var(--space-md);
}

/* Name - bold typography */
.name {
    font-family: var(--font-heading);
    font-size: clamp(3.5rem, 12vw, 10rem);
    font-weight: 700;
    color: var(--color-text);
    line-height: 0.95;
    margin-bottom: var(--space-lg);
    letter-spacing: -0.02em;
}

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

/* Link styling */
.link {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-body);
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--color-text);
    text-decoration: none;
    padding: 1.25rem 2.5rem;
    border: 1.5px solid var(--color-border);
    background-color: transparent;
    cursor: pointer;
    transition: var(--transition);
    min-width: 220px;
    justify-content: center;
}

.link:hover {
    background-color: var(--color-text);
    color: var(--color-background);
}

.link:focus-visible {
    outline: 2px solid var(--color-text);
    outline-offset: 4px;
}

/* Icon styling */
.icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

/* Responsive */
@media (min-width: 640px) {
    .links {
        flex-direction: row;
        justify-content: center;
        gap: var(--space-lg);
    }
}

/* Dark theme — applied via explicit toggle (data-theme set by JS) */
[data-theme="dark"] {
    --color-background: #000000;
    --color-text: #ffffff;
    --color-text-muted: #999999;
    --color-border: #ffffff;
}

/* No-JS fallback: honor system preference when data-theme isn't set */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        --color-background: #000000;
        --color-text: #ffffff;
        --color-text-muted: #999999;
        --color-border: #ffffff;
    }
}

/* Scroll cue below hero links */
.scroll-cue {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-top: var(--space-lg);
    font-family: var(--font-body);
    font-size: 1.1rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    text-decoration: none;
    transition: var(--transition);
}

.scroll-cue:hover,
.scroll-cue:focus-visible {
    color: var(--color-text);
}

.scroll-cue-icon {
    width: 18px;
    height: 18px;
    animation: scroll-cue-bounce 2s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
    .scroll-cue-icon {
        animation: none;
    }
}

@keyframes scroll-cue-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

/* ===== SECTION SHARED STYLES ===== */
section {
    padding: var(--space-xl) var(--space-lg);
    border-top: 1px solid var(--color-border);
}

.section-inner {
    max-width: 100rem;
    margin: 0 auto;
}

.section-label {
    font-family: var(--font-body);
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--color-text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: var(--space-xs);
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.6s var(--transition), transform 0.6s var(--transition);
}

.section-title {
    font-family: var(--font-heading);
    font-size: clamp(2.4rem, 5vw, 4rem);
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.01em;
    margin-bottom: var(--space-lg);
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.6s var(--transition), transform 0.6s var(--transition);
}

.section-label.is-visible,
.section-title.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== TECHNICAL STACK SECTION ===== */
.stack-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr));
    gap: var(--space-sm);
}

.stack-card {
    border: 1.5px solid var(--color-border);
    padding: var(--space-md);
    text-align: left;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s var(--transition), transform 0.5s var(--transition), background-color var(--transition), color var(--transition);
}

.stack-card.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.stack-card:hover {
    background-color: var(--color-text);
    color: var(--color-background);
}

.stack-card:hover .stack-index {
    color: var(--color-background);
    border-color: var(--color-background);
}

.stack-card:hover .stack-tags li {
    border-color: var(--color-background);
}

.stack-index {
    display: block;
    font-family: var(--font-body);
    font-size: 1.2rem;
    color: var(--color-text-muted);
    letter-spacing: 0.05em;
    margin-bottom: var(--space-xs);
}

.stack-card-title {
    font-family: var(--font-heading);
    font-size: 1.9rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
    letter-spacing: -0.01em;
}

.stack-tags {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.stack-tags li {
    font-family: var(--font-body);
    font-size: 1.2rem;
    padding: 0.6rem 1.2rem;
    border: 1px solid var(--color-border);
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}

.stack-card--pending {
    border-style: dashed;
}

/* ===== PORTFOLIO SECTION ===== */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(28rem, 1fr));
    gap: var(--space-sm);
}

.project-card {
    display: block;
    border: 1.5px solid var(--color-border);
    padding: var(--space-md);
    text-align: left;
    text-decoration: none;
    color: var(--color-text);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s var(--transition), transform 0.5s var(--transition), background-color var(--transition), color var(--transition);
}

.project-card.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.project-card:not(.project-card--placeholder):hover {
    background-color: var(--color-text);
    color: var(--color-background);
}

.project-card:not(.project-card--placeholder):hover .project-index,
.project-card:not(.project-card--placeholder):hover .project-tags li {
    color: var(--color-background);
    border-color: var(--color-background);
}

.project-card:focus-visible {
    outline: 2px solid var(--color-text);
    outline-offset: 4px;
}

.project-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
}

.project-index {
    font-family: var(--font-body);
    font-size: 1.2rem;
    color: var(--color-text-muted);
    letter-spacing: 0.05em;
}

.project-arrow {
    width: 20px;
    height: 20px;
    transition: transform var(--transition);
}

.project-card:hover .project-arrow {
    transform: translate(3px, -3px);
}

.project-name {
    font-family: var(--font-heading);
    font-size: 2.1rem;
    font-weight: 700;
    margin-bottom: var(--space-xs);
    letter-spacing: -0.01em;
}

.project-description {
    font-family: var(--font-body);
    font-size: 1.3rem;
    color: var(--color-text-muted);
    line-height: 1.6;
    margin-bottom: var(--space-sm);
}

.project-card:not(.project-card--placeholder):hover .project-description {
    color: var(--color-background);
}

.project-tags {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.project-tags li {
    font-family: var(--font-body);
    font-size: 1.1rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--color-border);
}

.project-card--placeholder {
    border-style: dashed;
    cursor: default;
}

.project-card--placeholder .project-name,
.project-card--placeholder .project-description {
    color: var(--color-text-muted);
}

/* ===== FOOTER ===== */
.site-footer {
    padding: var(--space-md) var(--space-lg);
    text-align: center;
    border-top: 1px solid var(--color-border);
}

.footer-text {
    font-family: var(--font-body);
    font-size: 1.1rem;
    color: var(--color-text-muted);
    letter-spacing: 0.05em;
}

/* Responsive adjustments for new sections */
@media (max-width: 640px) {
    section {
        padding: var(--space-lg) var(--space-md);
    }
}
