/* style.css */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  cursor: none !important;
}

/* ─── CURSOR ─── */
#cursor {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.2s;
  mix-blend-mode: difference;
}

#cursor.visible {
  opacity: 1;
}

.cursor-h {
  position: absolute;
  width: 22px;
  height: 1px;
  background-color: #ffffff;
  transform: translate(-50%, -50%);
  transition: opacity 0.12s;
}

.cursor-v {
  position: absolute;
  width: 1px;
  height: 22px;
  background-color: #ffffff;
  transform: translate(-50%, -50%);
  transition: opacity 0.12s;
}

.cursor-pointer {
  position: absolute;
  transform-origin: right center;
  transform: translate(-100%, -50%) rotate(-135deg);
  color: #ffffff;
  font-size: 18px;
  line-height: 1;
  font-family: 'Cascadia Mono', 'Courier New', Courier, monospace;
  opacity: 0;
  transition: opacity 0.12s;
}

#cursor.is-hovering .cursor-h,
#cursor.is-hovering .cursor-v {
  opacity: 0;
}

#cursor.is-hovering .cursor-pointer {
  opacity: 1;
}

:root {
  --bg: #090909;
  --text: #c8c8c8;
  --bright: #ffffff;
  --dim: #a4a4a4;
  --border: #777777;
  --line: #1e1e1e;
  --accent: #7ee787;
  --accent-bright: #b6f7bd;
  --pad-x: 5%;
}

::selection {
  background: #ffffff;
  color: #111111;
}

:focus-visible {
  outline: 1px solid var(--border);
  outline-offset: 3px;
}

html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

html {
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: var(--border) var(--bg);
}

::-webkit-scrollbar {
  width: 5px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--dim);
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Cascadia Mono', 'Courier New', Courier, monospace;
  font-size: 14px;
  line-height: 1.65;
}

/* subtle greenish grid backdrop */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(126, 231, 135, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(126, 231, 135, 0.12) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(ellipse 120% 90% at 50% 0%, #000 35%, transparent 100%);
  mask-image: radial-gradient(ellipse 120% 90% at 50% 0%, #000 35%, transparent 100%);
}

/* ─── LINK HOVER INDICATOR ─── */
a {
  position: relative;
}

a::before {
  content: '>';
  position: absolute;
  right: calc(100% + 5px);
  top: 0;
  opacity: 0;
  color: var(--text);
  pointer-events: none;
  transition: opacity 0.15s;
}

a:hover::before {
  opacity: 1;
}

/* ─── NAV ─── */
nav {
  position: sticky;
  top: 0;
  background-color: var(--bg);
  border-bottom: 1px solid #2a2a2a;
  padding: 14px var(--pad-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 100;
}

.nav-brand {
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s;
}

.nav-brand:hover {
  color: var(--bright);
}

.nav-links {
  display: flex;
  gap: 28px;
}

.nav-links a {
  color: var(--dim);
  text-decoration: none;
  transition: color 0.15s;
}

.nav-links a:hover {
  color: var(--bright);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--dim);
  font-family: 'Cascadia Mono', 'Courier New', Courier, monospace;
  font-size: 14px;
  padding: 0;
  transition: color 0.15s;
  cursor: none !important;
}

.nav-toggle:hover {
  color: var(--bright);
}

/* ─── SECTIONS ─── */
section {
  padding: 72px var(--pad-x);
}

.section-title {
  font-size: 1.75rem;
  font-weight: bold;
  color: var(--bright);
  margin-bottom: 28px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.section-title[data-num]::before {
  content: attr(data-num);
  font-size: 0.85rem;
  font-weight: normal;
  color: var(--accent);
  opacity: 0.7;
  letter-spacing: 0.05em;
}

/* ─── ABOUT ─── */
#about {
  min-height: calc(100vh - 45px);
  display: flex;
  flex-direction: column;
}

.about-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 64px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--dim);
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 5px 12px;
  letter-spacing: 0.03em;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(126, 231, 135, 0.6);
  animation: pulse 2.4s infinite;
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(126, 231, 135, 0.5); }
  70%  { box-shadow: 0 0 0 6px rgba(126, 231, 135, 0); }
  100% { box-shadow: 0 0 0 0 rgba(126, 231, 135, 0); }
}

.about-tagline {
  font-size: 11px;
  color: var(--dim);
  line-height: 1.6;
  text-decoration: none;
  transition: color 0.15s;
}

.about-tagline:hover {
  color: var(--bright);
}

.about-layout {
  display: flex;
  gap: 200px;
  align-items: center;
  width: 100%;
  flex: 1;
}

.about-text {
  flex: 1;
  min-width: 0;
}

.hero-prompt {
  font-size: 13px;
  color: var(--dim);
  margin-bottom: 10px;
}

.hero-path {
  color: var(--accent);
  opacity: 0.85;
}

.hero-name {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: bold;
  color: var(--bright);
  line-height: 1.1;
  margin-bottom: 18px;
  letter-spacing: -0.01em;
}

.hero-name::after {
  content: '_';
  color: var(--accent);
  animation: blink 1.1s steps(1) infinite;
  margin-left: 4px;
}

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

.about-hook {
  font-size: 12px;
  color: var(--dim);
  margin-bottom: 16px;
  letter-spacing: 0.04em;
}

.hero-stats {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.hero-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hero-stat-num {
  font-size: 1.35rem;
  font-weight: bold;
  color: var(--bright);
  line-height: 1;
}

.hero-stat-label {
  font-size: 11px;
  color: var(--dim);
  letter-spacing: 0.03em;
}

.about-desc {
  text-align: justify;
  line-height: 1.8;
  margin-bottom: 28px;
}

.social-links {
  display: flex;
  gap: 20px;
  margin-top: 24px;
}

.social-link {
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s;
}

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

.cv-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.cv-btn {
  display: inline-block;
  font-size: 1rem;
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--border);
  padding: 14px 28px;
  transition: color 0.15s, background-color 0.15s, border-color 0.15s;
}

.cv-btn::before {
  display: none;
}

.cv-btn:hover {
  background-color: #ffffff;
  border-color: #ffffff;
  color: #111111;
}

.about-image {
  width: 360px;
  flex-shrink: 0;
  position: relative;
}

.about-image::before,
.about-image::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border: 1px solid var(--accent);
  opacity: 0.55;
  pointer-events: none;
}

.about-image::before {
  top: -7px;
  left: -7px;
  border-right: none;
  border-bottom: none;
}

.about-image::after {
  bottom: -7px;
  right: -7px;
  border-left: none;
  border-top: none;
}

.about-image img {
  width: 100%;
  display: block;
  border: 2px solid var(--border);
  filter: grayscale(0.15) contrast(1.02);
  transition: filter 0.4s, border-color 0.4s;
}

.about-image:hover img {
  filter: grayscale(0) contrast(1.05);
  border-color: var(--dim);
}

/* ─── TECH STACK ─── */
#tech-stack {
  border-top: 1px solid #1e1e1e;
}

.stack-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 32px;
}

.stack-label {
  color: var(--bright);
  margin-bottom: 14px;
}

.stack-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stack-list li {
  color: var(--dim);
  transition: color 0.15s;
}

.stack-list li:hover {
  color: var(--bright);
}

.stack-list li::before {
  content: '> ';
  color: var(--border);
  transition: color 0.15s;
}

.stack-list li:hover::before {
  color: var(--accent);
}

/* ─── PROJECTS ─── */
#projects {
  border-top: 1px solid #1e1e1e;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: 32px;
  row-gap: 48px;
}

.project-card .img-placeholder,
.project-card .project-img {
  width: 100%;
  height: 275px;
  border: 1px solid var(--border);
  margin-bottom: 14px;
  background: transparent;
  display: block;
  object-fit: cover;
  transition: border-color 0.25s, filter 0.4s;
}

.project-card {
  position: relative;
  transition: background-color 0.2s, transform 0.25s, box-shadow 0.25s;
  padding: 10px;
  margin: -10px;
}

/* ─── LIVE WEBSITE BADGE ─── */
.live-badge {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: #0a0a0a;
  font-size: 10px;
  font-weight: bold;
  letter-spacing: 0.04em;
  padding: 4px 9px;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.live-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #0a0a0a;
}

.project-card:hover {
  background-color: rgba(255, 255, 255, 0.08);
  transform: translateY(-4px);
}

.project-card:hover .project-img {
  border-color: var(--dim);
  filter: brightness(1.05);
}

.project-card h3 {
  position: relative;
  display: inline-block;
}

.project-card:hover h3 {
  color: var(--bright);
}

.project-card h3 {
  font-size: 0.9rem;
  font-weight: bold;
  color: var(--bright);
  margin-bottom: 8px;
}

.project-card p {
  text-align: justify;
  line-height: 1.75;
}

.project-kind {
  text-align: left;
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.02em;
  margin-bottom: 6px;
}

.project-results {
  margin-top: 14px;
}

.results-label {
  text-align: left;
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 7px;
}

.project-results ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.project-results li {
  text-align: left;
  font-size: 13px;
  color: var(--dim);
  line-height: 1.5;
  padding-left: 16px;
  position: relative;
}

.project-results li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--border);
}

.project-tags,
.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.modal-tags {
  margin-bottom: 20px;
}

.tag {
  font-size: 11px;
  color: var(--dim);
  border: 1px solid #333;
  padding: 2px 8px;
}

/* ─── PROJECT SIDEBAR ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  z-index: 500;
  pointer-events: none;
  transition: background 0.35s;
}

.modal-overlay.open {
  background: rgba(0, 0, 0, 0.6);
  pointer-events: all;
}

.modal-box {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: min(480px, 90vw);
  background: var(--bg);
  border-left: 1px solid var(--border);
  padding: 48px 36px 64px;
  overflow-y: scroll;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.open .modal-box {
  transform: translateX(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 28px;
  gap: 20px;
}

.modal-title {
  font-size: 1rem;
  font-weight: bold;
  color: var(--bright);
}

.modal-close {
  background: none;
  border: none;
  color: var(--dim);
  font-family: 'Cascadia Mono', 'Courier New', Courier, monospace;
  font-size: 14px;
  padding: 0;
  flex-shrink: 0;
  transition: color 0.15s;
  position: relative;
}

.modal-close:hover {
  color: var(--bright);
}

.modal-media img {
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  display: block;
  margin-bottom: 24px;
}

/* ─── MODAL GALLERY ─── */
.modal-gallery {
  position: relative;
  width: 100%;
  margin-bottom: 24px;
}

.modal-gallery-track {
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--border);
}

.modal-gallery-track img {
  width: 100%;
  height: auto;
  display: block;
}

.modal-gallery-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

.modal-gallery-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 0.8rem;
  padding: 4px 10px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.modal-gallery-btn:hover {
  color: var(--bright);
  border-color: var(--bright);
}

.modal-gallery-counter {
  font-size: 0.8rem;
  color: var(--dim);
}

.modal-media .img-placeholder {
  width: 100%;
  height: 220px;
  border: 1px solid var(--border);
  margin-bottom: 24px;
}

.modal-desc {
  line-height: 1.85;
  text-align: justify;
  margin-bottom: 0;
}

.modal-detail {
  margin-top: 20px;
  margin-bottom: 24px;
}

.modal-detail-label {
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 8px;
}

.modal-detail-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.modal-detail-list li {
  font-size: 13px;
  color: var(--text);
  line-height: 1.55;
  padding-left: 16px;
  position: relative;
}

.modal-detail-list li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--border);
}

.modal-actions {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.modal-link,
.modal-github {
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s;
}

.modal-link:hover,
.modal-github:hover {
  color: var(--bright);
}

/* ─── EDUCATION ─── */
#education {
  border-top: 1px solid #1e1e1e;
}

.edu-entry {
  margin-bottom: 36px;
}

.edu-entry:last-child {
  margin-bottom: 0;
}

.edu-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 12px;
}

.edu-degree {
  color: var(--bright);
  font-weight: bold;
  margin-bottom: 4px;
}

.edu-institution {
  font-size: 12px;
  color: var(--dim);
}

.edu-date {
  font-size: 12px;
  color: var(--dim);
  white-space: nowrap;
  flex-shrink: 0;
}

.edu-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.edu-list li {
  color: var(--text);
  line-height: 1.7;
  padding-left: 16px;
  position: relative;
}

.edu-list li::before {
  content: '>';
  position: absolute;
  left: 0;
  color: var(--border);
}

/* ─── EXPERIENCES ─── */
#experiences {
  border-top: 1px solid #1e1e1e;
}


.experiences-layout {
  display: flex;
  gap: 48px;
  align-items: flex-start;
}

.experiences-text {
  flex: 1;
  min-width: 0;
}

.experience-entry {
  margin-bottom: 30px;
}

.experience-entry:last-child {
  margin-bottom: 0;
}

.experience-title {
  margin-bottom: 8px;
  color: var(--text);
}

.experience-entry p {
  line-height: 1.65;
}

.experiences-image {
  width: 240px;
  flex-shrink: 0;
}

.experiences-image .img-placeholder {
  width: 100%;
  height: 148px;
  border: 1px solid var(--border);
  background: transparent;
}

/* ─── PUBLICATION ─── */
#publication {
  border-top: 1px solid #1e1e1e;
}

.pub-title {
  font-weight: bold;
  color: var(--text);
  margin-bottom: 4px;
}

.pub-venue {
  font-size: 12px;
  color: var(--dim);
  margin-bottom: 20px;
}

.pub-abstract {
  text-align: justify;
  line-height: 1.8;
  margin-bottom: 18px;
}

.pub-link {
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s;
}

.pub-link:hover {
  color: var(--bright);
}

/* ─── FOOTER ─── */
#footer {
  border-top: 1px solid var(--line);
  padding: 64px var(--pad-x) 32px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 32px;
  padding-bottom: 40px;
}

.footer-prompt {
  font-size: 13px;
  color: var(--dim);
  margin-bottom: 12px;
}

.footer-mail {
  font-size: clamp(1.1rem, 3vw, 1.6rem);
  font-weight: bold;
  color: var(--bright);
  text-decoration: none;
  transition: color 0.15s;
}

.footer-mail:hover {
  color: var(--accent);
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s;
}

.footer-links a:hover {
  color: var(--bright);
}

.footer-base {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--dim);
}

.footer-top {
  color: var(--dim);
  text-decoration: none;
  transition: color 0.15s;
}

.footer-top:hover {
  color: var(--bright);
}

/* ─── SCROLL REVEAL ─── */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.js .reveal.in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .status-dot,
  .hero-name::after {
    animation: none;
  }
}

/* ─── BRACKETED LINKS (green) ─── */
.social-link,
.pub-link,
.footer-links a,
.footer-top,
.nav-toggle,
.modal-close,
.modal-link,
.modal-github,
.modal-gallery-btn {
  color: var(--accent);
}

.social-link:hover,
.pub-link:hover,
.footer-links a:hover,
.footer-top:hover,
.nav-toggle:hover,
.modal-close:hover,
.modal-link:hover,
.modal-github:hover {
  color: var(--accent-bright);
}

.modal-gallery-btn {
  border-color: var(--accent);
}

.modal-gallery-btn:hover {
  color: var(--accent-bright);
  border-color: var(--accent-bright);
}

/* prompt ">" indicator on bracketed links */
.social-link::before,
.pub-link::before,
.footer-links a::before,
.footer-top::before,
.modal-link::before,
.modal-github::before {
  color: var(--accent);
}

/* download CV button — fully green */
.cv-btn {
  color: var(--accent);
  border-color: var(--accent);
}

.cv-btn:hover {
  background-color: var(--accent);
  border-color: var(--accent);
  color: #0a0a0a;
}

/* ─── RESPONSIVE ─── */

/* Touch devices — hide custom cursor */
@media (hover: none) {
  #cursor { display: none; }
  *, *::before, *::after { cursor: auto !important; }
}

/* Tablet (≤1024px) */
@media (max-width: 1024px) {
  .about-layout {
    gap: 60px;
  }

  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stack-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Mobile (≤768px) */
@media (max-width: 768px) {
  section {
    padding: 48px var(--pad-x);
  }

  p {
    text-align: justify;
  }

  .section-title {
    font-size: 1.35rem;
    margin-bottom: 20px;
  }

  /* Nav */
  nav {
    flex-wrap: wrap;
    align-items: center;
  }

  .nav-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    gap: 0;
    border-top: 1px solid #1e1e1e;
    padding-top: 12px;
    margin-top: 10px;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: 8px 0;
    width: fit-content;
  }

  /* About */
  #about {
    min-height: auto;
    padding-top: 40px;
  }

  .about-layout {
    flex-direction: column;
    gap: 32px;
  }

  .about-image {
    width: 100%;
    max-width: 300px;
  }

  .about-desc {
    text-align: justify;
  }

  .about-bar {
    margin-bottom: 36px;
  }

  .hero-stats {
    gap: 24px;
  }

  .hero-stat-num {
    font-size: 1.15rem;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .social-links {
    justify-content: center;
  }

  .cv-actions {
    flex-direction: column;
  }

  .cv-btn {
    display: block;
    text-align: center;
    font-size: 0.9rem;
    padding: 12px 20px;
  }

  /* Tech stack */
  .stack-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Projects */
  .projects-grid {
    grid-template-columns: 1fr;
    row-gap: 36px;
  }

  .project-card p {
    text-align: justify;
  }

  /* Experiences */
  .experiences-layout {
    flex-direction: column;
  }

  .experiences-image {
    width: 100%;
  }

  /* Education */
  .edu-header {
    flex-direction: column;
    gap: 4px;
  }

  /* Publication */
  .pub-abstract {
    text-align: justify;
  }

  /* Sidebar */
  .modal-box {
    width: 100vw;
    padding: 32px 24px;
  }
}
