﻿/* AG064.eu - Component Styles */

/* ===== Navigation ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-fixed);
  padding: var(--space-md) 0;
  background: var(--navbar-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid transparent;
  /* backdrop-filter blur is GPU-expensive; only animate the cheap
     properties. The blur is set on the static navbar-bg, not on
     any state transition. */
  transition: background-color var(--transition-base), border-bottom-color var(--transition-base);
}

.navbar.scrolled {
  background: var(--navbar-bg-scrolled);
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-md);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
}

.navbar-logo-icon {
  height: 52px;
  width: auto;
  display: block;
  transition: filter var(--transition-base);
}

.navbar-logo:hover .navbar-logo-icon {
  filter: drop-shadow(0 0 8px var(--accent-red-glow));
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  list-style: none;
}

.navbar-link {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--silver-300);
  text-decoration: none;
  padding: var(--space-sm) 0;
  position: relative;
  transition: color var(--transition-base);
}

.navbar-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-red);
  transition: width var(--transition-base);
}

.navbar-link:hover,
.navbar-link.active {
  color: var(--silver-100);
}

.navbar-link:hover::after,
.navbar-link.active::after {
  width: 100%;
}

.navbar-link.active::after {
  box-shadow: 0 0 10px var(--accent-red);
}

/* Mobile Menu Toggle (hamburger). Three bars that animate into an X
   when the menu is open. Always rendered, only visible below 768px
   via the media query. The .active class is set by main.js when the
   overlay is open. */
.navbar-toggle {
  display: none;
  position: relative;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  color: var(--text-primary);
  transition: opacity var(--transition-base);
}

.navbar-toggle:hover {
  opacity: 0.7;
}

.navbar-toggle:focus-visible {
  outline: 2px solid var(--accent-red);
  outline-offset: 2px;
}

.navbar-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform var(--transition-base), opacity var(--transition-base);
  transform-origin: center;
}

/* When menu is open, the three bars become an X.
   Middle bar fades out, outer bars rotate to form the X. */
.navbar-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.navbar-toggle.active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.navbar-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Menu Overlay (fullscreen).
   The .navbar-nav becomes a fixed fullscreen overlay on mobile, hiding
   the desktop inline nav. Items stagger-in on open. The overlay uses the
   same warm cream / dark surface tokens as the page so the menu feels
   integrated, not jarring. */
@media (max-width: 768px) {
  .navbar-toggle {
    display: flex;
    z-index: calc(var(--z-modal) + 2); /* Stay above the overlay so the X is clickable */
  }

  .navbar-nav {
    position: fixed;
    inset: 0;
    /* Belt-and-suspenders: even with position:fixed + top/bottom:0,
       some browsers (older WebKit) refuse to stretch a flex container
       that has flex-direction:column and treats the height as content-
       sized. Explicit height:100vh (and a min-height fallback) forces
       the overlay to fill the viewport on every mobile browser. */
    width: 100vw;
    height: 100vh;
    height: 100dvh; /* dynamic viewport height on mobile - excludes URL bar */
    min-height: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Soft gradient background so the menu has some depth, not a flat fill. */
    background:
      radial-gradient(ellipse at top, var(--surface) 0%, var(--bg-base) 70%),
      var(--bg-base);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-slow), visibility var(--transition-slow);
    z-index: var(--z-modal);
    padding: 96px var(--space-lg) var(--space-xl);
    gap: var(--space-md);
    list-style: none;
  }

  .navbar-nav.open {
    opacity: 1;
    visibility: visible;
  }

  /* Each <li> fades and slides up in sequence when the menu opens. */
  .navbar-nav > li {
    width: 100%;
    text-align: center;
    margin: 0;
    padding: 0;
    border: 0;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.4s ease, transform 0.4s ease;
  }

  .navbar-nav.open > li {
    opacity: 1;
    transform: translateY(0);
  }

  /* Stagger delays for the 5 children. */
  .navbar-nav.open > li:nth-child(1) { transition-delay: 0.05s; }
  .navbar-nav.open > li:nth-child(2) { transition-delay: 0.10s; }
  .navbar-nav.open > li:nth-child(3) { transition-delay: 0.15s; }
  .navbar-nav.open > li:nth-child(4) { transition-delay: 0.20s; }
  .navbar-nav.open > li:nth-child(5) { transition-delay: 0.25s; }

  /* Big nav link typography. Active link shows in red with a small dot
     on the left so the current page is obvious at a glance. */
  .navbar-nav .navbar-link {
    display: inline-block;
    font-size: clamp(1.75rem, 7vw, 2.25rem);
    font-weight: 600;
    color: var(--text-secondary);
    padding: var(--space-sm) var(--space-lg);
    margin: 0;
    letter-spacing: -0.015em;
    transition: color var(--transition-base), transform var(--transition-base);
    position: relative;
  }

  .navbar-nav .navbar-link::after {
    display: none;
  }

  .navbar-nav .navbar-link:hover,
  .navbar-nav .navbar-link.active {
    color: var(--accent-text);
  }

  /* Active link gets a small red dot on the left so the current page
     is obvious at a glance. Position absolute relative to the inline-block
     link, so it sits at the same vertical center as the text. */
  .navbar-nav .navbar-link.active::before {
    content: "";
    position: absolute;
    left: -18px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-red);
    box-shadow: 0 0 10px var(--accent-red-glow);
  }

  /* Theme toggle and lang switcher sit at the bottom of the overlay,
     stacked. Strip the desktop border + padding so they fit centered. */
  .navbar-nav .navbar-theme {
    position: relative;
    margin: var(--space-lg) 0 0;
    padding: 0;
    border: 0;
    display: flex;
    justify-content: center;
  }

  .navbar-nav .navbar-lang {
    position: relative;
    margin: var(--space-md) 0 0;
    padding: 0;
    border: 0;
    display: flex;
    justify-content: center;
  }

  .navbar-nav .navbar-lang .navbar-lang-sep {
    opacity: 0.3;
  }
}

/* Backdrop dim layer that sits behind the overlay. */
.mobile-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--mobile-overlay-bg);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-slow), visibility var(--transition-slow);
  z-index: var(--z-modal - 1);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.mobile-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* When the overlay is open, the navbar should stay visible but feel
   like a quiet bar above the menu, not a separate competing element.
   Reduce the scrolled state elevation while open. */
.navbar.menu-open {
  background: transparent;
  border-bottom-color: transparent;
  box-shadow: none;
}

@media (max-width: 768px) {
  .navbar.menu-open {
    background: transparent;
  }
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  padding: var(--space-md) var(--space-xl);
  border-radius: var(--border-radius-md);
  border: none;
  cursor: pointer;
  transition: color var(--transition-base), background-color var(--transition-base), border-color var(--transition-base), transform var(--transition-base);
  position: relative;
  overflow: hidden;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Primary Button - high-contrast neutral solid. Red is demoted to
   state-color only (live dot, focus ring, Argentum link) - the
   primary CTA should be calm and confident, not a 2018 call-to-action. */
.btn-primary {
  background: var(--text-primary);
  color: var(--bg-base);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, var(--shadow-md);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, var(--shadow-lg);
  color: var(--bg-base);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

/* Secondary Button */
.btn-secondary {
  background: transparent;
  color: var(--silver-200);
  border: 1px solid var(--border-light);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--surface);
  border-color: var(--silver-400);
  color: var(--silver-100);
}

/* Ghost Button */
.btn-ghost {
  background: transparent;
  color: var(--silver-300);
  padding: var(--space-sm) var(--space-md);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--surface);
  color: var(--silver-100);
}

/* Icon Button */
.btn-icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: var(--border-radius-sm);
}

.btn-icon svg {
  width: 20px;
  height: 20px;
}

/* Button Sizes */
.btn-sm {
  font-size: 0.85rem;
  padding: var(--space-sm) var(--space-md);
}

.btn-lg {
  font-size: 1.1rem;
  padding: var(--space-lg) var(--space-2xl);
}

/* ===== Cards ===== */
.card {
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-lg);
  padding: var(--space-xl);
  transition: border-color var(--transition-base), background-color var(--transition-base), transform var(--transition-base);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--silver-400), transparent);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.card:hover {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-card);
  transform: translateY(-4px);
}

.card:hover::before {
  opacity: 1;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.card-title {
  font-size: 1.25rem;
  margin-bottom: var(--space-xs);
}

.card-subtitle {
  font-size: 0.875rem;
  color: var(--silver-400);
}

.card-body {
  color: var(--silver-300);
}

.card-footer {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border);
}

/* Glass Card */
.card-glass {
  background: var(--surface-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* ===== Social Icons ===== */
.social-icons {
  display: flex;
  gap: var(--space-md);
}

.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--border-radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--silver-300);
  transition: color var(--transition-base), border-color var(--transition-base);
}

.social-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.social-icon:hover {
  color: var(--accent-text);
  border-color: var(--border-glow);
  box-shadow: 0 0 20px var(--accent-red-glow);
  transform: translateY(-2px);
}

.social-icon:active {
  transform: scale(0.95);
}

/* ===== Badges & Tags ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: var(--space-xs) var(--space-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-sm);
  color: var(--silver-300);
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.badge-red {
  background: var(--accent-red-subtle);
  border-color: var(--border-glow);
  color: var(--accent-text);
}

.tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.8rem;
  padding: var(--space-xs) var(--space-sm);
  background: transparent;
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius-sm);
  color: var(--silver-300);
  transition: color var(--transition-base), background-color var(--transition-base), border-color var(--transition-base);
}

.tag:hover {
  background: var(--surface);
  border-color: var(--silver-400);
  color: var(--silver-100);
}

/* ===== Form Elements ===== */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--silver-200);
  margin-bottom: var(--space-sm);
}

.form-input,
.form-textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--silver-100);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-md);
  padding: var(--space-md);
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent-red);
  box-shadow: 0 0 0 3px var(--accent-red-subtle);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--silver-500);
}

.form-textarea {
  min-height: 150px;
  resize: vertical;
}

.form-input.error,
.form-textarea.error {
  border-color: var(--accent-red);
}

.form-error {
  display: block;
  font-size: 0.8rem;
  color: var(--accent-text);
  margin-top: var(--space-xs);
}

/* ===== Section Headers ===== */
.section-header {
  text-align: center;
  margin-bottom: var(--space-3xl);
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-text);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-md);
}

.section-label::before,
.section-label::after {
  content: '';
  width: 20px;
  height: 1px;
  background: var(--accent-red);
}

.section-title {
  margin-bottom: var(--space-md);
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--silver-400);
  max-width: 600px;
  margin: 0 auto;
}

/* ===== Decorative Elements ===== */
.gradient-text {
  background: linear-gradient(135deg, var(--silver-100) 0%, var(--silver-300) 50%, var(--silver-100) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-shift 4s ease infinite;
}

.glow-text {
  text-shadow: 0 0 30px var(--accent-red-glow), 0 0 60px var(--accent-red-subtle);
}

.glow-border {
  position: relative;
}

.glow-border::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: var(--gradient-red);
  opacity: 0;
  z-index: -1;
  transition: opacity var(--transition-base);
  filter: blur(10px);
}

.glow-border:hover::after {
  opacity: 0.5;
}

/* Decorative Line */
.deco-line {
  width: 60px;
  height: 2px;
  background: var(--gradient-red);
  border-radius: 1px;
}

/* Decorative Orb - kept as a no-op for backwards compat. The previous
   red/silver glow orbs added visual clutter to the hero without helping
   comprehension, so they were removed. If a future redesign wants a
   decorative element, define it here with intent rather than reusing
   this class. */
.orb {
  display: none;
}

.orb-red,
.orb-silver {
  display: none;
}

/* ===== Stats ===== */
.stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: var(--space-md) var(--space-sm);
}

.stat-value {
  font-family: var(--font-heading);
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--silver-100);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

.stat-value-accent {
  color: var(--accent-text);
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--silver-500);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

/* ===== Hero Elements ===== */
.hero-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
  gap: var(--space-sm);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: var(--space-sm) var(--space-md);
  background: var(--accent-red-subtle);
  border: 1px solid var(--border-glow);
  border-radius: 100px;
  color: var(--accent-text);
  margin-bottom: var(--space-3xl);
}

.hero-badge-dot {
  width: 6px;
  height: 6px;
  background: var(--accent-red);
  border-radius: 50%;
  animation: pulse-glow 2s ease-in-out infinite;
}

/* ===== Footer ===== */
.footer {
  padding: var(--space-3xl) 0 var(--space-xl);
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
  text-align: center;
}

.footer-logo {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--silver-100);
}

.footer-tagline {
  font-size: 0.9rem;
  color: var(--silver-400);
  font-style: italic;
}

.footer-links {
  display: flex;
  gap: var(--space-xl);
  list-style: none;
}

.footer-link {
  font-size: 0.875rem;
  color: var(--silver-400);
}

.footer-link:hover {
  color: var(--silver-100);
}

.footer-copyright {
  font-size: 0.8rem;
  color: var(--silver-400);
}

/* "Built with NexusLite" credit. Lives just above the copyright
   line on every page footer. Clicking it goes to the /nexuslite/
   showcase so visitors can see the proof rather than just the
   claim. */
.footer-credit {
  font-size: 0.8rem;
  color: var(--silver-400);
  margin: 0;
}
.footer-credit-link {
  color: var(--silver-200);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color var(--transition-base), border-color var(--transition-base);
}
.footer-credit-link:hover {
  color: var(--accent-text);
  border-bottom-color: var(--accent-red);
}

/* ===== Divider ===== */
.divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: var(--space-2xl) 0;
}

/* ===== Avatar ===== */
.avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--gradient-silver);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: var(--bg-primary);
  border: 3px solid var(--border);
}

.avatar-lg {
  width: 120px;
  height: 120px;
  font-size: 3rem;
}

.avatar-xl {
  width: 160px;
  height: 160px;
  font-size: 4rem;
}

/* ===== Skill Badge ===== */
.skill-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-md);
  font-size: 0.875rem;
  color: var(--silver-200);
  transition: color var(--transition-base), border-color var(--transition-base);
}

.skill-badge:hover {
  border-color: var(--accent-red);
  color: var(--silver-100);
}

.skill-badge-icon {
  font-size: 1.1em;
}

/* ===== Language Dot ===== */
.lang-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

/* Language colors */
.lang-javascript { background: #f7df1e; }
.lang-typescript { background: #3178c6; }
.lang-python { background: #3572a5; }
.lang-rust { background: #dea584; }
.lang-go { background: #00add8; }
.lang-java { background: #b07219; }
.lang-cpp { background: #f34b7d; }
.lang-html { background: #e34c26; }
.lang-css { background: #563d7c; }
.lang-shell { background: #89e051; }
.lang-default { background: var(--silver-400); }

/* ===== Tooltip ===== */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  padding: var(--space-sm) var(--space-md);
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-sm);
  font-size: 0.8rem;
  color: var(--silver-200);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-fast), visibility var(--transition-fast), transform var(--transition-fast);
  z-index: var(--z-tooltip);
}

[data-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-4px);
}

/* ===== Loading Spinner ===== */
.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--accent-red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== Toast / Alert ===== */
.alert {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--border-radius-md);
  border: 1px solid;
  font-size: 0.9rem;
}

.alert-success {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.3);
  color: #22c55e;
}

.alert-error {
  background: var(--accent-red-subtle);
  border-color: var(--border-glow);
  color: var(--accent-text);
}

.alert-info {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
  color: #3b82f6;
}

/* ===== Language Colors Map (for JS) ===== */
/* These are used in JS to set dynamic colors */
:root {
  --lang-js-color: #f7df1e;
  --lang-ts-color: #3178c6;
  --lang-py-color: #3572a5;
  --lang-rs-color: #dea584;
  --lang-go-color: #00add8;
  --lang-java-color: #b07219;
  --lang-cpp-color: #f34b7d;
  --lang-html-color: #e34c26;
  --lang-css-color: #563d7c;
  --lang-sh-color: #89e051;
}
