/* ==========================================================================
   NORM.MOV — ULTRA-ADAPTIVE CYBER-NOIR DESIGN SYSTEM
   ========================================================================== */

:root {
  /* Color Palette */
  --bg-dark: #07080a;
  --bg-card: rgba(18, 20, 26, 0.75);
  --bg-card-hover: rgba(26, 30, 40, 0.9);
  
  --accent-lime: #ccff00;
  --accent-cyan: #00f0ff;
  --accent-magenta: #ff0055;
  --accent-purple: #7928ca;
  --accent-rec-red: #ff2a2a; /* REC recording red accent */

  --text-main: #f0f2f5;
  --text-muted: #8a919e;
  --text-dim: #545b66;

  --border-light: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(255, 42, 42, 0.4);

  /* Fonts */
  --font-heading: 'Syne', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Fluid Responsive Sizing - optimized so HOLOSHCHAPOV always fits across all viewports */
  --fs-hero-title: clamp(1.4rem, 5.2vw, 3.8rem);
  --fs-hero-sub: clamp(0.8rem, 2.8vw, 1.3rem);
  --fs-section-title: clamp(1.5rem, 5vw, 3rem);
  --fs-card-title: clamp(1.05rem, 3.5vw, 1.5rem);
  --fs-body: clamp(0.9rem, 2.5vw, 1.12rem);

  /* Safe Area & Container Spacing */
  --spacing-container-padding: clamp(1rem, 4vw, 4rem);
  --spacing-section-py: clamp(3.5rem, 8vw, 7.5rem);

  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Rule for preventing surname breaks while dynamically sizing */
.nobrak {
  white-space: nowrap;
  display: inline-block;
  font-size: 0.92em;
}

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

html {
  scroll-behavior: smooth;
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-body);
  overflow-x: hidden;
  width: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  position: relative;
  min-height: 100dvh;
  width: 100%;
  cursor: default;
  overflow-x: hidden;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Canvas Background & Noise */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100dvh;
  z-index: -2;
  pointer-events: none;
}

.noise-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100dvh;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.035'/%3E%3C/svg%3E");
  z-index: -1;
  pointer-events: none;
}

/* Custom REC Red Liquid Cursor (Desktop Only) */
@media (hover: hover) and (pointer: fine) {
  .custom-cursor {
    position: fixed;
    width: 10px;
    height: 10px;
    background: var(--accent-rec-red);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: width 0.2s, height 0.2s, background-color 0.2s, box-shadow 0.2s;
    box-shadow: 0 0 12px var(--accent-rec-red), 0 0 4px #ff0000;
  }

  .custom-cursor-follower {
    position: fixed;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 42, 42, 0.5);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    transition: transform 0.15s ease-out, width 0.2s, height 0.2s, border-color 0.2s;
  }

  body.hovered .custom-cursor {
    width: 16px;
    height: 16px;
    background: #ff0000;
    box-shadow: 0 0 20px #ff0000, 0 0 8px #ff4444;
  }

  body.hovered .custom-cursor-follower {
    width: 50px;
    height: 50px;
    border-color: rgba(255, 0, 0, 0.8);
    background: rgba(255, 0, 0, 0.05);
  }
}

@media (hover: none), (pointer: coarse) {
  .custom-cursor, .custom-cursor-follower {
    display: none !important;
  }
}

/* Header & Nav */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: clamp(0.8rem, 2vw, 1.2rem) var(--spacing-container-padding);
  padding-top: max(clamp(0.8rem, 2vw, 1.2rem), env(safe-area-inset-top));
  z-index: 1000;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(7, 8, 10, 0.85);
  border-bottom: 1px solid var(--border-light);
  transition: var(--transition-smooth);
}

.header-container {
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-logo {
  font-family: var(--font-heading);
  font-size: clamp(1.15rem, 4vw, 1.6rem);
  font-weight: 800;
  color: var(--text-main);
  text-decoration: none;
  letter-spacing: -0.5px;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.logo-accent {
  color: var(--accent-lime);
  text-shadow: 0 0 12px rgba(204, 255, 0, 0.4);
}

.status-dot {
  width: 7px;
  height: 7px;
  background-color: var(--accent-lime);
  border-radius: 50%;
  display: inline-block;
  margin: 0 2px;
}

.logo-dot {
  margin-top: 4px;
}

.pulse {
  animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
  0% { box-shadow: 0 0 0 0 rgba(204, 255, 0, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(204, 255, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(204, 255, 0, 0); }
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.5vw, 2.5rem);
}

.nav-link {
  font-family: var(--font-mono);
  font-size: clamp(0.75rem, 0.9vw, 0.85rem);
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.5px;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--accent-lime);
  text-shadow: 0 0 8px rgba(204, 255, 0, 0.3);
}

/* Mobile Toggle & Drawer */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  padding: 0.5rem;
  -webkit-tap-highlight-color: transparent;
}

.mobile-toggle i {
  width: 26px;
  height: 26px;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  right: -100%;
  width: 88vw;
  max-width: 380px;
  height: 100dvh;
  background: rgba(7, 8, 10, 0.98);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2.2rem;
  border-left: 1px solid var(--border-light);
  padding: 2rem 1.5rem;
  padding-bottom: max(2rem, env(safe-area-inset-bottom));
  transition: right 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-drawer.open {
  right: 0;
}

.close-drawer {
  position: absolute;
  top: max(1.5rem, env(safe-area-inset-top));
  right: 1.5rem;
  background: none;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  padding: 0.5rem;
  -webkit-tap-highlight-color: transparent;
}

.close-drawer i {
  width: 28px;
  height: 28px;
}

.drawer-link {
  font-family: var(--font-heading);
  font-size: clamp(1.25rem, 5vw, 1.5rem);
  color: var(--text-main);
  text-decoration: none;
  letter-spacing: 1px;
}

/* Buttons & Copy Success Animation */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.85rem 1.6rem;
  font-family: var(--font-mono);
  font-size: clamp(0.75rem, 0.85vw, 0.85rem);
  font-weight: 700;
  text-decoration: none;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition-smooth);
  border: none;
  white-space: nowrap;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}

.btn i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.btn span {
  display: inline-block;
  line-height: 1;
}

.btn-large {
  padding: 1.1rem 2rem;
  font-size: clamp(0.85rem, 1vw, 1rem);
}

.btn-primary {
  background: var(--accent-lime);
  color: #000;
  box-shadow: 0 0 20px rgba(204, 255, 0, 0.3);
}

.btn-primary:hover, .btn-primary:active {
  background: #d8ff33;
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(204, 255, 0, 0.6);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  border: 1px solid var(--border-light);
}

.btn-secondary:hover, .btn-secondary:active {
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--text-muted);
  transform: translateY(-2px);
}

/* Animated Copy State */
.copy-btn.copied {
  background: var(--accent-cyan) !important;
  color: #000 !important;
  border-color: var(--accent-cyan) !important;
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.6) !important;
  animation: copyPulse 0.4s ease-out;
}

@keyframes copyPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.btn-glow {
  border: 1px solid var(--accent-lime);
  color: var(--accent-lime);
  padding: 0.5rem 1.2rem;
}

.btn-glow:hover {
  background: var(--accent-lime);
  color: #000;
}

/* Hero Section */
.hero-clean {
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(6.5rem, 14vw, 11rem) var(--spacing-container-padding) clamp(3.5rem, 6vw, 6rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  min-height: clamp(550px, 75dvh, 900px);
}

.hero-tag {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
}

.badge {
  font-family: var(--font-mono);
  font-size: clamp(0.65rem, 2.2vw, 0.78rem);
  padding: 0.35rem 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  border-radius: 30px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.neon-badge {
  border-color: rgba(0, 240, 255, 0.4);
  color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.08);
}

.icon-sm {
  width: 13px;
  height: 13px;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: var(--fs-hero-title);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -1px;
  margin-bottom: 1.2rem;
  background: linear-gradient(135deg, #ffffff 40%, var(--text-muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  max-width: 100%;
}

.title-sub {
  display: block;
  font-size: var(--fs-hero-sub);
  letter-spacing: 0.5px;
  margin-top: 0.5rem;
  color: var(--accent-lime);
  -webkit-text-fill-color: var(--accent-lime);
  text-shadow: 0 0 15px rgba(204, 255, 0, 0.3);
}

.hero-description {
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 2rem;
  max-width: 750px;
}

.hero-actions {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  width: 100%;
}

/* Global Section Styling */
.section {
  max-width: 1600px;
  margin: 0 auto;
  padding: var(--spacing-section-py) var(--spacing-container-padding);
}

.section-header {
  margin-bottom: clamp(2rem, 4vw, 3.5rem);
}

.section-tag {
  font-family: var(--font-mono);
  font-size: clamp(0.7rem, 2.2vw, 0.85rem);
  color: var(--accent-lime);
  letter-spacing: 1px;
  margin-bottom: 0.4rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: var(--fs-section-title);
  font-weight: 800;
  letter-spacing: -0.5px;
}

.section-title-compact {
  font-size: clamp(1.25rem, 3.2vw, 2.2rem);
  line-height: 1.25;
}

/* Works Section */
.filter-bar {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.filter-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  padding: 0.55rem 1rem;
  font-family: var(--font-mono);
  font-size: clamp(0.68rem, 2vw, 0.8rem);
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.filter-btn:hover, .filter-btn.active {
  background: var(--accent-lime);
  color: #000;
  border-color: var(--accent-lime);
  font-weight: 700;
}

.works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr));
  gap: clamp(1.2rem, 3vw, 2.5rem);
}

.work-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  overflow: hidden;
  transition: var(--transition-smooth);
}

.work-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
}

.card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.work-card:hover .card-media img {
  transform: scale(1.06);
}

.card-tag {
  position: absolute;
  top: 0.8rem;
  left: 0.8rem;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-light);
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-size: clamp(0.6rem, 1.8vw, 0.7rem);
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
}

.card-hover-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: var(--transition-fast);
}

.work-card:hover .card-hover-overlay {
  opacity: 1;
}

.hover-btn {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: #000;
  background: var(--accent-lime);
  padding: 0.65rem 1.2rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.card-info {
  padding: clamp(1.2rem, 3vw, 1.8rem);
}

.card-info h3 {
  font-family: var(--font-heading);
  font-size: var(--fs-card-title);
  margin-bottom: 0.5rem;
}

.card-info p {
  color: var(--text-muted);
  font-size: clamp(0.85rem, 2.2vw, 0.95rem);
  line-height: 1.5;
  margin-bottom: 1rem;
}

.tech-tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.tech-tags span {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.04);
  padding: 0.2rem 0.55rem;
  border-radius: 3px;
}

/* Services Section */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr));
  gap: clamp(1.2rem, 2.5vw, 2rem);
}

.service-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: clamp(1.4rem, 3vw, 2.2rem);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: var(--transition-smooth);
}

.service-card:hover {
  border-color: var(--accent-cyan);
  transform: translateY(-4px);
  background: var(--bg-card-hover);
}

.service-icon {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid rgba(0, 240, 255, 0.3);
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--accent-cyan);
  margin-bottom: 1.2rem;
}

.service-card h3 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  margin-bottom: 0.8rem;
}

.service-card p {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.55;
  margin-bottom: 1.2rem;
}

.service-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.service-list li {
  font-size: 0.82rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.service-list li i {
  width: 13px;
  height: 13px;
  color: var(--accent-lime);
  flex-shrink: 0;
}

/* About Section */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

.lead-text {
  font-size: clamp(1.05rem, 3vw, 1.28rem);
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.body-text {
  color: var(--text-muted);
  font-size: var(--fs-body);
  line-height: 1.65;
  margin-bottom: 1.2rem;
}

.software-arsenal {
  margin-top: 1.8rem;
}

.software-arsenal h4 {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent-lime);
  margin-bottom: 0.8rem;
  letter-spacing: 1px;
}

.tool-badges {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.tool-badge {
  font-family: var(--font-mono);
  font-size: clamp(0.72rem, 2vw, 0.82rem);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-light);
  padding: 0.45rem 0.8rem;
  border-radius: 4px;
  transition: var(--transition-fast);
}

.tool-badge:hover {
  border-color: var(--accent-lime);
  color: var(--accent-lime);
}

/* Clean Avatar Portrait Styling */
.avatar-portrait-wrapper {
  position: relative;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

.avatar-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 4/5;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border-light);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  background: var(--bg-card);
  transition: var(--transition-smooth);
}

.avatar-frame:hover {
  border-color: var(--border-glow);
  box-shadow: 0 25px 60px rgba(255, 42, 42, 0.2);
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  filter: contrast(1.05) brightness(0.95);
  transition: transform 0.6s ease;
}

.avatar-frame:hover .avatar-img {
  transform: scale(1.04);
}

.avatar-overlay-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 65%, rgba(7, 8, 10, 0.6) 100%);
  pointer-events: none;
}

/* Contact Section & Direct Contact Actions */
.contact-box {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: clamp(1.6rem, 4vw, 3.5rem);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.contact-header {
  text-align: center;
  max-width: 650px;
  margin: 0 auto 2.5rem;
}

.contact-header h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.45rem, 3.5vw, 2.2rem);
  margin-bottom: 0.6rem;
}

.contact-header p {
  color: var(--text-muted);
  font-size: var(--fs-body);
}

.direct-contact-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.2rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.social-links-bar {
  display: flex;
  justify-content: center;
  gap: clamp(1rem, 3vw, 2.2rem);
  padding-top: 1.8rem;
  border-top: 1px solid var(--border-light);
  flex-wrap: wrap;
}

.social-link {
  font-family: var(--font-mono);
  font-size: clamp(0.72rem, 2vw, 0.82rem);
  color: var(--text-muted);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition-fast);
}

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

/* Footer */
.footer {
  padding: 2.5rem var(--spacing-container-padding);
  padding-bottom: max(2.5rem, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border-light);
  text-align: center;
}

.footer-container p {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-bottom: 0.3rem;
}

/* Target Breakpoints with Surname Fitting Protection */
@media (max-width: 1200px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
}

@media (max-width: 768px) {
  .nav-menu {
    display: none;
  }

  .mobile-toggle {
    display: block;
  }

  .hero-clean {
    padding-top: clamp(6rem, 15vh, 7.5rem);
    padding-bottom: clamp(3rem, 8vh, 4.5rem);
    min-height: auto;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
  }

  .hero-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .direct-contact-actions {
    flex-direction: column;
    width: 100%;
  }

  .direct-contact-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .filter-bar {
    overflow-x: auto;
    padding-bottom: 0.5rem;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .filter-btn {
    white-space: nowrap;
    flex-shrink: 0;
  }

  .contact-box {
    padding: 1.5rem 1rem;
  }
}

@media (max-width: 480px) {
  :root {
    --fs-hero-title: clamp(1.35rem, 6.2vw, 2.2rem);
  }

  .nobrak {
    font-size: 0.88em;
  }
}

@media (max-width: 360px) {
  :root {
    --fs-hero-title: 1.3rem;
  }
  .nobrak {
    font-size: 0.85em;
  }
}
