:root {
  --bg: #fff;
  --text: #1d1d1f;
  --accent: #007aff;
}
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* Dark mode */
.dark {
  --bg: #1c1c1e;
  --text: #f2f2f7;
}

/* Layout */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header & Nav */
.site-header {
  border-bottom: 1px solid #e5e5e5;
}
.dark .site-header {
  border-color: #2c2c2e;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.logo {
  font-size: 1.25rem;
  font-weight: 600;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
nav {
  display: flex;
  align-items: center;
}
.nav-link, .nav-button {
  margin-left: 16px;
  font-weight: 500;
  text-decoration: none;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-link:hover, .nav-button:hover {
  color: var(--accent);
}

/* Posts */
.posts .post {
  position: relative;
  margin-bottom: 60px;
}
.post-title {
  margin: 0;
  font-size: 1.75rem;
}

/* ===================== */
/* Index & Archive Post Card Polish */
/* ===================== */

/* Apply to both index posts and archive pinned posts */
.posts .post,
.pinned-posts .pinned-entry {
    background: rgba(0, 0, 0, 0.015);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
    margin-bottom: 25px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

/* Dark mode matching */
.dark .posts .post,
.dark .pinned-posts .pinned-entry {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Hover lift effect */
.posts .post:hover,
.pinned-posts .pinned-entry:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.post-title a {
  color: inherit;
  text-decoration: none;
}
.post-title a:hover {
  color: var(--accent);
}
/* excerpt always visible */
.post-excerpt {
  margin-top: 0.5em;
}
/* hidden full content */
.post-full {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}
.post-full.expanded {
  max-height: 400px; /* adjust as needed */
  margin-top: 1em;
}
/* pill-style read-more button */
button.read-more {
  display: inline-block;
  padding: 0.5em 1.25em;
  margin-top: 0.5em;
  background: var(--accent);
  color: var(--bg);
  border-radius: 999px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
button.read-more:hover {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}

/* hidden-by-default password form */
.pw-form {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
  margin-top: 0; /* no gap until expanded */
}
/* when expanded, give it room */
.pw-form.expanded {
  max-height: 500px; /* enough to show the entire form */
  margin-top: 1em;
}
/* reuse your read-more bubble style for the submit button */
#password-form .read-more {
  margin-top: 1em;
}

/* Video embed */
.post-video {
  margin: 1.5em 0;
}
.post-video video {
  width: 100%;
  max-height: 480px;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.post-video.embed {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.post-video.embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Archive pinned styling from your ZIP */
.pinned-posts .pinned-entry {
  display: flex;
  flex-direction: column;
}
.pinned-posts .pinned-entry .post-title {
  margin-bottom: 0.5em;
}
.pinned-posts .pinned-entry button.read-more {
  align-self: flex-start;
  margin-top: 0;
}

/* Modal (add-post) */
.modal {
  position: fixed;
  top: 0; left: 0;
  width:100%; height:100%;
  background: rgba(0,0,0,0.4);
  display:flex; align-items:center; justify-content:center;
}
.modal-content {
    background: var(--bg);           /* White in light mode, black in dark mode */
    color: var(--text);              /* Black text in light mode, white in dark mode */
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    padding: 24px;
    width: 90%;
    max-width: 500px;
}

.dark .modal-content {
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-content label {
  display:block; margin:10px 0; font-weight:500;
}
.modal-content input,
.modal-content textarea {
  width:100%; padding:8px; margin-top:4px;
  border:1px solid #ccc; border-radius:4px;
  background:transparent;
  color: inherit;
  box-sizing: border-box;
}
.modal-actions {
  display:flex; justify-content:flex-end; gap:10px; margin-top:15px;
}
.modal-actions button {
    padding: 0.5em 1.25em;
    border-radius: 999px;
    background: var(--accent);
    color: var(--bg);
    border: 1px solid transparent;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.modal-actions button:hover {
    background: transparent;
    color: var(--accent);
    border-color: var(--accent);
}

/* Context Menu */
.context-menu {
  position: absolute;
  background: var(--bg);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  border-radius: 6px;
  z-index:1000;
}
.context-menu ul {
  list-style:none; margin:0; padding:8px 0;
}
.context-menu li {
  padding:8px 16px; cursor:pointer; white-space:nowrap;
}
.context-menu li:hover {
  background: #f0f0f5;
}

/* Profile page */
.profile label {
  display:block; margin:10px 0; font-weight:500;
}
.profile input {
  width:100%; padding:8px; margin-top:4px;
  border:1px solid #ccc; border-radius:4px;
}
.password-message {
  margin-top:10px; font-style:italic;
}

/* Footer */
.site-footer {
  border-top: 1px solid #e5e5e5;
  text-align: center;
  padding: 40px 0;
  margin-top: 30px;
  font-size: 0.9rem;
}
.dark .site-footer {
  border-color: #2c2c2e;
}
/* ————— Delete‐button styling ————— */
button.delete-post {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text);
  margin-left: 0.5em;
}
button.delete-post:hover {
  color: #e00;
}

/* ————— Theme‐toggle SVG sizing ————— */
#theme-toggle svg {
  width: 1.2rem;
  height: 1.2rem;
  stroke: var(--text);
}
#theme-toggle:hover svg {
  stroke: var(--accent);
}

/* give a little space between toggle and Home link */
#theme-toggle {
  margin-right: 12px;
  font-size: 1.2rem;
}

#theme-toggle:focus {
  outline: none;                    /* optional: remove focus ring */
}

/* password form collapse */
.pw-form {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
  margin-top: 0;
}
.pw-form.expanded {
  max-height: 500px;
  margin-top: 1em;
}

/* reuse your read-more bubble for Confirm button */
button.read-more {
  padding: 0.5em 1.25em;
  border-radius: 999px;
  background: var(--accent);
  color: var(--bg);
  border: 1px solid transparent;
}
button.read-more:hover {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}

/* images inserted under video */
.post-image {
  margin: 1.5em 0;
}
.post-image img {
  width: 100%;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
/* ===================== */
/* Skills Section (Polished Minimalist) */
/* ===================== */

#skills {
    background: var(--bg);
    color: var(--text);
    padding: 60px 20px;
}

.skills-container {
    max-width: 900px;
    margin: 0 auto;
}

#skills h2 {
    font-size: 2.25rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 50px;
}

.skill-category {
    background: rgba(0, 0, 0, 0.015);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.dark .skill-category {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.skill-category:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-3px);
}

.skill-category h3 {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 15px;
}

.skill-category ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.skill-category ul li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 0.95rem;
}

.dark .skill-category ul li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.skill-category ul li:last-child {
    border-bottom: none;
}

/* ===================== */
/* Skills Section - Mobile Tweak */
/* ===================== */

@media (max-width: 600px) {
    #skills {
        padding: 24px;
    }

    #skills h2 {
        font-size: 1.75rem;
        margin-bottom: 35px;
    }

    .skills-container {
        max-width: 100%;
    }

    .skill-category {
        padding: 15px;
        margin-bottom: 20px;
    }

    .skill-category h3 {
        font-size: 1.15rem;
        margin-bottom: 12px;
    }

    .skill-category ul li {
        font-size: 0.9rem;
        padding: 6px 0;
    }
}

/* ===================== */
/* Projects / Certifications Section */
/* ===================== */

#projects, #certifications {
    background: var(--bg);
    color: var(--text);
    padding: 60px 20px;
}

.projects-container, .certifications-container {
    max-width: 900px;
    margin: 0 auto;
}

#projects h2, #certifications h2 {
    font-size: 2.25rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 50px;
}

.project-item, .certification-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(0, 0, 0, 0.015);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.dark .project-item, .dark .certification-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.project-item:hover, .certification-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.project-title, .certification-title {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 4px;
}

.project-description, .certification-description {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text);
}

/* Responsive tweaks for mobile */
@media (max-width: 600px) {
    #projects, #certifications {
        padding: 24px;
    }

    #projects h2, #certifications h2 {
        font-size: 1.75rem;
        margin-bottom: 35px;
    }

    .project-item, .certification-item {
        padding: 15px;
        margin-bottom: 20px;
    }

    .project-title, .certification-title {
        font-size: 1.15rem;
    }

    .project-description, .certification-description {
        font-size: 0.9rem;
    }
}

/* ===================== */
/* About & Contact Sections Clean Layout */
/* ===================== */

.about, #contact {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px 20px;
    background: var(--bg);
    color: var(--text);
    margin-top: 20px;
    margin-bottom: 20px;
}

.about h1, #contact h2 {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 30px;
    text-align: center;
}

.about p {
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 25px;
}

#contact ul {
    list-style: none;
    padding-left: 0;
    margin: 0 auto;
    max-width: 400px;
}

#contact ul li {
    font-size: 1rem;
    line-height: 1.8;
    text-align: center;
    margin-bottom: 15px;
}

#contact ul li a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

#contact ul li a {
    position: relative;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

#contact ul li a::after {
    content: "";
    display: block;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s ease;
    position: absolute;
    bottom: -3px;
    left: 0;
}

#contact ul li a:hover::after {
    width: 100%;
}


/* Responsive tweak for smaller screens */
@media (max-width: 600px) {
    .about, #contact {
        padding: 24px;
    }

    .about h1, #contact h2 {
        font-size: 1.75rem;
        margin-bottom: 25px;
    }

    .about p, #contact ul li {
        font-size: 0.95rem;
        line-height: 1.7;
    }
}



/* ===================== */
/* Final Apple Micro-Polish System */
/* ===================== */

/* Global text smoothing & letter spacing */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: 0.2px;
}

/* Headings consistency */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: 0.3px;
    color: var(--text);
}

/* Buttons + links micro hover effect */
a, button {
    transition: color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

/* Global border radius for all cards & modals */
.skill-category,
.project-item,
.certification-item,
.modal-content,
.context-menu,
.site-footer,
button.read-more {
    border-radius: 12px !important;
}

/* Subtle shadow system */
.skill-category,
.project-item,
.certification-item,
.modal-content {
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.skill-category:hover,
.project-item:hover,
.certification-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

/* Buttons subtle shadow lift */
button:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* Remove shadow from theme toggle button on hover */
#theme-toggle:hover {
    box-shadow: none !important;
}

/* Unified spacing for sections */
section {
    margin-bottom: 60px;
}

/* Footer clean up */
.site-footer p {
    letter-spacing: 0.5px;
    font-weight: 400;
}

/* ===================== */
/* Apple Nav Bar + Theme Toggle Polish */
/* ===================== */

/* Nav bar height + spacing */
.site-header {
    background: var(--bg);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    transition: box-shadow 0.2s ease;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Logo styling */
.logo {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Nav link clean spacing */
nav a.nav-link,
nav button.nav-button {
    margin-left: 18px;
    font-size: 0.95rem;
    letter-spacing: 0.4px;
}

/* Clean transparent theme toggle emoji button */
#theme-toggle {
    background-color: transparent;
    border: none;
    padding: 0;
    margin-right: 12px;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    transition: transform 0.2s ease;
    font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", "Segoe UI Symbol", -apple-system, system-ui, sans-serif;
}

#theme-toggle:hover {
    transform: scale(1.15);
}

/* Theme toggle hover effect */
#theme-toggle:hover {
    transform: scale(1.15);
}

/* Smooth underline for nav links */
.nav-link {
    position: relative;
    text-decoration: none;
}

.nav-link::after {
    content: "";
    display: block;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s;
    position: absolute;
    bottom: -4px;
    left: 0;
}

.nav-link:hover::after {
    width: 100%;
}

/* ===================== */
/* Final Ultra-Bonus: Smooth Motion + Animations */
/* ===================== */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Default transition for interactive elements */
a, button, .skill-category, .project-item, .certification-item, #theme-toggle {
    transition: all 0.2s ease-in-out;
}

/* Slightly slower transitions for hover lifts */
.skill-category:hover,
.project-item:hover,
.certification-item:hover {
    transition: all 0.25s ease-in-out;
}

/* Remove harsh outlines but keep accessibility focus */
a:focus, button:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Smooth modal + context menu appearance (if used) */
.modal, .context-menu {
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Subtle hover glow for interactive buttons */
button:hover, a:hover {
    filter: brightness(1.03);
}

/* ===================== */
/* Add section box styling to main sections */
/* ===================== */

#skills, #projects, #certifications, .about, #contact {
    background: rgba(0, 0, 0, 0.015);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    padding: 24px;
    margin-bottom: 40px;
}

.dark #skills, .dark #projects, .dark #certifications, .dark .about, .dark #contact {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
}