/*
 * Portfolio Lander Styles
 * Author: Yash Gupta
 * https://yashgupta.in
 */

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

html {
    height: 100%;
    width: 100%;
    overflow: hidden;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    height: 100%;
    width: 100%;
    overflow: hidden;
    position: fixed;
    top: 0;
    left: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: #fafafa;
    color: #0a0a0a;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    padding: max(2rem, env(safe-area-inset-top)) max(2rem, env(safe-area-inset-right)) max(2rem, env(safe-area-inset-bottom)) max(2rem, env(safe-area-inset-left));
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    cursor: none;
}

@media (max-width: 768px) {
    body {
        cursor: auto;
    }
}

/* ========================================
   Disable All User Interactions
   ======================================== */
body {
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Prevent iOS text selection popup */
body * {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Prevent zoom on double-tap for iOS */
* {
    touch-action: manipulation;
}

/* ========================================
   Custom Mouse Cursor
   ======================================== */
.cursor-dot,
.cursor-ring {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 9999;
    border-radius: 50%;
    will-change: transform;
    contain: layout style;
}

.cursor-dot {
    width: 6px;
    height: 6px;
    background-color: #0a0a0a;
    transition: background-color 0.3s, opacity 0.2s;
}

.cursor-ring {
    width: 32px;
    height: 32px;
    border: 1.5px solid #0a0a0a;
    opacity: 0.6;
    transition: border-color 0.3s, width 0.15s, height 0.15s, opacity 0.2s;
}

.cursor-dot.hidden,
.cursor-ring.hidden {
    opacity: 0;
}

.cursor-dot.hovering {
    opacity: 0;
}

.cursor-ring.hovering {
    width: 42px;
    height: 42px;
    opacity: 0.8;
}

@media (max-width: 768px) {
    .cursor-dot,
    .cursor-ring {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cursor-dot,
    .cursor-ring {
        display: none;
    }
}

/* ========================================
   Canvas Background
   ======================================== */
#c {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: auto;
}

/* ========================================
   Main Container
   ======================================== */
.container {
    max-width: 600px;
    position: relative;
    z-index: 1;
    pointer-events: none;
}

.container * {
    pointer-events: auto;
}

/* ========================================
   Typography
   ======================================== */
h1 {
    font-size: clamp(2.5rem, 8vw, 4rem);
    font-weight: 300;
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
    opacity: 0;
    animation: fadeIn 0.8s ease forwards;
    line-height: 1.1;
}

.intro {
    font-size: clamp(1.1rem, 3vw, 1.35rem);
    font-weight: 300;
    line-height: 1.7;
    color: #737373;
    opacity: 0;
    animation: fadeIn 0.8s ease 0.2s forwards;
}

.intro .hl {
    color: #0a0a0a;
    font-weight: 400;
    display: inline-block;
    transition: transform 0.2s ease;
}

.intro .hl:hover {
    transform: scale(1.03);
}

.school {
    margin-top: 2.5rem;
    font-size: 0.9rem;
    color: #a1a1a1;
    font-weight: 400;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    opacity: 0;
    animation: fadeIn 0.8s ease 0.4s forwards;
}

/* ========================================
   Social Links
   ======================================== */
.links {
    margin-top: 1.25rem;
    display: flex;
    gap: 1.25rem;
    opacity: 0;
    animation: fadeIn 0.8s ease 0.6s forwards;
}

.links a {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #525252;
    transition: color 0.2s ease, transform 0.2s ease;
    text-decoration: none;
    padding: 8px;
    border-radius: 8px;
    min-width: 44px;
    min-height: 44px;
}

.links a:first-child {
    margin-left: -8px;
}

.links a:hover {
    color: #0a0a0a;
    transform: translateY(-2px);
}

.links a:active {
    transform: translateY(0);
}

.links a:focus-visible {
    outline: 2px solid #0a0a0a;
    outline-offset: 2px;
}

.links svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.links a:last-child svg {
    width: 29.3px;
    height: 29.3px;
}

.links a:last-child {
    margin-left: -10px;
}

/* ========================================
   Cursor Animation
   ======================================== */
.cur {
    display: inline-block;
    width: 4px;
    height: 1.1em;
    background-color: #0a0a0a;
    margin-left: 4px;
    animation: blink 1s infinite;
    vertical-align: text-bottom;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    border-radius: 1px;
    position: relative;
}

.cur::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 160px;
    height: 160px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
}

.cur:hover {
    transform: scaleY(1.08);
    animation-play-state: paused;
    opacity: 1 !important;
}

/* ========================================
   Keyframe Animations
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

/* ========================================
   Tablet Styles (max-width: 768px)
   ======================================== */
@media (max-width: 768px) {
    #c {
        display: none;
    }

    body {
        padding: 1.5rem;
        padding: max(1.5rem, env(safe-area-inset-top)) max(1.5rem, env(safe-area-inset-right)) max(1.5rem, env(safe-area-inset-bottom)) max(1.5rem, env(safe-area-inset-left));
    }
}

/* ========================================
   Mobile Styles (max-width: 480px)
   ======================================== */
@media (max-width: 480px) {
    body {
        padding: 1.25rem;
        padding: max(1.25rem, env(safe-area-inset-top)) max(1.25rem, env(safe-area-inset-right)) max(1.25rem, env(safe-area-inset-bottom)) max(1.25rem, env(safe-area-inset-left));
    }

    h1 {
        margin-bottom: 1rem;
        font-size: clamp(2rem, 10vw, 2.5rem);
    }

    .intro {
        font-size: clamp(1rem, 4vw, 1.15rem);
        line-height: 1.6;
    }

    .school {
        margin-top: 2rem;
        font-size: 0.8rem;
    }

    .links {
        margin-top: 1.5rem;
    }
}

/* ========================================
   Extra Small Devices (max-width: 320px)
   ======================================== */
@media (max-width: 320px) {
    body {
        padding: 1rem;
    }

    h1 {
        font-size: 1.75rem;
    }

    .intro {
        font-size: 0.95rem;
    }

    .school {
        font-size: 0.75rem;
    }
}

/* ========================================
   Landscape Mobile
   ======================================== */
@media (max-height: 500px) and (orientation: landscape) {
    body {
        padding: 1rem 2rem;
        align-items: flex-start;
        padding-top: max(1rem, env(safe-area-inset-top));
    }

    h1 {
        font-size: clamp(1.5rem, 5vw, 2rem);
        margin-bottom: 0.75rem;
    }

    .intro {
        font-size: clamp(0.9rem, 2vw, 1rem);
    }

    .school {
        margin-top: 1rem;
        font-size: 0.75rem;
    }

    .links {
        margin-top: 1rem;
    }
}

/* ========================================
   High DPI / Retina Displays
   ======================================== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    body {
        -webkit-font-smoothing: subpixel-antialiased;
    }
}

/* ========================================
   Dark Mode Support (Optional)
   ======================================== */
@media (prefers-color-scheme: dark) {
    /* Uncomment below to enable dark mode
    body {
        background-color: #0a0a0a;
        color: #fafafa;
    }

    .intro {
        color: #a1a1a1;
    }

    .intro .hl {
        color: #fafafa;
    }

    .school {
        color: #737373;
    }

    .links a {
        color: #a1a1a1;
    }

    .links a:hover {
        color: #fafafa;
    }

    .cur {
        background-color: #fafafa;
    }

    .links a:focus-visible {
        outline-color: #fafafa;
    }
    */
}

/* ========================================
   Reduced Motion Preferences
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    #c {
        display: none;
    }

    h1, .intro, .school, .links {
        opacity: 1;
        transform: none;
    }
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
    body {
        background: white;
        color: black;
        position: static;
        overflow: visible;
        padding: 2cm;
    }

    #c {
        display: none;
    }

    .links a {
        color: black;
    }

    .links a::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
    }

    h1, .intro, .school, .links {
        opacity: 1;
        animation: none;
    }
}
