/* Import Google Font */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;700;900&display=swap');

/* Root variables */
:root {
    --bg: #252221;               /* brownish grey */
    --fg: #ffffff;               /* white */
    --accent: #9d103f;           /* magenta */
    --subtle: #1b3148;           /* greyish blue */
    --secondary-accent: #aa1446; /* magenta 2 */
    --highlight-accent: #ff005d; /* pinkish */
    --dynamic-accent: #0d0205;   /* dark brown */
    --main-font: 'Poppins', sans-serif; /* Keep font */

    /* Adjusted link/hover colors based on new palette */
    --link-color: var(--secondary-accent);
    --link-hover-color: var(--fg);       /* White for link hover */
    --blue-highlight: #3b8dff;       /* Brighter blue for popping */
    --hover-skill-text: var(--fg);       /* White text for skills hover */

    /* ADDED: Define mobile navbar height */
    --mobile-nav-height: 50px;      /* Adjust as needed, e.g., 50px or 60px */
}

/* Base styles and reset */
body, html {
    margin: 0;
    padding: 0;
    font-family: var(--main-font);
    background-color: var(--bg);
    color: var(--fg);
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

#content {
    flex-grow: 1;
    display: flex;
    position: relative;
    padding-top: 50px; /* Desktop. Mobile will override. */
    z-index: 2;
}

/* Persona-style Navigation */
/* ---------------------------------------------------------- */
#navbar {
    position: fixed;
    top: 75px; /* Desktop */
    z-index: 20;
    padding: 0;
}

#navbar ul {
    list-style: none;
    padding: 0;
    margin-left: 40px;
    margin-right: 40px;
}

#navbar li {
    margin-bottom: 5px;
    position: relative;
    transform: none;
    background-color: transparent;
    width: auto;
    min-width: 0;
    box-shadow: none;
}

#navbar li::after {
    content: none;
}

#navbar a {
    display: inline-block;
    padding: 8px 15px 8px 10px;
    color: var(--fg);
    text-decoration: none;
    font-weight: 900;
    font-size: 1.6em;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    z-index: 1;
    transform: none;
    transition: color 0.2s ease-out;
}

#navbar a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -8px;
    right: -8px;
    bottom: 0;
    background: linear-gradient(
        115deg,
        var(--accent) 60%,
        #0000 90%
    );
    z-index: -1;
    transform: skewX(-25deg) rotate(-2deg);
    transform-origin: center;
    opacity: 0;
    transition: opacity 0.05s ease-in-out, transform 0.15s ease-in-out, background 0.15s ease-in-out;
    padding-right: 10px;
}

#navbar a::after {
    content: '';
    position: absolute;
    top: 0;
    left: -3px;
    right: -3px;
    bottom: 0;
    background-color: white;
    z-index: -2;
    transform: skewX(-25deg) rotate(-8deg);
    transform-origin: center;
    opacity: 0;
    transition: opacity 0.20s ease-in-out, transform 0.15s ease-in-out;
}

#navbar li:hover a::before {
    opacity: 1;
}

#navbar li:hover a::after {
    opacity: 0.8;
}

#navbar li:hover a {
    color: var(--fg);
}

/* Main Content Area */
/* ---------------------------------------------------------- */
#main-content {
    flex-grow: 1;
    padding: 40px 40px 40px 250px; /* Adjust left padding based on nav width */
    transition: opacity 0.4s ease-in-out;
    position: relative;
    z-index: 1;
    overflow-y: auto;
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

/* Headings inside main content */
#main-content h1 {
    font-size: 2.8em;
    font-weight: 900;
    color: var(--accent);
    margin-top: 0;
    margin-bottom: 30px;
    text-transform: uppercase;
    position: relative;
    display: inline-block;
    padding-bottom: 8px;
    letter-spacing: 1px;
    line-height: 1.1;
}

#main-content h1::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 5px;
    background-color: var(--fg);
    transform: skewX(-45deg);
    transform-origin: left bottom;
    z-index: -1;
}

#main-content h2 {
    font-size: 1.8em;
    font-weight: 700;
    color: var(--accent);
    margin-top: 40px;
    margin-bottom: 20px;
    text-transform: uppercase;
}

/* General H3 style within main content (including those in ContentCards) */
#main-content h3 {
    font-size: 1.4em;
    font-weight: 700;
    color: var(--accent);
    margin-top: 25px;
    margin-bottom: 10px;
}

#main-content h4 {
     font-size: 1.1em;
     font-weight: 700;
     color: var(--fg);
     margin-top: 10px;
     margin-bottom: 5px;
}

#main-content p {
    line-height: 1.7;
    margin-bottom: 15px;
}

/* General link styling in main content */
/* Applies to links that are NOT navbar links, NOT .content-card-title-link, and NOT .social-links a */
#main-content a:not(#navbar a):not(.content-card-title-link):not(.social-links a) {
    color: var(--link-color);
    text-decoration: none;
    font-weight: 700;
    position: relative;
    transition: color 0.2s ease;
}

#main-content a:not(#navbar a):not(.content-card-title-link):not(.social-links a):hover {
    color: var(--link-hover-color);
    text-decoration: none;
}

#main-content a:not(#navbar a):not(.content-card-title-link):not(.social-links a)::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    bottom: -2px;
    left: 0;
    background-color: var(--link-color); /* Underline color for general links */
    transform: scaleX(0);
    transform-origin: bottom left;
    transition: transform 0.3s ease-in-out, background-color 0.2s ease;
}

#main-content a:not(#navbar a):not(.content-card-title-link):not(.social-links a):hover::after {
    transform: scaleX(1);
    background-color: var(--link-hover-color); /* Underline color for general links on hover */
}

#main-content ul {
    list-style: none;
    padding-left: 20px;
    margin-bottom: 15px;
}

#main-content ul ul {
    margin-top: 8px;
    margin-bottom: 10px;
    padding-left: 20px;
}

#main-content ul ul li {
    margin-bottom: 6px;
}

#main-content ul li {
    margin-bottom: 10px;
    position: relative;
}

#main-content ul li::before {
    content: '>';
    position: absolute;
    left: -20px;
    color: var(--link-color);
    font-weight: 900;
}

/* Styling for SocialLinks Component (Static Double Underline) */
#main-content .social-links {
  text-align: left;
  margin-bottom: 1rem;
}

#main-content .social-links a {
  color: var(--fg);
  font-weight: bold;
  font-size: 1.0em;
  text-decoration: none !important; /* Ensure no default underline */
  border-bottom: none !important;   /* Ensure no borders create lines */
  position: relative;
  padding-bottom: 8px; /* Space for the double underlines */
  display: inline-block;
}

#main-content .social-links a:not(:last-child) {
  margin-right: 15px;
}

#main-content .social-links a::before { /* Top underline */
  content: '';
  position: absolute;
  bottom: 4px; /* Adjust for spacing */
  left: 0;
  width: 100%;
  height: 1px;
  background-color: var(--fg);
}

#main-content .social-links a::after { /* Bottom underline */
  content: '';
  position: absolute;
  bottom: 0px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--fg);
}

#main-content .social-links a:hover {
  color: var(--secondary-accent); /* Or any other hover effect for text */
}


/* Content Card Styling */
/* ---------------------------------------------------------- */
.content-card {
    background-color: rgba(37, 34, 33, 0.8);
    border: 2px solid var(--subtle);
    padding: 30px;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
    transition: border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 4px;
}

.content-card:hover {
     border-color: var(--accent);
     transform: translateY(-5px) scale(1.01);
     box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.content-card::before {
    content: '';
    position: absolute;
    top: -10%;
    left: -100px;
    bottom: -10%;
    width: 80%;
    background-color: var(--dynamic-accent);
    transform: skewX(-25deg);
    z-index: 0;
    opacity: 0.4;
    transition: left 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.4s ease;
}

.content-card:hover::before {
    left: -40px;
    opacity: 0.8;
}

.content-card em {
    color: var(--blue-highlight);
}

.content-card > * {
    position: relative;
    z-index: 1;
}

/* H3 style within Content Cards */
#main-content .content-card h3 {
    font-size: 1.4em; /* Consistent with general #main-content h3 */
    font-weight: 700; /* Consistent */
    color: var(--accent); /* This is key for the link text color to inherit */
    margin-top: 0; /* Titles are often first */
    margin-bottom: 10px; /* Consistent */
}

/* Styling for the Content Card Title Link (a.content-card-title-link) */
#main-content .content-card h3 a.content-card-title-link {
  color: inherit; /* Inherits --accent from the parent h3 */
  font-weight: inherit; /* Inherits font-weight from parent h3 */
  text-decoration: none; /* No underline on the text itself */
  position: relative; /* Essential for the ::after pseudo-element */
}

#main-content .content-card h3 a.content-card-title-link:hover {
  color: var(--link-hover-color); /* Text color on hover */
  text-decoration: none; /* Still no underline on the text itself */
}

/* Animated underline for Content Card Title Links */
#main-content .content-card h3 a.content-card-title-link::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 2px; /* Match general link underline thickness */
  bottom: -2px; /* Match general link underline position */
  left: 0;
  background-color: var(--accent); /* Underline color matches the title's text color (var(--accent)) */
  transform: scaleX(0); /* Initial state for animation */
  transform-origin: bottom left;
  transition: transform 0.3s ease-in-out, background-color 0.2s ease;
}

#main-content .content-card h3 a.content-card-title-link:hover::after {
  transform: scaleX(1); /* Animate in */
  background-color: var(--link-hover-color); /* Underline color on hover matches the text's hover color */
}

.content-card h4 {
    color: var(--accent);
    font-size: 1.1em;
    font-weight: 700;
    margin-top: 10px;
    margin-bottom: 5px;
}

.related-skills {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--subtle);
}

.related-skills h5 {
    color: var(--fg);
    margin-bottom: 10px;
    font-size: 1em;
    text-transform: uppercase;
}

.related-skills ul {
    display: flex;
    flex-wrap: wrap;
    gap: 28px;
    padding-left: 0;
    margin-bottom: 0;
}

.related-skills ul li {
    background-color: var(--subtle);
    color: var(--fg);
    padding: 6px 14px;
    border-radius: 3px;
    font-size: 0.9em;
    font-weight: 400;
    margin-bottom: 0;
    border: 1px solid transparent;
    transition: background-color 0.2s, border-color 0.2s, transform 0.2s;
    cursor: default;
}

.related-skills ul li:hover {
    background-color: var(--accent);
    border-color: var(--fg);
    transform: scale(1.05);
    color: var(--hover-skill-text);
}

.related-skills ul li::before {
    content: none;
}

/* Blog Specific Styles */
/* ---------------------------------------------------------- */
.blog-section {
    margin-bottom: 3rem;
}

.blog-post-item h3 { /* Note: Might conflict with .content-card h3 a styling if blog items are in cards */
    margin-top: 0;
    font-size: 1.6em;
    color: var(--accent);
    line-height: 1.3;
}

.blog-post-title-link {
    color: var(--secondary-accent);
    text-decoration: none;
    font-weight: 700;
}

.blog-post-title-link:hover {
    color: var(--fg);
}

.blog-post-meta {
    font-size: 0.85em;
    color: var(--blue-highlight);
    margin-top: 0.25rem;
    margin-bottom: 0.75rem;
    font-style: italic;
}

.blog-post-description {
    color: var(--fg);
    opacity: 0.9;
}

/* Blog Post Page Specific Styles ([slug].tsx) */
/* ---------------------------------------------------------- */
.blog-post-outer-container {
    margin: 0 auto; /* Or your preferred layout styling */
}

.back-to-blog-link {
    display: inline-block;
    margin-bottom: 1.5rem;
    color: var(--secondary-accent);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9em;
    transition: color 0.2s ease;
}

.back-to-blog-link:hover {
    color: var(--fg); /* This is white, which might be hard to see on a dark site background if the link is outside the white box */
                     /* Consider var(--accent) or var(--highlight-accent) for hover if it's outside the white box */
}
.back-to-blog-link::after {
    content: none !important;
}

.blog-post-content-wrapper {
    background-color: var(--fg); /* This is your white background */
    padding: 2rem 2.5rem;
    border-radius: 4px;
    margin-top: 1.5rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);

    /* --- ADD THIS FOR TEXT COLOR INSIDE THE WHITE BOX --- */
    color: #333333; /* Dark grey for good readability on white. Adjust as desired. */
    /* You could also define a new CSS variable like --text-on-light-bg: #333; */
}

/* Ensure headings within the white box also get a dark color if not already specified */
.blog-post-content-wrapper h1,
.blog-post-content-wrapper h2,
.blog-post-content-wrapper h3, /* This will affect markdown H3s */
.blog-post-content-wrapper h4,
.blog-post-content-wrapper h5,
.blog-post-content-wrapper h6 {
    /* If your general #main-content h1,h2,h3 etc. use var(--accent) (magenta),
       they will contrast well. If they inherit --fg (white), override them here: */
    color: var(--accent); /* Keep accent color for headings if desired, it usually works on white */
    /* Or, if you want dark headings too: */
    /* color: #222222; */
}

/* Specifically for .markdown-body if it's inside .blog-post-content-wrapper */
.blog-post-content-wrapper .markdown-body {
    /* The color: #333333; from .blog-post-content-wrapper will be inherited by <p> tags. */
    /* Links within markdown are already handled by your #main-content .markdown-body a rules,
       which set color: var(--accent);. This is good. */
}


.blog-post-metadata {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee; /* Light grey border on white background */
    font-size: 0.9em;
    color: #555555; /* Medium grey for metadata text */
}
.blog-post-metadata p {
    margin: 0.3rem 0;
    line-height: 1.5;
}
.blog-post-metadata strong {
    color: #222222; /* Darker color for "Author:", "Date:" labels */
}

body #content #main-content .blog-post-content-wrapper .markdown-body a:hover {
    color: var(--secondary-accent) !important;
    text-decoration: underline !important;
}
body #content #main-content .blog-post-content-wrapper .markdown-body a::after {
    content: none;
}

/* --- GRUVBOX DARK PRISMJS THEME - INTEGRATED --- */
#main-content .markdown-body pre {
	color: #ebdbb2;
	font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace;
	direction: ltr;
	text-align: left;
	white-space: pre;
	word-spacing: normal;
	word-break: normal;
	line-height: 1.5;
	font-size: 0.9em;
	-moz-tab-size: 4;
	-o-tab-size: 4;
	tab-size: 4;
	-webkit-hyphens: none;
	-moz-hyphens: none;
	-ms-hyphens: none;
	hyphens: none;
}

#main-content .markdown-body pre[class*="language-"]::-moz-selection,
#main-content .markdown-body pre[class*="language-"] ::-moz-selection,
#main-content .markdown-body code[class*="language-"]::-moz-selection,
#main-content .markdown-body code[class*="language-"] ::-moz-selection {
	color: #fbf1c7;
	background: #7c6f64;
}

#main-content .markdown-body pre[class*="language-"]::selection,
#main-content .markdown-body pre[class*="language-"] ::selection,
#main-content .markdown-body code[class*="language-"]::selection,
#main-content .markdown-body code[class*="language-"] ::selection {
	color: #fbf1c7;
	background: #7c6f64;
}

#main-content .markdown-body pre[class*="language-"] {
	padding: 1em;
	margin: 1.5em 0;
	overflow: auto;
	border-radius: 4px;
}

#main-content .markdown-body :not(pre) > code[class*="language-"],
#main-content .markdown-body pre {
    background: #1d2021 !important;
}

#main-content .markdown-body :not(pre) > code[class*="language-"] {
    padding: 0.2em 0.4em;
    border-radius: 3px;
}

#main-content .markdown-body h3,
#main-content .markdown-body h4,
#main-content .markdown-body h5,
#main-content .markdown-body h6 {
    color: var(--accent); /* This is consistent with other H3s */
}

#main-content .markdown-body a:not(#navbar a) {
    color: var(--accent); /* Markdown links will be accent color */
    text-decoration: none;
    font-weight: normal; /* Markdown links are normal weight */
}
#main-content .markdown-body a:hover:not(#navbar a) {
    text-decoration: underline; /* Simple underline on hover for markdown links */
    color: var(--highlight-accent); /* Different hover color for markdown links */
}

/* Explicitly remove the general animated ::after from markdown links */
#main-content .markdown-body a:not(#navbar a)::after {
    content: none !important;
}

#main-content .markdown-body .token.comment,
#main-content .markdown-body .token.prolog,
#main-content .markdown-body .token.cdata {
	color: #a89984;
	font-style: italic;
}

#main-content .markdown-body .token.delimiter,
#main-content .markdown-body .token.boolean,
#main-content .markdown-body .token.keyword,
#main-content .markdown-body .token.selector,
#main-content .markdown-body .token.important,
#main-content .markdown-body .token.atrule {
	color: #fb4934;
}

#main-content .markdown-body .token.operator,
#main-content .markdown-body .token.punctuation,
#main-content .markdown-body .token.attr-name {
	color: #a89984;
}

#main-content .markdown-body .token.tag,
#main-content .markdown-body .token.tag .token.punctuation,
#main-content .markdown-body .token.doctype,
#main-content .markdown-body .token.builtin {
	color: #fabd2f;
}

#main-content .markdown-body .token.entity,
#main-content .markdown-body .token.number,
#main-content .markdown-body .token.symbol {
	color: #d3869b;
}

#main-content .markdown-body .token.property,
#main-content .markdown-body .token.constant,
#main-content .markdown-body .token.variable {
	color: #83a598;
}

#main-content .markdown-body .token.string,
#main-content .markdown-body .token.char {
	color: #b8bb26;
}

#main-content .markdown-body .token.attr-value,
#main-content .markdown-body .token.attr-value .token.punctuation:not(.tag .token.punctuation) {
	color: #b8bb26;
}

#main-content .markdown-body .token.url {
	color: #b8bb26;
	text-decoration: underline;
}

#main-content .markdown-body .token.function,
#main-content .markdown-body .token.class-name {
	color: #fabd2f;
}

#main-content .markdown-body .token.regex {
	background: #b8bb26;
	color: #1d2021;
}

#main-content .markdown-body .token.bold {
	font-weight: bold;
}

#main-content .markdown-body .token.italic {
	font-style: italic;
}

#main-content .markdown-body .token.inserted {
	background: rgba(168, 153, 132, 0.2);
	color: #b8bb26;
}

#main-content .markdown-body .token.deleted {
	background: rgba(251, 73, 52, 0.2);
	color: #fb4934;
}

/* --- END GRUVBOX DARK PRISMJS THEME --- */

#main-content .webgpu-widget .static-arrow-button { /* Be specific to avoid conflicts */
  background-color: #282828;
  border: 1px solid #555; /* Already in inline, but good for consistency */
  padding: 0px;
  cursor: pointer;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  transition: background-color 0.15s ease-in-out; /* For smooth hover */
}

#main-content .webgpu-widget .static-arrow-button .static-arrow-button-svg {
  fill: #ddd;
  transition: fill 0.15s ease-in-out; /* For smooth hover if fill changes */
}

/* Hover state for the button */
#main-content .webgpu-widget .static-arrow-button:hover {
  background-color: #6a6a6a; /* Matches onMouseEnter style from Preact component */
}

/* Active (pressed) state for the button - limited CSS version */
/* This won't replicate the boxShadow inset effect perfectly but gives some feedback */
#main-content .webgpu-widget .static-arrow-button:active {
  background-color: #4a4a4a; /* Matches onMouseDown style from Preact component */
  /* box-shadow: inset 0 0 3px #333; /* Optional: simple inset shadow */
}

/* Disabled state - this would be applied by client-side JS by adding a class */
#main-content .webgpu-widget .static-arrow-button.disabled-by-js {
  background-color: #4a4a4a !important;
  color: #777 !important; /* Affects text if there was any */
  cursor: not-allowed !important;
  /* box-shadow: none !important; */ /* Clear any active shadows */
}

#main-content .webgpu-widget .static-arrow-button.disabled-by-js .static-arrow-button-svg {
  fill: #666 !important;
}

/* Mobile / Responsive Adjustments */
/* ---------------------------------------------------------- */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }

    #content {
        padding-top: var(--mobile-nav-height);
    }

    #navbar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: var(--mobile-nav-height);
        padding: 0;
        margin: 0;
        background-color: var(--bg);
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 5px rgba(0,0,0,0.2);
        z-index: 1000;
    }

    #navbar ul {
        display: flex;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        flex-wrap: wrap;
        gap: 0;
        padding: 0;
        margin: 0;
        width: 100%;
    }

    #navbar li {
        margin-bottom: 0;
        transform: none;
    }

    #navbar a {
        font-size: 0.8em;
        font-weight: 900;
        color: var(--fg);
        text-decoration: none;
        text-transform: uppercase;
        padding: 6px 8px;
        letter-spacing: 0.5px;
        display: inline-block;
        position: relative;
        transform: none;
        transition: color 0.2s ease-out;
    }

    #navbar a::before,
    #navbar a::after {
        content: none !important;
    }
    
    #navbar li:hover a {
        color: var(--secondary-accent);
    }

    #main-content {
        padding: 20px;
    }

    #main-content h1 {
        font-size: 1.8em;
    }
    #main-content h1::after {
        height: 4px;
    }
    #main-content h2 {
        font-size: 1.5em;
    }
    /* Ensure card title H3s also scale down if #main-content h3 does */
    #main-content h3, 
    #main-content .content-card h3 { /* Apply mobile H3 size to card titles too */
        font-size: 1.2em;
    }

    .content-card {
        padding: 20px;
        margin-bottom: 25px;
    }
    .content-card::before {
        left: -100px;
        width: 800px; 
        opacity: 0.3;
    }

    .content-card:hover::before {
        left: -20px;
        opacity: 0.6;
    }
    .related-skills ul {
        gap: 8px;
    }
    .related-skills ul li {
        padding: 5px 10px;
        font-size: 0.8em;
    }

    .blog-post-content-wrapper {
        padding: 1.5rem 1rem;
    }
    #main-content .markdown-body h1 {
        font-size: 1.6em;
    }
}
