/* ============================================
   ARTURO VICENTE JAÉN — Portfolio Design 2026
   Identity: Precision · Computation · Optics
   Palette: near-black base · warm amber accent · monospace data
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
  /* Palette */
  --bg: #0B0C10;
  --surface: #1A1B23;
  --surface-raised: #22232D;
  --text: #F0F0F5;
  --text-muted: #9CA3AF;
  --text-dim: #6B7280;
  --accent: #F59E0B;
  --accent-light: #FBBF24;
  --accent-dim: rgba(245,158,11,0.12);
  --link: #10B981;
  --link-hover: #34D399;
  --border: #2A2B35;
  --border-light: #3A3B45;

  /* Typography */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Spacing scale */
  --space-xs: 0.375rem;
  --space-sm: 0.75rem;
  --space-md: 1.25rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 5rem;
  --space-3xl: 8rem;

  /* Layout */
  --max-w: 1100px;
  --gutter: var(--space-md);
  --radius: 0;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.45, 0, 0.55, 1);
}

/* Light theme overrides */
[data-theme="light"] {
  --bg: #FAFAFA;
  --surface: #FFFFFF;
  --surface-raised: #F4F4F8;
  --text: #111827;
  --text-muted: #6B7280;
  --text-dim: #9CA3AF;
  --accent: #D97706;
  --accent-light: #F59E0B;
  --accent-dim: rgba(217,119,6,0.08);
  --link: #059669;
  --link-hover: #047857;
  --border: #E5E7EB;
  --border-light: #F3F4F6;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text);
  background-color: var(--bg);
  -webkit-text-size-adjust: 100%;
}

a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.2s var(--ease-out);
}
a:hover { color: var(--link-hover); }

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

::selection { background: var(--accent-dim); color: var(--accent-light); }

/* --- Layout --- */
.container {
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--space-3xl);
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-body);
  font-weight: 700;
  color: var(--text);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

h1 { font-size: clamp(2.5rem, 6vw, 4rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: var(--space-md); }
h3 { font-size: 1.2rem; margin-bottom: var(--space-xs); }

p { max-width: 72ch; }

code, .mono {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--accent-dim);
  color: var(--accent-light);
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #0B0C10;
}
.btn-primary:hover {
  background: var(--accent-light);
  color: #0B0C10;
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent-light);
}

.btn-sm { padding: 0.4rem 1rem; font-size: 0.85rem; }

/* --- Cards --- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
}
.card:hover { border-color: var(--border-light); }

.card-body { padding: var(--space-md); }
.card-footer { padding: var(--space-sm) var(--space-md); border-top: 1px solid var(--border); }

.card-header {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  background: var(--surface-raised);
}

/* --- Navbar --- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(11,12,16,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding-block: 0.75rem;
}

[data-theme="light"] .navbar {
  background: rgba(250,250,250,0.88);
}

.navbar-brand {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text) !important;
  letter-spacing: -0.02em;
}
.navbar-brand:hover { color: var(--accent-light) !important; }

.navbar-nav .nav-link {
  color: var(--text-muted) !important;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.4rem 0.9rem !important;
  border-radius: 4px;
  transition: all 0.2s var(--ease-out);
}
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: var(--text) !important;
  background: var(--accent-dim);
}

.theme-toggle {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s var(--ease-out);
}
.theme-toggle:hover {
  background: var(--accent-dim);
  color: var(--accent-light);
  border-color: var(--accent);
}

/* --- Hero --- */
.hero {
  padding-block: var(--space-4xl);
  padding-top: calc(var(--space-4xl) + 60px);
  min-height: 85vh;
  display: flex;
  align-items: center;
}

.hero h1 {
  margin-bottom: var(--space-md);
  letter-spacing: -0.04em;
}

.hero h1 .accent {
  color: var(--accent-light);
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
  max-width: 58ch;
}

.hero-cta { display: flex; gap: var(--space-sm); flex-wrap: wrap; }

/* --- Stats row --- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-md);
}

.stat {
  text-align: center;
  padding: var(--space-md);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.stat-number {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-light);
  margin-bottom: 0.25rem;
}
.stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* --- Research cards (index) --- */
.research-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  padding: var(--space-lg);
  transition: all 0.25s var(--ease-out);
}
.research-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.research-card h3 {
  font-family: var(--font-mono);
  font-size: 1rem;
  margin-bottom: var(--space-sm);
}
.research-card p {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}
.research-card ul {
  list-style: none;
  margin-top: var(--space-sm);
}
.research-card ul li {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 0.2rem 0;
  border-bottom: 1px solid var(--border-light);
}
.research-card ul li:last-child { border-bottom: none; }

/* --- Tags / badges --- */
.badge-tech {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-light);
  background: var(--accent-dim);
  padding: 0.2em 0.55em;
  border-radius: 3px;
  margin: 0.15rem 0.25rem 0.15rem 0;
}

/* --- Timeline --- */
.timeline-item {
  padding: var(--space-sm) 0 var(--space-md);
  border-bottom: 1px solid var(--border);
}
.timeline-item:last-child { border-bottom: none; }
.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 0.25rem;
}
.timeline-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}
.timeline-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* --- Publications --- */
.pub-year {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-light);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: var(--space-xs);
}
.pub-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
  transition: all 0.2s var(--ease-out);
}
.pub-card:hover { border-color: var(--border-light); }
.pub-title {
  font-size: 1rem;
  margin-bottom: var(--space-xs);
}
.pub-authors {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}
.pub-journal {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* --- Contact cards --- */
.contact-info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: var(--space-md);
}
.contact-icon {
  font-size: 1.5rem;
  margin-bottom: var(--space-xs);
}
.contact-info-card h5 {
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
}

/* --- Footer --- */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-block: var(--space-xl);
  text-align: center;
}
.footer p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

/* --- Scroll reveal --- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}
.reveal.active {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* --- Subpage hero --- */
.subpage-hero {
  padding-top: calc(var(--space-3xl) + 60px);
  padding-bottom: var(--space-2xl);
}
.hero-title {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: var(--space-sm);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .section { padding-block: var(--space-2xl); }
  .hero { min-height: 70vh; }
  .hero-cta { flex-direction: column; }
  .hero-cta .btn { width: 100%; justify-content: center; }
  .pub-card .row { flex-direction: column; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
  * { transition-duration: 0s !important; animation-duration: 0s !important; }
}
