/* ============================================
   FONTS
   ============================================ */
@import url('https://api.fontshare.com/v2/css?f%5B%5D=satoshi@300,400,500,600&display=swap');

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
    /* Typography */
    --font-primary: 'Satoshi', Arial, sans-serif;
    --font-mono: monospace;
    
    /* Colors */
    --color-text: #000;
    --color-bg: #ffffff;
    --color-muted: #969696;
    
    /* Borders */
    --color-border-light: rgba(0, 0, 0, 0.1);
    --color-border-medium: rgba(0, 0, 0, 0.2);
    --color-border-heavy: rgba(0, 0, 0, 0.3);
    
    /* Navigation */
    --color-nav-bg: rgba(255, 255, 255, 0.5);
    --color-nav-border: rgba(0, 0, 0, 0.05);
    
    /* Opacity Scale */
    --opacity-full: 1;
    --opacity-high: 0.9;
    --opacity-medium: 0.7;
    --opacity-low: 0.6;
    --opacity-lower: 0.4;
    --opacity-lowest: 0.3;
    
    /* Layout */
    --container-max: 900px;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
}

/* ============================================
   RESET & BASE
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: auto;
}

body {
    font-family: var(--font-primary);
    background-color: var(--color-bg);
    padding: 20px;
    padding-bottom: 80px;
    opacity: 1;
    transition: opacity var(--transition-normal);
}

header, nav, main, section, article, aside, footer, figure, figcaption {
    display: block;
}

figure {
    margin: 0;
}

strong {
    font-weight: 400;
}

em {
    font-style: italic;
}

/* ============================================
   LAYOUT: CONTAINER
   ============================================ */
.container {
    max-width: var(--container-max);
    width: 100%;
}

/* ============================================
   LAYOUT: HOME PAGE
   ============================================ */
body:has(#home-container) {
    padding: 0;
    padding-bottom: 0;
    overflow: hidden;
}

#home-container {
    min-height: 100vh;          /* Fallback for older browsers */
    min-height: 100dvh;         /* Dynamic viewport height */
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
    padding: 20px;
    box-sizing: border-box;
}

.home-profile {
    /* No positioning needed - flexbox handles centering */
}

.home-content {
    max-width: 1000px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
    text-align: center;
}

.home-profile-image {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    opacity: var(--opacity-high);
    transition: opacity var(--transition-normal);
}

.home-profile-image:hover {
    opacity: var(--opacity-full);
}

.home-name {
    position: static !important;
    transform: none !important;
    font-size: 14px;
    font-weight: 400;
    color: var(--color-text);
    text-transform: none;
    margin: 0;
    z-index: auto;
}

.home-separator {
    opacity: var(--opacity-lower);
    margin: 0 0.3em;
}

.home-bio-line {
    font-size: 12px;
    font-weight: 300;
    line-height: 1.7;
    color: var(--color-text);
    opacity: var(--opacity-low);
    margin: 0 0 var(--spacing-md) 0;
    font-style: italic;
}

.home-description {
    font-size: 12px;
    font-weight: 300;
    line-height: 1.7;
    color: var(--color-text);
    opacity: var(--opacity-low);
    margin: 0;
    max-width: 600px;
}

.home-links {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: var(--spacing-sm);
}

/* ============================================
   LAYOUT: PROJECT PAGES
   ============================================ */
body.page-centered {
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 60px;
    padding-bottom: 80px;
}

.project-viewport {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 0;
}

/* ============================================
   COMPONENT: NAVIGATION
   ============================================ */
.main-nav {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 10000 !important;
    display: flex !important;
    justify-content: center;
    align-items: center;
    gap: 30px;
    padding: 20px;
    background-color: var(--color-nav-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--color-nav-border);
    font-family: var(--font-primary);
    font-size: 12px;
}

.nav-link {
    color: rgba(0, 0, 0, 0.4);
    text-decoration: none;
    transition: color var(--transition-fast);
    position: relative;
    white-space: pre;
    display: inline-flex;
    align-items: center;
}

.nav-link:hover,
.nav-link.active {
    color: rgba(0, 0, 0, 0.7);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--color-text);
    transition: width var(--transition-normal);
}

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

/* ============================================
   COMPONENT: BACK LINK
   ============================================ */
.back-link {
    font-size: 12px;
    color: rgba(0, 0, 0, 0.4);
    text-decoration: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background-color: var(--color-nav-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--color-nav-border);
    transition: color var(--transition-normal);
    white-space: pre;
}

.back-link:hover {
    color: rgba(0, 0, 0, 0.7);
}

/* ============================================
   COMPONENT: FOOTER
   ============================================ */
footer {
    text-align: center;
    padding: var(--spacing-lg) 20px;
    }
    
.copyright {
        font-size: 12px;
    font-weight: 300;
    color: var(--color-text);
    opacity: var(--opacity-lower);
    margin: 0;
}

/* ============================================
   COMPONENT: TYPOGRAPHY
   ============================================ */
h1 {
    font-size: 14px;
    font-weight: 400;
    margin-bottom: var(--spacing-lg);
    color: var(--color-text);
}

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

.title {
    font-size: 14px;
    font-weight: 400;
    opacity: var(--opacity-full);
    display: inline;
}

h1.title {
    margin: 0;
    padding: 0;
    font-family: var(--font-primary);
}

.description {
    font-size: 12px;
    font-weight: 300;
    color: var(--color-text);
    opacity: var(--opacity-low);
}

.separator {
    font-size: 9px;
    font-family: var(--font-mono);
    font-weight: 400;
    color: var(--color-text);
    opacity: var(--opacity-lowest);
}

/* ============================================
   COMPONENT: SEPARATOR (HR)
   ============================================ */
hr {
    border: none;
    border-top: 1px solid var(--color-border-light);
    margin: var(--spacing-xl) 0;
}

/* ============================================
   COMPONENT: LINK - OUTLINK (Header style)
   ============================================ */
.outlinks {
    margin-bottom: 20px;
    text-align: left;
}

.outlink {
    font-size: 9px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text);
    opacity: var(--opacity-lower);
    text-decoration: none;
    position: relative;
    display: inline;
    transition: opacity var(--transition-normal);
}

.outlink:hover {
    opacity: var(--opacity-medium);
}

.outlink::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--color-text);
    transition: width var(--transition-normal);
}


.outlink-arrow {
    font-size: 8px;
    display: inline-block;
    margin-left: 2px;
}

.outlink-separator {
    font-size: 9px;
    font-family: var(--font-mono);
    font-weight: 400;
    color: var(--color-text);
    opacity: var(--opacity-lowest);
    margin: 0 8px;
}

/* ============================================
   COMPONENT: LINK - SOCIAL
   ============================================ */
.social-link {
    font-size: 10px;
    text-transform: uppercase;
    color: var(--color-text);
    opacity: var(--opacity-lower);
    text-decoration: none;
    position: relative;
    display: inline-block;
    transition: opacity var(--transition-normal);
}

.social-link:hover {
    opacity: var(--opacity-medium);
}

.social-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--color-text);
    transition: width var(--transition-normal);
}


/* ============================================
   COMPONENT: LINK - ARTICLE
   For all links within article content
   ============================================ */
.article-link {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text);
    text-decoration: none;
    display: inline;
    position: relative;
    opacity: var(--opacity-full);
}

.article-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--color-text);
    transition: width var(--transition-normal);
}


/* ============================================
   COMPONENT: LINK - READ MORE (Animated)
   For project cards on works page
   ============================================ */
.read-more {
    font-size: 12px;
    font-weight: 400;
    font-style: italic;
    color: var(--color-text);
    text-decoration: none;
    display: inline;
    position: relative;
    opacity: var(--opacity-full);
}

.read-more-text {
    position: relative;
}

.read-more-text::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--color-text);
    transition: width var(--transition-normal);
}

.read-more-arrow {
    display: inline-block;
    transition: transform var(--transition-fast);
}

/* Read More animations (triggered by .project-link hover) */
.project-link {
    text-decoration: none;
    color: inherit;
    display: block;
    cursor: pointer;
}

.project-link:hover .read-more {
    animation: blink-color 0.8s ease-in-out infinite;
}

.project-link:hover .read-more-text::after {
    width: 100%;
    animation: blink-underline 0.8s ease-in-out infinite;
}

.project-link:hover .read-more-arrow {
    animation: arrow-bounce 0.8s ease-in-out infinite;
}

@keyframes blink-color {
    0%, 100% { color: var(--color-text); }
    50% { color: var(--color-muted); }
}

@keyframes blink-underline {
    0%, 100% { background-color: var(--color-text); }
    50% { background-color: var(--color-muted); }
}

@keyframes arrow-bounce {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(8px); }
}

/* ============================================
   COMPONENT: PROJECT SUMMARY
   ============================================ */
.project-summary {
    margin-top: 30px;
    text-align: left;
    color: var(--color-text);
    line-height: 1.6;
    display: block;
}

.project-tags {
    font-size: 9px;
    font-weight: 400;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #333;
    opacity: var(--opacity-medium);
    margin-top: var(--spacing-md);
    margin-bottom: 0;
    text-align: left;
}

.project-grid {
    width: 100%;
    margin: var(--spacing-lg) 0;
}

.project-grid img {
    width: 100%;
    height: auto;
    display: block;
}

/* ============================================
   COMPONENT: ARTICLE - CONTENT SECTION
   ============================================ */
.content-section {
    margin-top: var(--spacing-lg);
    text-align: left;
}

.content-section h2 {
    font-size: 14px;
    font-weight: 400;
    margin-top: var(--spacing-xl);
    margin-bottom: var(--spacing-md);
}

.content-section h2:first-child {
    margin-top: 0;
}

.content-section h3 {
    font-size: 12px;
    font-weight: 400;
    margin-top: var(--spacing-sm);
    margin-bottom: var(--spacing-xs);
    color: var(--color-text);
}

/* Trait/attribute headings (followed by embed-selector) */
.content-section h2:has(+ .embed-selector) {
    font-size: 12px;
    margin-top: var(--spacing-sm);
    margin-bottom: var(--spacing-xs);
}

.content-section h3:first-child {
    margin-top: 0;
}

.content-section p {
    font-size: 12px;
    font-weight: 300;
    line-height: 1.7;
    color: var(--color-text);
    opacity: var(--opacity-low);
    margin-bottom: var(--spacing-md);
}

.content-section p .title {
    opacity: var(--opacity-full);
    font-size: 14px;
    font-weight: 400;
}

.content-section p .description {
    opacity: var(--opacity-low);
    font-size: 12px;
    font-weight: 300;
}

.content-section strong {
    font-weight: 400;
    opacity: var(--opacity-full);
}

.content-section ul {
    list-style: none;
    padding: 0;
    margin: var(--spacing-md) 0;
}

.content-section li {
    font-size: 12px;
    font-weight: 300;
    line-height: 1.7;
    color: var(--color-text);
    opacity: var(--opacity-low);
    margin-bottom: var(--spacing-sm);
}

/* ============================================
   COMPONENT: ARTICLE - INTRO QUOTE
   ============================================ */
.intro-quote {
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: var(--spacing-sm);
}

.intro-quote em {
    font-style: italic;
}

/* ============================================
   COMPONENT: ARTICLE - MEDIA
   ============================================ */
.article-video {
    width: 100%;
    max-width: var(--container-max);
    margin: var(--spacing-lg) 0;
    display: block;
}

.article-image {
    margin: var(--spacing-lg) 0;
}

.article-image img {
    width: 100%;
    max-width: var(--container-max);
    height: auto;
    display: block;
}

.media-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-sm);
    margin: var(--spacing-lg) 0;
    max-width: var(--container-max);
    align-items: center;
}

.media-grid-2 video,
.media-grid-2 img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ============================================
   COMPONENT: ARTICLE - TABLE
   ============================================ */
.content-section table {
    width: 100%;
    border-collapse: collapse;
    margin-top: var(--spacing-md);
}

.content-section th {
    font-size: 12px;
    font-weight: 400;
    text-align: left;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--color-border-medium);
}

.content-section td {
    font-size: 12px;
    font-weight: 300;
    color: var(--color-text);
    opacity: var(--opacity-low);
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--color-border-light);
}

.content-section td:first-child {
    font-weight: 400;
    opacity: var(--opacity-full);
}

.content-section td:last-child {
    font-family: var(--font-mono);
    font-size: 11px;
}

.content-section td a {
    color: inherit;
    text-decoration: underline;
    opacity: var(--opacity-full);
    transition: opacity var(--transition-normal);
}

.content-section td a:hover {
    opacity: var(--opacity-medium);
}

/* ============================================
   COMPONENT: INTERACTIVE EMBEDS
   ============================================ */
.interactive-hint {
    font-size: 12px;
    font-weight: 400;
    opacity: var(--opacity-full);
    margin: var(--spacing-md) 0 var(--spacing-xs);
    font-style: italic;
}

.embed-selector {
    letter-spacing: 0.1em;
    margin: 0.25rem 0 var(--spacing-xs);
}

.embed-link {
    font-size: 11px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text);
    opacity: var(--opacity-medium);
    text-decoration: none;
    position: relative;
    display: inline;
    cursor: pointer;
    transition: opacity var(--transition-normal);
    margin: 0 0.3em;
}

.embed-link:hover {
    opacity: var(--opacity-full);
}

.embed-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--color-text);
    transition: width var(--transition-normal);
}


.embed-container {
    width: 100%;
    max-width: var(--container-max);
    height: 250px;
    margin: var(--spacing-lg) 0;
}

.embed-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    touch-action: auto;
    -webkit-overflow-scrolling: touch;
}

/* Creators Media Viewer */
.creators-media-viewer {
    width: 100%;
    max-height: 400px;
    background: #FFFFFF;
    margin: var(--spacing-xl) auto var(--spacing-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.creators-media-viewer video,
.creators-media-viewer img {
    max-width: 100%;
    max-height: 400px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: none;
}

/* ============================================
   COMPONENT: FAQ ACCORDION
   ============================================ */
.faq-list {
    margin: var(--spacing-lg) 0;
}

.faq-item {
    border-bottom: 1px solid var(--color-border-light);
    padding: 0;
}

.faq-item summary {
    padding: var(--spacing-sm) 0;
    cursor: pointer;
    font-weight: 400;
    font-size: 13px;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    font-size: 18px;
    font-weight: 300;
    color: var(--color-muted);
    transition: transform var(--transition-fast);
}

.faq-item[open] summary::after {
    content: '−';
}

.faq-item p {
    padding: 0 0 var(--spacing-sm) 0;
    font-size: 13px;
    line-height: 1.7;
    opacity: 0.8;
}

/* FAQ links use .article-link component */

/* ============================================
   COMPONENT: CARDS
   ============================================ */
.cards {
    display: grid;
    grid-template-columns: repeat(4, 210px);
    gap: 20px;
    justify-content: center;
}

.card-image {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
    background-color: #ddd;
    display: block;
}

/* ============================================
   COMPONENT: WRITING LIST
   ============================================ */
.writing-list {
    display: flex;
    flex-direction: column;
    margin-top: var(--spacing-xl);
    max-height: 320px;
    overflow-y: scroll;
    overflow-x: hidden;
    padding-right: 12px;
}

.writing-list::-webkit-scrollbar {
    width: 2px;
    display: block;
}

.writing-list::-webkit-scrollbar-track {
    background: transparent;
    border-left: 2px solid #ccc;
}

.writing-list::-webkit-scrollbar-thumb {
    background: #999;
    border-radius: 0;
    width: 2px;
}

.writing-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md) 0;
    border-bottom: 1px solid var(--color-border-medium);
    gap: 0.75rem;
    transition: border-color var(--transition-normal);
    cursor: pointer;
}

.writing-item > a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.writing-item:hover {
    border-bottom-color: var(--color-text);
}

.writing-title {
    font-size: 12px;
    font-weight: 400;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: transform var(--transition-normal);
}

.writing-item:hover .writing-title {
    transform: translateX(8px);
}

.writing-tag {
    font-family: var(--font-mono);
    font-size: 9px;
    text-transform: uppercase;
    opacity: var(--opacity-low);
    border: 1px solid var(--color-border-heavy);
    padding: 2px 8px;
    width: 70px;
    flex-shrink: 0;
    text-align: center;
}

.writing-date {
    font-family: var(--font-mono);
    font-size: 9px;
    opacity: var(--opacity-lower);
    flex-shrink: 0;
}

/* ============================================
   COMPONENT: ABOUT SECTION
   ============================================ */
.about-profile {
    margin: var(--spacing-xl) 0;
}

.about-profile img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    opacity: var(--opacity-high);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.about-text {
    font-size: 12px;
    font-weight: 300;
    line-height: 1.7;
    opacity: var(--opacity-low);
    margin-bottom: var(--spacing-xl);
}

.about-links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.about-emails {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
    font-size: 12px;
    font-weight: 300;
    color: #969696;
}

.about-emails a {
    font-weight: 400;
    color: var(--color-text);
}

.newsletter-link {
    margin-top: var(--spacing-xl);
}

.subscribe-button {
    display: inline-block;
    padding: 10px 24px;
    font-size: 10px;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration: none;
    background: var(--color-text);
    color: var(--color-bg);
    border: 1px solid var(--color-text);
    cursor: pointer;
    transition: opacity var(--transition-normal);
}

.subscribe-button:hover {
    opacity: var(--opacity-medium);
}

/* ============================================
   COMPONENT: MODAL
   ============================================ */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--color-bg);
    padding: var(--spacing-lg);
    max-width: 500px;
    width: 90%;
    position: relative;
    border: 1px solid var(--color-muted);
}

.modal-close {
    position: absolute;
    top: -12px;
    right: -12px;
    background: var(--color-text);
    border: none;
    width: 24px;
    height: 24px;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    color: var(--color-bg);
    transition: opacity var(--transition-normal);
    padding: 0;
    line-height: 24px;
    text-align: center;
}

.modal-close:hover {
    opacity: var(--opacity-medium);
}

/* ============================================
   COMPONENT: CURSOR FOLLOWER
   ============================================ */
.cursor-follower {
    position: fixed;
    width: 10px;
    height: 10px;
    background-color: transparent;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: background-color var(--transition-fast);
}

.cursor-follower.blink {
    animation: blinkCursor 0.5s ease-in-out infinite;
}

@keyframes blinkCursor {
    0%, 100% {
        background-color: transparent;
    }
    50% {
        background-color: var(--color-muted);
    }
}

/* ============================================
   PAGE: 404
   ============================================ */
.error-page {
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.error-container {
    height: 100vh;              /* Fallback for older browsers */
    height: 100dvh;             /* Dynamic viewport height - fixes iOS Chrome */
    width: 100vw;
    position: relative;
}

.error-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    gap: 40px;
}

.error-number {
    font-family: var(--font-primary);
    font-size: 40px;
    font-weight: 300;
    color: var(--color-muted);
    line-height: 1;
    margin-top: -8px;
}

.error-image {
    border-radius: 50%;
    opacity: var(--opacity-high);
}

/* ============================================
   PAGE: PRESS (override)
   ============================================ */
.press-list {
    max-height: none;
    overflow: visible;
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* Tablet: 2x2 grid (4 columns need 900px, switch earlier) */
@media (max-width: 950px) {
    .cards {
        grid-template-columns: repeat(2, 210px);
        gap: 20px;
    }

    /* 2x2 grid width: 210px × 2 + 20px gap = 440px */
    .container {
        max-width: 440px;
    }
}

/* Smaller tablets / large phones */
@media (max-width: 768px) {
    .main-nav {
        gap: 20px;
        font-size: 11px;
    }
    
    .home-profile-image {
        width: 150px;
        height: 150px;
    }
    
    .home-description {
        max-width: 100%;
    }

    .writing-tag {
        display: none;
    }
}

/* ============================================
   HOVER EFFECTS (Desktop only)
   ============================================ */
@media (hover: hover) {
    .nav-link:hover::after,
    .outlink:hover::after,
    .social-link:hover::after,
    .article-link:hover::after,
    .embed-link:hover::after {
        width: 100%;
    }
}

/* PWA standalone mode fix (home screen app only) */
@media all and (display-mode: standalone) {
    .error-container {
        height: 100dvh;
        height: -webkit-fill-available;
    }
}

/* Mobile: single column */
@media (max-width: 480px) {
    .cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .cards .card-image,
    .cards video {
        width: 100%;
        height: auto;
        aspect-ratio: 1;
    }

    /* Home page: smaller text to fit social links */
    .home-content {
        gap: 0.5rem;
    }
    
    .home-profile-image {
        width: 100px;
        height: 100px;
    }
    
    .home-name {
        font-size: 12px;
        margin-bottom: 0.25rem;
    }
    
    .home-description {
        font-size: 10px;
        line-height: 1.4;
        margin-bottom: 0.5rem;
    }
    
    .social-links {
        margin-top: 0.5rem;
        gap: 0.75rem;
    }
    
    .social-link {
        font-size: 9px;
    }
}
