/* ==========================================================================
   RENOCEROS PORTFOLIO — style.css
   Author: Moreno Kristovan (Renoceros)
   Philosophy: "Crafting systems, tools, and tactile experiences."
   Architecture: Apple HIG Minimalist Native Glass & 2-Layer Noise Engine
   ========================================================================== */

:root {
  /* THEME: Light Mode */
  --bg-color: #f8f9fa;
  --text-color: #1d1d1f;
  --text-muted: #55555c; /* WCAG 2.1 AA Compliant: High Contrast */
  --nav-bg: rgba(248, 249, 250, 0.85);
  --accent-color: #22461E; /* Tactical Rhino Green */
  --accent-light: #22461E; /* WCAG 2.1 AAA Compliant on Light: 8.8:1 contrast */
  --accent-glow: rgba(34, 70, 30, 0.22);
  --badge-bg: #e5e5ea;
  --badge-text: #1d1d1f;
  --card-bg: rgba(255, 255, 255, 0.75);
  --card-border: rgba(0, 0, 0, 0.08);
  --terminal-bg: #1c1d22;
  --terminal-text: #f0f0f5;
  --img-opacity: 0.95;

  /* Bootstrap Variable Sync */
  --bs-body-bg: var(--bg-color);
  --bs-body-color: var(--text-color);

  /* Glass Tokens */
  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-border: rgba(255, 255, 255, 0.8);
}

[data-theme="dark"] {
  /* THEME: Dark Mode */
  --bg-color: #0c0d10;
  --text-color: #f5f5f7;
  --text-muted: #a1a1a6; /* WCAG 2.1 AA Compliant: 6.2:1 High Contrast */
  --nav-bg: rgba(12, 13, 16, 0.85);
  --accent-color: #22461E; /* Tactical Rhino Green */
  --accent-light: #4ea844; /* Calibrated Harmonic Luminous Tint of #22461E for Dark Mode */
  --accent-glow: rgba(34, 70, 30, 0.45);
  --badge-bg: #1c1e24;
  --badge-text: #e6edf3;
  --card-bg: rgba(20, 23, 30, 0.75);
  --card-border: rgba(255, 255, 255, 0.09);
  --terminal-bg: #0a0b0e;
  --terminal-text: #e6edf3;
  --img-opacity: 0.92;

  /* Bootstrap Variable Sync */
  --bs-body-bg: var(--bg-color);
  --bs-body-color: var(--text-color);

  /* Glass Tokens */
  --glass-bg: rgba(22, 25, 34, 0.6);
  --glass-border: rgba(255, 255, 255, 0.12);
}

/* Base Document Setup */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--bg-color);
  color: var(--text-color);
  overflow-x: hidden;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-color) !important;
  color: var(--text-color) !important;
  line-height: 1.6;
  letter-spacing: -0.012em;
  transition: background-color 0.5s cubic-bezier(0.25, 1, 0.5, 1),
              color 0.5s cubic-bezier(0.25, 1, 0.5, 1);
  position: relative;
  overflow-x: hidden;
}

/* Typography Helpers */
.font-mono {
  font-family: "SF Mono", "JetBrains Mono", Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.tracking-tight {
  letter-spacing: -0.035em;
}

.text-muted {
  color: var(--text-muted) !important;
}

/* Material Symbols Integration */
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  vertical-align: middle;
}

/* Top Navigation Bar */
.navbar {
  background-color: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--card-border);
  transition: background-color 0.5s cubic-bezier(0.25, 1, 0.5, 1),
              border-color 0.5s ease;
  z-index: 1030;
  position: relative;
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--text-color) !important;
}

.navbar-brand span {
  color: var(--accent-light);
}

.nav-link {
  color: var(--text-muted) !important;
  font-weight: 500;
  font-size: 0.92rem;
  transition: color 0.2s ease;
  padding: 0.5rem 0.85rem !important;
}

.nav-link:hover {
  color: var(--text-color) !important;
}

/* Theme Toggle Button (Google Material Symbols) */
.theme-btn {
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 999px;
  background-color: var(--badge-bg);
  color: var(--text-color);
  border: 1px solid var(--card-border);
  transition: transform 0.2s ease, background-color 0.3s ease;
  user-select: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.theme-btn:hover {
  transform: scale(1.06);
}

.theme-btn .icon {
  font-size: 18px;
  color: var(--text-color);
}

/* Hero Section */
.hero-section {
  min-height: 85vh;
  padding-top: 130px;
  padding-bottom: 70px;
  position: relative;
}

/* Strict Logo Floater Constraints */
.logo-floater {
  display: inline-block;
  width: 130px;
  max-width: 130px;
  height: auto;
  margin: 0 auto;
  animation: floatLogo 6s ease-in-out infinite;
}

.hero-logo {
  width: 130px !important;
  max-width: 130px !important;
  height: auto !important;
  aspect-ratio: 331.427 / 777.693;
  display: block !important;
  margin: 0 auto !important;
  transition: transform 0.12s ease-out;
  cursor: pointer;
  user-select: none;
}

@keyframes floatLogo {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-12px); }
  100% { transform: translateY(0px); }
}

.moniker-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-light);
  margin-bottom: 1.25rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.hero-title {
  font-size: clamp(2.8rem, 6vw, 4.8rem);
  font-weight: 800;
  line-height: 1.08;
  margin-bottom: 0.5rem;
}

.hero-subtitle {
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  font-weight: 400;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
}

.hero-description {
  max-width: 50%;
  margin: 0 auto 2.25rem auto;
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* Buttons */
.btn-primary-custom {
  background-color: var(--accent-color);
  color: #ffffff !important;
  border: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.75rem 1.75rem;
  border-radius: 999px;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.btn-primary-custom:hover {
  background-color: var(--accent-light);
  color: #ffffff !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--accent-glow);
}

.btn-secondary-custom {
  background-color: var(--card-bg);
  color: var(--text-color) !important;
  border: 1px solid var(--card-border);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.75rem 1.75rem;
  border-radius: 999px;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.btn-secondary-custom:hover {
  background-color: var(--badge-bg);
  transform: translateY(-2px);
}

/* Glass Section Container */
.glass-node {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
  transition: background-color 0.5s ease, border-color 0.5s ease;
}

/* Section Header Primitives */
.section-header {
  margin-bottom: 3.5rem;
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-light);
  margin-bottom: 0.5rem;
}

.section-label .material-symbols-outlined {
  font-size: 16px;
}

.section-heading {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-color);
}

.section-divider {
  width: 50px;
  height: 3px;
  background-color: var(--accent-color);
  border-radius: 2px;
  margin: 1rem auto 0 auto;
}

/* Project Rows */
.project-row {
  margin-bottom: 85px;
  position: relative;
}

.project-row:last-child {
  margin-bottom: 0;
}

.project-title {
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
  color: var(--text-color);
}

.project-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 1.5rem;
}

.badge-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 1rem;
}

.tech-badge {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 6px;
  background-color: var(--badge-bg);
  color: var(--badge-text);
  border: 1px solid var(--card-border);
}

/* Image Wrapper with YOLO Corner Brackets & Embedded Project Carousel */
.img-wrapper {
  overflow: hidden;
  border-radius: 16px;
  position: relative;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.16);
  border: 1px solid var(--card-border);
  background-color: #0d1117;
  aspect-ratio: 16 / 10;
}

.img-wrapper .carousel,
.img-wrapper .carousel-inner,
.img-wrapper .carousel-item {
  width: 100%;
  height: 100%;
}

.img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: var(--img-opacity);
  filter: grayscale(0.15);
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1),
              filter 0.4s ease,
              opacity 0.4s ease;
}

.img-wrapper:hover img {
  transform: scale(1.025);
  filter: grayscale(0);
  opacity: 1;
}

/* YOLO Target Bounding Box Corners */
.img-wrapper::before,
.img-wrapper::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  border: 2px solid var(--accent-light);
  transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  opacity: 0;
  z-index: 15;
  pointer-events: none;
}

.img-wrapper::before {
  top: 14px;
  left: 14px;
  border-right: 0;
  border-bottom: 0;
}

.img-wrapper::after {
  bottom: 14px;
  right: 14px;
  border-left: 0;
  border-top: 0;
}

.img-wrapper:hover::before,
.img-wrapper:hover::after {
  opacity: 1;
  width: calc(100% - 28px);
  height: calc(100% - 28px);
}

/* YOLO Computer Vision Monospace Tag */
.cv-tag {
  position: absolute;
  top: 14px;
  left: 14px;
  background-color: var(--accent-color);
  color: #ffffff;
  font-family: "SF Mono", Menlo, Monaco, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: 4px;
  opacity: 0;
  transform: translateY(-8px);
  transition: all 0.35s cubic-bezier(0.25, 1, 0.5, 1);
  z-index: 16;
  pointer-events: none;
}

.img-wrapper:hover .cv-tag {
  opacity: 1;
  transform: translateY(0);
}

/* Slide Caption Overlay Tag inside Project Carousel */
.slide-caption-tag {
  position: absolute;
  bottom: 12px;
  left: 14px;
  font-family: "SF Mono", monospace;
  font-size: 0.7rem;
  font-weight: 600;
  background-color: rgba(10, 12, 16, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #f5f5f7;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  z-index: 14;
  pointer-events: none;
}

/* Mini Carousel Navigation Controls */
.mini-carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: rgba(12, 13, 16, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #f5f5f7;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease, background-color 0.2s ease, transform 0.2s ease;
  z-index: 15;
  cursor: pointer;
  padding: 0;
}

.img-wrapper:hover .mini-carousel-nav {
  opacity: 1;
}

.mini-carousel-nav:hover {
  background-color: rgba(12, 13, 16, 0.95);
  color: var(--accent-light);
  transform: translateY(-50%) scale(1.08);
}

.mini-prev { left: 10px; }
.mini-next { right: 10px; }

/* Subtle Indicators at bottom-right of project card */
.project-carousel-indicators {
  position: absolute;
  bottom: 12px;
  right: 14px;
  left: auto;
  margin: 0;
  display: flex;
  gap: 4px;
  z-index: 14;
}

.project-carousel-indicators [data-bs-target] {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.45);
  border: none;
  opacity: 0.6;
  transition: all 0.25s ease;
  padding: 0;
}

.project-carousel-indicators .active {
  width: 16px;
  border-radius: 8px;
  background-color: var(--accent-light);
  opacity: 1;
}

/* Action Links */
.project-links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}

.action-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-light);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  border-radius: 8px;
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  transition: all 0.2s ease;
}

.action-link:hover {
  background-color: var(--badge-bg);
  color: var(--accent-light);
  transform: translateY(-1px);
}



/* --- APPLE DEVELOPER ACADEMY SECTION --- */
.academy-stat-box {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 1rem 0.75rem;
  text-align: center;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.academy-stat-box:hover {
  transform: translateY(-2px);
  border-color: rgba(78, 168, 68, 0.4);
}

.academy-stat-box .stat-num {
  font-family: "SF Mono", monospace;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
}

.academy-stat-box .stat-lbl {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.25rem;
}

.academy-pillar-card {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 1.75rem 1.5rem;
  transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), border-color 0.3s ease, box-shadow 0.3s ease;
}

.academy-pillar-card:hover {
  transform: translateY(-4px);
  border-color: rgba(78, 168, 68, 0.4);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
}

.pillar-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background-color: var(--badge-bg);
  border: 1px solid var(--card-border);
  color: var(--accent-light);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.text-accent {
  color: var(--accent-light) !important;
}

.leading-relaxed {
  line-height: 1.65;
}

/* Engineering Invariants Cards */
.invariant-card {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 2rem;
  height: 100%;
  transition: transform 0.3s ease;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
}

.invariant-card:hover {
  transform: translateY(-3px);
}

.invariant-badge {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--accent-light);
  line-height: 1;
  margin-bottom: 1rem;
  font-family: "SF Mono", monospace;
}

/* Terminal Specification Window (No Photo) */
.terminal-window {
  background-color: var(--terminal-bg);
  color: var(--terminal-text);
  border-radius: 16px;
  border: 1px solid var(--card-border);
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  font-family: "SF Mono", Menlo, Monaco, Consolas, monospace;
}

.terminal-header {
  background-color: rgba(0, 0, 0, 0.3);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.terminal-dots {
  display: flex;
  gap: 8px;
}

.terminal-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dot-red    { background-color: #ff5f56; }
.dot-yellow { background-color: #ffbd2e; }
.dot-green  { background-color: #27c93f; }

.terminal-title {
  margin-left: auto;
  margin-right: auto;
  font-size: 0.8rem;
  color: #86868b;
  transform: translateX(-18px);
}

.terminal-body {
  padding: 1.75rem;
  font-size: 0.92rem;
  line-height: 1.75;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.terminal-prompt {
  color: var(--accent-light);
  font-weight: 700;
}

.terminal-dim {
  color: #98989d;
}

.terminal-highlight {
  color: #f5f5f7;
  font-weight: 600;
}

/* Contact Action Buttons */
.contact-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--text-color) !important;
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.contact-pill:hover {
  background-color: var(--badge-bg);
  color: var(--accent-light) !important;
  transform: translateY(-2px);
}

/* Footer */
footer {
  border-top: 1px solid var(--card-border);
  background-color: var(--nav-bg);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Scroll Entrance Animations */
.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: all 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: all 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

.reveal-bottom {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

.active {
  opacity: 1 !important;
  transform: translate(0, 0) !important;
}

/* Mobile Ergonomics & Viewport Safety */
@media (max-width: 991px) {
  .hero-section {
    padding-top: 110px;
    padding-bottom: 50px;
  }
  .hero-description {
    max-width: 85%;
  }
  .project-row {
    margin-bottom: 60px;
  }
  .img-wrapper {
    margin-top: 1.5rem;
  }
  .terminal-body {
    padding: 1.25rem;
    font-size: 0.85rem;
  }
}

@media (max-width: 575px) {
  .logo-floater {
    width: 104px;
    max-width: 104px;
  }
  .hero-logo {
    width: 104px !important;
    max-width: 104px !important;
  }
  .hero-title {
    font-size: 2.6rem;
  }
  .hero-subtitle {
    font-size: 1.35rem;
  }
  .hero-description {
    max-width: 100%;
    font-size: 1rem;
  }
  .project-title {
    font-size: 1.55rem;
  }
  .btn-primary-custom, .btn-secondary-custom {
    width: 100%;
    justify-content: center;
  }
  .contact-pill {
    width: 100%;
    justify-content: center;
  }
}

/* ==========================================================================
   PORTAL SWITCH BUTTON (IMMUNE TO TRANSITIONS & GLITCHES)
   ========================================================================== */
.portal-item {
  position: relative;
  z-index: 10005 !important;
}

.mode-btn {
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 999px;
  background-color: var(--badge-bg);
  color: var(--text-color) !important;
  border: 1px solid var(--card-border);
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1),
              background-color 0.3s ease,
              border-color 0.3s ease,
              box-shadow 0.3s ease;
  user-select: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none !important;
  position: relative;
  z-index: 10005 !important;
}

.mode-btn:hover {
  transform: scale(1.08);
  border-color: var(--accent-light);
  box-shadow: 0 0 16px var(--accent-glow);
}

.mode-btn .icon {
  font-size: 18px;
  color: var(--text-color);
  line-height: 1;
}

.mode-btn.mosh-firing {
  transform: scale(0.92);
  border-color: var(--accent-light);
  box-shadow: 0 0 20px var(--accent-glow);
}

/* Datamosh Tearing State — Everything except portal item shakes */
body.mosh-active #stage-viewport,
body.mosh-active .spatial-viewport,
body.mosh-active .navbar-brand,
body.mosh-active .nav-link,
body.mosh-active .action-link,
body.mosh-active .theme-btn {
  animation: moshTear 0.08s steps(2) infinite;
  filter: contrast(1.25) saturate(1.2);
}

@keyframes moshTear {
  0% { transform: translate3d(0, 0, 0); }
  25% { transform: translate3d(-10px, 0, 0); }
  50% { transform: translate3d(8px, 0, 0); }
  75% { transform: translate3d(-4px, 0, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

