/* ==========================================================================
   Joneiro Site - Base Styles
   ========================================================================== */

/* --- @font-face: JetBrains Mono Variable --- */

@font-face {
  font-family: 'JetBrains Mono';
  src: url('../assets/fonts/JetBrainsMono-VariableFont_wght.ttf') format('truetype');
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('../assets/fonts/JetBrainsMono-Italic-VariableFont_wght.ttf') format('truetype');
  font-weight: 100 800;
  font-style: italic;
  font-display: swap;
}

/* --- CSS Reset --- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* --- Design Tokens --- */

:root {
  --bg: #0a0a0f;
  --text: #ffffff;
  --accent: #2ec4b6;
  --surface: #12121a;

  --accent-2: #7c6af5;
  --accent-3: #f59e0b;

  --font-mono: 'JetBrains Mono', monospace;
}

/* --- Base --- */

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: #0a0a0f;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--text);
  font-family: var(--font-mono);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(46, 196, 182, 0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

a {
  color: var(--accent);
  text-decoration: none;
}

h1, h2, h3 {
  font-weight: 700;
  line-height: 1.2;
}

section {
  padding: 100px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

/* --- Navigation --- */

nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  background: rgba(10, 10, 15, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 40px;
  border-bottom: 1px solid rgba(46, 196, 182, 0.1);
  transition: background 0.3s;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
}

.nav-logo img {
  height: 42px;
  width: auto;
}

.logo-glow {
  animation: logoBreath 3.5s ease-in-out infinite;
}

@keyframes logoBreath {
  0%, 100% {
    filter: drop-shadow(0 0 6px rgba(46, 196, 182, 0.4))
            drop-shadow(0 0 16px rgba(46, 196, 182, 0.2));
  }
  50% {
    filter: drop-shadow(0 0 12px rgba(46, 196, 182, 0.75))
            drop-shadow(0 0 32px rgba(46, 196, 182, 0.4))
            drop-shadow(0 0 56px rgba(46, 196, 182, 0.15));
  }
}

@media (prefers-reduced-motion: reduce) {
  .logo-glow {
    animation: none;
    filter: drop-shadow(0 0 8px rgba(46, 196, 182, 0.5))
            drop-shadow(0 0 20px rgba(46, 196, 182, 0.3));
  }
}

.nav-logo .typewriter {
  font-size: 1.2rem;
  font-weight: 600;
}

.nav-logo-block {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.nav-logo .nav-subtitle {
  font-size: 0.6rem;
  color: rgba(255, 255, 255, 0.3);
  font-weight: 400;
}

.nav-links {
  display: flex;
  gap: 32px;
  align-items: center;
}

.nav-links a {
  color: var(--text);
  opacity: 0.7;
  transition: opacity 0.3s, color 0.3s;
  font-size: 0.9rem;
}

.nav-links a:hover {
  opacity: 1;
  color: var(--accent);
}

.nav-links a.active {
  opacity: 1;
  color: var(--accent);
}

.btn-nav {
  border: 1px solid var(--accent);
  color: var(--accent) !important;
  opacity: 1 !important;
  padding: 8px 20px;
  border-radius: 4px;
  transition: all 0.3s;
}

.btn-nav:hover {
  background: var(--accent);
  color: var(--bg) !important;
}

/* --- Hero --- */

#hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  padding-top: 80px;
}

.hero-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.hero-logo img {
  height: 80px;
  width: auto;
}

.hero-logo-text {
  font-size: 2.5rem;
  font-weight: 600;
  color: var(--text);
}

.hero-logo-block {
  display: flex;
  flex-direction: column;
  gap: 0;
  text-align: left;
}

.hero-subtitle {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.35);
  margin-top: 0;
  line-height: 1.3;
  text-align: left;
  min-width: 220px;
}

#hero h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  margin: 0 0 16px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), #ffffff 60%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#hero p {
  font-size: 1.1rem;
  opacity: 0.7;
  max-width: 600px;
  line-height: 1.6;
  margin: 0 0 40px;
}

/* --- Blinking Cursor --- */

.cursor {
  color: #ffffff;
  animation: blink 1s step-end infinite;
}

.typewriter {
  display: inline;
}
.typewriter-text {
  /* no special styles needed */
}

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

/* --- Hero Entrance --- */
.hero-enter {
  opacity: 0;
  transform: translateY(30px);
  animation: heroSlideUp 0.8s ease forwards;
}

@keyframes heroSlideUp {
  to { opacity: 1; transform: translateY(0); }
}

/* --- Scroll Hint --- */
.scroll-hint {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
}

.scroll-arrow {
  display: block;
  width: 20px;
  height: 20px;
  border-right: 2px solid rgba(255, 255, 255, 0.4);
  border-bottom: 2px solid rgba(255, 255, 255, 0.4);
  transform: rotate(45deg);
  animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
  0%, 100% { transform: rotate(45deg) translateY(0); opacity: 0.4; }
  50% { transform: rotate(45deg) translateY(8px); opacity: 1; }
}

/* --- Buttons --- */

.btn-primary {
  background: var(--accent);
  color: var(--bg);
  padding: 14px 32px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s;
  display: inline-block;
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 rgba(46, 196, 182, 0);
}

.btn-primary:hover {
  background: transparent;
  color: var(--accent);
  box-shadow: 0 0 20px rgba(46, 196, 182, 0.3);
}

.btn-outline {
  border: 2px solid var(--text);
  color: var(--text);
  padding: 14px 32px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s;
  display: inline-block;
  box-shadow: 0 0 0 rgba(255, 255, 255, 0);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 20px rgba(46, 196, 182, 0.2);
}

.hero-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
}

/* --- Decorative Lines --- */

.decorative-lines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
}

.decorative-lines span {
  position: absolute;
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--accent), transparent);
  opacity: 0.15;
  transform: rotate(-35deg);
  animation: floatLine 10s ease-in-out infinite alternate;
}

.decorative-lines span:nth-child(1) {
  top: 10%; right: 15%; height: 300px;
  animation-duration: 8s;
}
.decorative-lines span:nth-child(2) {
  top: 20%; right: 10%; height: 200px;
  animation-duration: 12s; animation-delay: 0.5s;
}
.decorative-lines span:nth-child(3) {
  top: 5%; right: 22%; height: 150px;
  animation-duration: 10s; animation-delay: 1s;
}
.decorative-lines span:nth-child(4) {
  top: 30%; left: 12%; height: 250px;
  animation-duration: 14s; animation-delay: 0.3s;
}
.decorative-lines span:nth-child(5) {
  top: 15%; left: 8%; height: 180px;
  animation-duration: 11s; animation-delay: 0.7s;
}

@keyframes floatLine {
  0% { opacity: 0.15; transform: rotate(-35deg) translateY(0); }
  100% { opacity: 0.25; transform: rotate(-35deg) translateY(-20px); }
}

/* --- Section Headings --- */

section h2 {
  font-size: 2rem;
  margin-bottom: 40px;
  position: relative;
  display: inline-block;
}

section h2::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 60px;
  height: 3px;
  background: var(--accent);
}

/* Alternate section backgrounds */
#gallery,
#contact {
  position: relative;
}

#gallery::before,
#contact::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: 100%;
  background: linear-gradient(to right, rgba(18,18,26,0) 0%, rgba(18,18,26,0.5) 50%, rgba(18,18,26,0) 100%);
  border-top: 1px solid rgba(255,255,255,0.03);
  border-bottom: 1px solid rgba(255,255,255,0.03);
  z-index: -1;
  pointer-events: none;
}

/* --- Section Labels --- */
.section-label {
  display: block;
  font-size: 0.75rem;
  color: var(--accent-2);
  opacity: 0.6;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

/* --- About --- */

#about p {
  max-width: 720px;
  opacity: 0.8;
  line-height: 1.7;
  margin-bottom: 16px;
}

/* --- Stats Row --- */
.stats-row {
  display: flex;
  gap: 48px;
  margin-top: 40px;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-label {
  font-size: 0.85rem;
  opacity: 0.6;
  margin-top: 4px;
}

/* --- Gallery --- */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.gallery-card {
  aspect-ratio: 1;
  background: var(--surface);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.3);
  font-size: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
  position: relative;
  overflow: hidden;
}

.gallery-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(46, 196, 182, 0.1);
}

.gallery-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  transition: filter 0.35s ease, transform 0.35s ease;
  filter: saturate(0.85) brightness(0.9);
}

.gallery-card:hover img {
  filter: saturate(1.05) brightness(1.05);
  transform: scale(1.03);
}

.gallery-card::after {
  content: 'AI Generated';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 12px;
  background: linear-gradient(transparent, rgba(10,10,15,0.85));
  color: var(--accent);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.3s, transform 0.3s;
}

.gallery-card:hover::after {
  opacity: 1;
  transform: translateY(0);
}

/* --- Portfolio --- */

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 24px;
}

.portfolio-card {
  background: var(--surface);
  border-radius: 8px;
  padding: 32px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-top: 2px solid var(--accent);
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
  position: relative;
  display: flex;
  flex-direction: column;
}

.portfolio-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 24px rgba(46, 196, 182, 0.12);
  transform: translateY(-4px);
}

.card-tag {
  display: inline-block;
  border: 1px solid var(--accent-2);
  color: var(--accent-2);
  font-size: 0.7rem;
  padding: 2px 10px;
  border-radius: 2px;
  margin-bottom: 16px;
  width: fit-content;
  letter-spacing: 0.03em;
}

.portfolio-card h3 {
  margin: 0 0 12px;
  font-size: 1.3rem;
}

.portfolio-card p {
  opacity: 0.6;
  line-height: 1.5;
  margin: 0 0 20px;
  flex-grow: 1;
}

.card-link {
  font-size: 0.9rem;
  color: var(--accent);
  transition: all 0.3s;
}

.card-link:hover {
  letter-spacing: 0.05em;
}

/* --- Contact --- */

#contact {
  text-align: center;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}

.contact-info a {
  font-size: 1.1rem;
  transition: color 0.3s;
}

.contact-info a:hover {
  color: var(--text);
}

/* --- Footer --- */

footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 80px 40px 32px;
  font-size: 0.85rem;
  background: rgba(10, 10, 15, 0.6);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 60px;
  max-width: 1000px;
  margin: 0 auto;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col h4 {
  margin: 0 0 12px;
  font-size: 0.75rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.6;
}

.footer-col a {
  color: var(--text);
  opacity: 0.4;
  transition: opacity 0.3s, color 0.3s;
  font-size: 0.8rem;
}

.footer-col a:hover {
  opacity: 1;
  color: var(--accent);
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 4px;
}

.footer-logo img {
  height: 24px;
  width: auto;
}

.footer-tagline {
  opacity: 0.3;
  margin: 0;
  font-size: 0.75rem;
}

.footer-subtitle {
  display: block;
  font-size: 0.55rem;
  color: rgba(255, 255, 255, 0.2);
  font-weight: 400;
}

.footer-bottom {
  text-align: center;
  padding-top: 32px;
  margin-top: 48px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-bottom a {
  color: var(--text);
  opacity: 0.3;
  text-decoration: none;
  font-size: 0.75rem;
  transition: opacity 0.3s;
}

.footer-bottom a:hover {
  opacity: 0.7;
  color: var(--accent);
}

.footer-bottom p {
  margin: 8px 0 0;
  opacity: 0.2;
  font-size: 0.75rem;
}

/* --- Progress Bar --- */
#progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: var(--accent);
  width: 0%;
  z-index: 200;
  transition: width 0.1s linear;
}

/* --- Back to Top --- */
#back-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 44px;
  height: 44px;
  border: 1px solid var(--accent);
  background: rgba(10, 10, 15, 0.9);
  color: var(--accent);
  font-size: 1.2rem;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, background 0.3s;
  z-index: 95;
  font-family: var(--font-mono);
}

#back-top.visible {
  opacity: 1;
  pointer-events: auto;
}

#back-top:hover {
  background: var(--accent);
  color: var(--bg);
}

/* --- Accessibility --- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* --- Hamburger Toggle --- */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 110;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: all 0.3s;
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}
.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* --- Node Canvas --- */
#node-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* --- Code Background --- */
#code-bg {
  position: fixed;
  top: 0;
  right: 0;
  width: 50%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.08);
  white-space: pre;
  padding: 80px 40px;
  text-align: right;
  opacity: 0.7;
}
#code-bg .kw { color: rgba(198, 120, 221, 0.18); }
#code-bg .fn { color: rgba(97, 175, 239, 0.18); }
#code-bg .st { color: rgba(152, 195, 121, 0.18); }
#code-bg .cm { color: rgba(92, 99, 112, 0.22); }
#code-bg .im { color: rgba(198, 120, 221, 0.18); }
#code-bg .nu { color: rgba(209, 154, 102, 0.18); }
#code-bg .sf { color: rgba(86, 182, 194, 0.18); }
#code-bg .op { color: rgba(255, 255, 255, 0.10); }
#code-bg .cur { color: rgba(46, 196, 182, 0.3); }

#code-bg-left {
  position: fixed;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.08);
  white-space: pre;
  padding: 80px 40px;
  text-align: left;
  opacity: 0.7;
}
#code-bg-left .kw { color: rgba(198, 120, 221, 0.18); }
#code-bg-left .fn { color: rgba(97, 175, 239, 0.18); }
#code-bg-left .st { color: rgba(152, 195, 121, 0.18); }
#code-bg-left .cm { color: rgba(92, 99, 112, 0.22); }
#code-bg-left .nu { color: rgba(209, 154, 102, 0.18); }
#code-bg-left .sf { color: rgba(86, 182, 194, 0.18); }
#code-bg-left .cur { color: rgba(46, 196, 182, 0.3); }

main, footer {
  position: relative;
  z-index: 1;
}

/* --- Fade-in Animation --- */

.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Contact Cards --- */
.contact-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 28px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  background: var(--surface);
  width: 340px;
  text-decoration: none;
  color: var(--text);
  opacity: 0.7;
  font-size: 0.9rem;
  transition: all 0.3s;
}

.contact-item:hover {
  opacity: 1;
  border-color: var(--accent);
  transform: translateX(6px);
  box-shadow: -4px 0 16px rgba(46, 196, 182, 0.15);
}

.contact-icon {
  color: var(--accent);
  font-weight: 700;
  font-size: 1rem;
  width: 20px;
  flex-shrink: 0;
}

/* --- Section Wipe Line --- */
#section-wipe {
  position: fixed;
  top: 50%; left: 0;
  width: 0%; height: 1px;
  background: var(--accent);
  opacity: 0;
  z-index: 500;
  pointer-events: none;
}
#section-wipe.active {
  animation: sectionWipe 0.3s ease-out forwards;
}
@keyframes sectionWipe {
  0%  { width: 0%;   opacity: 0.6; }
  70% { width: 100%; opacity: 0.6; }
  100%{ width: 100%; opacity: 0;   }
}

/* --- Cursor Trail --- */
#cursor-trail {
  position: fixed;
  top: 0; left: 0;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(46, 196, 182, 0.4);
  box-shadow: 0 0 8px rgba(46, 196, 182, 0.5);
  pointer-events: none;
  z-index: 9999;
}

/* --- Responsive --- */

@media (max-width: 768px) {
  nav { padding: 12px 20px; }

  .nav-toggle { display: flex; }

  .nav-links {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100vh;
    background: rgba(10, 10, 15, 0.98);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 24px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 105;
  }

  .nav-links.open {
    display: flex;
    opacity: 1;
    pointer-events: auto;
  }

  .nav-links a { font-size: 1.2rem; opacity: 1; }
  .btn-nav { display: inline-block !important; }

  #hero h1 { font-size: 2rem; }
  .hero-logo img { height: 50px; }
  .hero-logo-text { font-size: 1.5rem; }
  .hero-buttons { flex-direction: column; align-items: center; }
  .hero-subtitle { font-size: 0.7rem; }
  .nav-subtitle { display: none; }

  section { padding: 60px 20px; }
  .stats-row { flex-direction: column; gap: 24px; align-items: flex-start; }
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .portfolio-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
}
