/* ══════════════════════════════════════════════════════
   Winston Green — Portfolio Website Styles
   ══════════════════════════════════════════════════════ */

/* ── Custom Properties ────────────────────────────── */
:root {
    /* Colors */
    --cream: #FDFBF7;
    --cream-dark: #EDE7DB;
    --blue-hero: #5B8BBF;
    --blue-deep: #2C3E7B;
    --blue-light: #8AAED0;
    --sage: #7A917E;
    --sage-bg: #B8C8B5;
    --peach: #E8C9B0;
    --peach-bg: #F0D5C0;
    --gold: #D4A843;
    --gold-bg: #E8D197;
    --text-primary: #1A1A1A;
    --text-secondary: #555555;
    --text-muted: #888888;
    --white: #FFFFFF;

    /* Typography */
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Inter', -apple-system, sans-serif;

    /* Spacing */
    --section-pad: clamp(100px, 12vw, 180px);
    --container-max: 1100px;

    /* Transitions */
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Reset & Base ─────────────────────────────────── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-primary);
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 clamp(24px, 6vw, 60px);
}

/* ── Scroll Reveal ────────────────────────────────── */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ── LIGHTBOX ────────────────────────────── */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.lightbox[aria-hidden="false"] {
    opacity: 1;
    visibility: visible;
}

.lightbox__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
}

.lightbox__container {
    position: relative;
    z-index: 1;
    max-width: 90%;
    max-height: 90%;
}

.lightbox__image {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 4px;
}

.lightbox__video {
    position: relative;
    z-index: 1;
    width: 90vw;
    max-width: 1000px;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.lightbox__video iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.lightbox__close,
.lightbox__nav {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
    z-index: 20;
}

.lightbox__close:hover,
.lightbox__nav:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-50%) scale(1.05);
}

.lightbox__close {
    top: 40px;
    right: 40px;
    width: 48px;
    height: 48px;
}

.lightbox__close:hover {
    transform: scale(1.05);
    /* No translateY for close button */
}

.lightbox__nav {
    top: 50%;
    transform: translateY(-50%);
    width: 64px;
    height: 64px;
}

/* ── Sticky Nav Visibility ────────────────────────── */
.sticky-nav {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-20px);
    transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.sticky-nav--visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.lightbox__nav--prev {
    left: 40px;
}

.lightbox__nav--next {
    right: 40px;
}

/* ── Case Studies ────────────────────────────── */
.case-study {
    transition: all 0.5s var(--ease-out);
}

.case-study--expanded {
    margin-top: 4rem;
    margin-bottom: 4rem;
}

.case-study__deep-dive {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.6s var(--ease-out), opacity 0.4s ease;
    opacity: 0;
}

.case-study--expanded .case-study__deep-dive {
    grid-template-rows: 1fr;
    opacity: 1;
}

.case-study__deep-dive>div {
    overflow: hidden;
}

/* ── Contact Section ────────────────────────────── */
.contact__image {
    object-position: 50% 10%;
    /* Center on face, move up to show top of head */
    transition: transform 0.5s var(--ease-out);
}

.contact__image-container {
    position: relative;
}

/* Optional subtle ring around circular image */
.contact__image-container::after {
    content: '';
    position: absolute;
    inset: -8px;
    border: 1px solid rgba(0, 0, 0, 0.03);
    border-radius: 50%;
    pointer-events: none;
}

.dark .contact__image-container::after {
    border-color: rgba(255, 255, 255, 0.05);
}

.contact__social-link {
    color: var(--text-primary);
    transition: all 0.3s var(--ease-out);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.dark .contact__social-link {
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.1);
}

.contact__social-link:hover {
    background: rgba(0, 0, 0, 0.03);
    transform: translateY(-2px);
    border-color: rgba(0, 0, 0, 0.1);
}

.dark .contact__social-link:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.contact__social-link svg {
    width: 20px;
    height: 20px;
}

/* ── RESUME IDE LAYOUT ───────────────────────────── */
.resume-ide {
    transition: all 0.3s var(--ease-out);
}

.shadow-ide {
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.05);
    /* Softened shadow to prevent "weirdness" */
}

.dark .shadow-ide {
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.3);
}

.resume-tab {
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0.5rem 1rem;
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--ide-text-secondary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
}

.resume-tab:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

.dark .resume-tab {
    color: #9ca3af;
}

.dark .resume-tab:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.resume-tab.active {
    background-color: var(--white);
    border-color: var(--ide-border);
    border-bottom-color: transparent;
    color: var(--ide-text-main);
    z-index: 20;
    margin-bottom: -1px;
}

.dark .resume-tab.active {
    background-color: #1a1a1a;
    border-color: #333;
    border-bottom-color: transparent;
    color: var(--white);
}

.resume-content-pane {
    display: none;
}

.resume-content-pane.active {
    display: block;
}

/* Line numbers and status bar custom tweaks if not covered by tailwind */
.resume-ide .border-dashed {
    border-style: dashed;
}

/* Animations */
@keyframes pulse-subtle {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.animate-pulse-subtle {
    animation: pulse-subtle 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ── UI Polish: Scroll Progress ───────────────────── */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(to right, #3B82F6, #8B5CF6);
    z-index: 9999;
    transition: width 0.1s ease-out;
}

/* ── Flip Card Layout (How I Build) ───────────────── */
.flip-card {
    background-color: transparent;
    perspective: 1000px;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s var(--ease-out);
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner,
.flip-card:focus-within .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
    position: absolute;
    inset: 0;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 0.75rem; /* matches Tailwind rounded-xl */
}

.flip-card-front {
    transform: rotateY(0deg);
}

.flip-card-back {
    transform: rotateY(180deg);
}

/* ── Custom Dashed Borders (Longer Dashes) ───────────────── */
.dashed-long-r { --dashed-r: linear-gradient(to bottom, currentColor 66%, transparent 0%); }
.dashed-long-b { --dashed-b: linear-gradient(to right, currentColor 66%, transparent 0%); }

.dashed-long-r,
.dashed-long-b {
    background-image: var(--dashed-r, none), var(--dashed-b, none);
    background-position: right top, left bottom;
    background-size: 2px 24px, 24px 2px;
    background-repeat: repeat-y, repeat-x;
}
