/* ─────────────────────────────────────────
   style.css - William Sanjaya Kesuma Portfolio
   ───────────────────────────────────────── */

/* ── RESET & VARIABLES ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0E0F0D;
  --surface: #161814;
  --text: #E8E4DC;
  --muted: #7A7870;
  --accent: #5DB88A;
  --accent-light: #7DD4A8;
  --line: #2A2C27;
  --white: #1A1C18;
  --serif: 'DM Serif Display', Georgia, serif;
  --sans: 'DM Sans', sans-serif;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.7;
  overflow-x: hidden;
}

/* ── NAV ── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 4rem;
  background: rgba(14,15,13,0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-logo {
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.01em;
}
.nav-links { display: flex; gap: 2.5rem; list-style: none; }
.nav-links a {
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
  position: relative;
  padding-bottom: 3px;
}
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}
.nav-links a:hover { color: var(--accent); }
.nav-links a:hover::after { transform: scaleX(1); transform-origin: left; }
.nav-right { display: flex; align-items: center; gap: 1.5rem; }
.nav-contact { display: flex; gap: 1rem; align-items: center; }
.nav-contact-link {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(93,184,138,0.1); text-decoration: none;
  transition: all 0.2s ease; overflow: hidden; flex-shrink: 0;
}
.nav-contact-link img { width: 16px; height: 16px; object-fit: contain; display: block; }
.nav-contact-link:hover { background: rgba(93,184,138,0.25); transform: scale(1.1); }
.nav-hamburger { display: none; }

/* ── SECTIONS ── */
section { padding: 7rem 4rem; }

/* ── HERO ── */
#hero {
  min-height: 100vh;
  display: flex; flex-direction: column; justify-content: center;
  padding: clamp(5rem, 8vh, 8rem) clamp(1.5rem, 5vw, 6rem) clamp(3rem, 5vh, 5rem) !important;
  position: relative; overflow: hidden;
}
.hero-container {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 4vw, 5rem); align-items: center;
  position: relative; z-index: 1;
  max-width: 1400px; margin: 0 auto; width: 100%;
}
.hero-content { position: relative; z-index: 1; }
.hero-label {
  display: flex; align-items: center; gap: 0.75rem;
  margin-bottom: clamp(1rem, 2vh, 1.5rem); min-height: 1.5rem;
  font-size: clamp(0.65rem, 0.8vw, 0.78rem); letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--accent); font-weight: 500;
}
.hero-label::before {
  content: ''; display: inline-block; width: 2rem; height: 1px;
  background: var(--accent); flex-shrink: 0;
}
h1 {
  font-family: var(--serif);
  font-size: clamp(2.8rem, 5.5vw, 7rem);
  line-height: 1.05; letter-spacing: -0.02em; color: var(--text);
  margin-bottom: clamp(1rem, 2vh, 1.5rem); word-spacing: 9999px;
}
h1 em { font-style: italic; color: var(--accent); word-spacing: normal; white-space: nowrap; }
.hero-sub {
  font-size: clamp(0.9rem, 1.1vw, 1.1rem); color: var(--muted);
  max-width: 52ch; margin-bottom: clamp(2rem, 3vh, 3rem);
  font-weight: 300; line-height: 1.7;
}
.hero-cta {
  display: inline-flex; align-items: center; gap: 0.75rem;
  background: var(--accent); color: #0E0F0D;
  padding: clamp(0.7rem, 1vh, 0.9rem) clamp(1.4rem, 2vw, 2rem);
  font-size: clamp(0.72rem, 0.85vw, 0.85rem); font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase;
  text-decoration: none; transition: background 0.2s, gap 0.2s;
}
.hero-cta:hover { background: var(--accent-light); gap: 1.2rem; }
.hero-frame { display: flex; align-items: center; justify-content: flex-end; }
.frame-inner {
  position: relative;
  width: clamp(240px, 30vw, 520px); height: clamp(240px, 30vw, 520px);
  border-radius: 50%; overflow: hidden;
  background: linear-gradient(135deg, var(--accent), #7DD4A8);
  box-shadow: 0 20px 60px rgba(93,184,138,0.25);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.frame-inner:hover { transform: scale(1.05); box-shadow: 0 30px 80px rgba(93,184,138,0.35); }
.hero-image { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }

/* ── ABOUT ── */
#about { background: var(--white); }
.about-grid {
  display: grid; grid-template-columns: 1fr 2fr;
  gap: 5rem; max-width: 1100px; margin: 0 auto; align-items: start;
}
.section-label {
  font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent); font-weight: 500; margin-bottom: 1.25rem;
  display: flex; align-items: center; gap: 0.75rem;
}
.section-label::before {
  content: ''; display: inline-block; width: 1.5rem; height: 1px; background: var(--accent);
}
h2 {
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.1; letter-spacing: -0.02em; margin-bottom: 2rem;
}
.about-right p { font-size: 1rem; color: var(--muted); margin-bottom: 1.5rem; max-width: 580px; }
.about-stats {
  display: flex; gap: 3rem; margin-top: 3rem;
  padding-top: 2.5rem; border-top: 1px solid var(--line);
}
.stat-num { font-family: var(--serif); font-size: 2.8rem; color: var(--accent); line-height: 1; }
.stat-label { font-size: 0.78rem; color: var(--muted); letter-spacing: 0.05em; margin-top: 0.3rem; }

/* ── EXPERIENCE ── */
#experience { background: var(--bg); }
.exp-inner { max-width: 900px; margin: 0 auto; }
.exp-header { margin-bottom: 4rem; }

.exp-item {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 0 3rem;
  padding: 2.5rem 0;
  border-top: 1px solid var(--line);
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s ease, transform 0.5s ease, background 0.3s ease;
}
.exp-item.visible { opacity: 1; transform: translateY(0); }
.exp-item:hover { background: rgba(93,184,138,0.03); }

.exp-date { font-size: 0.75rem; letter-spacing: 0.08em; color: var(--accent); font-weight: 500; text-transform: uppercase; margin-bottom: 0.5rem; }
.exp-company { font-size: 0.82rem; color: var(--muted); }
.exp-role { font-family: var(--serif); font-size: 1.35rem; margin-bottom: 0.75rem; line-height: 1.3; }
.exp-desc { font-size: 0.92rem; color: var(--muted); line-height: 1.7; }

.exp-toggle {
  background: none;
  border: 1px solid var(--line);
  color: var(--accent);
  padding: 0.6rem 1.2rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  margin-top: 1rem;
  transition: all 0.3s ease;
  font-family: var(--sans);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.exp-toggle:hover { border-color: var(--accent); background: rgba(93,184,138,0.07); }

.exp-details-content {
  grid-column: 1 / -1;
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}
.exp-item.active .exp-details-content {
  grid-template-rows: 1fr;
}
.details-inner {
  min-height: 0;
  overflow: hidden;
  padding-top: 0;
  transition: padding-top 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.exp-item.active .details-inner {
  border-top: 1px solid var(--line);
  padding-top: 2rem;
  margin-top: 1.5rem;
}
.details-grid { display: block; width: 100%; }
.details-text { margin-bottom: 2.5rem; max-width: 850px; }
.details-list { list-style: none; margin-top: 1rem; }
.details-list li {
  font-size: 0.85rem; color: var(--muted);
  padding: 0.4rem 0; position: relative; padding-left: 1.2rem;
}
.details-list li::before { content: '→'; position: absolute; left: 0; color: var(--accent); }

/* ── EXPERIENCE IMAGE CAROUSEL - DESKTOP ── */
.exp-carousel {
  width: 100%;
  overflow: hidden;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--bg);
  position: relative;
}
.exp-carousel-track {
  display: flex;
  width: max-content;
  animation: scrollExperience 30s linear infinite;
}
.exp-photo {
  width: 480px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-right: 1px solid var(--line);
}
@keyframes scrollExperience {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.exp-carousel:hover .exp-carousel-track { animation-play-state: paused; }

/* dots only visible on mobile */
.exp-carousel-dots { display: none; }

/* ── PROJECTS ── */
#projects { background: var(--white); }
.projects-header { max-width: 1100px; margin: 0 auto 3.5rem; }
.projects-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 1.5px; max-width: 1100px; margin: 0 auto; background: var(--line);
}
.project-card {
  background: var(--white); padding: 2.5rem; cursor: default;
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease, background 0.25s;
}
.project-card.visible { opacity: 1; transform: translateY(0); }
.project-card:hover { background: #141613; }
.project-tag {
  display: inline-block; font-size: 0.68rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent);
  background: rgba(93,184,138,0.1); padding: 0.25rem 0.7rem;
  margin-bottom: 1.5rem; font-weight: 500;
}
.project-title { font-family: var(--serif); font-size: 1.6rem; margin-bottom: 0.75rem; line-height: 1.2; }
.project-desc { font-size: 0.88rem; color: var(--muted); line-height: 1.7; margin-bottom: 1.5rem; }
.project-highlights { list-style: none; font-size: 0.82rem; color: var(--muted); }
.project-highlights li { padding: 0.3rem 0; padding-left: 1rem; position: relative; }
.project-highlights li::before { content: '→'; position: absolute; left: 0; color: var(--accent); font-size: 0.7rem; }

.project-case {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.6;
  font-style: italic;
  border-left: 2px solid var(--accent);
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 0 4px 4px 0;
  margin: 0.75rem 0;
}

/* ── SKILLS ── */
#skills { background: #131510; color: var(--text); }
.skills-inner { max-width: 1100px; margin: 0 auto; }
#skills h2 { color: var(--text); margin-bottom: 2.5rem; }

.skills-flat-grid {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}
.skill-category { }
.skill-category-title {
  font-size: 0.65rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent); font-weight: 500; margin-bottom: 1rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.skill-category-title::before {
  content: ''; display: inline-block; width: 1rem; height: 1px; background: var(--accent);
}
.skill-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.skill-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.75rem; font-weight: 300; border: 1px solid var(--accent);
  padding: 0.25rem 0.65rem; color: var(--text);
  background: rgba(93,184,138,0.10); transition: background 0.2s;
  cursor: default; border-radius: 2px;
}
.skill-tag:hover { background: rgba(93,184,138,0.22); }
.skill-tag i { font-size: 13px; flex-shrink: 0; }

/* ── ACHIEVEMENTS ── */
#achievements { background: var(--bg); }
.achievements-inner { max-width: 1100px; margin: 0 auto; }
.achievements-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 5rem; align-items: start; }
.achievements-col h2 { text-align: left; margin-bottom: 3rem; }
.timeline { position: relative; padding-left: 2.5rem; margin-bottom: 3rem; }
.timeline::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 1.5px;
  background: linear-gradient(to bottom, var(--accent) 0%, rgba(93,184,138,0.15) 100%);
}
.timeline-item {
  position: relative; padding-bottom: 2.5rem; opacity: 0; transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.timeline-item.visible { opacity: 1; transform: translateY(0); }
.timeline-marker {
  position: absolute; left: -2.82rem; top: 0.3rem; width: 1.1rem; height: 1.1rem;
  border-radius: 50%; background: var(--bg); border: 2px solid var(--accent);
  box-shadow: 0 0 0 3px var(--bg); transition: background 0.25s, border-color 0.25s;
}
.timeline-item:hover .timeline-marker { background: var(--accent); border-color: var(--accent-light); }
.timeline-date { font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); font-weight: 500; margin-bottom: 0.35rem; }
.timeline-content h4 { font-family: var(--serif); font-size: 1.2rem; color: var(--text); line-height: 1.25; margin-bottom: 0.25rem; }
.timeline-org { font-size: 0.82rem; color: var(--muted); font-style: italic; margin-bottom: 0.75rem; }
.timeline-desc { font-size: 0.9rem; color: var(--muted); line-height: 1.7; }
.highlight { color: var(--accent); font-weight: 500; }

/* ── CONTACT ── */
#contact { background: var(--bg); text-align: center; }
.contact-inner { max-width: 860px; margin: 0 auto; position: relative; z-index: 1; }
.contact-availability {
  display: inline-flex; align-items: center; gap: 0.55rem; font-size: 0.72rem;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); font-weight: 500;
  border: 1px solid rgba(93,184,138,0.3); padding: 0.35rem 0.9rem;
  border-radius: 999px; background: rgba(93,184,138,0.06); margin-bottom: 2.5rem;
}
.contact-availability::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(93,184,138,0.25); }
  50%       { box-shadow: 0 0 0 5px rgba(93,184,138,0.05); }
}
.contact-headline { font-family: var(--serif); font-size: clamp(2.8rem, 6vw, 5rem); line-height: 1.05; letter-spacing: -0.02em; margin-bottom: 1.25rem; }
.contact-headline em { font-style: italic; color: var(--accent); }
.contact-sub { font-size: 1rem; color: var(--muted); max-width: 460px; margin: 0 auto 4rem; line-height: 1.7; }
.contact-cards { display: flex; flex-wrap: wrap; gap: 0.85rem; justify-content: center; }
.contact-card {
  display: inline-flex; align-items: center; gap: 0.6rem; padding: 0.8rem 1.7rem;
  border: 1px solid rgba(93,184,138,0.35); border-radius: 999px;
  background: rgba(93,184,138,0.05); color: var(--text); text-decoration: none;
  font-size: 0.85rem; transition: all 0.28s ease; position: relative; overflow: hidden;
}
.contact-card:hover { color: #0E0F0D; border-color: var(--accent); transform: translateY(-3px); }
.contact-card::before {
  content: ''; position: absolute; inset: 0; background: var(--accent);
  transform: scaleX(0); transform-origin: left center; transition: transform 0.3s ease; z-index: 0;
}
.contact-card:hover::before { transform: scaleX(1); }
.contact-card-icon, .contact-card-value, .contact-card-arrow { position: relative; z-index: 1; }

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--line); padding: 2rem 4rem;
  display: flex; justify-content: space-between; align-items: center; background: var(--bg);
}
footer p { font-size: 0.78rem; color: var(--muted); }

/* ── SCROLL ANIMATIONS ── */
.fade-up { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.fade-up.visible { opacity: 1; transform: none; }

/* ── TABLET (max 1024px) ── */
@media (max-width: 1024px) {
  section { padding: 6rem 2.5rem; }
  .hero-container { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .about-grid { grid-template-columns: 1fr; gap: 2rem; }
  .projects-grid { grid-template-columns: 1fr; }
  .achievements-grid { grid-template-columns: 1fr; gap: 2rem; }
}

/* ── MOBILE (max 768px) ── */
@media (max-width: 768px) {

  /* NAV */
  nav { padding: 1rem 1.5rem; }
  .nav-links { display: none; }
  .nav-contact { gap: 0.75rem; }
  .nav-hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 4px;
    order: -1;
  }
  .nav-hamburger span {
    display: block;
    width: 22px;
    height: 1.5px;
    background: var(--text);
    transition: all 0.3s ease;
  }
  .nav-mobile-open .nav-links {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 57px;
    left: 0; right: 0;
    background: rgba(14,15,13,0.97);
    backdrop-filter: blur(12px);
    padding: 2rem 1.5rem;
    gap: 1.5rem;
    border-bottom: 1px solid var(--line);
    z-index: 99;
  }

  /* SECTIONS */
  section { padding: 4rem 1.25rem; }

  /* HERO */
  #hero { padding: 6rem 1.25rem 3rem !important; }
  .hero-container {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    text-align: center;
  }
  .hero-content { order: 2; }
  .hero-frame { order: 1; justify-content: center; }
  .frame-inner {
    width: clamp(160px, 55vw, 260px);
    height: clamp(160px, 55vw, 260px);
  }
  .hero-label { justify-content: center; }
  h1 { word-spacing: normal; font-size: clamp(2.4rem, 9vw, 3.5rem); }
  .hero-sub { margin: 0 auto 2rem; }
  .hero-cta { margin: 0 auto; }

  /* ABOUT */
  .about-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .about-stats { gap: 1.5rem; flex-wrap: wrap; }

  /* EXPERIENCE */
  .exp-item {
    grid-template-columns: 1fr;
    gap: 0.25rem;
    padding: 1.75rem 0;
  }
  .exp-meta {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
  }
  .exp-date { margin-bottom: 0; }
  .exp-company::before { content: '·'; margin-right: 0.25rem; color: var(--muted); }

  /* EXPERIENCE CAROUSEL - MOBILE */
  .exp-carousel {
    width: 100%;
    overflow: hidden;
    border-radius: 6px;
    border: 1px solid var(--line);
    touch-action: pan-y;
  }
  .exp-carousel-track {
    display: flex;
    /* width is set by JS as carousel.offsetWidth * total slides */
    animation: none !important;
    transition: transform 0.35s ease;
    will-change: transform;
  }
  .exp-photo {
    flex: 0 0 auto;
    width: 100%;        /* each photo = full carousel width, set by JS */
    max-width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-right: none;
    border-radius: 6px;
    display: block;
  }
  .exp-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
  }
  .exp-carousel-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--line); border: 1px solid var(--muted);
    cursor: pointer; transition: background 0.2s;
  }
  .exp-carousel-dot.active {
    background: var(--accent); border-color: var(--accent);
  }

  /* PROJECTS */
  .projects-grid { grid-template-columns: 1fr; }
  .project-card { padding: 1.75rem 1.25rem; }

  /* SKILLS */
  .skill-tags { gap: 0.35rem; }
  .skill-tag { font-size: 0.7rem; padding: 0.2rem 0.5rem; }

  /* ACHIEVEMENTS */
  .achievements-grid { grid-template-columns: 1fr; gap: 0; }
  .achievements-col h2 { margin-bottom: 2rem; }

  /* CONTACT */
  .contact-headline { font-size: clamp(2rem, 10vw, 2.8rem); }
  .contact-cards { flex-direction: column; align-items: center; }
  .contact-card { width: 100%; max-width: 320px; justify-content: center; }

  /* FOOTER */
  footer { flex-direction: column; gap: 0.5rem; text-align: center; padding: 1.5rem 1.25rem; }

  h2 { font-size: clamp(1.75rem, 7vw, 2.5rem); }
}


/* ── SMALL MOBILE (max 380px) ── */
@media (max-width: 380px) {
  .exp-meta { flex-direction: column; gap: 0.1rem; }
  .exp-company::before { display: none; }
  .skill-tag { font-size: 0.65rem; }
  .frame-inner { width: 140px; height: 140px; }
}