* {
  box-sizing: border-box;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  margin: 0;
  padding: 0;
  overflow-x: clip;
  background: #0d1017;
  color: #e8eaee;
  font-family: "Inter";
  font-size: 16px;
  line-height: 1.6;

  background-image: radial-gradient(
    circle at 1px 1px,
    rgba(255, 255, 255, 0.035) 1px,
    transparent 0
  );
  background-size: 24px 24px;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 500;
  letter-spacing: -0.015em;
}

p {
  margin: 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 48px;
}

/* Bottom shadow */
.bottom-shadow {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 244px;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 1) 0%,
    rgba(0, 0, 0, 0.95) 30%,
    rgba(0, 0, 0, 0.6) 60%,
    transparent 100%
  );
  z-index: 50;
  transition: opacity 0.3s ease;
}

body.at-bottom .bottom-shadow {
  opacity: 0;
}

/* Scroll progress bar */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 100%;
  background: #f3c871;
  transform-origin: left;
  transform: scaleX(0);
  z-index: 200;
  box-shadow: 0 0 12px #f3c871;
}

/* Nav */
.nav {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px;
  background: rgba(13, 16, 23, 0.86);
  backdrop-filter: blur(24px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 1000px;
  box-shadow:
    0 10px 34px rgba(0, 0, 0, 0.52),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 10px;
  margin-right: 4px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  font-family: "JetBrains Mono";
  font-size: 12px;
}

.nav-dot {
  width: 8px;
  height: 8px;
  border-radius: 100px;
  background: #f3c871;
  box-shadow: 0 0 8px #f3c871;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(0.85);
  }
}

.nav-link {
  position: relative;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: bold;
  color: #9aa0aa;
  border-radius: 1000px;
  transition: 0.2s;
  cursor: pointer;
}

.nav-link:hover {
  color: #e8eaee;
}

.nav-link.active {
  color: #e8eaee;
  background: #1b1f28;
}

.nav-link .num {
  font-family: "JetBrains Mono";
  font-size: 10px;
  color: #6b7280;
  margin-right: 6px;
}

.nav-link.active .num {
  color: #f3c871;
}

.nav-toggle {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 0;
  cursor: pointer;
  margin-left: auto;
  color: #e8eaee;
  font-size: 22px;
}

/* burger and x icons */
.nav-toggle i {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition:
    opacity 0.2s,
    transform 0.25s;
}

.nav-toggle .icon-x {
  opacity: 0;
  transform: translate(-50%, -50%) rotate(-90deg);
}

.nav.open .nav-toggle .icon-burger {
  opacity: 0;
  transform: translate(-50%, -50%) rotate(90deg);
}

.nav.open .nav-toggle .icon-x {
  opacity: 1;
  transform: translate(-50%, -50%) rotate(0);
}

/* Title and signature */
.title {
  position: relative;
  min-height: 320vh;
}

.title-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.title-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 96px 96px;
  background-position: center;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
  pointer-events: none;
  opacity: 0.6;
  z-index: 0;
}

.signature {
  width: min(92vw, 1200px);
  height: auto;
  display: block;
  overflow: visible;
  z-index: 1;
  filter: drop-shadow(0 0 22px rgba(243, 200, 113, 0.25));
}

.signature > g > path {
  stroke: #f3c871;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Basic section */
.section {
  min-height: 100vh;
  padding: 130px 0;
  scroll-margin-top: 80px;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 64px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.section-head .num {
  font-family: "JetBrains Mono";
  font-size: 13px;
  color: #f3c871;
}

.section-head h1 {
  font-family: "Rubik", "Inter";
  font-size: clamp(42px, 7vw, 56px);
  font-weight: 500;
  letter-spacing: -0.025em;
}

/* About */
.about-section {
  min-height: 480vh;
  padding: 0;
}

.about-sticky {
  position: sticky;
  top: 0;
  min-height: 100vh;
  padding: 130px 0;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas: "prose images";
  gap: 64px;
}

.about-text {
  grid-area: prose;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 19px;
  line-height: 1.6;
  text-align: justify;
  hyphens: auto;
}

.about-images {
  grid-area: images;
  position: relative;
  aspect-ratio: 1;
  border-radius: 18px;
  overflow: hidden;
  background: #13171f;
}

.about-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.about-image.active {
  opacity: 1;
}

.about-paragraph {
  color: #6b7280;
  opacity: 0.45;
  filter: blur(5px);
  transition: 0.45s ease;
}

.about-paragraph.revealed {
  color: #e8eaee;
  opacity: 1;
  filter: blur(0);
}

/* Education */
.timeline {
  position: relative;
  padding-left: 40px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: rgba(255, 255, 255, 0.16);
}

.timeline-group {
  margin-bottom: 64px;
}

.timeline-group:last-child {
  margin-bottom: 0;
}

.timeline-group-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 28px;
  margin-left: -40px;
  padding-left: 40px;
  position: relative;
}

.timeline-group-head::before {
  content: "";
  position: absolute;
  left: 6px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #0d1017;
  border: 2px solid #f3c871;
  box-shadow: 0 0 12px rgba(243, 200, 113, 0.32);
}

.timeline-group-head h2 {
  font-family: "Rubik";
  font-size: 28px;
  font-weight: 500;
}

.timeline-group-head h2 a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

.timeline-group-head h2 a:hover {
  color: #f3c871;
}

.timeline-item {
  position: relative;
  padding: 20px 28px 20px 40px;
  background: #13171f;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  margin-bottom: 16px;
  margin-left: -40px;
  transition:
    border-color 0.2s,
    transform 0.2s;
}

.timeline-item:hover {
  border-color: rgba(243, 200, 113, 0.32);
  transform: translateX(2px);
}

.timeline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 6px;
}

.timeline-date {
  font-family: "JetBrains Mono";
  font-size: 11px;
  color: #f3c871;
}

.timeline-place {
  font-size: 16px;
  font-weight: 500;
}

/* Projects */
.project-scene {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  position: relative;
  margin-top: 80px;
}

.project-rail {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 80px 0;
}

.project-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 48px;
  background: linear-gradient(180deg, #13171f, #0d1017);
  position: relative;
  overflow: hidden;
  aspect-ratio: 4/5;
  display: flex;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
  transition: 0.25s ease;
}

.project-card:hover {
  transform: scale(1.03);
  border-color: rgba(243, 200, 113, 0.32);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}

.project-card-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      circle at 70% 20%,
      rgba(243, 200, 113, 0.14) 0%,
      transparent 60%
    ),
    linear-gradient(135deg, transparent 0%, #1b1f28 100%);
  pointer-events: none;
}

.project-card-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  z-index: 1;
}

.project-mark {
  width: min(85%, 320px);
  aspect-ratio: 1;
  border-radius: 24px;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: auto;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  padding: 32px;
}

.project-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.project-mark img[src$="demdis.png"] {
  transform: scale(0.92);
}

.project-mark img[src$="fithub.png"] {
  transform: scale(0.9);
}

.project-mark img[src$="praktik.svg"] {
  transform: scale(0.82);
}

.project-name {
  font-family: "Rubik", "Inter", sans-serif;
  font-size: 56px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 8px;
}

.project-tagline {
  font-family: "JetBrains Mono";
  font-size: 12px;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.project-foot {
  display: flex;
  justify-content: space-between;
  margin-top: 32px;
  font-family: "JetBrains Mono";
  font-size: 11px;
  color: #6b7280;
}

.project-content {
  display: flex;
  flex-direction: column;
  gap: 80px;
  padding: 80px 0;
}

.project-block {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.project-block-label {
  font-family: "JetBrains Mono";
  font-size: 11px;
  color: #f3c871;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 16px;
}

.project-block h2 {
  font-family: "Rubik", "Inter";
  font-size: 32px;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.project-block p {
  font-size: 17px;
  line-height: 1.65;
  color: #9aa0aa;
  text-wrap: pretty;
}

.project-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 24px;
}

.project-stat {
  padding: 18px 20px;
  background: #13171f;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.project-stat-label {
  font-family: "JetBrains Mono";
  font-size: 10px;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.project-stat-value {
  font-family: "Rubik", "Inter";
  font-size: 24px;
  font-weight: 500;
}

.tech-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #13171f;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1000px;
  font-family: "JetBrains Mono";
  font-size: 12px;
  color: #9aa0aa;
}

.chip::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #f3c871;
}

/* Skills */
.skills-cloud {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: linear-gradient(
    180deg,
    rgba(13, 16, 23, 0.65),
    rgba(13, 16, 23, 0.9)
  );
  padding: 44px 36px;
}

.stack-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 28px;
  align-items: baseline;
  margin-bottom: 20px;
}

.stack-row:last-child {
  margin-bottom: 0;
}

.stack-token {
  display: inline-block;
  font-family: "Rubik";
  letter-spacing: -0.02em;
  line-height: 1;
}

.text-xl {
  font-size: clamp(56px, 8vw, 132px);
  font-weight: 600;
}

.text-lg {
  font-size: clamp(42px, 6vw, 92px);
  font-weight: 600;
}

.text-md {
  font-size: clamp(30px, 4vw, 66px);
  font-weight: 500;
}

.text-sm {
  font-size: clamp(24px, 3vw, 48px);
  font-weight: 500;
}

.text-xs {
  font-size: clamp(18px, 2.2vw, 36px);
  font-weight: 500;
}

.color-cyan {
  color: #79c5e8;
}

.color-amber {
  color: #f0d182;
}

.color-green {
  color: #9be2ad;
}

.color-blue {
  color: #86aefc;
}

/* Contact */
.contact-section {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 80px;
  align-items: start;
}

.contact-headline {
  font-family: "Rubik";
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1;
  letter-spacing: -0.03em;
  font-weight: 500;
  margin-bottom: 24px;
}

.contact-headline .accent {
  color: #f3c871;
}

.contact-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
}

.contact-item {
  background: #13171f;
  padding: 22px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  transition: 0.2s;
}

.contact-item:hover {
  background: #1b1f28;
  color: #f3c871;
}

.contact-icon {
  font-size: 22px;
  color: #f3c871;
  width: 28px;
  text-align: center;
}

.contact-item > div {
  flex: 1;
}

.contact-label {
  font-family: "JetBrains Mono";
  font-size: 11px;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.contact-value {
  font-size: 16px;
}

.contact-arrow {
  width: 12px;
  height: 12px;
  border-top: 1.5px solid #e8eaee;
  border-right: 1.5px solid #e8eaee;
  transform: rotate(45deg);
  opacity: 0.5;
  transition: 0.2s;
}

.contact-item:hover .contact-arrow {
  border-top-color: #f3c871;
  border-right-color: #f3c871;
  opacity: 1;
  transform: rotate(45deg) translate(2px, -2px);
}

/* --- Footer --- */
.footer {
  padding: 32px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-family: "JetBrains Mono";
  font-size: 11px;
  color: #6b7280;
}

.footer .container {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

@media (max-width: 980px) {
  .bottom-shadow {
    display: block;
  }
  .container {
    padding: 0 28px;
  }
  .section {
    min-height: auto;
    padding: 90px 0;
  }

  .nav {
    width: calc(100% - 24px);
    border-radius: 18px;
    flex-wrap: wrap;
    padding: 8px;
    gap: 6px;
    background: rgba(13, 16, 23, 0.55);
    backdrop-filter: blur(18px) saturate(160%);
  }
  .nav-brand {
    flex: 1;
  }
  .nav-toggle {
    display: flex;
  }
  .nav-link {
    display: none;
    padding: 12px 16px;
    width: 100%;
    text-align: center;
    border-radius: 12px;
  }
  .nav-link .num {
    display: none;
  }
  .nav.open .nav-link {
    display: block;
  }

  .title {
    min-height: 280vh;
  }
  .title-grid {
    background-size: 56px 56px;
  }
  .project-name {
    font-size: 40px;
  }

  .about-section {
    min-height: auto;
    padding: 90px 0;
  }
  .about-sticky {
    position: static;
    min-height: auto;
    padding: 0;
  }
  .about-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
  }
  .about-images,
  .about-text {
    display: contents;
  }
  .about-images {
    aspect-ratio: auto;
    overflow: visible;
    background: none;
  }
  .about-image {
    position: static;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 50vh;
    aspect-ratio: auto;
    object-fit: contain;
    border-radius: 14px;
    margin: 0 auto;
    opacity: 0.45;
    filter: blur(5px);
    transition:
      opacity 0.45s ease,
      filter 0.45s ease;
  }
  .about-image.active {
    opacity: 1;
    filter: blur(0);
  }
  .about-paragraph[data-i="0"] {
    order: 1;
  }
  .about-image[data-i="0"] {
    order: 2;
  }
  .about-paragraph[data-i="1"] {
    order: 3;
  }
  .about-image[data-i="1"] {
    order: 4;
  }
  .about-paragraph[data-i="2"] {
    order: 5;
  }
  .about-image[data-i="2"] {
    order: 6;
  }

  .project-scene {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .project-rail {
    position: static;
    height: auto;
    padding: 32px 0;
  }
  .project-card {
    aspect-ratio: auto;
    padding: 28px;
  }
  .project-mark {
    width: 160px;
    height: 160px;
    padding: 18px;
  }
  .project-content {
    padding: 32px 0;
    gap: 48px;
  }
  .project-block {
    min-height: auto;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .skills-cloud {
    padding: 34px 24px;
  }
  .stack-row {
    gap: 14px 18px;
    margin-bottom: 16px;
  }
}
