/* Local Font Definitions */

/* Libre Baskerville - Body Font */
@font-face {
  font-family: 'Libre Baskerville';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../assets/fonts/libre-baskerville-latin-400-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Libre Baskerville';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('../assets/fonts/libre-baskerville-latin-400-italic.woff2') format('woff2');
}

@font-face {
  font-family: 'Libre Baskerville';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../assets/fonts/libre-baskerville-latin-700-normal.woff2') format('woff2');
}

/* Space Grotesk - Heading Font */
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../assets/fonts/space-grotesk-latin-400-500-700-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../assets/fonts/space-grotesk-latin-400-500-700-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../assets/fonts/space-grotesk-latin-400-500-700-normal.woff2') format('woff2');
}
/* End Local Font Definitions */


/* css/style.css */
:root {
    /* Color Scheme - Muted Analog Film */
    --paper: #faf6f2;
    --ink: #2a2621;
    --accent: #c44d3c;     /* Aged terracotta (Light Mode) */
    --accent-secondary: #6b9080; /* Moss green */
    --border: rgba(42, 38, 33, 0.15);
    --card-bg: #ffffff;
    --input-bg: #faf6f2;
    --input-text: #2a2621;
    --ink-secondary: rgba(42, 38, 33, 0.7);
    --grid-item-bg: rgba(0,0,0,0.02); /* BG for contained images */

    /* Typography */
    --font-heading: 'Space Grotesk', system-ui, sans-serif;
    --font-body: 'Libre Baskerville', Georgia, serif;

    /* Other */
    --header-height: 80px;
}

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

html {
    scroll-behavior: smooth;
}

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

/* Ensure main content takes available space and avoid header overlap */
main {
    flex-grow: 1;
    padding-top: var(--header-height); /* THIS is the main rule for header space */
}

/* Texture Overlay */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
      0deg,
      rgba(0,0,0,0.02) 0px,
      rgba(0,0,0,0.02) 1px,
      transparent 1px,
      transparent 4px
    );
    pointer-events: none;
    z-index: -1;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 500;
    letter-spacing: -0.03em;
    margin-bottom: 1rem;
}

/* Consistent Page Title Spacing - This will be replaced by a more specific rule for .legal-page-content */
/* main > .container > h1:first-of-type {
    margin-top: 2rem;
    margin-bottom: 2rem;
} */
/* Adjust hero specifically if needed */
.hero h1 {
    margin-top: 0; /* Reset hero title margin if container handles it */
}

/* REMOVED Heading adjustments within main content - will be replaced by specific .legal-page-content rules */
/* main > .container h2 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}
main > .container h3 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}
main > .container h4,
main > .container h5,
main > .container h6 {
    margin-top: 1.5rem;
} */

/* === Legal Page Content Styles === */
.container.legal-page-content h1:first-of-type {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.container.legal-page-content h2 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}
.container.legal-page-content h3 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}
.container.legal-page-content h4 {
    font-size: clamp(1.25rem, 4vw, 1.75rem);
    line-height: 1.4;
    margin-bottom: 0.75rem;
    font-family: var(--font-heading);
    font-weight: 500;
    letter-spacing: -0.03em;
    margin-top: 1.5rem;
}
.container.legal-page-content h5 {
    font-size: clamp(1.1rem, 3.5vw, 1.5rem);
    line-height: 1.4;
    margin-bottom: 0.75rem;
    font-family: var(--font-heading);
    font-weight: 500;
    letter-spacing: -0.03em;
    margin-top: 1.5rem;
}
.container.legal-page-content h6 {
    font-size: clamp(1rem, 3vw, 1.25rem);
    line-height: 1.5;
    margin-bottom: 0.5rem;
    font-family: var(--font-heading);
    font-weight: 500;
    letter-spacing: -0.03em;
    margin-top: 1.5rem;
}

.container.legal-page-content p {
    line-height: 1.7;
    margin-bottom: 1.25rem;
}
.container.legal-page-content p:last-child { /* Ensure specificity if global p:last-child exists and is stronger */
    margin-bottom: 0; /* Keep consistent with typical p:last-child behavior */
}

.container.legal-page-content ul,
.container.legal-page-content ol {
    margin-bottom: 1.25rem;
    padding-left: 1.8em;
}
.container.legal-page-content li {
    margin-bottom: 0.6rem;
}
.container.legal-page-content ul ul,
.container.legal-page-content ol ol,
.container.legal-page-content ul ol,
.container.legal-page-content ol ul {
   margin-top: 0.5rem;
   margin-bottom: 0.5rem;
}

.container.legal-page-content a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.15em;
}
.container.legal-page-content a:hover {
    color: var(--accent);
    opacity: 0.8;
    text-decoration: underline;
}

h1 { font-size: clamp(2.5rem, 7vw, 3.5rem); line-height: 1.1; } /* Slightly reduced max h1 */
h2 { font-size: clamp(1.8rem, 6vw, 2.5rem); line-height: 1.2; }
h3 { font-size: clamp(1.5rem, 5vw, 2rem); line-height: 1.3; }
h4 { font-size: clamp(1.25rem, 4vw, 1.75rem); line-height: 1.4; margin-bottom: 0.75rem; }
h5 { font-size: clamp(1.1rem, 3.5vw, 1.5rem); line-height: 1.4; margin-bottom: 0.75rem; }
h6 { font-size: clamp(1rem, 3vw, 1.25rem); line-height: 1.5; margin-bottom: 0.5rem; }
/* REMOVED Ensure h4, h5, h6 also use the heading font - this is now part of specific .legal-page-content rules or covered by global h1-h6 */
/* h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 500;
    letter-spacing: -0.03em;
} */

/* REMOVED Paragraph and list adjustments within main content - will be replaced by specific .legal-page-content rules */
/* main > .container p {
    line-height: 1.7;
    margin-bottom: 1.25rem;
    max-width: 65ch;
}
main > .container p:last-child {
    margin-bottom: 0;
}

main > .container ul,
main > .container ol {
    margin-bottom: 1.25rem;
    padding-left: 1.8em;
}
main > .container li {
    margin-bottom: 0.6rem;
}
main > .container ul ul,
main > .container ol ol,
main > .container ul ol,
main > .container ol ul {
    margin-bottom: 0.6rem;
} */

/* REMOVED Link adjustments within main content - will be replaced by specific .legal-page-content rules */
/* main > .container a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.15em;
}
main > .container a:hover {
    color: var(--accent);
    opacity: 0.8;
    text-decoration: underline;
} */

p {
    max-width: 65ch;
    margin-bottom: 1.5rem;
}
p:last-child {
    margin-bottom: 0;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: opacity 0.3s;
}
a:hover {
    opacity: 0.7;
    text-decoration: underline;
}

/* Header */
.main-header {
    padding: 0; /* Remove padding here, handle in nav */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(250, 246, 242, 0.9);
    backdrop-filter: blur(5px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    height: var(--header-height);
    display: flex;
    align-items: center;
}

.main-header nav {
    display: flex;
    justify-content: space-between; /* This will push logo and nav links apart */
    align-items: center;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 1.5rem; /* Consistent horizontal padding */
}

.logo-link {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--ink);
    text-decoration: none;
    white-space: nowrap; /* Prevent logo wrapping */
    margin-right: 1.5rem; /* Ensure some space before nav links */
}
.logo-link:hover {
    text-decoration: none;
    opacity: 0.8;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    margin-left: auto; /* Push nav links group to the right */
}

.nav-links a {
    font-family: var(--font-heading);
    text-decoration: none;
    color: var(--ink);
    font-weight: 500;
    white-space: nowrap; /* Prevent links wrapping */
}
.nav-links a:hover {
    color: var(--accent);
    opacity: 1;
    text-decoration: none;
}
.nav-links a.active {
    font-weight: 700;
    color: var(--accent);
}

/* Theme Switch */
.theme-switch {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 57px;
    height: 28px;
    border-radius: 14px;
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    padding: 0;
    flex-shrink: 0; /* Prevent switch from shrinking */
}

.switch-track {
    width: 100%;
    height: 100%;
    background-color: #cccccc;
    border-radius: 14px;
    position: relative;
    transition: background-color 0.3s ease;
}

.switch-thumb {
    position: absolute;
    /* Keep your existing top: 4px; */
    top: 4px;
    /* Set the default light mode left position */
    left: 4px;
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    /* CHANGE: Add transition for left property */
    transition: left 0.3s ease, background-color 0.3s ease;
    /* REMOVE transform transition if you added it */
}

body.dark-mode .switch-thumb {
    /* Calculate left: track_width - thumb_width - left_padding */
    left: calc(57px - 20px - 4px); /* = 33px */
    /* Optional: change thumb color in dark mode if needed */
    /* background-color: var(--some-dark-thumb-color); */
}

/* Container for sections */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem 4rem; /* REMOVED top padding */
}

/* Hero Section */
.hero {
    padding: 4rem 1rem 4rem;
    text-align: center;
}

.hero h1 {
    margin-bottom: 1.5rem;
}

.hero p {
    max-width: 60ch;
    margin-left: auto;
    margin-right: auto;
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

/* Accent Color Styling */
.accent-text {
    color: var(--accent);
    position: relative;
    display: inline-block;
}

.accent-secondary-underline {
    color: var(--accent-secondary);
    position: relative;
    display: inline-block;
}

/* Shared underline styles */
.accent-underline::after,
.accent-secondary-underline::after {
    content: '';
    position: absolute;
    bottom: -0.15em;
    left: 0;
    width: 100%;
    height: 2px;
    background: currentColor;
    opacity: 0.4;
}

/* Section Titles */
.section-title {
    font-family: var(--font-heading);
    font-size: clamp(1.6rem, 5vw, 2.2rem);
    margin-top: 3rem;
    margin-bottom: 2rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
}
.section-title.center {
    text-align: center;
}

/* Generic Card Style */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 1.5rem;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    color: var(--ink);
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 25px rgba(0,0,0,0.08);
}

/* Project Grid (Preview on Home) */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.project-card h3 {
    font-size: 1.3rem;
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.project-card p {
    font-size: 0.95rem;
    color: var(--ink-secondary);
    margin-bottom: 1rem;
    flex-grow: 1;
}

.project-card .button {
    margin-top: auto;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    align-self: flex-start;
}

/* General content list styling */
.container ul,
.container ol {
    padding-left: 1.5em; /* Standard indentation */
    margin-bottom: 1.5rem; /* Consistent with paragraph bottom margin */
}

.container li {
    margin-bottom: 0.5rem; /* Space between list items */
}

.container ul ul,
.container ol ol,
.container ul ol,
.container ol ul {
    margin-bottom: 0.5rem; /* Less margin for nested lists */
}

/* === PORTFOLIO PAGE STYLES === */

/* Main Showcase Item */
.portfolio-item {
    margin-bottom: 3rem;
}

.portfolio-item img.portfolio-showcase-image {
    display: block;
    max-width: 100%;
    width: auto;
    max-height: 65vh;
    margin: 0 auto 1.5rem auto;
    border: 1px solid var(--border);
    object-fit: contain;
    background-color: var(--grid-item-bg); /* Use variable */
}

.portfolio-item .description {
    max-width: 70ch;
    margin: 0 auto;
    text-align: left;
}
.portfolio-item .description.center {
    text-align: center;
}

.portfolio-item .description p {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

/* Image Grid - USE CONTAIN */
.portfolio-grid {
    display: grid;
    gap: 1rem;
    margin-bottom: 3rem;
    grid-template-columns: repeat(2, 1fr);
}

.portfolio-grid .grid-item {
    position: relative;
    overflow: hidden;
    background-color: var(--grid-item-bg); /* BG for empty space */
    border: 1px solid var(--border); /* Border on the container */
    /* Use custom property with a fallback default (e.g., 4/3) */
    aspect-ratio: var(--grid-item-aspect-ratio, 4 / 3);
}

.portfolio-grid a.grid-item-link {
    display: block;
    width: 100%;
    height: 100%;
    line-height: 0;
    transition: opacity 0.2s ease-in-out;
}

.portfolio-grid a.grid-item-link:hover {
    opacity: 0.85;
}

.portfolio-grid img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain; /* SHOW FULL IMAGE */
    border: none;
    /* Alt text styling */
    color: var(--ink-secondary);
    font-size: 0.8rem;
    text-align: center;
    line-height: 1.2;
}

/* Responsive adjustments for portfolio grid */
@media (min-width: 576px) {
    .portfolio-grid { grid-template-columns: repeat(1, 1fr); }
}
@media (min-width: 768px) {
    .portfolio-grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
}
@media (min-width: 1024px) {
    .portfolio-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Logo Grid */
.logo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); /* Slightly larger min */
    gap: 2.5rem;
    align-items: center;
    margin-bottom: 3rem;
}

.logo-item {
    text-align: center;
}

.logo-item img {
    max-width: 100%;
    max-height: 340px; /* INCREASED max height */
    height: auto;
    width: auto;
    display: inline-block;
    border: none;
    margin-bottom: 0.5rem;
}

.logo-item p {
    font-size: 0.8rem;
    color: var(--ink-secondary);
    margin-bottom: 0;
}


/* === ABOUT PAGE STYLES === */

.about-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: flex-start;
}

.portrait-container {
    position: relative;
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 5px 25px rgba(0,0,0,0.1);
}

.portrait-container img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 600px;
    object-fit: cover;
}

.bio-text {
    max-width: 65ch;
}
.bio-text ul {
    list-style-position: outside;
    padding-left: 1.5em;
    margin-bottom: 1.5rem;
}
.bio-text li {
    margin-bottom: 0.5rem;
}

.skill-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 2rem 0;
}

.skill-tag {
    padding: 0.5rem 1.2rem;
    background: rgba(42, 38, 33, 0.05);
    border: 1px solid transparent;
    border-radius: 2rem;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    transition: background-color 0.3s, border-color 0.3s;
}
.skill-tag:hover {
    background: rgba(42, 38, 33, 0.08);
    border-color: var(--border);
}

.skill-tag.accent {
    background: rgba(196, 77, 60, 0.1);
    color: var(--accent);
}
.skill-tag.accent:hover {
     background: rgba(196, 77, 60, 0.15);
     border-color: rgba(196, 77, 60, 0.3);
}

.skill-tag.accent-secondary {
    background: rgba(107, 144, 128, 0.1);
    color: var(--accent-secondary);
}
.skill-tag.accent-secondary:hover {
    background: rgba(107, 144, 128, 0.15);
    border-color: rgba(107, 144, 128, 0.3);
}

.philosophy {
    font-style: italic;
    margin-top: 2rem;
    padding: 1rem 1.5rem;
    border-left: 3px solid var(--accent);
    background-color: rgba(196, 77, 60, 0.03);
}

/* About page grid layout */
@media (min-width: 768px) {
    .about-grid {
        grid-template-columns: 2fr 3fr;
        gap: 3rem;
        align-items: center;
    }
    .about-grid .portrait-container { order: 1; margin: 0; }
    .about-grid .bio-content { order: 2; }
}


/* === CONTACT PAGE STYLES === */

.contact-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
}

@media (min-width: 992px) {
    .contact-grid { grid-template-columns: 1fr 1fr; }
}


.contact-card {
    padding: 2rem;
}

.contact-card h2 {
    font-family: var(--font-heading);
    margin-top: 0;
    margin-bottom: 1.5rem;
}

.contact-info p {
    margin-bottom: 1rem;
}
.contact-info strong {
    font-family: var(--font-heading);
    color: var(--ink-secondary);
}


.email-link {
    color: var(--accent);
    font-weight: 700;
    word-break: break-all;
}
.email-link:hover {
    text-decoration: underline;
}

/* Form Styles */
form label {
    display: block;
    margin-bottom: 0.5rem;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 500;
}

input[type="text"],
input[type="email"],
textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    margin-bottom: 1.25rem;
    border: 1px solid var(--border);
    font-family: var(--font-body);
    font-size: 1rem;
    background: var(--input-bg);
    color: var(--input-text);
    transition: border-color 0.3s, box-shadow 0.3s;
    border-radius: 4px;
}

textarea {
    resize: vertical;
    min-height: 150px;
    max-height: 400px;
}

input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(196, 77, 60, 0.15);
}

button[type="submit"] {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.85rem 2.5rem;
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    border-radius: 4px;
}

button[type="submit"]:hover {
    background-color: #a83f31;
    transform: translateY(-2px);
}

/* Form submission status message */
#form-status {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 4px;
    display: none;
    text-align: center;
    font-size: 0.95rem;
}
#form-status.success {
    background-color: rgba(107, 144, 128, 0.1);
    color: var(--accent-secondary);
    border: 1px solid rgba(107, 144, 128, 0.3);
    display: block;
}
#form-status.error {
    background-color: rgba(196, 77, 60, 0.1);
    color: var(--accent);
    border: 1px solid rgba(196, 77, 60, 0.3);
    display: block;
}


/* Footer */
footer {
    padding: 2.5rem 1rem;
    text-align: center;
    border-top: 1px solid var(--border);
    margin-top: 4rem;
    color: var(--ink-secondary);
    font-size: 0.9rem;
}
footer p {
    margin-bottom: 0.5rem;
    max-width: none;
}

/* Utility Classes */
.button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--accent);
    color: white;
    text-decoration: none;
    font-family: var(--font-heading);
    margin-top: 1rem;
    border: none;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.3s, transform 0.2s;
}
.button:hover {
    background-color: #a83f31;
    text-decoration: none;
    transform: translateY(-2px);
    opacity: 1;
}
.button.secondary {
    background: var(--accent-secondary);
}
.button.secondary:hover {
     background-color: #577a6b;
     opacity: 1;
}


/* Dark Mode */
body.dark-mode {
    --paper: #1a1918;
    --ink: #e8e6e3;
    --accent: #b56d5a; /* Darker terracotta for contrast */
    --accent-secondary: #88a899;
    --border: rgba(232, 230, 227, 0.15);
    --card-bg: #252422;
    --input-bg: #333230;
    --input-text: #e8e6e3;
    --ink-secondary: rgba(232, 230, 227, 0.7);
    --grid-item-bg: rgba(255,255,255,0.03); /* Dark mode grid BG */
}

body.dark-mode::after {
    background: repeating-linear-gradient(
        0deg,
        rgba(255,255,255,0.015) 0px,
        rgba(255,255,255,0.015) 1px,
        transparent 1px,
        transparent 5px
    );
}

body.dark-mode .main-header {
    background: rgba(26, 25, 24, 0.95);
}

body.dark-mode .card {
    box-shadow: none;
}
body.dark-mode .card:hover {
     border-color: rgba(232, 230, 227, 0.3);
     transform: translateY(-5px);
     box-shadow: 0 6px 25px rgba(0,0,0,0.15);
}

body.dark-mode input[type="text"]:focus,
body.dark-mode input[type="email"]:focus,
body.dark-mode textarea:focus {
    box-shadow: 0 0 0 3px rgba(181, 109, 90, 0.25);
}

body.dark-mode button[type="submit"],
body.dark-mode .button {
    color: var(--ink);
    background-color: var(--accent);
}
body.dark-mode button[type="submit"]:hover,
body.dark-mode .button:hover {
    background-color: #c88776;
}
body.dark-mode .button.secondary {
     background-color: var(--accent-secondary);
     color: #1a1918;
}
body.dark-mode .button.secondary:hover {
    background-color: #a0c0b1;
}


body.dark-mode .skill-tag {
     background: rgba(232, 230, 227, 0.08);
}
body.dark-mode .skill-tag:hover {
    background: rgba(232, 230, 227, 0.12);
    border-color: var(--border);
}
body.dark-mode .skill-tag.accent {
    background: rgba(181, 109, 90, 0.15);
    color: var(--accent);
}
body.dark-mode .skill-tag.accent:hover {
     background: rgba(181, 109, 90, 0.2);
     border-color: rgba(181, 109, 90, 0.4);
}
body.dark-mode .skill-tag.accent-secondary {
    background: rgba(136, 168, 153, 0.15);
    color: var(--accent-secondary);
}
body.dark-mode .skill-tag.accent-secondary:hover {
    background: rgba(136, 168, 153, 0.2);
    border-color: rgba(136, 168, 153, 0.4);
}

body.dark-mode .logo-item img {
    filter: grayscale(0%);
    opacity: 0.9;
}
body.dark-mode .logo-item:hover img {
    opacity: 1;
}

body.dark-mode .switch-track {
    background-color: #666666;
}

/* Dark Mode Form Status */
body.dark-mode #form-status.success {
    background-color: rgba(136, 168, 153, 0.15);
    border: 1px solid rgba(136, 168, 153, 0.4);
    color: var(--accent-secondary);
}
body.dark-mode #form-status.error {
    background-color: rgba(181, 109, 90, 0.15);
    border: 1px solid rgba(181, 109, 90, 0.4);
    color: var(--accent);
}

/* Responsive Adjustments */
@media (max-width: 767px) {
    .main-header nav { padding: 0 1rem; } /* Less padding on smaller screens */
    .logo-link { margin-right: 1rem; }
    .nav-links { gap: 1rem; }

    .hero h1 .accent-text,
    .hero h1 .accent-secondary-underline {
        display: inline-block;
        margin-bottom: 0.2em;
        vertical-align: baseline;
    }

    .hero { padding-top: 3rem; padding-bottom: 3rem; }
    .about-grid { gap: 1.5rem; }
    .about-grid .portrait-container { margin-bottom: 1.5rem; max-width: 80%;}

    .contact-grid { gap: 2rem; }
    footer { margin-top: 3rem; }
}

@media (max-width: 480px) {
    main > .container > h1:first-of-type { margin-top: 1rem; } /* Less space above title */
    h1 { font-size: 2rem; }
    h2 { font-size: 1.6rem; }

    .hero h1 .accent-text,
    .hero h1 .accent-secondary-underline {
        display: inline-block;
        margin-bottom: 0.2em;
        vertical-align: baseline;
    }

    .container { padding: 1.5rem 1rem 3rem; }
    .project-grid { grid-template-columns: 1fr; gap: 1.5rem; }
    .portfolio-grid { grid-template-columns: repeat(1, 1fr); gap: 1rem; }
    .logo-grid { grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 1.5rem; }

    .nav-links { gap: 0.5rem; } /* Reduced gap further */
    .nav-links a { font-size: 0.9rem; }
    .theme-switch {
        width: 50px; /* Adjusted width */
        height: 26px; /* Adjusted height */
    }

    .switch-thumb {
        width: 18px; /* Adjusted width */
        height: 18px; /* Adjusted height */
        /* Keep top: 4px; */
        top: 4px;
        /* Ensure light mode 'left' is correct for smaller size if needed,
           but often the base 4px is fine. Remove 'left: 4px' here if
           the base rule's 4px is sufficient for light mode */
        /* left: 4px; */ /* Remove if base 4px is okay */
    }

    /* ADD: Define the dark mode position specifically for the smaller size */
    body.dark-mode .switch-thumb {
         /* Calculate left: smaller_track_width - smaller_thumb_width - smaller_left_padding */
        left: calc(50px - 18px - 4px); /* = 28px */
    }
    /* Dynamic JS handles dark mode translate */

    button[type="submit"], .button {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
        width: 100%;
    }
}
/* Specific rule for hero h1 font weight */
.hero h1 {
    font-weight: 500;
}
