@import url('https://fonts.googleapis.com/css2?family=Bitcount+Single:wght,ELSH@500,0.8&family=Fjalla+One&family=Jost:wght@700&family=Poppins&family=Press+Start+2P&display=swap');

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

body {
  font-family: "Press Start 2P", system-ui;
  font-weight: 400;
  font-style: normal;
}

html { scroll-behavior: smooth; }

p { color: rgb(85, 85, 85); }

a { transition: all 300ms ease; }

.good-writing, article {
  font-family: "Jost", sans-serif;
  font-weight: 700;
  font-style: normal;
  color: black;
}

.dot-writing {
  font-family: "Press Start 2P", system-ui;
  font-weight: 400;
  font-style: normal;
}

/* ── DESKTOP NAV ── */
nav, .nav-links { display: flex; }

nav {
  justify-content: space-around;
  align-items: center;
  height: 17vh;
}

.nav-links {
  gap: 2rem;
  list-style: none;
  font-size: 1rem;
}

a, .btn {
  color: black;
  text-decoration: none;
  text-decoration-color: white;
}

a:hover {
  color: gray;
  text-decoration: underline;
  text-underline-offset: 0.5rem;
  text-decoration-color: rgb(181, 181, 181);
}

.logo { font-size: 1.5rem; }
.logo:hover { cursor: default; }
#dark { color: black; }

/* ── HAMBURGER MENU ── */
#menu-nav { display: none; justify-content: space-between; align-items: center; }

.menu { position: relative; }

.menu-icon {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 20px;
  width: 28px;
  cursor: pointer;
}

.menu-icon span {
  width: 100%;
  height: 3px;
  background: black;
  border-radius: 2px;
  transition: all 0.3s ease-in-out;
}

.menu-links {
  position: absolute;
  top: 120%;
  right: 0;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease-in-out;
  z-index: 1000;
}

.menu-links li { list-style: none; }

.menu-links a {
  display: block;
  padding: 10px 16px;
  text-decoration: none;
  color: black;
  text-align: center;
  font-size: 1rem;
  transition: all 0.3s ease-in-out;
}

.menu-links.open { max-height: 300px; }

.menu-icon.open span:first-child  { transform: rotate(45deg) translate(5px, 5px); }
.menu-icon.open span:nth-child(2) { opacity: 0; }
.menu-icon.open span:last-child   { transform: rotate(-45deg) translate(6px, -6px); }

/* ── SECTIONS ── */
section {
  padding-top: 4vh;
  height: 96vh;
  margin: 0 10rem;
  box-sizing: border-box;
  min-height: fit-content;
}

.section-container {
  display: flex;
  gap: 4rem;
  height: 80%;
}

/* ── PROFILE ── */
#profile {
  position: relative;
  display: flex;
  justify-content: center;
  gap: 5rem;
  height: 80vh;
}

.section-pic-container {
  display: flex;
  height: 400px;
  width: 400px;
  margin: auto 0;
}

.section-text { align-self: center; text-align: center; }
.section-text p { font-weight: 600; }
.section-text-p1 { text-align: center; }
.section-text-p2 { font-size: 1.25rem; margin-bottom: 1rem; }
.title { font-size: 1.5rem; text-align: center; }

#socials-container {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
  gap: 1rem;
}

.icon { cursor: pointer; height: 3rem; }

/* ── BUTTONS ── */
.btn-container {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.btn {
  font-weight: 600;
  transition: all 300ms ease;
  padding: 1rem;
  width: 8rem;
  border-radius: 2rem;
}

.btn-color-1 { border: rgb(0,0,0) 0.2rem solid; }
.btn-color-1:hover { cursor: pointer; background-color: black; color: white; }

/* ── ABOUT ── */
#about { position: relative; }

.about-container {
  display: flex;
  flex-wrap: nowrap;       /* keep 3 boxes in one row on desktop */
  gap: 2rem;
  margin-bottom: 2rem;
  margin-top: 2rem;
  align-items: stretch;   /* equal height */
  width: 100%;
}

.about-details-container {
  justify-content: center;
  flex-direction: column;
}

.about-details-container { display: flex; }

.about-pic { height: 420px; border-radius: 2rem; }

.arrow {
  position: absolute;
  right: -5rem;
  bottom: 2.5rem;
}

.details-container {
  padding: 1.5rem;
  flex: 1;
  min-width: 0;          /* prevents flex children from overflowing */
  max-width: 100%;
  background: white;
  border-radius: 2rem;
  border: 0.1rem solid rgb(163,163,163);
  text-align: center;
  box-sizing: border-box;
  overflow: hidden;
}

/* Experience internals */
.project-img {
  border-radius: 1rem;
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.section__pic-container { height: 400px; width: 400px; margin: auto 0; }

/* ── EXPERIENCE ── */
#experience { position: relative; }

.experience-subtitle {
  color: rgb(85, 85, 85);
  font-weight: 600;
  font-size: 1.5rem;
  margin-bottom: 2rem;
}

.experience-details-container {
  display: flex;
  justify-content: center;
  flex-direction: column;
}

.article-container {
  display: flex;
  text-align: initial;
  flex-wrap: wrap;
  flex-direction: row;
  gap: 2.5rem;
  justify-content: space-around;
}

/* ── PROJECTS SECTION ── */
#projects {
  position: relative;
  height: auto;
  padding-bottom: 4rem;
}

/* DESKTOP: 3-col × 2-row grid */
.proj-desktop-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, auto);
  gap: 18px;
  margin-top: 2rem;
  width: 100%;
}

.proj-card {
  border: 1px solid #e8e8e8;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  background: #fff;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.proj-card:hover {
  box-shadow: 0 10px 32px rgba(0,0,0,0.10);
  border-color: #ccc;
  transform: translateY(-3px);
}

/* Fixed 16:9 ratio — same shape no matter what the source image is */
.proj-card-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  flex-shrink: 0;
  background: #f0f0f0;
}

.proj-card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.proj-card:hover .proj-card-img-wrap img { transform: scale(1.05); }

/* Coloured left accent stripe over image */
.proj-card-accent {
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
  background: var(--acc, #f9ca24);
  z-index: 1;
}

.proj-card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}

.proj-card-num {
  font-family: "Press Start 2P", system-ui;
  font-size: 8px;
  margin-bottom: 2px;
}

.proj-card-title {
  font-family: "Jost", sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: #111;
  line-height: 1.3;
}

.proj-card-desc {
  font-family: "Jost", sans-serif;
  font-size: 12px;
  color: #777;
  line-height: 1.55;
  flex: 1;
}

.proj-card-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }

.proj-tag {
  font-family: "Jost", sans-serif;
  font-size: 10px;
  font-weight: 700;
  background: #f4f4f4;
  color: #444;
  border-radius: 4px;
  padding: 2px 8px;
}

/* MOBILE strip: hidden on desktop */
.proj-mobile-strip-wrap { display: none; }

/* ── MODAL (desktop) ── */
.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.70);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.backdrop.open { opacity: 1; pointer-events: all; }

.modal {
  position: relative;
  background: #141414;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  width: 100%;
  max-width: 820px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: row;
  box-shadow: 0 40px 100px rgba(0,0,0,0.75);
  transform: translateY(20px) scale(0.97);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.23,1,0.32,1), opacity 0.35s ease;
}

.backdrop.open .modal { transform: none; opacity: 1; }

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 10;
  line-height: 1;
}
.modal-close:hover { background: rgba(255,255,255,0.18); }

/* Left col: image — fixed 16:9, same ratio as cards */
.modal-img-col {
  flex: 0 0 55%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 20px 0 0 20px;
  align-self: stretch;
}

.modal-img-col img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Right col: info */
.modal-info-col {
  flex: 1;
  padding: 28px 28px 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}

.modal-num {
  font-family: "Press Start 2P", system-ui;
  font-size: 9px;
  color: #888;
}

.modal-title {
  font-family: "Jost", sans-serif;
  font-weight: 700;
  font-size: 1.35rem;
  color: #fff;
  line-height: 1.25;
}

.modal-desc {
  font-family: "Jost", sans-serif;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.55);
  line-height: 1.65;
  flex: 1;
}

.modal-stack-label {
  font-family: "Press Start 2P", system-ui;
  font-size: 7px;
  color: rgba(255,255,255,0.3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 4px;
}

.modal-tags { display: flex; flex-wrap: wrap; gap: 6px; }

.modal-tag {
  font-family: "Jost", sans-serif;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 5px;
  padding: 3px 9px;
}

.modal-divider {
  height: 1px;
  background: rgba(255,255,255,0.07);
  margin: 4px 0;
}

.modal-github {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: rgba(255,255,255,0.85);
  font-family: "Jost", sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  padding: 10px 18px;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  align-self: flex-start;
}

.modal-github:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.35);
  color: #fff;
}

/* ── MOBILE infinite strip ── */
.proj-mobile-strip-wrap {
  overflow: hidden;
  width: 100%;
  margin-top: 1.5rem;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 7%, black 93%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, black 7%, black 93%, transparent 100%);
}

.proj-mobile-strip {
  display: flex;
  gap: 14px;
  width: max-content;
}

@keyframes proj-scroll-infinite {
  0%   { transform: translateX(0); }
  100% { transform: translateX(var(--proj-scroll-dist)); }
}

.proj-mobile-strip.running {
  animation: proj-scroll-infinite var(--proj-scroll-duration, 28s) linear infinite;
}

.proj-mobile-strip.paused { animation-play-state: paused; }

.proj-strip-card {
  flex: 0 0 200px;
  height: 250px;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  background: #111;
  border: 1px solid rgba(255,255,255,0.06);
}

.proj-strip-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(0.65);
  transition: filter 0.25s;
}

.proj-strip-card:active img { filter: brightness(0.9); }

.proj-strip-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.25) 55%, transparent 100%);
  pointer-events: none;
}

.proj-strip-body {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 12px 11px 11px;
}

.proj-strip-num {
  font-family: "Press Start 2P", system-ui;
  font-size: 7px;
  margin-bottom: 4px;
}

.proj-strip-title {
  font-family: "Jost", sans-serif;
  font-weight: 700;
  font-size: 12px;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 5px;
}

.proj-strip-tags { display: flex; gap: 4px; flex-wrap: wrap; }

.proj-strip-tag {
  font-family: "Jost", sans-serif;
  font-size: 9px;
  font-weight: 700;
  border-radius: 3px;
  padding: 2px 5px;
  opacity: 0.9;
}

/* ── SKILLS ── */
#skills { position: relative; }
article .icon { cursor: default; }

/* ── CONTACT ── */
#contact {
  display: flex;
  justify-content: center;
  flex-direction: column;
  height: 70vh;
}

.contact-info-upper-container {
  display: flex;
  justify-content: center;
  border-radius: 2rem;
  border: 0.1rem solid rgb(163,163,163);
  margin: 2rem auto;
  padding: 0.5rem;
}

.contact-info-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 1rem;
}

.contact-info-container p { font-size: larger; }
.contact-icon { cursor: default; }
.email-icon { height: 3.5rem; cursor: default; }

/* ── FOOTER ── */
footer { height: 26vh; margin: 0 1rem; }
footer p { text-align: center; }

/* ── SCROLL ANIMATION ── */
@keyframes appear {
  from { opacity: 0; scale: 0.5; }
  to   { opacity: 1; scale: 1; }
}

.scroll-block {
  animation: appear linear;
  animation-timeline: view();
  animation-range: entry 0% cover 30%;
}

/* ── HIGHLIGHT MARKER ── */
.marker {
  background: linear-gradient(120deg, #f9ca24 0%, #f9ca24 100%);
  background-repeat: no-repeat;
  background-size: 0% 40%;
  background-position: 0 90%;
  padding: 0 3px;
  transition: background-size 1s ease;
}

.marker.visible { background-size: 100% 40%; }

.shift { margin-left: 20px; }