/* Minimalist: Using system Helvetica stack only */

:root {
  /* Default (Light) - The Last of Us / Post-Apocalyptic */
  --bg: #f5f1e8;
  --bg-secondary: #e8e4d9;
  --bg-glass: rgba(245, 241, 232, 0.92);
  --bg-glass-heavy: rgba(245, 241, 232, 0.97);
  --bg-glass-overlay: rgba(245, 241, 232, 0.99);

  --text-main: #2a2a2a;
  --text-primary: #2a2a2a;
  --text-muted: #6b6b6b;
  --text-ghost: #b8b8b8;

  --accent: #4a7c59;
  /* Moss Green */
  --accent-glow: rgba(74, 124, 89, 0.25);
  --accent-bright: #5d9e6f;

  /* Post-Apocalyptic Palette */
  --rust: #8b5a3c;
  --concrete: #9a9a9a;
  --moss-dark: #3d5a3e;
  --weathered-text: #d4c5a9;
  --bio-glow: rgba(127, 176, 105, 0.4);

  /* Decor */
  --ui-border: #4a7c59;
  --ui-indicator: #5d9e6f;
}

[data-theme="dark"] {
  --bg: #1a1a18;
  --bg-secondary: #252421;
  --bg-glass: rgba(26, 26, 24, 0.88);
  --bg-glass-heavy: rgba(26, 26, 24, 0.96);
  --bg-glass-overlay: rgba(26, 26, 24, 0.98);

  --text-main: #e8e4d9;
  --text-primary: #e8e4d9;
  --text-muted: #9a9690;
  --text-ghost: #3d3d38;

  --accent: #7fb069;
  /* Brighter organic green for dark mode */
  --accent-glow: rgba(127, 176, 105, 0.35);
  --accent-bright: #92c77e;

  /* Post-Apocalyptic Dark Palette */
  --rust: #a06b47;
  --concrete: #6b6b6b;
  --moss-dark: #4a6b4a;
  --weathered-text: #c4b5a0;
  --bio-glow: rgba(146, 199, 126, 0.5);

  --ui-border: #7fb069;
  --ui-indicator: #92c77e;
}

:root {
  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 6rem;

  /* Typography - Unified Helvetica */
  --font-mono: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-body: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-display: 'Helvetica Neue', Helvetica, Arial, sans-serif;

  /* Motion */
  --ease-snap: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.23, 1, 0.32, 1);

  /* Z-index */
  --z-navbar: 1000;
  --z-overlay: 9998;
  --z-scanlines: 9999;
}

/* ======================================================
   GLOBAL
   ====================================================== */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--text-main);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
  position: relative;
  transition: color 0.2s var(--ease-smooth);
}

a:hover {
  color: var(--accent);
}

::selection {
  background: var(--accent-glow);
  color: var(--text-main);
}

*:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
  border-radius: 2px;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
  image-rendering: -webkit-optimize-contrast;
}

/* ======================================================
   TYPOGRAPHY
   ====================================================== */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 300;
  letter-spacing: -0.03em;
  /* Más apretado, estilo diseñador */
}

code,
pre,
.mono {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

/* ======================================================
   SUBTLE ACCENTS
   ====================================================== */

/* Weathered texture overlay - Post-apocalyptic aesthetic */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.015;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 3px, var(--concrete) 3px, var(--concrete) 3.5px),
    repeating-linear-gradient(90deg, transparent, transparent 7px, var(--rust) 7px, transparent 7.5px);
  background-size: 100% 100%, 100% 100%;
  mix-blend-mode: multiply;
  z-index: var(--z-scanlines);
}

/* Accent bars */
.accent-bar {
  height: 1px;
  background: var(--accent);
  width: 100%;
}

/* Hacky elements - más sutiles */
.terminal {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: var(--space-sm);
  background: var(--bg-secondary);
  border-left: 2px solid var(--accent);
  margin: var(--space-md) 0;
}

.terminal::before {
  content: '> ';
  color: var(--accent);
}

/* Broken grid overlay - decayed infrastructure */
.grid-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.008;
  background-image:
    linear-gradient(var(--moss-dark) 0.5px, transparent 0.5px),
    linear-gradient(90deg, var(--moss-dark) 0.5px, transparent 0.5px);
  background-size: 32px 32px;
  z-index: var(--z-overlay);
}

/* Orange accent highlights */
.highlight {
  background: var(--accent-glow);
  padding: 0.1em 0.3em;
  border-radius: 2px;
}

mark {
  background: var(--accent-glow);
  color: var(--text-main);
}

/* Clean buttons */
button,
.button {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: var(--space-xs) var(--space-sm);
  background: transparent;
  border: 1px solid var(--text-ghost);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s var(--ease-smooth);
  letter-spacing: 0.05em;
}

button:hover,
.button:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

/* ======================================================
   NO MOTION
   ====================================================== */

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  body::before,
  .grid-overlay {
    display: none;
  }
}

/* ======================================================
   UTILITIES
   ====================================================== */

.lang-toggle {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0;
  transition: color 0.2s var(--ease-smooth);
}

.lang-toggle:hover {
  color: var(--accent);
}

/* Floating timestamp */
.timestamp {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-ghost);
  letter-spacing: 0.1em;
}

/* Data labels */
.label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 0.2em;
  display: inline-block;
}

/* ======================================================
   REUSABLE COMPONENTS
   ====================================================== */

/* Section Headers */
.section-header {
  margin-bottom: var(--space-xl);
}

.terminal-line {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.line-number {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-ghost);
  opacity: 0.5;
  min-width: 1.5rem;
}

.line-symbol {
  color: var(--text-ghost);
  font-family: var(--font-mono);
  opacity: 0.5;
}

/* Section Titles */
.section-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

/* Accent Elements */
.accent-bar {
  height: 1px;
  background: linear-gradient(90deg, var(--text-ghost) 0%, transparent 100%);
  width: 100%;
  max-width: 150px;
  opacity: 0.3;
  transform-origin: left;
}

/* Brackets */
.bracket {
  color: var(--text-ghost);
  transition: color 0.3s ease;
}

.bracket-link:hover .bracket {
  color: var(--accent);
}

/* Status Indicators */
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

/* Links with Icons */
.link-with-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-decoration: none;
  color: var(--text-main);
  transition: color 0.2s ease;
}

.link-with-arrow:hover {
  color: var(--accent);
}

/* Responsive - Global Components */
@media (max-width: 768px) {
  .terminal-line {
    gap: var(--space-xs);
  }

  .line-number {
    font-size: 0.7rem;
  }
}

/* ======================================================
   ANIMATIONS
   ====================================================== */

/* Fade in animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInSimple {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Utility classes */
.fade-in {
  animation: fadeIn 0.6s ease-out forwards;
}

.fade-in-delay-1 {
  animation: fadeIn 0.6s ease-out 0.1s forwards;
  opacity: 0;
}

.fade-in-delay-2 {
  animation: fadeIn 0.6s ease-out 0.2s forwards;
  opacity: 0;
}

.fade-in-delay-3 {
  animation: fadeIn 0.6s ease-out 0.3s forwards;
  opacity: 0;
}

/* Smooth transitions */
.smooth-hover {
  transition: all 0.3s var(--ease-smooth);
}

.smooth-hover:hover {
  transform: translateY(-2px);
  color: var(--accent);
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .fade-in,
  .fade-in-delay-1,
  .fade-in-delay-2,
  .fade-in-delay-3 {
    animation: none;
    opacity: 1;
    transform: none;
  }
}