/* ===================================
   CSS CUSTOM PROPERTIES (VARIABLES)
   =================================== */
:root {
    /* Colors */
    --color-primary: #000;
    --color-secondary: #b00000;
    --color-white: #ffffff;
    --color-gray-50: #f5f5f5;
    --color-gray-100: #e6e6e6;
    --color-gray-300: #a7a7a7;
    --color-gray-400: #747474;
    --color-gray-500: #5c5c5c;
    --color-gray-600: #52525b;
    --color-gray-700: #404040;
    --color-gray-800: #d1d5db;
    --color-background: rgba(255, 255, 255, 0.8);
    --color-backdrop: rgba(255, 255, 255, 0.5);

    /* Typography */
    --font-family: "Inter", sans-serif;
    --font-size-xs: 0.48rem;
    --font-size-sm: 0.5rem;
    --font-size-base: 0.75rem;
    --font-size-md: 0.8rem;
    --font-size-lg: 0.9rem;
    --font-size-xl: 1rem;
    --font-size-2xl: 1.24rem;
    --font-size-3xl: 1.5rem;
    --font-size-4xl: 1.8rem;
    --font-size-5xl: 2.25rem;
    --font-size-6xl: 4rem;

    /* Spacing */
    --spacing-xs: 0.125rem;
    --spacing-sm: 0.375rem;
    --spacing-md: 0.5rem;
    --spacing-lg: 0.75rem;
    --spacing-xl: 1rem;
    --spacing-2xl: 1.5rem;
    --spacing-3xl: 2.5rem;
    --spacing-4xl: 3.5rem;
    --spacing-5xl: 7rem;

    /* Border Radius */
    --radius-sm: 0.5rem;
    --radius-md: 0.7rem;
    --radius-lg: 1.5rem;
    --radius-xl: 3.4375rem;
    --radius-full: 50px;
    --radius-circle: 50%;

    /* Transitions */
    --transition-fast: 100ms;
    --transition-base: 0.2s ease-in-out;
    --transition-slow: 0.3s ease-in-out;

    /* Shadows & Effects */
    --backdrop-blur: blur(6px);
    --backdrop-blur-strong: blur(9px);

    /* Z-index */
    --z-sticky: 10;
    --z-overlay: 50;
    --z-cursor: 100;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-weight: 400;
    color: var(--color-primary);
    background-color: var(--color-white);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

/* Remove default list styles */
ul,
ol {
    list-style: none;
}

/* Remove default link styles */
a {
    text-decoration: none;
    color: inherit;
}

/* Improve button defaults */
button {
    border: none;
    background: none;
    font-family: inherit;
    cursor: pointer;
}

/* ===================================
   UTILITY CLASSES
   =================================== */
.container {
    width: 90%;
    margin: var(--spacing-2xl) auto;
    max-width: 1220px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ===================================
   ANIMATIONS
   =================================== */

@keyframes cursorFadeIn {
    0%,
    99% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

@font-face {
    font-family: "Inter";
    src: url("../font/Inter-VariableFont_opsz,wght.ttf") format("truetype");
    font-display: swap;
}

/* ===================================
   HEADER STYLES
   =================================== */
header {
    display: inline;
}

/* Headline */
.headline {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.headline__logo {
    font-size: var(--font-size-3xl);
    font-weight: 400;
}

.headline__logo span {
    font-weight: 600;
}

.headline__message {
    display: none;
    width: 50%;
    align-items: center;
    justify-content: space-between;
    font-weight: 400;
    font-size: 0.95rem;
}

.headline__btn-group {
    display: flex;
    width: fit-content;
}

.headline__btn {
    font-size: var(--font-size-lg);
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
    border-radius: 100px;
    cursor: pointer;
    transition: var(--transition-slow);
}

.headline__btn:first-child {
    padding: var(--spacing-md) 1.62rem var(--spacing-md) var(--spacing-xl);
}

.headline__btn:last-child {
    margin-left: -0.95rem;
    padding: var(--spacing-md) var(--spacing-xl) var(--spacing-md) 1.62rem;
}

.headline__btn:hover {
    color: var(--color-white);
    background: var(--color-primary);
}

/* Jumbotron */
.jumbotron {
    margin-top: var(--spacing-3xl);
    height: 70vh;
}

.jumbotron__title {
    width: 90%;
    max-width: 90%;
    font-weight: 500;
    font-size: var(--font-size-6xl);
    line-height: 113%;
}

.jumbotron__subtitle {
    font-weight: 400;
    font-size: var(--font-size-3xl);
}

.jumbotron__subtitle span {
    color: var(--color-secondary);
    font-weight: 700;
    font-size: 1.8rem;
}

.jumbotron__description {
    margin-top: var(--spacing-4xl);
    color: var(--color-gray-500);
    font-size: var(--font-size-xs);
}

.jumbotron__cta {
    display: flex;
    width: fit-content;
    margin-top: var(--spacing-md);
}

.jumbotron__btn {
    cursor: pointer;
}

.jumbotron__btn--primary {
    font-weight: 400;
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    background: var(--color-white);
    border: 1px solid var(--color-primary);
    padding: 0.875rem 1.25rem;
}

.jumbotron__btn--secondary {
    background: #bfbfbf;
    border: 1px solid var(--color-primary);
    border-left: none;
    padding: 0.9375rem var(--spacing-xl);
}

/* Navigation */
.navigation {
    position: sticky;
    top: 30px;
    z-index: var(--z-sticky);
    display: flex;
    justify-content: center;
    margin-top: -1rem !important;
}

.navigation__list {
    width: 90%;
    max-width: 500px;
    display: flex;
    justify-content: space-between;
    padding: var(--spacing-xl) 1.3rem;
    border: 1px solid var(--color-gray-400);
    border-radius: var(--radius-xl);
    background: var(--color-background);
    backdrop-filter: var(--backdrop-blur);
}

.navigation__item {
    display: block;
    text-align: center;
    cursor: pointer;
}

.navigation__link {
    font-family: var(--font-family);
    font-size: var(--font-size-md);
    font-weight: 400;
    color: var(--color-primary);
    transition: var(--transition-base);
    position: relative;
    display: inline-block;
}

.navigation__link::after {
    content: "";
    position: absolute;
    bottom: -4px;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: var(--color-primary);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

/* Only show hover effect on devices that support hover */
@media (hover: hover) and (pointer: fine) {
    .navigation__link:hover::after,
    .navigation__link:focus::after {
        width: 100%;
    }
}

/* Always show active state regardless of device - HIGHEST PRIORITY */
.navigation__link--active::after {
    width: 100% !important;
    background-color: var(--color-primary) !important;
    opacity: 1 !important;
}

/* Touch device specific styles */
.touch-device .navigation__link:hover::after {
    width: 0; /* Disable hover effect on touch devices */
}

/* Touch hover class for controlled hover effect on touch devices */
.touch-device .navigation__link.touch-hover:not(.navigation__link--active)::after {
    width: 100%;
}

/* Ensure active state always takes priority over touch hover */
.touch-device .navigation__link--active::after {
    width: 100% !important;
}

/* ===================================
   MAIN CONTENT STYLES
   =================================== */
.main-title {
    font-weight: 400;
    font-size: var(--font-size-xl);
}

/* Thank You Note Section */
.section--thank-you {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-bottom: 1px dashed var(--color-primary);
}

.section--thank-you .title {
    font-size: var(--font-size-4xl);
    font-weight: 400;
    line-height: 2rem;
}

.section--thank-you .title span {
    font-weight: 700;
}

.section--thank-you .date {
    margin-top: var(--spacing-xl);
    margin-left: 0.3rem;
    font-size: var(--font-size-xl);
    font-weight: 400;
    text-decoration-line: underline;
}

/* Common Section Styles */
.section {
    margin: 0 auto;
    padding-top: var(--spacing-5xl);
    max-width: 768px;
}

/* Profile Component */
.profile {
    padding: var(--spacing-2xl) 0 var(--spacing-xl) 0;
    display: flex;
    align-items: center;
}

.profile__image {
    width: 4rem;
    border-radius: var(--radius-sm);
    margin-right: var(--spacing-2xl);
}

.profile__name {
    font-size: 2.8rem;
    font-weight: 700;
}

/* Badge Component */
.badge-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 6px;
    font-weight: 500;
    font-size: var(--font-size-base);
    line-height: 1.3rem;
    color: var(--color-gray-700);
    padding: var(--spacing-xs) 0.625rem;
    background-color: var(--color-gray-50);
}

.badge--interactive {
    padding: var(--spacing-sm) var(--spacing-lg);
    border: 1px solid var(--color-gray-300);
    border-radius: var(--radius-full);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-slow);
    background-color: transparent;
    color: inherit;
}

.badge--interactive:hover {
    border-radius: 0;
    border-color: var(--color-white);
    background: var(--color-primary);
    color: var(--color-white);
}

/* Description Text */
.description {
    margin-top: var(--spacing-xl);
    font-size: var(--font-size-lg);
    line-height: 1.5rem;
    color: var(--color-gray-600);
}

/* Skills Section Specific */
.skills__section {
    padding: var(--spacing-2xl) 0 var(--spacing-xl) 0; /* Remove bottom padding */
}

.skills__learn {
    padding-top: var(--spacing-xl);
    padding-bottom: var(--spacing-xl); /* Match project section bottom padding */
    border-top: 1px dotted var(--color-primary);
    margin-bottom: 0;
}

.skills__learn-title {
    font-weight: 400;
    font-size: 1.25rem;
    line-height: 1.75rem;
    text-transform: uppercase;
}

.skills__learn-title span {
    font-weight: 300;
}

.skills__learn .badge-container {
    margin-top: var(--spacing-xl);
    margin-bottom: 0;
}

/* Project Section */
.project__grid {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--spacing-lg);
    padding: var(--spacing-2xl) 0 var(--spacing-xl) 0;
}

.project__title {
    width: 15.5rem;
    height: fit-content;
    border-radius: var(--radius-lg);
    padding-bottom: var(--spacing-xl);
    text-transform: uppercase;
    font-size: var(--font-size-5xl);
    line-height: 2.5rem;
}

.project__card {
    width: 48%;
    height: 10rem;
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: var(--color-gray-100);
}

.project__number {
    width: fit-content;
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    background: var(--color-primary);
    color: var(--color-white);
    font-size: var(--font-size-base);
    font-weight: 500;
}

.project__card-title {
    font-size: var(--font-size-xl);
    line-height: 2rem;
}

.project__card-description {
    font-size: var(--font-size-sm);
    line-height: 0.8rem;
}

.project__card--cta {
    display: none;
    background: var(--color-white);
    font-size: var(--font-size-base);
    line-height: var(--spacing-xl);
    align-items: center;
    justify-content: center;
}

/* Contact Section */
.contact__social-container {
    margin-top: var(--spacing-4xl);
    height: 45vh;
}

.contact__social-container > * + * {
    width: 100%;
    border-top: 1px solid var(--color-gray-800);
}

.contact__social-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-xl);
    color: var(--color-primary);
}

.contact__social-text {
    font-size: var(--font-size-3xl);
    line-height: 2rem;
    transition: var(--transition-slow);
}

.contact__social-icon {
    width: 2rem;
    transition: var(--transition-slow);
    user-select: none;
}

.contact__social-link:hover .contact__social-text {
    font-size: 2rem;
}

.contact__social-link:hover .contact__social-icon {
    width: 2.5rem;
    transform: rotate(45deg);
}

/* Footer */
.footer {
    clear: both;
    padding: var(--spacing-xl);
    font-size: var(--font-size-md);
    text-align: center;
    text-transform: uppercase;
}

.footer__link {
    color: var(--color-primary);
}

.footer__link:hover {
    text-decoration: underline;
}

/* Scroll to Top Button */
.scroll-to-top {
    display: inline;
    visibility: hidden;
    position: relative;
}

.scroll-to-top__button {
    bottom: 0;
    float: right;
    position: sticky;
    padding-bottom: var(--spacing-xl);
    border: none;
    background: transparent;
    cursor: pointer;
}

.scroll-to-top__icon {
    border-radius: var(--radius-circle);
    width: 60px;
    height: 60px;
    background: var(--color-backdrop);
    backdrop-filter: var(--backdrop-blur-strong);
    transition: scale var(--transition-fast);
}

.scroll-to-top__button:active .scroll-to-top__icon {
    transform: scale(0.8);
}

/* Cursor Ring (Desktop only) */
.cursor-ring {
    position: fixed;
    translate: -50% -50%;
    z-index: var(--z-cursor);
    width: 70px;
    height: 70px;
    mix-blend-mode: difference;
    background-color: #fafafa;
    border-radius: var(--radius-circle);
    pointer-events: none;
    transition: scale var(--transition-fast);
    animation: cursorFadeIn 0.7s ease-in-out;
    display: none; /* Hidden by default on all devices */
}

.cursor-ring--active {
    scale: 0.75;
}

/* Hide cursor ring on touch devices */
@media (hover: none) and (pointer: coarse) {
    .cursor-ring {
        display: none !important;
    }
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */

/* Extra Small Screens (0px - 330px) */
@media only screen and (max-width: 330px) {
    .project__card {
        width: 100%;
        height: 10rem;
    }

    .project__card-title {
        font-size: var(--font-size-xl);
    }

    .project__card-description {
        font-size: var(--font-size-base);
    }

    .navigation__list {
        width: 20rem;
    }
}

/* Small Screens (558px+) */
@media (min-width: 558px) {
    .container {
        max-width: 640px;
    }

    /* Jumbotron adjustments */
    .jumbotron {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: flex-start;
    }

    .jumbotron__title {
        max-width: 90%;
        font-size: 4.5rem;
        font-weight: 400;
    }

    .jumbotron__subtitle {
        font-size: var(--font-size-2xl);
    }

    .jumbotron__subtitle span {
        font-size: 1.74rem;
    }

    /* Navigation adjustments */
    .navigation__list {
        max-width: 500px;
        padding: 1.25rem 3.125rem;
    }

    .navigation__link {
        font-size: var(--font-size-xl);
    }

    /* Project adjustments */
    .project__number {
        font-size: 0.775rem;
    }

    .project__card-title {
        font-size: var(--font-size-lg);
        line-height: 2rem;
    }

    .project__card-description {
        font-size: 0.65rem;
        line-height: var(--spacing-xl);
    }

    .project__card--cta {
        display: flex;
    }
}

/* Medium Screens (640px+) */
@media (min-width: 640px) {
    .container {
        max-width: 1220px;
    }

    .jumbotron__title {
        font-size: 5rem;
    }

    .jumbotron__subtitle {
        font-size: 1.38rem;
    }

    .jumbotron__subtitle span {
        font-size: 1.88rem;
    }

    .project__title,
    .project__card {
        width: 31.9%;
        height: 11rem;
    }

    .project__card {
        padding: var(--spacing-2xl);
    }
}

/* Large Screens (768px+) */
@media (min-width: 768px) {
    .headline__message {
        display: flex;
    }

    .jumbotron__title {
        max-width: 80%;
        font-size: 5.5rem;
    }

    .jumbotron__subtitle {
        font-size: var(--font-size-3xl);
    }

    .jumbotron__subtitle span {
        font-size: 2rem;
    }

    .project__title,
    .project__card {
        width: 32%;
        height: 12rem;
    }

    .project__number {
        font-size: 0.875rem;
    }

    .project__card-title {
        font-size: var(--font-size-xl);
    }

    .project__card-description {
        font-size: var(--font-size-base);
    }
}

/* Extra Large Screens (1024px+) */
@media (min-width: 1024px) {
    .jumbotron__title {
        max-width: 65%;
    }

    /* Show cursor ring on desktop */
    .cursor-ring {
        display: block;
    }
}

/* 2XL Screens (1280px+) */
@media (min-width: 1280px) {
    .jumbotron__title {
        max-width: 50%;
    }
}

/* ===================================
   ACCESSIBILITY UTILITIES
   =================================== */

/* Screen reader only text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Skip link for keyboard navigation */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--color-primary);
    color: var(--color-white);
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 10000;
    font-size: var(--font-size-base);
    font-weight: 600;
}

.skip-link:focus {
    top: 6px;
}

/* Focus visible enhancements */
.badge--interactive:focus-visible,
.navigation__link:focus-visible,
.headline__btn:focus-visible,
.jumbotron__btn:focus-visible,
.contact__social-link:focus-visible,
.scroll-to-top__button:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Remove focus outline for mouse clicks */
.badge--interactive:focus:not(:focus-visible),
.navigation__link:focus:not(:focus-visible),
.headline__btn:focus:not(:focus-visible),
.jumbotron__btn:focus:not(:focus-visible),
.contact__social-link:focus:not(:focus-visible),
.scroll-to-top__button:focus:not(:focus-visible) {
    outline: none;
}
