/* ==========================================
   CSS Variables
   ========================================== */
:root {
    --bg-color: #f5f4f0;
    --text-color: #1a1a1a;
    --accent-color: #666666;
    --hover-color: #000000;

    --font-serif: 'Crimson Text', Georgia, Times, serif;

    --max-width: 720px;
    --padding-mobile: 40px;
    --padding-desktop: 60px;
}

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

html {
    font-size: 16px;
}

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

/* ==========================================
   Layout
   ========================================== */
main {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: var(--padding-mobile);
}

.content {
    max-width: var(--max-width);
    width: 100%;
    opacity: 0;
    transform: translateY(10px);
    animation: fadeIn 1s ease-out 0.2s forwards;
    transition: transform 0.1s ease-out;
}

@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
   Typography
   ========================================== */
p {
    font-size: clamp(1.375rem, 3.2vw, 2rem);
    line-height: 1.65;
    font-weight: 400;
    letter-spacing: -0.015em;
    margin: 0;
    opacity: 0;
    animation: paragraphFade 1s ease-out 0.3s forwards;
}

@keyframes paragraphFade {
    to {
        opacity: 1;
    }
}

em {
    font-style: italic;
    font-weight: 400;
}

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

a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: var(--text-color);
    opacity: 0.3;
    transition: opacity 0.2s ease;
}

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

a:hover::after {
    opacity: 1;
}

/* ==========================================
   Interactive Elements
   ========================================== */
.contact {
    margin-top: 3em;
    opacity: 0;
    animation: paragraphFade 1s ease-out 0.5s forwards;
}

@media (max-width: 640px) {
    .contact {
        margin-top: 2em;
    }
}

/* ==========================================
   Responsive
   ========================================== */
@media (min-width: 768px) {
    main {
        padding: var(--padding-desktop);
    }
}

@media (max-width: 640px) {
    p {
        font-size: clamp(1.125rem, 5vw, 1.375rem);
    }
}

/* ==========================================
   Text Selection
   ========================================== */
::selection {
    background-color: rgba(0, 0, 0, 0.1);
    color: var(--text-color);
}

::-moz-selection {
    background-color: rgba(0, 0, 0, 0.1);
    color: var(--text-color);
}

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

    .content {
        animation: none;
        opacity: 1;
        transform: none;
    }

    p {
        animation: none;
        opacity: 1;
        transform: none;
    }
}
