@import 'animations.css';
@import 'devsec-switch.css';
@import 'timeline.css';
@import 'about-overrides.css';

/*===============
  Global Styles
===============*/

* {
  padding: 0;
  margin: 0;
  border: 0;
  outline: 0;
  /* background-color: inherit; <-- REMOVED: Caused layout breakage on overlays */
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  box-shadow: none;
  box-sizing: border-box;
  /* Mobile Touch Optimization: Remove tap highlight */
  -webkit-tap-highlight-color: transparent;
}

/* Mobile Touch Optimization: Remove 300ms delay on clickable elements */
a, button, .btn, .nav__hamburger, .scroll-top, input, label {
  touch-action: manipulation;
}

/* Prevent FOUC for Custom Elements */
devsec-console:not(:defined),
contact-form:not(:defined),
artifacts-zone:not(:defined) {
  display: none;
}

/* Ensure these overlays are hidden by default globally */
devsec-console,
contact-form,
artifacts-zone {
  display: block; /* Custom Elements default to inline */
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px; /* Offset for fixed header */
  /* Subtle overlay gradient for better header legibility */
  background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0) 100%);
  background-repeat: no-repeat;
  background-size: 100% 180px; /* Cover the top 180px of the screen */
  background-position: top center;
  position: relative; /* Needed for z-index if body also has bg */
  z-index: 0; /* Ensures it sits above main content but under fixed header */
}

:root {
  /* Fonts */
  --font-primary: 'Poppins', sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', monospace;

  /* Dark Mode (Default) - Arcane OS (Midnight Blue & Electric Violet) */
  --clr-bg: #0B0E14; /* Deep Midnight Blue - Reduces eye strain vs pure black */
  --clr-fg: #f8fafc; /* Soft White (Slate 50) */
  
  /* Component Variables (Dark) */
  --clr-card-bg: #1e293b; /* Slate 800 - Contrast against midnight bg */
  --clr-heading: #ffffff; /* Pure White for emphasis */
  --clr-text-secondary: #94a3b8; /* Slate 400 */
  --clr-border-light: #334155; /* Slate 700 */
  --clr-border-btn: #475569; /* Slate 600 */
  --clr-btn-bg: #1e293b; /* Slate 800 */
  --clr-footer-bg: linear-gradient(180deg, #0B0E14, #0f172a);
  --clr-footer-border: #1e293b;
  
  /* Accents (Luminous Arcane Violet) */
  --clr-accent: #a78bfa; /* Violet 400 - Brighter for better legibility */
  --clr-accent-hover: #c4b5fd; /* Violet 300 - Even lighter for hover */
  --clr-accent-transparent: rgba(167, 139, 250, 0.2); /* Subtle glow effect */
  --clr-fg-alt: #cbd5e1; /* Slate 300 */
  --shadow: 0 10px 40px -10px rgba(167, 139, 250, 0.25); /* Glowing shadow */
  --radius: 12px;
}

.light {
  /* Light Mode - Japanese Paper & Liquid Ink (Warm & Organic) */
  --clr-bg: #fafaf9; /* Stone 50 - Warm, premium paper feel */
  --clr-fg: #1c1917; /* Stone 900 - Deep warm ink */
  
  /* Component Variables (Light) */
  --clr-card-bg: #ffffff; /* Pure White Cards regarding paper bg */
  --clr-heading: #0c0a09; /* Stone 950 - Absolute Black Ink */
  --clr-text-secondary: #57534e; /* Stone 500 */
  --clr-border-light: #e7e5e4; /* Stone 200 - Pencil lines */
  --clr-border-btn: #d6d3d1; /* Stone 300 */
  --clr-btn-bg: #f5f5f4; /* Stone 100 */
  --clr-footer-bg: #f5f5f4; /* Solid structure */
  --clr-footer-border: #e7e5e4;
  
  /* Accents (Liquid Ink Focus) */
  --clr-accent: #1c1917; /* Stone 900 - Warm Black Focus */
  --clr-accent-hover: #44403c; /* Stone 700 */
  --clr-accent-transparent: rgba(28, 25, 23, 0.08); /* Ink wash */
  --clr-fg-alt: #44403c; /* Stone 700 */
  --shadow: 0 10px 30px -5px rgba(28, 25, 23, 0.08); /* Soft warm shadow */
}

body {
  font-family: 'Poppins', sans-serif;
  line-height: 1.7;
  color: var(--clr-fg);
  background-color: var(--clr-bg);
  transition: background-color 0.4s ease, color 0.4s ease;
}

::-moz-selection {
  background: var(--clr-accent);
  color: var(--clr-bg);
}

::-webkit-selection,
::selection {
  background: var(--clr-accent);
  color: var(--clr-bg);
}

/* Typography */
h1 {
  font-size: 56px;
  line-height: 1.2;
  font-weight: 700;
  color: var(--clr-fg);
}

h2 {
  font-size: 40px;
  line-height: 1.2;
  font-weight: 600;
  color: var(--clr-fg);
}

h3 {
  font-size: 22px;
  line-height: 1.3;
  font-weight: 600;
  color: var(--clr-fg);
}

h4 {
  font-size: 18px;
  font-weight: 600;
  color: var(--clr-fg);
}

@media (min-width: 1200px) {
  h1 {
    font-size: 84px;
  }
  h2 {
    font-size: 48px;
  }
  h3 {
    font-size: 26px;
  }
  h4 {
    font-size: 20px;
  }
}

@media (max-width: 768px) {
  h1 {
    font-size: 40px;
  }
  h2 {
    font-size: 32px;
  }
  h3 {
    font-size: 20px;
  }
  h4 {
    font-size: 16px;
  }
}

@media (max-width: 576px) {
  h1 {
    font-size: 36px;
  }
  h2 {
    font-size: 28px;
  }
  h3 {
    font-size: 18px;
  }
  h4 {
    font-size: 15px;
  }
}

@media (max-width: 360px) {
  h1 {
    font-size: 32px;
  }
  h2 {
    font-size: 24px;
  }
}

ul {
  list-style-type: none;
}

a {
  text-decoration: none;
}

button {
  cursor: pointer;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

[data-animate] {
  opacity: 0;
  transform: translateY(30px);
}

/* Buttons and Links */
.link {
  color: var(--clr-accent);
  position: relative;
  padding-bottom: 4px;
  transition: color 0.3s ease, transform 0.2s ease;
}

@media (hover: hover) {
  .link:hover,
  .link:focus {
    color: var(--clr-accent-hover);
    transform: translateY(-2px);
  }

  .link:hover::before,
  .link:focus::before {
    width: 100%;
  }
}

/* --- HEADER & NAV REFACTOR (Orbital HUD) --- */

.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  max-width: 100%;
  width: 100%;
  margin: 0 auto;
  justify-content: space-between;
  
  /* CLEAN TRANSPARENCY (No Blur, No Glow) */
  background-color: rgba(15, 15, 20, 0.6); /* Just a subtle tint */
  /* Removed backdrop-filter and harsh borders for a cleaner look */
  
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  
  transition: transform 0.4s ease, background-color 0.4s ease, padding 0.4s ease;
  padding: 20px 60px;
}

.header.hidden {
  transform: translateY(-100%); /* Hides the header upwards */
  pointer-events: none;
}

/* Light Mode Adjustment */
.light .header {
  background-color: rgba(240, 242, 245, 0.6);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: none;
}

.header.scrolled {
  padding: 15px 60px;
}

/* Logo Refinement */
.logo {
  font-family: var(--font-mono); 
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -1px; /* Tighter for modern look */
  transition: color 0.3s ease;
  background: none;
}

@media (hover: hover) {
  .logo:hover {
    color: var(--clr-accent);
    text-shadow: 0 0 12px var(--clr-accent);
  }
}

/* --- NAVIGATION & BRACKET SYSTEM (Sanitized) --- */

.nav__list {
  display: flex;
  gap: 40px;
  margin-right: 40px;
}

/* Shared behavior for Menu Text (Tech Toggles) */
.hover-brackets {
  color: var(--clr-fg);
  font-family: var(--font-mono);
  font-size: 13px; 
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 5px 0;
  transition: color 0.2s ease;
  background: none;
  position: relative;
  cursor: pointer;
  
  /* ALIGNMENT FIX: Baseline ensures text matches brackets */
  display: inline-flex;
  align-items: baseline; 
  justify-content: center;
  line-height: 1; /* Critical for vertical alignment */
}

/* Navigation Links - Solid Laser Targeting System */
.link--nav {
  color: var(--clr-fg);
  font-family: 'Poppins', sans-serif;
  font-size: 15px; 
  font-weight: 500;
  text-transform: capitalize;
  letter-spacing: 0.5px;
  padding: 6px 12px;
  transition: color 0.3s ease;
  position: relative;
  opacity: 0.8;
  
  /* DRAWING LINES (Solid Color via CSS Gradient Hack) */
  background-image: 
    linear-gradient(var(--clr-accent), var(--clr-accent)), 
    linear-gradient(var(--clr-accent), var(--clr-accent)), 
    linear-gradient(var(--clr-accent), var(--clr-accent)), 
    linear-gradient(var(--clr-accent), var(--clr-accent)); 
    
  background-repeat: no-repeat;
  
  /* Initial State: Size 0 (Invisible) */
  /* THICKER BORDERS: 2px Sides, 3px Bottom */
  background-size: 
    0% 2px,   /* Top */
    2px 0%,   /* Right */
    0% 3px,   /* Bottom */
    2px 0%;   /* Left */
    
  background-position: 
    left top,      
    right top,     
    right bottom,  
    left bottom;   
}

@media (hover: hover) {
  .link--nav:hover, 
  .link--nav:focus {
    color: var(--clr-accent);
    opacity: 1;
    /* Trigger Animation - Slower Duration (0.8s) */
    animation: laser-draw-solid 0.8s cubic-bezier(0.19, 1, 0.22, 1) forwards;
  }
}

/* Pseudo-elements for Brackets (Only for Tech Toggles now) */
.hover-brackets::before {
  content: "["; 
  opacity: 0;
  color: var(--clr-accent);
  transition: opacity 0.2s ease;
  font-weight: 400;
  margin-right: 10px; /* Fixed spacing [ Word */
  display: inline-block;
}

.hover-brackets::after {
  content: "]";
  opacity: 0;
  color: var(--clr-accent);
  transition: opacity 0.2s ease;
  font-weight: 400;
  margin-left: 10px; /* Fixed spacing Word ] */
  display: inline-block;
}

/* Hover States for Brackets */
@media (hover: hover) {
  .hover-brackets:hover,
  .btn--tech:hover .hover-brackets { 
    color: var(--clr-accent);
    text-shadow: 0 0 8px rgba(0, 255, 153, 0.4);
  }

  .hover-brackets:hover::before,
  .btn--tech:hover .hover-brackets::before,
  .hover-brackets:hover::after,
  .btn--tech:hover .hover-brackets::after {
    opacity: 1;
  }
}

/* Tech Buttons (Sys/Lang/Menu) - NOW WITH LASER EFFECT */
.btn--tech {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--clr-fg-alt); 
  background: transparent; 
  border: none; 
  padding: 8px 12px;
  border-radius: 0 !important; /* Ensure perfectly sharp corners */
  overflow: hidden; /* Ensure content doesn't bleed out of sharp corners */
  transition: color 0.3s ease;
  letter-spacing: 0.5px;
  height: auto; 
  position: relative;
  display: inline-flex;
  align-items: center;

  /* LASER SETUP (Same as nav) */
  background-image: 
    linear-gradient(var(--clr-accent), var(--clr-accent)), 
    linear-gradient(var(--clr-accent), var(--clr-accent)), 
    linear-gradient(var(--clr-accent), var(--clr-accent)), 
    linear-gradient(var(--clr-accent), var(--clr-accent)); 
  background-repeat: no-repeat;
  background-size: 0% 2px, 2px 0%, 0% 3px, 2px 0%;
  background-position: left top, right top, right bottom, left bottom; 
}

@media (hover: hover) {
  .btn--tech:hover {
    color: var(--clr-accent);
    /* Trigger Animation */
    animation: laser-draw-solid 0.8s cubic-bezier(0.19, 1, 0.22, 1) forwards;
  }

  .light .btn--tech:hover {
      color: var(--clr-accent);
  }
}

/* Keyframes for the "Square to Underline" sequence - THICKER VERSION */
@keyframes laser-draw-solid {
  /* 1. Draw Top and Right */
  0% {
    background-size: 0% 2px, 2px 0%, 0% 3px, 2px 0%;
  }
  30% {
    background-size: 100% 2px, 2px 100%, 0% 3px, 2px 0%;
  }
  /* 2. Draw Bottom and Left (Completing the square) */
  60% {
    background-size: 100% 2px, 2px 100%, 100% 3px, 2px 100%;
  }
  /* 3. Collapse Top, Right, Left -> Leaving only Bottom */
  100% {
    background-size: 0% 2px, 2px 0%, 100% 3px, 2px 0%;
  }
}

.link--icon {
  color: var(--clr-fg);
  font-size: 28px;
  transition: color 0.3s ease, transform 0.2s ease;
}

@media (hover: hover) {
  .link--icon:hover,
  .link--icon:focus {
    color: var(--clr-accent-hover);
    transform: scale(1.15);
  }
}

/* --- BUTTONS SYSTEM REFACTOR --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  border-radius: 9999px; /* Default Pill Shape */
  font-size: 16px;
  font-weight: 600;
  height: 48px;
  transition: all 0.3s ease;
  text-transform: capitalize;
  cursor: pointer;
}

/* NEW: Ghost Button (Borderless, Clean) */
.btn--ghost {
  background-color: transparent;
  border: none;
  color: var(--clr-accent);
  font-weight: 500;
  font-size: 18px; /* Slightly larger text for presence */
  padding: 0 16px;
  position: relative;
}

.btn--ghost::after {
  content: '';
  position: absolute;
  bottom: 8px;
  left: 50%;
  width: 0;
  height: 2px;
  background-color: var(--clr-accent);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

@media (hover: hover) {
  .btn--ghost:hover {
    color: var(--clr-accent-hover);
    transform: translateY(-2px);
    background-color: transparent; /* Ensure no bg on hover */
  }

  .btn--ghost:hover::after {
    width: 80%;
    background-color: var(--clr-accent-hover);
  }
}

.btn--primary {
  background-color: var(--clr-accent);
  color: var(--clr-bg);
}

@media (hover: hover) {
  .btn--primary:hover,
  .btn--primary:focus {
    background-color: var(--clr-accent-hover);
    transform: translateY(-3px);
    box-shadow: var(--shadow);
  }
}

.btn--outline {
  background-color: transparent;
  border: 2px solid var(--clr-accent);
  color: var(--clr-accent);
}

@media (hover: hover) {
  .btn--outline:hover,
  .btn--outline:focus {
    background-color: var(--clr-accent);
    color: var(--clr-bg);
    transform: translateY(-3px);
    box-shadow: var(--shadow);
  }
}

/* NEW: Sharp Tech Button (Rectangular, Solid Border) */
.btn--sharp {
    background: transparent;
    color: var(--clr-accent);
    border: 1px solid var(--clr-accent);
    border-radius: 0; /* SHARP CORNERS */
    font-family: var(--font-mono);
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 1px;
    padding: 12px 32px;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
    height: auto;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.1);
}

@media (hover: hover) {
  .btn--sharp:hover {
      background: rgba(0, 255, 153, 0.1);
      color: var(--clr-fg);
      border-color: var(--clr-accent-hover);
      box-shadow: 0 0 20px rgba(0, 255, 153, 0.4);
      transform: translateY(-2px);
      text-shadow: none;
  }
}

/* NEW: Editorial Button (Matches Resume/CV Style) */
.btn--editorial {
  display: inline-block;
  padding: 12px 30px;
  border: 1px solid var(--clr-accent);
  color: var(--clr-accent);
  background: transparent;
  text-decoration: none;
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
  border-radius: 0; /* Sharp edges */
  text-transform: uppercase;
  height: auto; /* Override default btn height if needed */
}

.btn--editorial::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 0; height: 100%;
  background-color: var(--clr-accent);
  transition: width 0.3s ease;
  z-index: -1;
}

@media (hover: hover) {
  .btn--editorial:hover {
    color: var(--clr-bg); /* Invert text color (Dark text on Green bg, or Light text on Blue bg) */
    transform: translateY(0); /* Reset lift for this specific style if desired, or keep it */
    box-shadow: none;
  }

  .btn--editorial:hover::before {
    width: 100%;
  }
}

/* Keep Grid Buttons Rounded */
.project .btn {
    /* Inherits rounded */
}

.btn--icon {
  padding: 0;
  font-size: 26px;
  background: none;
  border: none;
}

@media (hover: hover) {
  .btn--icon:hover,
  .btn--icon:focus {
    color: var(--clr-accent-hover);
    transform: scale(1.15);
  }
}

@media (max-width: 576px) {
  .btn {
    font-size: 15px;
    height: 44px;
  }
}

/* Layout */
.center {
  display: flex;
  align-items: center;
}

.nav {
  gap: 20px;
  position: relative;
}

.nav__hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--clr-fg);
  cursor: pointer;
  font-size: 26px;
  padding: 8px;
}

.nav__lang-toggle {
  display: flex;
  /* Background and border are handled by .btn--tech for the laser effect */
  color: var(--clr-fg);
  cursor: pointer;
  /* Font size handled by btn--tech */
  padding: 8px;
}

.lang-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 10px;
  background-color: var(--clr-bg);
  border-radius: var(--radius);
  /* Stronger shadow for dropdown */
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4); /* Darker, more pronounced shadow */
  padding: 10px 0;
  min-width: 120px;
  z-index: 1000;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.light .lang-menu {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15); /* Lighter but still noticeable shadow for light theme */
}

.lang-menu.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.lang-option {
  display: block;
  width: 100%;
  padding: 8px 20px;
  font-size: 15px;
  color: var(--clr-fg);
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
}

@media (hover: hover) {
  .lang-option:hover,
  .lang-option:focus {
    background-color: var(--clr-accent);
    color: var(--clr-bg);
  }
}

main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

.section {
  margin-top: 160px;
  padding: 40px 0;
}

.section__title {
  text-align: center;
  margin-bottom: 40px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  position: relative;
}

.section__title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background-color: var(--clr-accent);
  margin: 12px auto 0;
}

.about {
  flex-direction: column;
  text-align: center;
  margin-top: 60px;
  padding: 40px 0;
}

.about__name {
  color: var(--clr-accent);
}

.about__role {
  margin-top: 20px;
  font-weight: 500;
  font-size: 24px;
}

.about__desc {
  font-size: 17px;
  max-width: 800px;
  margin: 28px auto 0;
  color: var(--clr-fg-alt);
  line-height: 1.8;
}

.about__contact {
  margin-top: 40px;
  display: flex;
  gap: 20px;
}

.skills__list {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
}

.skills__list-item {
  font-family: var(--font-mono);
  font-size: 13px; /* Smaller for tech look */
  background-color: var(--clr-accent);
  color: var(--clr-bg); /* Use bg color for text on accent */
  padding: 8px 18px;
  border-radius: 4px; /* Slightly squarer for tech feel */
  transition: background-color 0.3s ease, transform 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  border: none;
  font-weight: 500;
}

@media (hover: hover) {
  .skills__list-item:hover {
    background-color: var(--clr-accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--clr-accent-transparent);
  }
}

.skill-icon {
  height: 20px;
  width: auto;
  vertical-align: middle;
}

.skills-category {
  margin-bottom: 40px;
}

.skills-category h3 {
  text-align: center;
  color: var(--clr-fg);
  margin-bottom: 15px;
  font-size: 22px;
  font-weight: 600;
}

.projects__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 80px;
  margin: 0 auto;
}

.contact {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: 160px;
  text-align: center;
  padding: 40px 0;
}

/* --- FOOTER RE-ENGINEERING (Technical Grid) --- */
.footer {
  padding: 0; /* Padding handled by grid items */
  background-color: var(--clr-bg); /* Solid background to anchor the page */
  margin-top: 100px;
  position: relative;
  
  /* LASER BOX SETUP (4 Gradients) with Transparency */
  background-image: 
    linear-gradient(var(--clr-accent-transparent), var(--clr-accent-transparent)), /* Top */
    linear-gradient(var(--clr-accent-transparent), var(--clr-accent-transparent)), /* Right */
    linear-gradient(var(--clr-accent-transparent), var(--clr-accent-transparent)), /* Bottom */
    linear-gradient(var(--clr-accent-transparent), var(--clr-accent-transparent)); /* Left */
    
  background-repeat: no-repeat;
  
  /* Initial State: Invisible */
  background-size: 
    0% 2px,   /* Top Width */
    2px 0%,   /* Right Height */
    0% 2px,   /* Bottom Width */
    2px 0%;   /* Left Height */
    
  background-position: 
    top left, 
    top right, 
    bottom right, 
    bottom left;
    
  transition: background-size 0.8s cubic-bezier(0.19, 1, 0.22, 1);
}

@media (hover: hover) {
  .footer:hover {
    /* Draw Full Box */
    background-size: 
      100% 2px, 
      2px 100%, 
      100% 2px, 
      2px 100%;
  }
}

/* Optional: Add a "scanline" or grid pattern overlay to the footer background */
.footer::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
    z-index: 0;
}

.footer__content {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr; /* 3 Equal Technical Columns */
  gap: 0; /* Borders will handle separation */
  padding: 0;
  text-align: left;
  position: relative;
  z-index: 1;
}

.footer__section {
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* Left align for tech feel */
  padding: 60px 40px;
  border-right: 1px solid rgba(255, 255, 255, 0.1); /* Technical Dividers */
}

.light .footer__section {
    border-right: 1px solid rgba(0, 0, 0, 0.1);
}

.footer__section:last-child {
    border-right: none;
}

.footer__title {
  margin-bottom: 24px;
  color: var(--clr-accent);
  font-family: var(--font-mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 700;
}

.footer__desc {
  font-size: 14px;
  color: var(--clr-fg-alt);
  max-width: 100%;
  margin: 0;
  line-height: 1.8;
}

/* Social Links specific to Footer */
.footer__links {
  display: flex;
  justify-content: flex-start;
  gap: 20px;
  margin-top: 20px;
}

/* Copyright / System Status Section */
.footer__copyright {
  justify-content: space-between;
}

.footer__copyright p {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--clr-fg-alt);
  margin-bottom: 20px;
}

/* Responsive Footer */
@media (max-width: 900px) {
  .footer__content {
    grid-template-columns: 1fr; /* Stack vertically */
  }
  
  .footer__section {
    padding: 30px 20px; /* Reduced padding for mobile consistency */
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    align-items: flex-start; /* Ensure left align sticks on mobile */
  }
  
  .light .footer__section {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  }
  
  .footer__section:last-child {
    border-bottom: none;
  }
  
  /* Fix DevSec Toggle Alignment in Mobile */
  .devsec-access {
      align-self: flex-start; /* Override any potential centering */
      margin-top: 10px;
  }
}

/* Scroll Top Button Refined and SHARP */
.scroll-top {
  position: fixed;
  bottom: 80px;
  right: 60px;
  font-size: 20px;
  color: var(--clr-accent);
  background: transparent;
  border: 1px solid var(--clr-accent);
  border-radius: 0; /* SHARP CORNERS */
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  opacity: 0;
  visibility: hidden;
  z-index: 10000;
  cursor: pointer;
  overflow: hidden; /* For the fill effect */
}

.scroll-top.visible {
  opacity: 1;
  visibility: visible;
}

/* Generic & Robust Arrow Icon */
.scroll-top__icon {
  position: relative;
  z-index: 2;
  font-family: Arial, sans-serif; /* Ultra-generic font for the character */
  font-size: 24px;
  font-weight: bold;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--clr-accent);
  transition: color 0.3s ease;
  user-select: none;
}

.scroll-top:hover .scroll-top__icon {
  color: var(--clr-bg);
}

.scroll-top::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  background: var(--clr-accent);
  transition: width 0.3s ease;
  z-index: -1;
}

@media (hover: hover) {
  .scroll-top:hover {
    color: var(--clr-bg);
    transform: translateY(-2px);
    box-shadow: 0 0 20px var(--clr-accent-transparent);
  }

  .scroll-top:hover::before {
    width: 100%;
  }
}

/* Highlight links in about description */
.about__desc a {
  color: var(--clr-accent);
  font-weight: bold;
  position: relative;
  padding-bottom: 4px;
  transition: color 0.3s ease, transform 0.2s ease;
  text-decoration: none; /* Asegura que no haya subrayado por defecto */
}

.about__desc a:hover,
.about__desc a:focus {
  color: var(--clr-accent-hover);
  transform: translateY(-2px);
}

.about__desc a::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--clr-accent-hover);
  transition: width 0.3s ease;
}

.about__desc a:hover::before,
.about__desc a:focus::before {
  width: 100%;
}

@media (max-width: 1200px) {
  .nav {
    gap: 20px;
    padding: 0 20px;
  }

  .nav__list {
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--clr-bg);
    padding-top: 100px; /* Space for fixed header */
    align-items: center;
    justify-content: flex-start;
    gap: 30px;
    
    /* Animation: Fade In/Out */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px); /* Slight slide up effect */
    transition: opacity 0.3s ease, visibility 0.3s, transform 0.3s ease;
    
    box-shadow: none;
    margin-right: 0;
    z-index: 999; /* Below header */
    
    /* Performance Optimization: Removed backdrop-filter on mobile */
    /* backdrop-filter: blur(15px); */
    /* -webkit-backdrop-filter: blur(15px); */
    background-color: rgba(20, 20, 23, 0.98); /* Almost solid for performance & legibility */
  }
  
  .light .nav__list {
      background-color: rgba(245, 245, 245, 0.98);
  }

  .nav__list.display-nav-list {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }

  .nav__list-item {
    margin: 0;
    text-align: center;
    width: 100%;
  }
  
  .nav__list-item .link--nav {
    font-size: 24px; /* Larger text for mobile */
    display: block;
    padding: 15px 0;
    
    /* Reset hover effects for mobile touch */
    letter-spacing: 1px;
  }
  
  /* Disable complex hover on mobile */
  .nav__list-item .link--nav::before,
  .nav__list-item .link--nav::after {
      content: none;
  }

  .nav__hamburger {
    display: flex;
    z-index: 1001; /* Ensure it stays clickable */
  }

  .lang-menu {
    top: 70px;
    right: 20px;
  }
  
  .header {
    padding: 15px 20px; /* Standard padding mobile */
  }
}

@media (max-width: 768px) {
  body {
    font-size: 15px;
    line-height: 1.6;
  }
  
  .header {
    padding: 15px 16px;
  }

  .section {
    margin-top: 70px;
    padding: 30px 24px;
  }
  
  .section__title {
    margin-bottom: 30px;
  }

  .about {
    margin-top: 40px;
    padding: 30px 24px;
  }
  
  .about__desc {
    padding: 0 10px;
  }

  .projects__grid {
    gap: 80px; /* Further increased spacing for optimal breathing room and consistency with desktop */
  }
  
  .project {
    padding: 18px;
  }

  .footer {
    padding: 50px 0;
  }

  .footer__content {
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 0 24px;
  }
  
  .footer__section {
    margin-bottom: 20px;
  }

@media (max-width: 768px) {
  .scroll-top {
    width: 44px;
    height: 44px;
    font-size: 18px;
    bottom: 80px; /* Increased safe zone for mobile toolbars */
    right: 30px; /* Adjusted right margin for better spacing */
  }
}
  
  .about__role {
    font-size: 20px;
  }
  
  .skills__list-item {
    font-size: 14px;
    padding: 8px 16px;
  }
  
  .project__description {
    font-size: 15px;
  }
}

@media (max-width: 576px) {
  .about__contact {
    flex-direction: column;
    align-items: center;
  }
  
  .about__contact .btn {
    width: 100%;
    max-width: 280px;
  }
  
  .project__stack {
    gap: 8px;
  }
  
  .stack-icon {
    height: 20px;
  }
  
  .project__links {
    flex-direction: column;
    gap: 12px;
    align-items: center;
  }
  
  .project__links .btn {
    width: 100%;
  }
  
  .footer__links {
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  .nav__list {
    top: 70px;
  }
  
  .skills__list {
    gap: 12px;
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  .section {
    padding: 20px 0;
    margin-top: 60px;
  }
  
  .about {
    margin-top: 30px;
    padding: 20px 0;
  }
  
  .project {
    padding: 15px;
  }
}

@media (max-width: 360px) {
  .skills__list {
    gap: 8px;
  }
  
  .skills__list-item {
    font-size: 13px;
    padding: 6px 12px;
  }
  
  .skill-icon {
    height: 16px;
  }
  
  .about__role {
    font-size: 18px;
  }
}
