/* ============================================================
   MARIO USHEV — DARK GOTHIC CLI REDESIGN
   Palette: bg #000000 | text #B3B99F | accent #B3B99F/40
   Fonts: DM Sans + Space Mono (unchanged)
   ============================================================ */

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

/* ---------- Custom Properties ---------- */
:root {
  --bg:          #000000;
  --surface:     #0a0a0a;
  --surface-2:   #111111;
  --border:      #1e1e1e;
  --border-mid:  #272727;
  --text:        #B3B99F;
  --text-dim:    #5a5f52;
  --text-muted:  #363b31;
  --accent:      #B3B99F;
  --accent-glow: rgba(179, 185, 159, 0.07);
  --prompt:      #4a4f44;
  --line-h:      1px solid #1a1a1a;
  --font-mono:   'Space Mono', monospace;
  --font-sans:   'DM Sans', sans-serif;
  --radius:      2px;
  --transition:  0.25s ease;
}

/* ---------- Body ---------- */
html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---------- Selection ---------- */
::selection {
  background: rgba(179, 185, 159, 0.15);
  color: var(--text);
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-mid); border-radius: 2px; }

/* ---------- Fade-out transition ---------- */
body {
  transition: opacity 0.3s ease;
}
body.fade-out {
  opacity: 0;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes scanline {
  0%   { transform: translateY(-100%); }
  100% { transform: translateY(100vh); }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

@keyframes wave {
  0%   { transform: rotate(0deg); }
  10%  { transform: rotate(14deg); }
  20%  { transform: rotate(-8deg); }
  30%  { transform: rotate(14deg); }
  40%  { transform: rotate(-4deg); }
  50%  { transform: rotate(10deg); }
  60%  { transform: rotate(0deg); }
  100% { transform: rotate(0deg); }
}

.wave-emoji {
  display: inline-block;
  animation: wave 2.5s infinite;
  transform-origin: 70% 70%;
}

/* ---------- Reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}
.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delays */
.tech-item:nth-child(1) { transition-delay: 0.08s; }
.tech-item:nth-child(2) { transition-delay: 0.16s; }
.tech-item:nth-child(3) { transition-delay: 0.24s; }
.tech-item:nth-child(4) { transition-delay: 0.32s; }
.tech-item:nth-child(5) { transition-delay: 0.40s; }
.tech-item:nth-child(6) { transition-delay: 0.48s; }

/* ============================================================
   GRID OVERLAY (decorative background grid)
   ============================================================ */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}

/* ============================================================
   HEADER
   ============================================================ */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 60px;
  height: 64px;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-mid);
}

/* Prompt symbol before logo */
.header::before {
  content: '//';
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  position: absolute;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  letter-spacing: 1px;
}

.logo {
  display: flex;
  gap: 10px;
  align-items: center;
}

.logo-img img {
  width: 36px;
  height: 50px;
  filter: brightness(0.7) contrast(1.2);
  opacity: 0.85;
}

.logo a {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
  font-weight: 400;
  letter-spacing: 0.05em;
  opacity: 0.85;
  transition: opacity var(--transition);
}
.logo a:hover { opacity: 1; }

.nav ul {
  list-style: none;
  display: flex;
  gap: 36px;
}

.nav ul li a {
  font-family: var(--font-mono);
  text-decoration: none;
  color: var(--text-dim);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  transition: color var(--transition);
  position: relative;
}

.nav ul li a::before {
  content: '~/';
  opacity: 0;
  transition: opacity var(--transition);
  margin-right: 2px;
  color: var(--text-muted);
}

.nav ul li a:hover,
.nav ul li a[style*="italic"] {
  color: var(--text);
  font-style: normal !important;
}

.nav ul li a:hover::before {
  opacity: 1;
}

/* Remove the inline italic style override cleanly */
.nav ul li a[style] {
  color: var(--text) !important;
  font-style: normal !important;
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero-section {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border-mid);
  overflow: hidden;
}

/* Vertical rule between photo and text */
.hero-section::after {
  content: '';
  position: absolute;
  left: 46%;
  top: 10%;
  bottom: 10%;
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--border-mid) 30%, var(--border-mid) 70%, transparent);
  pointer-events: none;
}

.intro {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  width: 100%;
  max-width: 1300px;
  margin: 0 auto;
  padding: 80px 60px;
  background: none;
  border: none;
  border-radius: 0;
  gap: 0;
}

.intro-content {
  display: contents;
}

/* ---------- Photo (left) ---------- */
.intro-image {
  position: relative;
  width: 100%;
  max-width: 420px;
  aspect-ratio: 3 / 4;
  border-radius: 0;
  background: transparent;
  overflow: visible;
  justify-self: center;
}

/* Corner brackets — CLI aesthetic */
.intro-image::before,
.intro-image::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  border-color: var(--border-mid);
  border-style: solid;
  pointer-events: none;
  z-index: 2;
}
.intro-image::before {
  top: -8px; left: -8px;
  border-width: 1px 0 0 1px;
}
.intro-image::after {
  bottom: -8px; right: -8px;
  border-width: 0 1px 1px 0;
}

/* Extra corner brackets via wrapper */
.intro-image-inner {
  position: relative;
  width: 100%;
  height: 100%;
}
.intro-image-inner::before,
.intro-image-inner::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  border-color: var(--border-mid);
  border-style: solid;
  pointer-events: none;
  z-index: 2;
}
.intro-image-inner::before {
  top: -8px; right: -8px;
  border-width: 1px 1px 0 0;
}
.intro-image-inner::after {
  bottom: -8px; left: -8px;
  border-width: 0 0 1px 1px;
}

.intro-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  border-radius: 0;
  filter: grayscale(100%) contrast(1.05) brightness(0.92);
  opacity: 0;
  transition: opacity 0.6s ease;
}
.intro-image img[src] {
  opacity: 1;
}

/* Photo index — CLI line number vibe */
.intro-image-label {
  position: absolute;
  bottom: -28px;
  left: 0;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

/* ---------- Text (right) ---------- */
.intro-text {
  padding-left: 60px;
  flex: unset;
  margin-right: 0;
}

/* CLI prompt prefix on heading */
.intro-text h1 {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 24px;
  position: relative;
}

.intro-text h1::before {
  content: '>';
  font-family: var(--font-mono);
  font-size: 0.55em;
  color: var(--text-muted);
  position: absolute;
  left: -28px;
  top: 8px;
}

.intro-text p {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 48px;
}

/* Stat pills */
.hero-stats {
  display: flex;
  gap: 32px;
  margin-top: 32px;
}

.hero-stat {
  border-left: 1px solid var(--border-mid);
  padding-left: 16px;
}

.hero-stat-num {
  font-family: var(--font-mono);
  font-size: 28px;
  color: var(--text);
  line-height: 1;
  margin-bottom: 4px;
}

.hero-stat-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Blinking cursor */
.cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--text-dim);
  margin-left: 4px;
  vertical-align: middle;
  animation: blink 1s step-end infinite;
}

/* ============================================================
   SECTION DIVIDER / LABEL
   ============================================================ */
.section-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 48px;
}

.section-meta-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  white-space: nowrap;
}

.section-meta-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

.section-meta-index {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

/* ============================================================
   TECHNOLOGIES SECTION
   ============================================================ */
.technologies {
  position: relative;
  z-index: 1;
  padding: 100px 60px;
  max-width: 1300px;
  margin: 0 auto;
  border-bottom: 1px solid var(--border);
}

.technologies > h2 {
  font-family: var(--font-sans);
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.technologies span {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.85em;
  opacity: 0.5;
}

.technologies > p {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 48px;
}

.tech-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.tech-item {
  display: flex;
  align-items: center;
  background: var(--bg);
  padding: 24px 20px;
  border-radius: 0;
  border: none;
  box-shadow: none;
  width: auto;
  height: auto;
  gap: 14px;
  transition: background var(--transition);
  position: relative;
  cursor: default;
}

/* Prompt line-number on left */
.tech-item::before {
  content: attr(data-index);
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-muted);
  opacity: 0.6;
}

.tech-item:hover {
  background: var(--surface);
  transform: none;
  box-shadow: none;
}

.tech-item img {
  width: 36px;
  height: 36px;
  margin-right: 0;
  border: 1px solid var(--border-mid);
  background: var(--surface-2);
  padding: 4px;
  object-fit: contain;
  border-radius: var(--radius);
  filter: grayscale(80%) brightness(0.9);
  flex-shrink: 0;
  transition: filter var(--transition);
}

.tech-item:hover img {
  filter: grayscale(0%) brightness(1);
}

.tech-item strong {
  display: block;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.tech-item p {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ============================================================
   PROJECT TABS
   ============================================================ */
input[name="project-tabs"] {
  display: none;
}

.web_applications,
.mobile_applications,
.design_applications {
  display: none;
  width: 100%;
}

#tab-web:checked ~ .web_applications,
#tab-mobile:checked ~ .mobile_applications,
#tab-design:checked ~ .design_applications {
  display: block;
}

/* ---------- Tab Buttons ---------- */
.project-category-buttons {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 60px;
  border-bottom: 1px solid var(--border);
  border-top: 1px solid var(--border);
  background: var(--bg);
}

/* Left annotation */
.project-category-buttons::before {
  content: '$ ls projects/';
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  margin-right: 24px;
  white-space: nowrap;
}

.web_applications_btn,
.mobile_applications_btn,
.design_applications_btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: none;
  border: none;
  cursor: pointer;
  padding: 20px 24px;
  position: relative;
  transition: color var(--transition);
  border-right: 1px solid var(--border);
}

.web_applications_btn::after,
.mobile_applications_btn::after,
.design_applications_btn::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0%;
  height: 1px;
  background: var(--text);
  transition: width 0.3s ease-out;
}

.web_applications_btn:hover,
.mobile_applications_btn:hover,
.design_applications_btn:hover {
  color: var(--text);
  background: none;
}

#tab-web:checked ~ .project-category-buttons .web_applications_btn,
#tab-mobile:checked ~ .project-category-buttons .mobile_applications_btn,
#tab-design:checked ~ .project-category-buttons .design_applications_btn {
  color: var(--text);
  font-weight: 700;
}

#tab-web:checked ~ .project-category-buttons .web_applications_btn::after,
#tab-mobile:checked ~ .project-category-buttons .mobile_applications_btn::after,
#tab-design:checked ~ .project-category-buttons .design_applications_btn::after {
  width: 100%;
}

/* ============================================================
   PROJECTS SECTION
   ============================================================ */
.projects {
  position: relative;
  z-index: 1;
  text-align: left;
  padding: 80px 60px;
  max-width: 1300px;
  margin: 0 auto;
}

.projects-section-scroll {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-bottom: 48px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  width: 100%;
  max-width: 1200px;
}

/* ---------- Project Card ---------- */
.project-item {
  background: var(--bg);
  text-align: left;
  position: relative;
  overflow: hidden;
  transition: background var(--transition);
}

.project-item:hover {
  background: var(--surface);
}

/* Row index */
.project-item::before {
  content: attr(data-index);
  position: absolute;
  top: 12px;
  right: 14px;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-muted);
  z-index: 2;
  opacity: 0.5;
}

.project-item-img-box {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 500 / 340;
  height: auto;
  overflow: hidden;
  margin-bottom: 0;
}

.project-item-img-box img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(60%) brightness(0.75);
  transition: filter 0.35s ease, transform 0.35s ease;
  border-radius: 0;
}

.project-item:hover .project-item-img-box img {
  filter: grayscale(0%) brightness(0.9);
  transform: scale(1.03);
}

.project-item-img-box::after {
  display: none;
}
.project-item-img-box:hover::after {
  display: none;
}

/* ---------- Project heading ---------- */
.project-heading {
  padding: 20px 20px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.project-item p {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin: 0;
}

.project-item h3 {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

/* ---------- Mobile project overrides ---------- */
.mobile_applications .project-grid {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  max-width: 800px;
  margin: 0;
  gap: 1px;
}

.project-mobile .project-item-img-box {
  aspect-ratio: auto;
  height: auto;
  max-height: 480px;
}

.project-mobile .project-item-img-box img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.project-mobile .project-item-img-box:hover img {
  transform: scale(1.02);
  width: 100%;
  height: auto;
}

.project-mobile .project-item-img-box:hover::after {
  display: none;
}

.project-mobile .project-heading {
  align-items: flex-start;
  text-align: left;
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg);
  border-top: 1px solid var(--border-mid);
  color: var(--text-dim);
  padding: 24px 60px;
  margin-top: 0;
  height: auto;
}

footer::before {
  content: '>';
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  margin-right: 12px;
}

footer p {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

footer a {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  padding: 0;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.06em;
  margin: 0 10px;
  transition: color var(--transition);
}

footer a:hover {
  color: var(--text);
  cursor: pointer;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .header {
    padding: 0 24px;
  }
  .header::before {
    display: none;
  }

  .intro {
    grid-template-columns: 1fr;
    padding: 60px 24px 80px;
    gap: 48px;
  }

  .hero-section::after {
    display: none;
  }

  .intro-image {
    max-width: 300px;
    aspect-ratio: 3/4;
    margin: 0 auto;
  }

  .intro-text {
    padding-left: 0;
  }

  .intro-text h1::before {
    display: none;
  }

  .technologies {
    padding: 60px 24px;
  }

  .project-category-buttons {
    padding: 0 24px;
    flex-wrap: wrap;
  }

  .project-category-buttons::before {
    display: none;
  }

  .projects {
    padding: 60px 24px;
  }

  footer {
    padding: 20px 24px;
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }

  footer::before {
    display: none;
  }
}

@media (max-width: 480px) {
  .nav ul {
    gap: 20px;
  }

  .hero-stats {
    flex-direction: column;
    gap: 20px;
  }

  .tech-grid {
    grid-template-columns: 1fr 1fr;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .mobile_applications .project-grid {
    grid-template-columns: 1fr;
  }
}
