:root {
    --bg-color: #0c0c0c;
    --text-color: #ffffff;
    --text-primary: #ffffff;
    --text-secondary: #e0e0e0;
    --text-tertiary: #888888;
    --text-dim: #999999;
    --text-muted: #666666;
    --accent-blue: #3b82f6;
    --status-green: #22c55e;
    --font-primary: "Geist Sans", sans-serif;
    --container-width: 600px;
    --section-spacing: 3rem;
    --border-subtle: rgba(255, 255, 255, 0.05);
    --border-color: #333;
    --bg-input: rgba(255, 255, 255, 0.03);
    --card-bg: rgba(255, 255, 255, 0.05);
    --code-bg: rgba(255, 255, 255, 0.1);
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-primary);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.2s ease, color 0.2s ease;
    overflow-x: hidden;
    position: relative;
    width: 100%;
}

/* Global Settings Classes */
body.font-sans {
    --font-primary: "Geist Sans", sans-serif;
}

body.font-serif {
    --font-primary: "Lora", serif;
}

body.font-mono {
    --font-primary: "IBM Plex Mono", monospace;
}

body.font-round {
    --font-primary: "Rubik", sans-serif;
}

/* Theme Adjustments - primary variable sets */
body.theme-light {
    --bg-color: #fafafa;
    --text-color: #1a1a1a;
    --text-primary: #1a1a1a;
    --text-secondary: #333333;
    --text-tertiary: #999999;
    --text-dim: #666666;
    --border-subtle: rgba(0, 0, 0, 0.05);
    --border-color: #ddd;
    --bg-input: rgba(0, 0, 0, 0.02);
    --card-bg: rgba(0, 0, 0, 0.03);
    --code-bg: rgba(0, 0, 0, 0.05);
}

body.theme-dark {
    --bg-color: #0c0c0c;
    --text-color: #ffffff;
    --text-primary: #ffffff;
    --text-secondary: #e0e0e0;
    --text-tertiary: #888888;
    --text-dim: #999999;
    --border-subtle: rgba(255, 255, 255, 0.05);
    --border-color: #333;
    --bg-input: rgba(255, 255, 255, 0.03);
    --card-bg: rgba(255, 255, 255, 0.05);
    --code-bg: rgba(255, 255, 255, 0.1);
}

body.theme-light .dim {
    color: #999;
}

body.theme-light .highlight {
    color: var(--text-color);
}

body.theme-light .nav-icon {
    color: #999;
}

body.theme-light .settings-section {
    border-color: #e5e5e5;
}

body.theme-light .option-preview {
    background: #f5f5f5;
    border-color: #e5e5e5;
}

body.theme-light .option-card.active .option-preview {
    border-color: #1a1a1a;
    background: #fff;
}

body.theme-light .settings-desc {
    color: #999;
}

body.theme-light .option-label {
    color: #999;
}

body.theme-light .option-card.active .option-label {
    color: #1a1a1a;
}

/* Palette Colors - affects surfaces and accents */
.highlight {
    color: var(--text-color);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 1.5rem 1rem;
    max-width: var(--container-width);
    margin: 0 auto;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 14px;
}

.nav-left a {
    text-decoration: none;
    transition: opacity 0.2s;
}

.nav-left a:hover {
    opacity: 0.7;
}

.brand {
    color: var(--text-color);
    font-weight: 400;
}

.separator {
    color: #444;
}

.current-page {
    color: var(--text-color);
    font-weight: 400;
}

.nav-right {
    display: flex;
    gap: 1.25rem;
    align-items: center;
}

.nav-icon {
    background: transparent;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    padding: 0.5rem;
    border-radius: 8px;
}

.nav-icon:hover {
    background: var(--border-subtle);
}

.nav-icon.active {
    background: var(--border-subtle);
}

body.theme-light .nav-icon {
    background: transparent;
    color: #1a1a1a;
}

body.theme-light .nav-icon:hover {
    background: rgba(0, 0, 0, 0.08);
}

body.theme-light .nav-icon.active {
    background: rgba(0, 0, 0, 0.12);
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Back Button Icons */
.icon-back {
    display: inline-block;
    width: 14px;
    height: 14px;
    background-color: currentColor;
    -webkit-mask-image: url('back.svg');
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    mask-image: url('back.svg');
    mask-repeat: no-repeat;
    mask-size: contain;
}

/* Back Button */
.back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 40px;
    transition: color 0.2s ease;
}

.back-button:hover {
    color: var(--text-color);
}

/* Settings Panel Styles */
.settings-page {
    padding-top: 0.5rem;
    padding-bottom: 3rem;
}

.settings-page .back-button {
    margin-top: 0;
    margin-bottom: 2rem;
}

.settings-section {
    margin-top: 1.5rem;
    border-top: 1px solid #1a1a1a;
    padding-top: 2rem;
}

.settings-group {
    margin-bottom: 3rem;
}

.settings-header {
    margin-bottom: 1rem;
}

.settings-header.main-header {
    margin-bottom: 2.5rem;
}

.settings-header.main-header .settings-title {
    font-size: 20px;
    line-height: 1.4;
}

.settings-title {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: var(--text-color);
    line-height: 1.5;
}

.settings-desc {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.65rem;
}

.options-grid.four-cols {
    grid-template-columns: repeat(4, 1fr);
}

.options-grid.five-cols {
    grid-template-columns: repeat(5, 1fr);
}

.option-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.option-preview {
    width: 100%;
    aspect-ratio: 16/9;
    background: transparent;
    border: 1.5px solid #2a2a2a;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.15s ease;
    overflow: hidden;
}

.option-card.active .option-preview {
    border-color: #fff;
}

.option-label {
    font-size: 13px;
    color: #666;
    transition: color 0.15s ease;
}

.option-card.active .option-label {
    color: #fff;
}

/* Theme Previews with Text Lines */
.preview-theme {
    width: 100%;
    height: 100%;
    display: flex;
    padding: 12px;
    box-sizing: border-box;
}

.preview-theme.system {
    display: flex;
    flex-direction: row;
}

.theme-side {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    justify-content: center;
    padding: 8px;
}

.theme-side.light {
    background: #f5f5f5;
}

.theme-side.dark {
    background: #2a2a2a;
}

.theme-line {
    height: 3px;
    background: #999;
    border-radius: 2px;
    width: 100%;
}

.theme-side.dark .theme-line {
    background: #666;
}

.theme-line.short {
    width: 60%;
}

.preview-theme.light {
    background: #f5f5f5;
    flex-direction: column;
    gap: 4px;
    justify-content: center;
}

.preview-theme.light .theme-line {
    background: #ccc;
}

.preview-theme.dark {
    background: #2a2a2a;
    flex-direction: column;
    gap: 4px;
    justify-content: center;
}

.preview-theme.dark .theme-line {
    background: #555;
}

/* Palette Swatches - restoring preview display */
.preview-swatch {
    width: 100%;
    height: 100%;
    border-radius: 4px;
}

/* Font Previews - Larger */
.preview-font {
    font-size: 32px;
    font-weight: 600;
    color: #fff;
}

[data-value="sans"] .preview-font {
    font-family: "Geist Sans", sans-serif;
}

[data-value="serif"] .preview-font {
    font-family: "Lora", serif;
}

[data-value="mono"] .preview-font {
    font-family: "IBM Plex Mono", monospace;
}

[data-value="round"] .preview-font {
    font-family: "Rubik", sans-serif;
}

/* Palette Swatches - using the colors they represent */
.swatch-default {
    background: #999;
}

.swatch-ocean {
    background: #7ba3c7;
}

.swatch-forest {
    background: #88b888;
}

.swatch-sunset {
    background: #d4a574;
}

.swatch-lavender {
    background: #b8a3d4;
}

body.theme-light .swatch-default {
    background: #666;
}

body.theme-light .swatch-ocean {
    background: #4a6a85;
}

body.theme-light .swatch-forest {
    background: #4a6a4a;
}

body.theme-light .swatch-sunset {
    background: #7a6a4a;
}

body.theme-light .swatch-lavender {
    background: #6a5a7a;
}

/* Navbar fixes */
.nav-icon {
    color: var(--text-dim);
}

.nav-icon:hover {
    background: var(--border-subtle);
    color: var(--text-color);
}

.nav-icon.active {
    background: var(--border-subtle);
    color: var(--text-color);
}

.brand {
    color: var(--text-color);
}

.separator {
    color: var(--text-muted);
}

/* Modal refinements - Consolidated */
.modal-backdrop,
.menu-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
}

body.theme-light .modal-backdrop,
body.theme-light .menu-backdrop {
    background: rgba(255, 255, 255, 0.3);
}

.modal-description {
    color: var(--text-dim);
}

/* Project items */
.project-arrow {
    color: var(--text-color);
}

/* Form refinement */
.form-group label {
    color: var(--text-dim);
}

/* Global transitions for theme switching */
body,
.container,
.project-item,
.writing-item,
.nav-icon,
.submit-button,
.form-group input,
.form-group textarea {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.2s ease, opacity 0.2s ease;
}

/* Palette Background Effects - Dark Mode */
body.palette-default {
    --bg-color: #0c0c0c;
    --text-dim: #999999;
}

body.palette-ocean {
    --bg-color: #0a1420;
    --text-dim: #7ba3c7;
}

body.palette-forest {
    --bg-color: #0d1810;
    --text-dim: #88b888;
}

body.palette-sunset {
    --bg-color: #1a1410;
    --text-dim: #d4a574;
}

body.palette-lavender {
    --bg-color: #14101a;
    --text-dim: #b8a3d4;
}

/* Palette Background Effects - Light Mode */
body.theme-light.palette-default {
    --bg-color: #fafafa;
    --text-dim: #666666;
}

body.theme-light.palette-ocean {
    --bg-color: #f7f9fc;
    --text-dim: #4a6a85;
}

body.theme-light.palette-forest {
    --bg-color: #f7faf7;
    --text-dim: #4a6a4a;
}

body.theme-light.palette-sunset {
    --bg-color: #fdf9f5;
    --text-dim: #7a6a4a;
}

body.theme-light.palette-lavender {
    --bg-color: #faf8fc;
    --text-dim: #6a5a7a;
}

/* Base Styles using variables */
body {
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.dim {
    color: var(--text-dim) !important;
}

.highlight,
.highlight a {
    color: var(--text-color) !important;
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-color: var(--text-color);
}

.contact-intro,
.personal-intro,
.experience-intro,
.project-desc,
.work-subtitle,
.settings-desc,
.section-description,
.experience-description,
.contact-description {
    color: var(--text-dim) !important;
}

.contact-section-title,
.projects-section-title,
.writing-section-title,
.personal-section-title,
.experience-title,
.work-title,
.section-label {
    color: var(--text-dim) !important;
    opacity: 0.8;
}

.project-name,
.writing-title,
.experience-role,
.company-name {
    color: var(--text-color) !important;
}

.submit-button {
    background: var(--text-color);
    color: var(--bg-color);
    border: 1px solid var(--border-subtle);
}

.social-value {
    color: var(--text-color);
}

.experience-date,
.writing-date {
    color: var(--text-color);
}

.social-right,
.experience-date,
.company-at {
    color: var(--text-color);
    opacity: 0.8;
}

/* Light Mode Adjustments for Settings */
body.theme-light .option-preview {
    border-color: #e0e0e0;
    background: #f8f8f8;
}

body.theme-light .option-card.active .option-preview {
    border-color: #1a1a1a;
    background: #fff;
}

body.theme-light .preview-font {
    color: #1a1a1a;
}

body.theme-light .option-label {
    color: #999;
}

body.theme-light .option-card.active .option-label {
    color: #1a1a1a;
}

.hero {
    margin-bottom: var(--section-spacing);
}

.profile-container {
    margin-bottom: 1.75rem;
}

.profile-img-wrapper {
    position: relative;
    width: 64px;
    height: 64px;
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 14px;
    background-color: #222;
}

.status-indicator {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    background-color: var(--status-green);
    border: 2px solid var(--bg-color);
    border-radius: 50%;
}

.hero-header {
    margin-bottom: 1.25rem;
}

.name-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

h1 {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-color);
}

.bio {
    font-size: 16px;
    line-height: 1.6;
    font-weight: 400;
    color: var(--text-color);
}

.bio p {
    margin-bottom: 1.5rem;
}

.dim {
    color: #777;
}

.highlight {
    color: var(--text-color);
    font-weight: 400;
}

.work-section {
    margin-top: 4rem;
}

.section-label {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.section-description {
    font-size: 16px;
}

@media (max-width: 600px) {
    .navbar {
        padding: 1.5rem;
    }

    .container {
        padding: 3rem 1.5rem;
    }
}

/* Work Section Styles */
.work-section {
    margin-top: 0;
    margin-bottom: 5rem;
    width: 100%;
}

.work-header {
    margin-bottom: 2rem;
}

.work-title {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.work-subtitle {
    font-size: 15px;
    line-height: 1.6;
}

.projects-canvas {
    position: relative;
    width: 100%;
    height: 500px;
    background-image: radial-gradient(circle, #333 0.5px, transparent 0.5px);
    background-size: 12px 12px;
    border-radius: 12px;
    overflow: hidden;
    margin: 0 auto;
}

body.theme-light .projects-canvas {
    background-image: radial-gradient(circle, #ddd 0.5px, transparent 0.5px);
}

.project-card {
    position: absolute;
    cursor: move;
    cursor: grab;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border: 3px solid #fff;
}

.project-card:active {
    cursor: grabbing;
}

.project-card:hover {
    transform: scale(1.05) translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

body.theme-light .project-card {
    border-color: #e0e0e0;
}

.project-image {
    display: block;
    width: 280px;
    height: auto;
    border-radius: 9px;
    pointer-events: none;
}

.project-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-modal.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    position: relative;
    max-width: 600px;
    width: 90%;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.modal-close {
    position: absolute;
    top: -3rem;
    right: 0;
    background: transparent;
    border: none;
    color: #999;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 1002;
}

.modal-close:hover {
    color: #fff;
    transform: rotate(90deg);
}

body.theme-light .modal-close {
    color: #666;
}

body.theme-light .modal-close:hover {
    color: #1a1a1a;
}

.modal-image-wrapper {
    position: relative;
    width: 100%;
    max-width: 500px;
    border-radius: 16px;
    overflow: hidden;
    border: 3px solid #fff;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

body.theme-light .modal-image-wrapper {
    border-color: #1a1a1a;
}

.modal-project-image {
    width: 100%;
    height: auto;
    display: block;
}

.modal-visit-icon {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 48px;
    height: 48px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.modal-visit-icon:hover {
    background: rgba(0, 0, 0, 0.95);
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.4);
}

body.theme-light .modal-visit-icon {
    background: rgba(255, 255, 255, 0.9);
    color: #1a1a1a;
    border-color: rgba(0, 0, 0, 0.1);
}

body.theme-light .modal-visit-icon:hover {
    background: rgba(255, 255, 255, 1);
    border-color: rgba(0, 0, 0, 0.2);
}

.modal-description {
    font-size: 15px;
    line-height: 1.6;
    color: #999;
    text-align: center;
    max-width: 600px;
    margin: 0;
}

body.theme-light .modal-description {
    color: #666;
}

@keyframes modalSlideIn {
    from {
        transform: scale(0.95) translateY(20px);
        opacity: 0;
    }

    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.modal-content {
    animation: modalSlideIn 0.3s ease;
}

/* Experience Section */
.experience-section {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.experience-section .container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.experience-header {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 0;
}

.experience-title {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.1em;
    margin-bottom: 0;
}

.experience-intro {
    font-size: 15px;
    line-height: 1.6;
}

.experience-timeline {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.experience-item {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 16px;
}

.experience-date {
    font-size: 13px;
    color: var(--text-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.experience-details {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.experience-role {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-color);
    margin: 0;
    display: inline;
    white-space: nowrap;
}

.experience-company {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.company-at {
    font-size: 15px;
    color: #666;
}

.company-logo {
    height: 16px;
    width: auto;
    object-fit: contain;
}

.company-name {
    font-size: 15px;
    color: var(--text-color);
}

.experience-description {
    font-size: 15px;
    line-height: 1.6;
    margin: 0;
}

@media (max-width: 600px) {
    .experience-item {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .experience-date {
        font-size: 12px;
    }
}

.experience-title-line {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Work & Projects Section */
.projects-section {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.projects-section .container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.projects-section-title {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.1em;
    color: #666;
    margin-bottom: 0;
}

.projects-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.project-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text-color);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0s;
}

body.theme-light .project-item {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.project-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

body.theme-light .project-item:hover {
    background: rgba(0, 0, 0, 0.02);
}

.project-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.project-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.project-name {
    font-size: 16px;
    font-weight: 400;
    margin: 0;
}

.project-desc {
    font-size: 16px;
    margin: 0;
}

.project-arrow {
    color: #666;
    flex-shrink: 0;
    transition: none;
}

.project-item:hover .project-arrow {
    color: var(--text-color);
}

@media (max-width: 600px) {
    .project-logo {
        width: 36px;
        height: 36px;
    }

    .project-name {
        font-size: 15px;
    }

    .project-desc {
        font-size: 15px;
    }
}

/* Main section top spacing */
main.container {
    padding-top: 3rem;
}

/* Writing Section */
.writing-section {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.writing-section .container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.writing-section-title {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.1em;
    color: #666;
    margin-bottom: 0;
}

.writing-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}



.writing-footer-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text-color);
    font-size: 15px;
    transition: opacity 0.2s ease;
}

.writing-footer-link:hover {
    opacity: 0.7;
}

.substack-logo {
    width: 18px;
    height: 18px;
    object-fit: contain;
    margin: 0 2px;
}

.writing-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    text-decoration: none;
    color: var(--text-color);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s ease;
}

body.theme-light .writing-item {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.writing-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

body.theme-light .writing-item:hover {
    background: rgba(0, 0, 0, 0.02);
}

.writing-title {
    font-size: 16px;
    font-weight: 400;
    margin: 0;
}

.writing-arrow {
    color: #666;
    transition: transform 0.2s ease, color 0.2s ease;
}

.writing-item:hover .writing-arrow {
    transform: translate(2px, -2px);
    color: var(--text-color);
}

@media (max-width: 600px) {

    .writing-footer-link {
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }
}

.personal-section {
    margin-top: 2rem;
    margin-bottom: 3rem;
}

.personal-section .container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.personal-section-title {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.1em;
    color: #666;
    margin-bottom: 0;
}

.personal-intro {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 0;
}

.spotify-embed {
    margin-bottom: 0;
    width: 100%;
    max-width: 640px;
}

.spotify-embed iframe {
    width: 100%;
}

.polaroid-gallery {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
    padding: 2.5rem 0;
    overflow: visible;
    flex-wrap: nowrap;
}

.polaroid-frame {
    flex: 0 0 140px;
    background: #fff;
    padding: 8px 8px 30px 8px;
    border-radius: 2px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s ease, z-index 0.1s;
    position: relative;
    z-index: 1;
    overflow: clip;
    /* Clip the image inside the frame if it overflows */
}

.polaroid-frame:hover {
    transform: scale(1.1) rotate(0deg) !important;
    z-index: 10;
}

.polaroid-frame img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
    border-radius: 1px;
}

.personal-caption {
    font-size: 14px;
    color: var(--text-dim);
    margin: 0;
    text-align: center;
}

@media (max-width: 600px) {
    .polaroid-gallery {
        gap: 4px;
        padding: 1.5rem 0;
    }

    .polaroid-frame {
        flex: 0 0 85px;
        padding: 5px 5px 20px 5px;
    }

    .polaroid-frame img {
        height: 100px;
    }

    .personal-caption {
        font-size: 13px;
    }
}

/* Contact Section */
.contact-section {
    margin-top: 2rem;
    margin-bottom: 5rem;
}

.contact-section .container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.contact-section-title {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.1em;
    color: #666;
    margin-bottom: 0;
}

.contact-intro {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 0;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    margin-top: 8px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-group label {
    font-size: 11px;
    color: var(--text-dim);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.8;
}

.form-group input,
.form-group textarea {
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 12px 16px;
    color: var(--text-color);
    font-family: inherit;
    font-size: 16px;
    outline: none;
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--text-dim);
    background: var(--bg-input);
}

.submit-button {
    background: var(--text-color);
    color: var(--bg-color);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 14px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 4px;
}

.submit-button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Social Links at Bottom */
.social-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 24px;
}

.social-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 0;
    text-decoration: none;
    color: var(--text-color);
    border-bottom: none;
    transition: opacity 0.2s ease;
}

.social-item:hover {
    opacity: 0.7;
}

.social-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.social-name {
    font-size: 16px;
    color: var(--text-color);
}

.social-right {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
}

.social-value {
    font-size: 16px;
}

/* Contact Section Refinements */
.contact-section-title {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.1em;
    margin-bottom: 0;
    text-transform: uppercase;
}

.contact-description {
    font-size: 16px;
    line-height: 1.6;
    margin-top: 16px;
}

.contact-description a {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 4px;
}

body.theme-light .contact-description a {
    color: #1a1a1a;
}

.contact-description a:hover {
    color: var(--text-color);
}

/* Social Item styling (Handle order) */
.social-links {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 32px;
}

.social-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    text-decoration: none;
    color: var(--text-color);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: opacity 0.2s ease;
}

body.theme-light .social-item {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.social-item:last-child {
    border-bottom: none;
}

.social-item:hover {
    opacity: 0.7;
}

.social-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.social-name {
    font-size: 16px;
    color: var(--text-color);
}

.social-right {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
}

.social-value {
    font-size: 16px;
}

/* Tech Stack Toggle */
.tech-stack-wrapper {
    margin-top: 24px;
    width: 100%;
}

.tech-stack-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    background: transparent;
    border: none;
    padding: 16px 0;
    color: var(--text-color);
    font-size: 16px;
    cursor: pointer;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

body.theme-light .tech-stack-toggle {
    border-top-color: rgba(0, 0, 0, 0.05);
}

.tech-stack-toggle .chevron {
    transition: transform 0.3s ease;
    opacity: 0.5;
}

.tech-stack-toggle.active .chevron {
    transform: rotate(180deg);
}

.tech-stack-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, margin-bottom 0.3s ease;
}

.tech-stack-content.active {
    max-height: 200px;
    margin-bottom: 16px;
}

.tech-stack-content p {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    padding-bottom: 16px;
}

/* Signature & Footer */
.signature-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 48px;
    margin-bottom: 32px;
}

.signature {
    width: 200px;
    height: auto;
    display: none;
}

body.theme-light .signature-light {
    display: block;
}

body.theme-dark .signature-dark {
    display: block;
}

/* Ensure system theme helper classes also trigger the correct signature */
body.theme-dark .signature-light {
    display: none;
}

body.theme-light .signature-dark {
    display: none;
}

.footer-minimal {
    text-align: center;
    padding-bottom: 48px;
}

.footer-minimal p {
    font-size: 14px;
    color: #444;
}

/* Submitted state for button */
.submit-button.submitted {
    background: rgba(255, 255, 255, 0.05) !important;
    color: #666 !important;
    cursor: default;
    border-color: transparent;
}

body.theme-light .submit-button.submitted {
    background: rgba(0, 0, 0, 0.03) !important;
}

/* Navigation Menu Modal Styling */
.nav-menu-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.nav-menu-modal.active {
    display: flex;
}

/* Menu backdrop styles consolidated at top */

.menu-container {
    position: relative;
    width: 100%;
    max-width: 520px;
    max-height: 85vh;
    background: var(--bg-color);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid var(--border-subtle);
    border-radius: 32px;
    padding: 32px;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    gap: 20px;
    animation: menuSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: var(--font-primary);
    overflow: hidden;
}

body.theme-light .menu-container {
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.1);
}

.menu-search-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 5px;
}

.menu-search-bar {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: 100px;
    padding: 12px 24px;
    color: var(--text-color);
    font-size: 15px;
    outline: none;
    font-family: inherit;
}

.menu-filter-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 5px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex-shrink: 0;
}

.menu-filter-row::-webkit-scrollbar {
    display: none;
}

.menu-pill {
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    color: var(--text-dim);
    padding: 10px 18px;
    border-radius: 100px;
    font-size: 14px;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
}

.menu-pill.active {
    background: var(--text-color);
    color: var(--bg-color);
    border-color: var(--text-color);
}

.menu-pill:hover:not(.active) {
    border-color: var(--text-dim);
}

@keyframes menuSlideIn {
    from {
        transform: translateY(30px) scale(0.95);
        opacity: 0;
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.menu-header {
    display: flex;
    justify-content: flex-end;
}

.menu-close {
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    color: var(--text-color);
    padding: 10px 22px;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

body.theme-light .menu-close {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.menu-close:hover {
    background: rgba(255, 255, 255, 0.15);
}

.menu-group-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    margin-bottom: 12px;
    padding-left: 16px;
    text-transform: none;
}

.menu-links {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-right: 4px;
}

.menu-links::-webkit-scrollbar {
    display: none;
}

.menu-item {
    font-size: 16px;
    font-weight: 400;
    color: var(--text-color);
    text-decoration: none;
    padding: 12px 16px;
    transition: all 0.2s;
    border-radius: 14px;
    font-family: inherit;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(4px);
}

body.theme-light .menu-item:hover {
    background: rgba(0, 0, 0, 0.04);
}

.menu-footer {
    margin-top: auto;
    display: flex;
    gap: 12px;
    padding-top: 20px;
    flex-shrink: 0;
}

.email-pill {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: 100px;
    padding: 14px 24px;
    color: var(--text-color);
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
}

.copy-email-btn {
    background: var(--text-color);
    color: var(--bg-color);
    border: none;
    border-radius: 100px;
    padding: 0 32px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

body.theme-light .copy-email-btn {
    background: #1a1a1a;
    color: #fff;
}

body.theme-dark .copy-email-btn {
    background: #fff;
    color: #000;
}

.copy-email-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.copy-email-btn:active {
    transform: translateY(0);
}

/* Ensure no horizontal scroll on all screen sizes */
@media (max-width: 768px) {
    .menu-container {
        max-width: 90%;
    }
}

/* Reading Page Styles */
.reading-page-section {
    padding-top: 2rem;
    padding-bottom: 5rem;
}

/* Wider container specifically for the reading 4-column layout */
.reading-page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.reading-main-title {
    font-size: 32px;
    font-weight: 500;
    margin-bottom: 1.5rem;
    letter-spacing: -0.5px;
    color: var(--text-color);
    line-height: 1.2;
    text-align: center;
    text-transform: capitalize;
}

.reading-description {
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 4rem;
    color: var(--text-dim) !important;
    max-width: 500px;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

@media (min-width: 1200px) {
    .books-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.book-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    position: relative;
    border: 1px solid var(--border-subtle);
    transition: all 0.3s ease;
    text-decoration: none;
}

.book-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.book-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.book-category {
    font-size: 10px;
    color: var(--text-dim);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.book-external-link {
    width: 28px;
    height: 28px;
    background: #fff;
    color: #000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.9;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

body.theme-dark .book-external-link {
    background: #f0f0f0;
}

.book-card:hover .book-external-link {
    transform: scale(1.1);
    opacity: 1;
}

.book-content {
    display: flex;
    flex-direction: row;
    gap: 1.25rem;
    align-items: center;
}

.book-cover-wrapper {
    flex-shrink: 0;
    perspective: 1000px;
}

.book-cover {
    width: 85px;
    height: 125px;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
}

.book-card:hover .book-cover {
    transform: rotateX(5deg) rotateY(-10deg) rotateZ(-2deg);
    box-shadow: 12px 16px 24px rgba(0, 0, 0, 0.2);
}

.book-info {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.book-status-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    width: fit-content;
    margin-bottom: 10px;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .05), inset 0 -2px 0 1px rgba(0, 0, 0, .08);
}

.status-reading {
    background: #fef3c7;
    color: #92400e;
}

.status-read {
    background: #dcfce7;
    color: #14532d;
}

.status-toread {
    background: #fee2e2;
    color: #b91c1c;
}

.book-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-color);
    line-height: 1.3;
    margin-bottom: 4px;
}

.book-author {
    font-size: 13px;
    color: var(--text-dim);
}

/* Theme specific card colors */
body.theme-light .book-card {
    background: #f5f5f5;
    border-color: rgba(0, 0, 0, 0.02);
}

body.theme-dark:not(.palette-ocean):not(.palette-forest):not(.palette-sunset):not(.palette-lavender) .book-card {
    background: #ffffff;
    border-color: #ffffff;
}

body.theme-dark:not(.palette-ocean):not(.palette-forest):not(.palette-sunset):not(.palette-lavender) .book-card .book-name {
    color: #1a1a1a !important;
}

body.theme-dark:not(.palette-ocean):not(.palette-forest):not(.palette-sunset):not(.palette-lavender) .book-card .book-author,
body.theme-dark:not(.palette-ocean):not(.palette-forest):not(.palette-sunset):not(.palette-lavender) .book-card .book-category {
    color: #666 !important;
}

body.theme-dark:not(.palette-ocean):not(.palette-forest):not(.palette-sunset):not(.palette-lavender) .book-card .book-external-link {
    /* The arrow icon inside */
    color: #000;
}

/* Palette variations */
body.palette-ocean .book-card {
    background: rgba(123, 163, 199, 0.12);
    border-color: rgba(123, 163, 199, 0.2);
}

body.palette-forest .book-card {
    background: rgba(136, 184, 136, 0.12);
    border-color: rgba(136, 184, 136, 0.2);
}

body.palette-sunset .book-card {
    background: rgba(212, 165, 116, 0.12);
    border-color: rgba(212, 165, 116, 0.2);
}

body.palette-lavender .book-card {
    background: rgba(184, 163, 212, 0.12);
    border-color: rgba(184, 163, 212, 0.2);
}

@media (max-width: 1100px) {
    .books-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 850px) {
    .books-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .reading-main-title {
        font-size: 32px;
    }

    .books-grid {
        grid-template-columns: 1fr;
    }

    .book-content {
        flex-direction: row;
        gap: 1.25rem;
    }

    .book-cover {
        width: 80px;
        height: 115px;
    }
}

/* Tools Page Styles */
.tools-page-section {
    padding-top: 3rem;
    padding-bottom: 5rem;
    text-align: center;
}

.tools-main-title {
    font-size: 32px;
    font-weight: 500;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.tools-description {
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 4rem;
    color: var(--text-dim) !important;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.tools-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Tools Directory Grid Styles */
.tools-grid-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
    margin-top: 2rem;
}

.tool-list-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    text-decoration: none;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-subtle);
    transition: background 0.2s ease;
}

.tool-list-card:hover {
    background: var(--bg-input);
}

.tool-list-card.empty {
    opacity: 0.5;
    cursor: default;
    border-bottom: none;
}

.tool-list-card.empty:hover {
    background: transparent;
}

.tool-card-content {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    width: 100%;
}

.tool-card-icon {
    width: 40px;
    height: 40px;
    background: var(--bg-input);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    flex-shrink: 0;
}

.tool-card-info {
    flex: 1;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tool-card-name {
    font-size: 16px;
    font-weight: 500;
    margin: 0;
}

.tool-card-desc {
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.4;
    margin: 0;
}

@media (max-width: 700px) {
    .tools-grid-list {
        grid-template-columns: 1fr;
    }
}

.tool-block {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2.5rem;
    border: 1px solid var(--border-subtle);
    transition: all 0.3s ease;
    text-align: left;
}

body.theme-light .tool-block {
    background: #fdfdfd;
    border-color: rgba(0, 0, 0, 0.05);
}

body.theme-dark:not(.palette-ocean):not(.palette-forest):not(.palette-sunset):not(.palette-lavender) .tool-block {
    background: #111;
    border-color: #222;
}

.tool-header {
    margin-bottom: 1.5rem;
}

.tool-name {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.tool-intro {
    font-size: 14px;
    color: var(--text-dim);
}

.tool-interface {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tool-input-group {
    display: flex;
    gap: 0.75rem;
}

.tool-input {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--text-color);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

.tool-input:focus {
    border-color: var(--text-dim);
}

.tool-button {
    background: var(--text-color);
    color: var(--bg-color);
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tool-button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.tool-result {
    margin-top: 1.5rem;
    padding: 1.5rem;
    border-radius: 12px;
    background: var(--bg-input);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1rem;
    border: 1px dashed var(--border-subtle);
}

.tool-result.active {
    display: flex;
}

.extracted-logo {
    max-width: 128px;
    max-height: 128px;
    object-fit: contain;
    border-radius: 12px;
}

.tool-actions {
    display: flex;
    gap: 0.5rem;
}

.tool-mini-button {
    background: var(--border-subtle);
    color: var(--text-color);
    border: none;
    border-radius: 6px;
    padding: 0.4rem 0.8rem;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.tool-mini-button:hover {
    background: var(--border-color);
}

@media (max-width: 600px) {
    .tool-block {
        padding: 1.5rem;
    }

    .tool-input-group {
        flex-direction: column;
    }

    .tool-button {
        width: 100%;
    }
}