/* ---------- RESET & BASE ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* screen-reader only utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:root {
  --bg: #1b1b1e;
  --bg-alt: #212123;
  --bg-card: #101010;
  --red: #db4747;
  --red-hover: #ff5757;
  --green: #22b07d;
  --blue: #376aed;
  --orange: #f19d2a;
  --white: #ffffff;
  --muted: #7d7c84;
  --border: rgba(255, 255, 255, 0.08);
  --ff-sans: "Poppins", sans-serif;
  --ff-serif: "Playfair Display", serif;
  --nav-h: 70px;
  --transition: 0.3s ease;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background: var(--bg);
  color: var(--white);
  font-family: var(--ff-sans);
  overflow-x: hidden;
  cursor: none; /* hide default when custom cursor active */
}

a {
  text-decoration: none;
  color: inherit;
}
img {
  display: block;
  max-width: 100%;
}
ul {
  list-style: none;
}
em {
  font-style: italic;
}
p {
  line-height: 1.75;
  color: var(--muted);
}

/* ---------- CUSTOM CURSOR ---------- */
.cursor-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--red);
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition:
    transform 0.1s,
    width 0.2s,
    height 0.2s,
    background 0.2s;
}
body:has(a:hover) .cursor-dot,
body:has(button:hover) .cursor-dot {
  width: 28px;
  height: 28px;
  background: rgba(219, 71, 71, 0.35);
}

/* hide custom cursor on touch devices */
@media (hover: none) {
  .cursor-dot { display: none; }
}

/* respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* focus-visible styles for keyboard navigation */
:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ---------- SCROLLBAR ---------- */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-alt);
}
::-webkit-scrollbar-thumb {
  background: var(--red);
  border-radius: 3px;
}

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--ff-sans);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.75rem 1.75rem;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.btn-primary {
  background: var(--red);
  color: var(--white);
}
.btn-primary:hover {
  background: var(--red-hover);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--red);
  border: 1.5px solid var(--red);
}
.btn-outline:hover {
  background: var(--red);
  color: var(--white);
  transform: translateY(-2px);
}

/* ---------- NAVIGATION ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  background: rgba(27, 27, 30, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 900;
  transition: var(--transition);
}
.nav.scrolled {
  background: rgba(27, 27, 30, 0.98);
}

.nav-logo {
  font-family: var(--ff-serif);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--white);
}
.logo-dot {
  color: var(--red);
}

.nav-links {
  display: flex;
  gap: 2.5rem;
}
.nav-link {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--muted);
  transition: var(--transition);
  position: relative;
}
.nav-link::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--red);
  transition: width var(--transition);
}
.nav-link:hover,
.nav-link.active {
  color: var(--white);
}
.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: var(--transition);
}
.hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger.open span:nth-child(2) {
  opacity: 0;
}
.hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* mobile drawer */
.mobile-menu {
  position: fixed;
  top: var(--nav-h);
  left: 0;
  width: 100%;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 2rem;
  transform: translateY(-110%);
  transition: transform 0.35s ease;
  z-index: 800;
}
.mobile-menu.open {
  transform: translateY(0);
}
.mobile-menu li {
  margin-bottom: 1.25rem;
}
.mob-link {
  font-size: 1rem;
  color: var(--muted);
  transition: var(--transition);
}
.mob-link:hover {
  color: var(--white);
}

/* ---------- SECTION BASE ---------- */
.section {
  padding: 7rem 0;
}
.section--dark {
  background: var(--bg-alt);
}

.container {
  width: min(90%, 1100px);
  margin: 0 auto;
}

.sec-header {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 4rem;
}
.sec-num {
  font-size: 5rem;
  font-weight: 100;
  line-height: 1;
  color: var(--white);
  opacity: 0.08;
  font-family: var(--ff-sans);
  flex-shrink: 0;
  margin-top: -0.5rem;
}
.sec-eyebrow {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 0.4rem;
}
.sec-title {
  font-family: var(--ff-serif);
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.1;
  color: var(--white);
}

/* ---------- SCROLL REVEAL ---------- */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition:
    opacity 0.65s ease,
    transform 0.65s ease;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ---------- HERO ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(var(--nav-h) + 3rem) 2rem 4rem;
  position: relative;
  background: var(--bg);
}
/* subtle grid pattern */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(90%, 780px);
}

.hero-text {
  max-width: 100%;
  text-align: center;
}

.hero-hi {
  font-size: 0.875rem;
  color: var(--red);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}
.hero-name {
  font-family: var(--ff-serif);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 700;
  line-height: 1;
  color: var(--white);
  margin-bottom: 1rem;
  position: relative;
}
.hero-name-accent {
  color: var(--white);
}
.hero-accent-dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  background: var(--red);
  border-radius: 50%;
  margin-left: 6px;
  vertical-align: super;
}

.hero-role {
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  color: var(--muted);
  letter-spacing: 0.04em;
  margin-bottom: 1.25rem;
  line-height: 1.5;
}
.hero-tagline {
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.75;
  margin-bottom: 2.25rem;
}
.hero-tagline em {
  color: var(--white);
  font-style: normal;
}

.hero-btns {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
  justify-content: center;
}

.hero-socials {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
}
.hero-socials a {
  font-size: 1.2rem;
  color: var(--muted);
  transition: var(--transition);
}
.hero-socials a:hover {
  color: var(--white);
  transform: translateY(-3px);
}


/* ---------- ABOUT ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: start;
}
.about-img-wrap {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  aspect-ratio: 4/5;
  max-width: 340px;
}
.about-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-stats {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}
.stat {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
}
.stat strong {
  display: block;
  font-family: var(--ff-serif);
  font-size: 1.6rem;
  color: var(--red);
  margin-bottom: 0.25rem;
}
.stat span {
  font-size: 0.7rem;
  color: var(--muted);
  line-height: 1.4;
}

.about-body {
  padding-top: 0.5rem;
}
.about-heading {
  font-family: var(--ff-serif);
  font-weight: 400;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  color: var(--white);
  line-height: 1.2;
  margin-bottom: 1.5rem;
}
.about-heading em {
  color: var(--red);
  font-style: italic;
}
.about-body p {
  margin-bottom: 1.25rem;
}
.about-body .btn {
  margin-top: 0.5rem;
}

/* ---------- TAGS ---------- */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.3rem 0.85rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  border: 1px solid var(--border);
  transition: var(--transition);
}
.tag:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
}
.tag-logo {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  display: block;
}
.tag-fa-icon {
  font-size: 0.7rem;
  opacity: 0.85;
}
.tag--red {
  background: rgba(219, 71, 71, 0.15);
  color: var(--red);
  border-color: rgba(219, 71, 71, 0.3);
}

/* ---------- STACK ---------- */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}
.stack-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.75rem;
  transition: var(--transition);
}
.stack-card:hover {
  border-color: rgba(219, 71, 71, 0.4);
  transform: translateY(-4px);
}
.stack-card-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.stack-icon-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--dot);
  flex-shrink: 0;
}
.stack-card h4 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--white);
}

/* ---------- TIMELINE ---------- */
.timeline {
  position: relative;
  padding-left: 1.5rem;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border);
}
.tl-item {
  position: relative;
  margin-bottom: 3.5rem;
  padding-left: 2rem;
}
.tl-dot {
  position: absolute;
  left: -1.75rem;
  top: 0.4rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--red);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 3px rgba(219, 71, 71, 0.3);
}
.tl-period {
  font-size: 0.75rem;
  color: var(--red);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
  display: block;
  margin-bottom: 0.5rem;
}
.tl-role {
  font-family: var(--ff-serif);
  font-weight: 400;
  font-size: 1.3rem;
  color: var(--white);
  margin-bottom: 0.35rem;
}
.tl-company {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--red);
  letter-spacing: 0.06em;
  transition: var(--transition);
}
.tl-company:hover {
  color: var(--red-hover);
}
.tl-desc {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.7;
  margin: 0.85rem 0;
}

/* ---------- PROJECTS ---------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}
.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.75rem;
  transition: var(--transition);
}
.project-card:hover {
  border-color: rgba(219, 71, 71, 0.4);
  transform: translateY(-6px);
}
.project-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}
.project-folder {
  font-size: 1.75rem;
  color: var(--red);
  opacity: 0.8;
}
.project-gh {
  font-size: 1.1rem;
  color: var(--muted);
  transition: var(--transition);
}
.project-gh:hover {
  color: var(--white);
}
.tag--muted {
  background: transparent;
  color: var(--muted);
  border-color: rgba(125, 124, 132, 0.3);
}
.project-name {
  font-family: var(--ff-serif);
  font-weight: 400;
  font-size: 1.2rem;
  color: var(--white);
  margin-bottom: 0.75rem;
}
.project-desc {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.7;
}
.project-tags {
  margin-top: 1.25rem;
}

/* ---------- EDUCATION ---------- */
.edu-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.edu-item {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 2rem;
  padding: 2rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: var(--transition);
}
.edu-item:hover {
  border-color: rgba(219, 71, 71, 0.35);
}
.edu-period {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--red);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding-top: 0.2rem;
}
.edu-body h3 {
  font-family: var(--ff-serif);
  font-weight: 400;
  font-size: 1.15rem;
  color: var(--white);
  margin-bottom: 0.4rem;
}
.edu-place {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 0.6rem;
}
.edu-place a {
  color: var(--red);
  transition: var(--transition);
}
.edu-place a:hover {
  color: var(--red-hover);
}
.edu-body p {
  font-size: 0.875rem;
}

/* ---------- CONTACT ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: start;
}
.contact-heading {
  font-family: var(--ff-serif);
  font-weight: 400;
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--white);
  line-height: 1.15;
  margin-bottom: 1.25rem;
}
.contact-heading em {
  color: var(--red);
  font-style: italic;
}
.contact-left p {
  margin-bottom: 2rem;
}
.contact-socials {
  display: flex;
  gap: 1.25rem;
}
.contact-socials a {
  font-size: 1.25rem;
  color: var(--muted);
  transition: var(--transition);
}
.contact-socials a:hover {
  color: var(--white);
  transform: translateY(-3px);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.contact-form .btn {
  width: 100%;
  justify-content: center;
}
.form-status {
  font-size: 0.875rem;
  text-align: center;
  min-height: 1.25rem;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-weight: 500;
}
.form-status--success {
  color: #22b07d;
  background: rgba(34, 176, 125, 0.1);
  border: 1px solid rgba(34, 176, 125, 0.25);
}
.form-status--error {
  color: var(--red);
  background: rgba(219, 71, 71, 0.1);
  border: 1px solid rgba(219, 71, 71, 0.25);
}
.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.form-field label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.form-field input,
.form-field textarea {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.85rem 1rem;
  color: var(--white);
  font-family: var(--ff-sans);
  font-size: 0.9rem;
  outline: none;
  resize: none;
  transition: border-color var(--transition);
}
.form-field input:focus,
.form-field textarea:focus {
  border-color: var(--red);
}
.form-field input::placeholder,
.form-field textarea::placeholder {
  color: var(--muted);
}

/* ---------- FOOTER ---------- */
.footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 2rem 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.footer-copy {
  font-size: 0.8rem;
  color: var(--muted);
}
.footer-socials {
  display: flex;
  gap: 1.25rem;
}
.footer-socials a {
  font-size: 1rem;
  color: var(--muted);
  transition: var(--transition);
}
.footer-socials a:hover {
  color: var(--white);
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) {
  .nav-links {
    display: none;
  }
  .hamburger {
    display: flex;
  }

  .br-desk {
    display: none;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  .about-img-wrap {
    max-width: 100%;
    aspect-ratio: 3/2;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  .edu-item {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .sec-num {
    font-size: 3rem;
  }
}

@media (max-width: 480px) {
  .nav {
    padding: 0 1.25rem;
  }
  .hero {
    padding-top: calc(var(--nav-h) + 2rem);
  }
  .section {
    padding: 5rem 0;
  }
  .btn {
    font-size: 0.8rem;
    padding: 0.65rem 1.4rem;
  }
  .about-stats {
    flex-direction: column;
  }
  .timeline {
    padding-left: 1rem;
  }
  .tl-item {
    padding-left: 1.25rem;
  }
}
