/* ==========================================================================
   Nic Cusworth - Design Director Portfolio
   Modern, Games Industry Professional Design
   ========================================================================== */

/* Custom Properties */
:root {
    --color-bg: #f5f3ef;
    --color-bg-elevated: #faf9f7;
    --color-bg-card: #faf9f7;
    --color-surface: #edeae4;

    --color-text: #1a1816;
    --color-text-muted: #4a453f;
    --color-text-subtle: #706963;

    --color-accent: #0066cc;
    --color-accent-light: #0077ee;
    --color-accent-glow: rgba(0, 102, 204, 0.12);

    --color-highlight: #e60012;
    --color-highlight-glow: rgba(230, 0, 18, 0.12);

    --font-display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-bg);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Container */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
}

@media (max-width: 768px) {
    .container {
        padding: 0 1.25rem;
    }
}

/* Typography */
h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

/* Section Tag */
.section-tag {
    display: inline-block;
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--color-accent-light);
    margin-bottom: 1rem;
    padding: 0.5rem 1rem;
    background: var(--color-accent-glow);
    border-radius: 100px;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s var(--ease-out-quart);
    cursor: pointer;
    border: none;
}

.btn--primary {
    background: var(--color-accent);
    color: white;
    box-shadow: 0 0 30px var(--color-accent-glow);
}

.btn--primary:hover {
    background: var(--color-accent-light);
    transform: translateY(-2px);
    box-shadow: 0 10px 40px var(--color-accent-glow);
}

.btn--outline {
    background: transparent;
    color: var(--color-text);
    border: 1px solid var(--color-surface);
}

.btn--outline:hover {
    background: var(--color-surface);
    border-color: var(--color-text-muted);
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    max-width: 1280px;
    margin: 0 auto;
}

.nav__logo {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.02em;
}

.nav__menu {
    display: flex;
    list-style: none;
    gap: 2.5rem;
    align-items: center;
}

.nav__link {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-muted);
    transition: color 0.2s ease;
}

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

.nav__link--cta {
    background: var(--color-accent);
    color: white;
    padding: 0.6rem 1.25rem;
    border-radius: 6px;
}

.nav__link--cta:hover {
    background: var(--color-accent-light);
    color: white;
}

.nav__toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.nav__hamburger {
    width: 24px;
    height: 2px;
    background-color: var(--color-text);
    position: relative;
    transition: all 0.3s ease;
}

.nav__hamburger::before,
.nav__hamburger::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background-color: var(--color-text);
    transition: all 0.3s ease;
}

.nav__hamburger::before { top: -7px; }
.nav__hamburger::after { top: 7px; }

@media (max-width: 768px) {
    .nav__menu {
        position: fixed;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--color-bg-elevated);
        flex-direction: column;
        padding: 2rem;
        gap: 1.5rem;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        border-top: 1px solid rgba(0, 0, 0, 0.05);
    }

    .nav__menu.nav__menu--open {
        opacity: 1;
        visibility: visible;
    }

    .nav__toggle {
        display: flex;
    }
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding: 8rem 0 4rem;
    overflow: hidden;
}

.hero__bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(230, 0, 18, 0.08), transparent),
        radial-gradient(ellipse 60% 40% at 80% 60%, rgba(0, 114, 206, 0.06), transparent),
        radial-gradient(ellipse 50% 30% at 20% 80%, rgba(230, 0, 18, 0.05), transparent);
    pointer-events: none;
}

.hero__content {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero__tag {
    display: inline-block;
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--color-highlight);
    margin-bottom: 1.5rem;
}

.hero__title {
    font-size: clamp(3rem, 8vw, 5.5rem);
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 1.5rem;
    line-height: 1;
}

.hero__description {
    font-size: 1.25rem;
    color: var(--color-text-muted);
    max-width: 500px;
    margin-bottom: 2.5rem;
    line-height: 1.7;
}

.hero__actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Hero Stats */
.hero__stats {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    padding: 3rem;
    background: var(--color-bg-card);
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.stat {
    text-align: center;
}

.stat__number {
    display: block;
    font-family: var(--font-display);
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--color-text) 0%, var(--color-accent-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat__label {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Hero Scroll Indicator */
.hero__scroll {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    color: var(--color-text-subtle);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.hero__scroll-line {
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, var(--color-text-subtle), transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(1); }
    50% { opacity: 1; transform: scaleY(1.2); }
}

@media (max-width: 968px) {
    .hero__content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero__description {
        margin-left: auto;
        margin-right: auto;
    }

    .hero__actions {
        justify-content: center;
    }

    .hero__stats {
        flex-direction: row;
        justify-content: center;
        padding: 2rem;
    }

    .hero__scroll {
        display: none;
    }
}

@media (max-width: 480px) {
    .hero__stats {
        flex-direction: column;
    }
}

/* ==========================================================================
   About Section
   ========================================================================== */

.about {
    padding: 8rem 0;
    background: var(--color-bg-elevated);
}

.about__content {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 5rem;
    align-items: center;
}

.about__image-wrapper {
    position: relative;
    width: 280px;
    height: 280px;
    margin: 0 auto;
}

.about__image-wrapper::before {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--color-accent), var(--color-highlight));
    opacity: 0.3;
    filter: blur(20px);
}

.about__photo {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    object-fit: cover;
    border: 4px solid var(--color-bg-card);
}

.about__title {
    font-size: 2.5rem;
    color: var(--color-text);
    margin-bottom: 1.5rem;
}

.about__description {
    font-size: 1.125rem;
    color: var(--color-text-muted);
    margin-bottom: 2.5rem;
    line-height: 1.8;
}

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

.skill {
    padding: 1.25rem;
    background: var(--color-surface);
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s var(--ease-out-quart);
}

.skill:hover {
    border-color: var(--color-accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(230, 0, 18, 0.1);
}

.skill h4 {
    font-size: 1rem;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.skill p {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    line-height: 1.5;
}

@media (max-width: 968px) {
    .about__content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .about__skills {
        text-align: left;
    }
}

@media (max-width: 580px) {
    .about__skills {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Portfolio Section
   ========================================================================== */

.portfolio {
    padding: 8rem 0;
}

.portfolio__header {
    text-align: center;
    margin-bottom: 4rem;
}

.portfolio__title {
    font-size: 3rem;
    color: var(--color-text);
    margin-bottom: 1rem;
}

.portfolio__subtitle {
    font-size: 1.125rem;
    color: var(--color-text-muted);
}

/* Featured Project */
.portfolio__featured {
    margin-bottom: 3rem;
}

.project--featured {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 3rem;
    background: var(--color-bg-card);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    transition: all 0.4s var(--ease-out-quart);
}

.project--featured:hover {
    border-color: var(--color-accent);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
}

.project--featured .project__image {
    aspect-ratio: 16/10;
}

.project--featured .project__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project--featured .project__content {
    padding: 3rem 3rem 3rem 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.project--featured .project__title {
    font-size: 2rem;
}

.project--featured .project__description {
    font-size: 1rem;
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

@media (max-width: 868px) {
    .project--featured {
        grid-template-columns: 1fr;
    }

    .project--featured .project__content {
        padding: 2rem;
    }
}

/* Portfolio Grid */
.portfolio__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 4rem;
}

.project {
    background: var(--color-bg-card);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    transition: all 0.4s var(--ease-out-quart);
}

.project:hover {
    border-color: var(--color-accent);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.project__image {
    aspect-ratio: 16/9;
    overflow: hidden;
    background: var(--color-surface);
}

.project__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s var(--ease-out-quart);
}

.project:hover .project__image img {
    transform: scale(1.05);
}

.project__content {
    padding: 1.5rem;
}

.project__year {
    display: inline-block;
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-highlight);
    margin-bottom: 0.75rem;
}

.project__title {
    font-size: 1.25rem;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.project__role {
    font-size: 0.9rem;
    color: var(--color-accent-light);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.project__studio {
    font-size: 0.8rem;
    color: var(--color-text-subtle);
}

/* Portfolio Toggle / Timeline */
.portfolio__more {
    margin-top: 2rem;
}

.portfolio__toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 1.25rem 2rem;
    background: var(--color-accent);
    border: none;
    border-radius: 12px;
    color: white;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    list-style: none;
}

.portfolio__toggle::-webkit-details-marker {
    display: none;
}

.portfolio__toggle:hover {
    background: var(--color-accent-light);
}

.portfolio__toggle-icon {
    transition: transform 0.3s ease;
}

details[open] .portfolio__toggle-icon {
    transform: rotate(180deg);
}

.portfolio__expanded {
    margin-top: 2rem;
}

/* Timeline */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.timeline__era h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--color-accent-light);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.timeline__items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.timeline__item {
    padding: 1.25rem;
    background: var(--color-surface);
    border-radius: 12px;
    border-left: 3px solid var(--color-accent);
}

.timeline__item h4 {
    font-size: 1rem;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.timeline__role {
    font-size: 0.875rem;
    color: var(--color-accent-light);
    margin-bottom: 0.25rem;
}

.timeline__studio {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
}

.timeline__tag {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.6rem;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
    color: var(--color-text-subtle);
}

.timeline__tag--special {
    background: var(--color-accent-glow);
    color: var(--color-accent-light);
}

.timeline__era--origin {
    padding: 2rem;
    background: linear-gradient(135deg, var(--color-surface), rgba(230, 0, 18, 0.05));
    border-radius: 16px;
    border: 1px solid rgba(230, 0, 18, 0.2);
}

/* ==========================================================================
   Music Section
   ========================================================================== */

.music {
    padding: 8rem 0;
    background: var(--color-bg-elevated);
}

.music__header {
    text-align: center;
    margin-bottom: 3rem;
}

.music__title {
    font-size: 3rem;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.music__subtitle {
    font-size: 1.125rem;
    color: var(--color-text-muted);
}

.music__intro {
    text-align: center;
    margin-bottom: 4rem;
    padding: 2rem;
    background: var(--color-bg-card);
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.music__logo {
    width: 180px;
    height: auto;
    margin: 0 auto 1.5rem;
    filter: brightness(0.9);
}

.music__tagline {
    font-size: 1rem;
    color: var(--color-text-muted);
}

.music__projects {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 2rem;
}

.music__project {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--color-bg-card);
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    transition: all 0.3s var(--ease-out-quart);
}

.music__project:hover {
    border-color: var(--color-accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.music__image {
    flex-shrink: 0;
}

.music__image img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 12px;
}

.music__content {
    display: flex;
    flex-direction: column;
}

.music__name {
    font-size: 1.125rem;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.music__description {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-bottom: 1rem;
    flex-grow: 1;
    line-height: 1.6;
}

.music__links {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.music__link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.875rem;
    background: var(--color-surface);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-text-muted);
    transition: all 0.2s ease;
}

.music__link:hover {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: white;
}

.music__link svg {
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .music__projects {
        grid-template-columns: 1fr;
    }

    .music__project {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .music__links {
        justify-content: center;
    }
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
    padding: 4rem 0 2rem;
    background: var(--color-text);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.footer__content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 2rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer__logo {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
}

.footer__tagline {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 0.25rem;
}

.footer__email {
    font-family: var(--font-display);
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    transition: color 0.2s ease;
}

.footer__email:hover {
    color: white;
}

.footer__bottom {
    text-align: center;
}

.footer__copyright {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

@media (max-width: 580px) {
    .footer__content {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }
}

/* ==========================================================================
   Utilities & Accessibility
   ========================================================================== */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Selection */
::selection {
    background: var(--color-accent);
    color: white;
}
