/* ==============================
   Quiet Confidence — Design System
   ============================== */

:root {
    --bg-color: #f7f6f3;
    --text-primary: #1a1a1a;
    --text-secondary: #777;
    --accent-color: #5a7a64;
    --accent-hover: #4a6854;
    --border-color: #e8e5e0;
    --font-display: 'Instrument Serif', Georgia, serif;
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
}

/* Base */

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Background grain texture */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='0.7' numOctaves='4' type='fractalNoise'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url("/?originalUrl=https%3A%2F%2Fsidnarsipur.github.io%2F%2523n")'/%3E%3C/svg%3E");
}

::selection {
    background-color: rgba(90, 122, 100, 0.2);
    color: var(--text-primary);
}

/* Scrollbar */

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #ccc8c0;
}

/* Layout */

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 100px 32px;
    display: flex;
    gap: 72px;
    align-items: flex-start;
}

.content {
    flex: 1;
    min-width: 0;
}

.content:only-child {
    max-width: 640px;
}

/* Profile Image */

.profile-img {
    width: 180px;
    height: 180px;
    object-fit: cover;
    border-radius: 12px;
    flex-shrink: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border-color);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.profile-img:hover {
    transform: scale(1.03);
}

/* Typography */

h1 {
    font-family: var(--font-display);
    font-size: 2.8rem;
    font-weight: 400;
    margin: 0 0 8px 0;
    letter-spacing: -0.01em;
    line-height: 1.15;
    color: var(--text-primary);
}

.accent-line {
    width: 40px;
    height: 2px;
    background-color: var(--accent-color);
    margin: 16px 0 20px 0;
    border-radius: 1px;
}

p {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin: 0 0 24px 0;
    font-weight: 400;
    line-height: 1.7;
}

.email-line {
    font-size: 0.9rem;
    margin-top: -12px;
}

h2 {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-secondary);
    padding-top: 48px;
    margin: 0 0 28px 0;
    font-weight: 500;
    border-top: 1px solid var(--border-color);
    border-bottom: none;
}

/* Links */

a {
    color: inherit;
    text-decoration: none;
    position: relative;
    transition: color 0.3s ease;
}

a::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--accent-color);
    transition: width 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

a:hover {
    color: var(--accent-color);
}

a:hover::after {
    width: 100%;
}

/* Nav Links (Pills) */

.links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 48px;
    font-size: 0.9rem;
}

.links a {
    color: var(--text-secondary);
    font-weight: 500;
    padding: 6px 16px;
    border: 1px solid var(--border-color);
    border-radius: 100px;
    transition: all 0.3s ease;
    letter-spacing: 0.01em;
}

.links a::after {
    display: none;
}

.links a:hover {
    color: var(--accent-color);
    border-color: var(--accent-color);
    background-color: rgba(90, 122, 100, 0.06);
}

/* Experience / Project Items */

.experience {
    margin-bottom: 36px;
}

.experience-header {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 6px;
    line-height: 1.5;
}

.bullet {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Back Link */

.back-link {
    display: inline-block;
    margin-bottom: 40px;
    font-size: 0.9rem;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    letter-spacing: 0.02em;
    transition: color 0.3s ease;
}

.back-link::after {
    display: none;
}

.back-link:hover {
    color: var(--accent-color);
}

/* ==============================
   Entrance Animations
   ============================== */

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Home page staggered entrance */
.page-home .profile-img,
.page-home .content > * {
    opacity: 0;
    animation: fadeUp 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.page-home .profile-img           { animation-delay: 0s; }
.page-home .content > *:nth-child(1)  { animation-delay: 0.05s; }
.page-home .content > *:nth-child(2)  { animation-delay: 0.1s; }
.page-home .content > *:nth-child(3)  { animation-delay: 0.15s; }
.page-home .content > *:nth-child(4)  { animation-delay: 0.2s; }
.page-home .content > *:nth-child(5)  { animation-delay: 0.25s; }
.page-home .content > *:nth-child(6)  { animation-delay: 0.3s; }
.page-home .content > *:nth-child(7)  { animation-delay: 0.35s; }
.page-home .content > *:nth-child(8)  { animation-delay: 0.4s; }
.page-home .content > *:nth-child(9)  { animation-delay: 0.45s; }
.page-home .content > *:nth-child(10) { animation-delay: 0.5s; }
.page-home .content > *:nth-child(11) { animation-delay: 0.55s; }

/* Inner pages — whole block fade-in */
.page-inner .content {
    opacity: 0;
    animation: fadeUp 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.05s forwards;
}

/* ==============================
   Responsive
   ============================== */

@media (max-width: 768px) {
    .container {
        flex-direction: column;
        padding: 48px 24px;
        gap: 32px;
    }

    .profile-img {
        width: 120px;
        height: 120px;
    }

    h1 {
        font-size: 2.2rem;
    }

    .links {
        gap: 10px;
    }

    .links a {
        padding: 5px 14px;
        font-size: 0.85rem;
    }

    h2 {
        padding-top: 40px;
    }

    .page-home .content > *:nth-child(n+6) {
        animation-delay: 0.3s;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 36px 20px;
    }

    h1 {
        font-size: 1.9rem;
    }

    .links {
        gap: 8px;
    }
}

/* Accessibility */

@media (prefers-reduced-motion: reduce) {
    .page-home .profile-img,
    .page-home .content > *,
    .page-inner .content {
        animation: none;
        opacity: 1;
    }

    .profile-img:hover {
        transform: none;
    }

    a::after {
        transition: none;
    }
}
