:root {
    --background: #fcfcfb;
    --text: #181818;
    --muted: #616161;
    --link: #181818;
    --link-border: #d5d5d5;
    --accent: #2f5cff;
    --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-meta: var(--font-body);
    --content-width: 45rem;
}

html[data-theme="80s"] {
    /* Full Retro CRT Terminal */
    --background: #000000;
    --text: #33ff00;
    --muted: #008800;
    --link: #ffff00;
    --link-border: #1e9900;
    --accent: #ff00ff;
    --font-body: "Courier New", Courier, monospace;
}

html[data-theme="90s"] {
    /* Netscape Navigator / Win 95 Era */
    --background: #c0c0c0;
    --text: #000000;
    --muted: #404040;
    --link: #0000ff;
    --link-border: #0000ff;
    --accent: #ff0000;
    --font-body: "Times New Roman", Times, serif;
}

html[data-theme="2000s"] {
    /* Web 2.0 / Blogspot Era */
    --background: #ffffff;
    --text: #333333;
    --muted: #888888;
    --link: #0055cc;
    --link-border: #b3d4fc;
    --accent: #ff6600; /* The mandatory Web 2.0 Orange */
    --font-body: Verdana, Tahoma, sans-serif;
}

html[data-theme="2010s"] {
    /* Flat Design / Hacker Dark Mode (Dracula inspired) */
    --background: #111111;
    --text: #f8f8f2;
    --muted: #6272a4;
    --link: #8be9fd;
    --link-border: #44475a;
    --accent: #ff79c6;
    --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

html { 
    font-size: 100%; 
}

body {
    background: var(--background);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    padding: 2rem;
    padding-bottom: 4rem;
    max-width: var(--content-width);
}

img { 
    display: block; 
    max-width: 100%; 
}

a {
    color: var(--link);
    text-decoration: underline;
    text-decoration-color: var(--link-border);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

a:hover, a:focus-visible {
    text-decoration-color: var(--accent);
    color: var(--accent);
}

button { 
    font: inherit; 
}

::selection { 
    background: color-mix(in srgb, var(--accent) 18%, transparent); 
}

.site-header {
    margin-bottom: 4rem;
}

.main-nav {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
}

.site-brand {
    color: var(--link);
    font-weight: 500;
    text-decoration: none;
    border-bottom: 0.5px solid var(--link-border);
    padding-bottom: 2px;
}

.site-brand:hover,
.site-brand:focus-visible {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.theme-switcher {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.language-switcher {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 0.9rem;
}

.language-switcher-label {
    color: var(--muted);
}

.language-link {
    color: var(--muted);
    text-decoration: none;
    border-bottom: 0.5px solid var(--link-border);
    padding-bottom: 1px;
}

.language-link:hover,
.language-link:focus-visible,
.language-link.is-active {
    color: var(--text);
    border-bottom-color: var(--text);
}

.theme-switcher button {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--muted);
    text-decoration: none;
}

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

.theme-switcher button[aria-pressed="true"] {
    color: var(--accent);
    font-weight: bold;
}

h1, h2, h3, h4, p, .page-title, .intro-copy, .blog-intro {
    font-size: 1rem;
    font-weight: normal;
}

h1, h2, h3, h4 {
    font-weight: bold;
}

p {
    margin-bottom: 1rem;
}

.profile-links {
    margin-top: 0.25rem;
    margin-bottom: 1.25rem;
    color: var(--muted);
    font-size: 0.95rem;
}

.profile-links a {
    color: var(--muted);
    text-decoration: none;
    border-bottom: 0.5px solid var(--link-border);
}

.profile-links a:hover,
.profile-links a:focus-visible {
    color: var(--text);
    border-bottom-color: var(--text);
}

.profile-links-divider {
    color: var(--link-border);
    padding: 0 0.25rem;
}

.social-icon {
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
    padding: 0;
    border: none;
    background: transparent;
    text-decoration: none;
    cursor: pointer;
}

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

.social-icon svg {
    width: 1.1rem;
    height: 1.1rem;
    display: block;
}

.portrait {
    margin-bottom: 1.5rem;
}

.portrait img {
    width: 10rem;
    height: 10rem;
    object-fit: cover;
    border-radius: 4px;
}

/* Profile Button */
.contact-action {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.75rem;
}

.social-icons-box {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.2rem;
    line-height: 1;
    border: 1px solid var(--text);
    border-radius: 4px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: bold;
    transition: all 0.2s ease;
    background: transparent;
}

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

.section-list {
    margin-top: 3rem;
}

.section-list h2 {
    margin-bottom: 1.5rem;
}

/* Projects (Tags) */
#projects .project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

#projects .project-tag {
    border: 1px solid var(--link-border);
    border-radius: 4px;
    padding: 0.4rem 0.8rem;
    transition: border-color 0.2s ease, background-color 0.2s ease;
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

#projects .project-tag.is-disabled {
    opacity: 0.55;
    cursor: default;
}

#projects .project-tag:hover {
    border-color: var(--text);
    background-color: rgba(128, 128, 128, 0.05);
}

/* Blog Preview List */
.blog-preview-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.blog-preview {
    position: relative;
    padding: 1.25rem;
    border: 1px solid var(--link-border);
    border-radius: 8px;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.blog-preview:hover {
    border-color: var(--text);
    transform: translateX(4px);
}

.blog-preview-link,
.blog-entry-link {
    position: absolute;
    inset: 0;
    z-index: 1;
    border: none;
    text-decoration: none;
}

.blog-preview h3 a,
.blog-entry h2 a {
    position: relative;
    z-index: 2;
}

.blog-preview h3 a {
    text-decoration: none;
    color: var(--text);
    font-size: 1.15rem;
}

.rss-icon {
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    border: none;
    transition: color 0.15s ease;
}

.rss-icon:hover {
    color: var(--accent);
}

.blog-meta {
    font-family: var(--font-meta);
    color: var(--muted);
    font-size: 0.85rem;
    margin-top: 0.2rem;
}

/* Internal full blog list */
.blog-list {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    margin-top: 2rem;
}

.item h3 {
    margin-bottom: 0.25rem;
}

.item h3 a {
    font-weight: normal;
}

.item p {
    color: var(--muted);
    margin-bottom: 0;
    line-height: 1.4;
    font-size: 0.95rem;
}

.blog-intro p {
    margin-bottom: 0;
}

.blog-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 2rem;
}

.blog-entry h2 {
    margin-bottom: 0.5rem;
}

.blog-entry {
    position: relative;
}

.site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    padding: 1rem 2rem;
    font-size: 0.8rem;
    background: var(--background);
}

.site-footer a {
    color: var(--muted);
    text-decoration: none;
    border-bottom: 0.5px solid var(--link-border);
}

.site-footer a:hover {
    color: var(--text);
    border-bottom-color: var(--text);
}

/* --- THEME SPECIFIC EXTREME OVERRIDES --- */

/* 80s: Retro CRT / Hacker */
html[data-theme="80s"] body {
    text-shadow: 0 0 5px var(--text);
    background-image: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 255, 0, 0.05) 2px, rgba(0, 255, 0, 0.05) 4px);
    background-size: 100% 4px;
}
html[data-theme="80s"] img {
    filter: sepia(100%) hue-rotate(80deg) saturate(400%);
    border: 2px dashed var(--text);
}
html[data-theme="80s"] .button {
    border-radius: 0;
    box-shadow: 4px 4px 0 var(--text);
    text-transform: uppercase;
    font-weight: bold;
    border-style: dashed;
}
html[data-theme="80s"] .button:hover {
    box-shadow: none;
    transform: translate(4px, 4px);
}
html[data-theme="80s"] #projects .project-tag {
    border-radius: 0;
    border: 1px dashed var(--text);
    background: #0a0a0a;
}
html[data-theme="80s"] #projects .project-tag:hover {
    background: #002200;
    border-style: solid;
}
html[data-theme="80s"] a:hover {
    background: var(--text);
    color: var(--background);
    text-shadow: none;
}

/* 90s: GeoCities / Win 95 */
html[data-theme="90s"] .button {
    background: #c0c0c0;
    border-top: 2px solid #ffffff;
    border-left: 2px solid #ffffff;
    border-right: 2px solid #000000;
    border-bottom: 2px solid #000000;
    border-radius: 0;
    color: #000;
    font-family: inherit;
    box-shadow: inset 1px 1px 0px #dfdfdf, inset -1px -1px 0px #808080;
}
html[data-theme="90s"] .button:active {
    border-top: 2px solid #000000;
    border-left: 2px solid #000000;
    border-right: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
    box-shadow: inset 1px 1px 0px #808080, inset -1px -1px 0px #dfdfdf;
    background: #b0b0b0;
    transform: none;
}
html[data-theme="90s"] img {
    border: 4px ridge #c0c0c0;
}
html[data-theme="90s"] #projects .project-tag {
    background: #ffffff;
    border-top: 2px solid #808080;
    border-left: 2px solid #808080;
    border-right: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
    border-radius: 0;
    box-shadow: 2px 2px 0 #000;
}
html[data-theme="90s"] a {
    text-decoration: underline;
    font-weight: bold;
}
html[data-theme="90s"] a:visited {
    color: #800080;
}

/* 2000s: Web 2.0 / Glossy */
html[data-theme="2000s"] body {
    background: linear-gradient(180deg, #f0f8ff, #ffffff);
    background-attachment: fixed;
}
html[data-theme="2000s"] .button {
    background: linear-gradient(180deg, #ff9900 0%, #ff6600 100%);
    color: white;
    border: 1px solid #cc5500;
    border-radius: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2), inset 0 2px 4px rgba(255,255,255,0.4);
    text-shadow: 1px 1px 0px rgba(0,0,0,0.3);
    font-weight: bold;
}
html[data-theme="2000s"] .button:hover {
    background: linear-gradient(180deg, #ffaa33 0%, #ff7711 100%);
    transform: translateY(-1px);
    border: 1px solid #cc5500;
}
html[data-theme="2000s"] img {
    border: 4px solid #fff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}
html[data-theme="2000s"] #projects .project-tag {
    background: linear-gradient(180deg, #fff 0%, #f9f9f9 100%);
    border-radius: 12px;
    border: 1px solid #ccc;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
html[data-theme="2000s"] #projects .project-tag:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 15px rgba(0,0,0,0.15);
}

/* 2010s: Flat / Minimalist */
html[data-theme="2010s"] body {
    background-color: #282a36; /* Dracula space-gray start */
}
html[data-theme="2010s"] .button {
    background: var(--accent);
    color: var(--background);
    border: none;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}
html[data-theme="2010s"] .button:hover {
    background: #ff92d0; /* lighter pink */
    color: #111;
}
html[data-theme="2010s"] img {
    border-radius: 50%;
    aspect-ratio: 1/1;
    object-fit: cover;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}
html[data-theme="2010s"] #projects .project-tag {
    border: none;
    background: #383a59;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    border-radius: 16px;
}
html[data-theme="2010s"] #projects .project-tag:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
}
html[data-theme="2010s"] a {
    text-decoration: none;
    border-bottom: 1px solid var(--link-border);
}
html[data-theme="2010s"] a:hover {
    border-bottom-color: var(--link);
}

@media (max-width: 640px) {
    body {
        padding: 1.25rem;
    }

    .main-nav {
        align-items: flex-start;
        flex-direction: column;
    }
}
