/* ==========================================================================
   Matt Pressberg Personal Site
   Design: "The Cartographer's Study"
   Palette: Aged parchment, warm charcoal, hunter green, brass accents
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Variables
   -------------------------------------------------------------------------- */
:root {
    /* Colors */
    --color-parchment: #F5F1E8;
    --color-parchment-dark: #EBE5D8;
    --color-ink: #2C2824;
    --color-ink-light: #4A4540;
    --color-hunter: #2D5A4A;
    --color-hunter-light: #3A7460;
    --color-brass: #B8936A;
    --color-brass-dark: #9A7B56;
    
    /* Typography */
    --font-serif: 'Newsreader', Georgia, serif;
    --font-sans: 'Source Sans 3', -apple-system, BlinkMacSystemFont, sans-serif;
    
    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2.5rem;
    --space-xl: 4rem;
    --space-2xl: 6rem;
    
    /* Layout */
    --max-width: 720px;
    --nav-height: 80px;
}

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

html {
    font-size: 18px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-weight: 400;
    line-height: 1.6;
    color: var(--color-ink);
    background-color: var(--color-parchment);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Subtle paper texture overlay */
.page-texture {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%' height='100%' filter='url(%23noise)'/%3E%3C/svg%3E");
    z-index: 1000;
}

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4 {
    font-family: var(--font-serif);
    font-weight: 500;
    line-height: 1.2;
    color: var(--color-ink);
}

h1 {
    font-size: 2.5rem;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 1rem;
    font-family: var(--font-sans);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-ink-light);
    margin-bottom: var(--space-md);
}

p {
    margin-bottom: var(--space-sm);
}

a {
    color: var(--color-hunter);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    background-color: var(--color-parchment);
    z-index: 100;
    border-bottom: 1px solid var(--color-parchment-dark);
}

.nav {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--space-md) var(--space-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--nav-height);
}

.nav-name {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--color-ink);
    letter-spacing: -0.01em;
}

.nav-name:hover {
    color: var(--color-hunter);
}

.nav-links {
    display: flex;
    gap: var(--space-md);
}

.nav-links a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-ink-light);
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-brass);
    transition: width 0.3s ease;
}

.nav-links a:hover {
    color: var(--color-ink);
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-links a.active {
    color: var(--color-ink);
}

.nav-links a.active::after {
    width: 100%;
}

main {
    flex: 1;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--space-xl) var(--space-md);
    width: 100%;
}

/* --------------------------------------------------------------------------
   Homepage Hero
   -------------------------------------------------------------------------- */
.hero {
    margin-bottom: var(--space-2xl);
}

.hero-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.hero-image-container {
    position: relative;
    width: 140px;
    height: 140px;
    flex-shrink: 0;
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    filter: grayscale(15%) sepia(10%);
    position: relative;
    z-index: 2;
}

/* Decorative frame effect */
.image-frame {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 100%;
    height: 100%;
    border: 2px solid var(--color-brass);
    border-radius: 4px;
    z-index: 1;
    opacity: 0.6;
}

.hero-text h1 {
    margin-bottom: var(--space-sm);
}

.tagline {
    font-size: 1.15rem;
    line-height: 1.7;
    color: var(--color-ink-light);
    max-width: 540px;
}

/* --------------------------------------------------------------------------
   Current Work Section
   -------------------------------------------------------------------------- */
.current-work {
    margin-bottom: var(--space-2xl);
}

.work-items {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.work-item {
    display: flex;
    flex-direction: column;
    padding: var(--space-md);
    background-color: var(--color-parchment-dark);
    border-radius: 4px;
    border: 1px solid transparent;
    transition: all 0.25s ease;
    position: relative;
}

.work-item:hover {
    border-color: var(--color-hunter);
    background-color: var(--color-parchment);
    transform: translateX(4px);
}

.work-title {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--color-ink);
    margin-bottom: var(--space-xs);
}

.work-desc {
    font-size: 0.9rem;
    color: var(--color-ink-light);
}

.external-indicator {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    font-size: 1rem;
    color: var(--color-brass);
    opacity: 0;
    transform: translate(-4px, 4px);
    transition: all 0.25s ease;
}

.work-item:hover .external-indicator {
    opacity: 1;
    transform: translate(0, 0);
}

/* --------------------------------------------------------------------------
   Connect/Social Section
   -------------------------------------------------------------------------- */
.connect {
    margin-bottom: var(--space-xl);
}

.social-links {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.social-link {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) 0;
    color: var(--color-ink-light);
    transition: color 0.2s ease;
}

.social-link:hover {
    color: var(--color-hunter);
}

.social-platform {
    font-weight: 600;
    font-size: 0.9rem;
}

.social-handle {
    font-size: 0.9rem;
    color: var(--color-ink-light);
    opacity: 0.8;
}

.social-link:hover .social-handle {
    color: var(--color-hunter);
    opacity: 1;
}

/* --------------------------------------------------------------------------
   Page Content (for interior pages)
   -------------------------------------------------------------------------- */
.page-content {
    flex: 1;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--space-xl) var(--space-md);
    width: 100%;
}

.page-header {
    margin-bottom: var(--space-xl);
}

.page-header h1 {
    margin-bottom: var(--space-sm);
}

.page-intro {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--color-ink-light);
    max-width: 540px;
}

/* --------------------------------------------------------------------------
   About Page
   -------------------------------------------------------------------------- */
.about-content {
    max-width: 600px;
}

.bio-text p {
    margin-bottom: var(--space-md);
    line-height: 1.75;
}

.bio-text h2 {
    margin-top: var(--space-xl);
    margin-bottom: var(--space-md);
}

.bio-text a {
    color: var(--color-hunter);
    text-decoration: underline;
    text-decoration-color: var(--color-brass);
    text-underline-offset: 3px;
    transition: text-decoration-color 0.2s ease;
}

.bio-text a:hover {
    text-decoration-color: var(--color-hunter);
}

.bio-text em {
    font-family: var(--font-serif);
    font-style: italic;
}

/* --------------------------------------------------------------------------
   Contact Form
   -------------------------------------------------------------------------- */
.contact-section {
    max-width: 480px;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-ink);
}

.form-group input,
.form-group textarea {
    font-family: var(--font-sans);
    font-size: 1rem;
    padding: var(--space-sm);
    border: 1px solid var(--color-parchment-dark);
    border-radius: 4px;
    background-color: var(--color-parchment);
    color: var(--color-ink);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-hunter);
    box-shadow: 0 0 0 3px rgba(45, 90, 74, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--color-ink-light);
    opacity: 0.5;
}

.form-group textarea {
    resize: vertical;
    min-height: 150px;
}

.submit-btn {
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 600;
    padding: var(--space-sm) var(--space-md);
    background-color: var(--color-hunter);
    color: var(--color-parchment);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    align-self: flex-start;
}

.submit-btn:hover {
    background-color: var(--color-hunter-light);
}

.submit-btn:active {
    transform: translateY(1px);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--space-lg) var(--space-md);
    width: 100%;
    border-top: 1px solid var(--color-parchment-dark);
}

.site-footer p {
    font-size: 0.85rem;
    color: var(--color-ink-light);
    margin: 0;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (min-width: 600px) {
    html {
        font-size: 19px;
    }
    
    h1 {
        font-size: 3rem;
    }
    
    .hero-content {
        flex-direction: row;
        align-items: flex-start;
        gap: var(--space-xl);
    }
    
    .hero-image-container {
        width: 160px;
        height: 160px;
    }
}

@media (min-width: 900px) {
    :root {
        --nav-height: 100px;
    }
    
    main {
        padding: var(--space-2xl) var(--space-md);
    }
}

/* --------------------------------------------------------------------------
   Utility Classes
   -------------------------------------------------------------------------- */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
