/* ============================================
   TYPEWRITER PERSONAL SITE — SHARED STYLES
   Courier Prime, regular weight only.
   Emphasis = underline, as on a real typewriter.
   ============================================ */

/* Font is loaded via <link> in each page's <head> (faster than @import). */

/* --- Reset & Base --- */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Courier Prime', 'Courier New', monospace;
    /* No background-attachment: fixed — it's ignored/janky on iOS Safari. */
    background: linear-gradient(45deg, #f4f1e8 0%, #f9f6f0 50%, #f4f1e8 100%);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    line-height: 1.8;
    letter-spacing: 0.5px;
    color: #2c2c2c;
    font-size: 16px;
}

/* Subtle paper texture overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(120, 119, 108, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(120, 119, 108, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(120, 119, 108, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: 1;
}

/* --- Sidebar Navigation --- */

.sidebar {
    position: fixed;
    left: 30px;
    top: 40px;
    width: 220px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid #333;
    box-shadow:
        8px 8px 0px rgba(0, 0, 0, 0.1),
        12px 12px 20px rgba(0, 0, 0, 0.15);
    z-index: 10;
    transform: rotate(-1deg);
    padding: 30px 25px;
}

/* Pushpin */
.sidebar::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 16px;
    background: #cc3b3b;
    border-radius: 50%;
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.3),
        inset 0 -1px 2px rgba(0, 0, 0, 0.2),
        0 0 8px rgba(204, 59, 59, 0.4);
}

.sidebar-title {
    font-size: 18px;
    margin: 48px 0 24px 0; /* matches spacing it had as an h2 */
    text-align: center;
    text-decoration: underline;
    text-underline-offset: 4px;
    letter-spacing: 1px;
    color: #2c2c2c;
}

.nav-menu {
    list-style: none;
}

.nav-menu li {
    margin-bottom: 12px;
    position: relative;
    padding-left: 18px;
}

.nav-menu li::before {
    content: '>';
    position: absolute;
    left: 0;
    color: #6b6b6b;
}

.nav-menu a {
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease, transform 0.2s ease;
    display: inline-block;
}

.nav-menu a:hover {
    color: #cc3b3b;
    transform: translateX(4px);
}

.nav-menu a.active {
    color: #cc3b3b;
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* External link indicator */
.nav-menu a.external::after {
    content: ' \2197';
    font-size: 12px;
}

/* --- Form Styling --- */
.hp-field {
    position: absolute;
    left: -9999px;
}

/* --- Main Content Area --- */

.main-content {
    margin-left: 300px;
    padding: 60px 80px 80px 60px;
    position: relative;
    z-index: 2;
    max-width: 800px;
}

/* --- Date Stamp --- */

.date-stamp {
    position: absolute;
    top: 20px;
    right: 40px;
    font-size: 12px;
    color: #5f5f5f;
    transform: rotate(5deg);
    border: 1px solid #999;
    padding: 5px 12px;
    background: rgba(255, 255, 255, 0.8);
    z-index: 5;
}

/* --- Typography --- */

/* No bold anywhere — headings rely on size, caps, and underlines,
   as a typewriter would. */
h1, h2, h3 {
    font-weight: normal;
}

h1 {
    font-size: 42px;
    margin-bottom: 30px;
    letter-spacing: 3px;
    text-decoration: underline;
    text-decoration-style: double;
    text-underline-offset: 8px;
    text-align: center;
}

h2 {
    font-size: 24px;
    margin: 48px 0 20px 0;
    letter-spacing: 1px;
}

h3 {
    font-size: 20px;
    margin: 36px 0 16px 0;
    letter-spacing: 0.5px;
}

p {
    margin-bottom: 20px;
    /* Ragged right — justified monospace creates ugly word-spacing rivers,
       and typewriters were never justified anyway. */
    text-align: left;
}

/* Typewriters had no bold or italic — emphasis was underlined.
   Only the regular weight of Courier Prime is loaded; all emphasis
   (strong and em alike) renders as underlined upright text. */
strong, em {
    font-weight: normal;
    font-style: normal;
    text-decoration: underline;
    text-underline-offset: 3px;
    letter-spacing: 0.5px;
}

a {
    color: #cc3b3b;
    text-decoration: none;
    border-bottom: 1px solid #cc3b3b;
    transition: color 0.2s ease;
}

a:hover {
    color: #2c2c2c;
    border-bottom-color: #2c2c2c;
}

/* --- Typewriter Divider --- */

.typewriter-line {
    border-bottom: 1px solid #bbb;
    margin: 32px 0;
    opacity: 0.4;
}

/* --- Highlight (yellow marker) --- */

.highlight {
    background: rgba(255, 230, 80, 0.3);
    padding: 2px 4px;
}

/* --- Project Items --- */

.project-item {
    margin-bottom: 40px;
    padding: 20px 24px;
    background: rgba(255, 255, 255, 0.3);
    border-left: 4px solid #333;
}

/* Project titles are h2 elements — override global h2 margins. */
.project-title {
    font-size: 20px;
    text-decoration: underline;
    text-underline-offset: 4px;
    letter-spacing: 0.5px;
    margin: 0 0 6px 0;
}

.project-subtitle {
    font-size: 14px;
    color: #5f5f5f;
    margin-bottom: 12px;
}

.project-link {
    display: inline-block;
    margin-top: 10px;
    font-size: 14px;
}

/* --- Document List ---
   Lighter than .project-item: no card box, just a manifest-style
   ruled list. One row per published file. */

.doc-list {
    list-style: none;
    margin-top: 8px;
}

.doc-item {
    padding: 16px 4px;
    border-bottom: 1px dashed #999;
}

.doc-item:first-child {
    border-top: 1px dashed #999;
}

.doc-line {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.doc-title {
    font-size: 17px;
}

/* Small bordered tag, like a rubber stamp: PDF / DOCX / etc. */
.doc-type {
    font-size: 11px;
    letter-spacing: 1.5px;
    border: 1px solid #5f5f5f;
    color: #5f5f5f;
    padding: 1px 7px;
    white-space: nowrap;
}

.doc-meta {
    font-size: 13px;
    color: #5f5f5f;
    margin-top: 4px;
}

.doc-desc {
    font-size: 15px;
    margin: 6px 0 0 0;
}

/* --- Contact Form --- */

.contact-form {
    max-width: 560px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    letter-spacing: 1px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #333;
    background: rgba(255, 255, 255, 0.9);
    font-family: 'Courier Prime', 'Courier New', monospace;
    font-size: 15px;
    line-height: 1.6;
    color: #2c2c2c;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #cc3b3b;
}

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

.submit-btn {
    background: #333;
    color: #f4f1e8;
    padding: 12px 32px;
    border: 2px solid #333;
    font-family: 'Courier Prime', 'Courier New', monospace;
    font-size: 16px;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.submit-btn:hover {
    background: #cc3b3b;
    border-color: #cc3b3b;
    color: #fff;
}

.contact-links {
    margin-top: 40px;
    padding: 24px;
    background: rgba(255, 255, 255, 0.3);
    border: 1px dashed #999;
}

.contact-links h2 {
    font-size: 20px;
    letter-spacing: 0.5px;
    margin: 0 0 16px 0;
}

.contact-links p {
    margin-bottom: 8px;
}

.contact-links a {
    border-bottom: none;
}

/* --- Footer --- */

.footer {
    margin-top: 60px;
    text-align: center;
    font-size: 13px;
    color: #5f5f5f;
}

/* --- Accessibility --- */

:focus-visible {
    outline: 2px solid #cc3b3b;
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *, *::before, *::after {
        transition: none !important;
    }
}

/* --- Mobile Responsive --- */

@media (max-width: 900px) {
    .sidebar {
        position: relative;
        left: 0;
        top: 0;
        width: calc(100% - 40px);
        margin: 20px;
        transform: none;
    }

    .main-content {
        margin-left: 0;
        padding: 40px 24px;
        max-width: 100%;
    }

    h1 {
        font-size: 32px;
    }

    .date-stamp {
        position: relative;
        top: 0;
        right: 0;
        display: inline-block;
        margin-bottom: 20px;
        transform: none;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 15px;
    }

    .sidebar {
        padding: 20px 18px;
    }

    h1 {
        font-size: 26px;
        letter-spacing: 2px;
    }

    .main-content {
        padding: 24px 16px;
    }
}
