/* ==========================================================
   Dymas Alfin — Portfolio
   Design tokens
   ========================================================== */
:root {
  --bg: #ffffff;
  --bg-soft: #f5f5f3;
  --bg-dark: #17171a;
  --ink: #121214;
  --ink-soft: #6f6f72;
  --line: #e4e4e1;
  --line-dark: #2c2c30;
  --accent: #3fbf6f;
  --radius-sm: 10px;
  --radius-md: 18px;
  --container: 1180px;

  --font-display: 'Space Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Inter', 'Helvetica Neue', Arial, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

a {
  color: inherit;
  text-decoration: none;
}
ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
h1,
h2,
h3,
p {
  margin: 0;
}

.arrow {
  display: inline-block;
  transition: transform 0.2s ease;
}
a:hover .arrow,
.tab:hover .arrow {
  transform: translate(2px, -2px);
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* ---------- shared building blocks ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.4rem;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  transition:
    transform 0.18s ease,
    background 0.18s ease;
}
.btn-dark {
  background: var(--ink);
  color: #fff;
}
.btn-dark:hover {
  transform: translateY(-2px);
  background: #000;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-soft);
  background: #fff;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(63, 191, 111, 0.15);
}

.pill-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  transition:
    background 0.18s ease,
    border-color 0.18s ease;
}
.pill-link:hover {
  background: var(--bg-soft);
  border-color: var(--ink);
}

.ghost-heading {
  position: relative;
  isolation: isolate;
  margin-bottom: 2.5rem;
  padding-top: clamp(1.5rem, 6vw, 3.2rem);
}
.ghost-heading::before {
  content: attr(data-ghost);
  position: absolute;
  top: -0.28em;
  left: 0;
  z-index: -1;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3.5rem, 13vw, 8rem);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
  opacity: 0.05;
  white-space: nowrap;
  pointer-events: none;
}
.ghost-heading.light::before {
  color: #fff;
  opacity: 0.07;
}
.ghost-heading .section-label {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  letter-spacing: -0.01em;
  color: var(--ink);
}
.ghost-heading.light .section-label {
  color: #fff;
}

/* ---------- reveal-on-load (single orchestrated hero sequence) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  animation: revealUp 0.7s cubic-bezier(0.22, 0.9, 0.32, 1) forwards;
  animation-delay: var(--d, 0s);
}
@keyframes revealUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================
   NAV
   ========================================================== */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.9rem;
  font-size: 0.92rem;
  font-weight: 500;
}
.nav-links a {
  color: var(--ink-soft);
  transition: color 0.15s ease;
}
.nav-links a:hover {
  color: var(--ink);
}
.nav-links .count {
  color: #b7b7b4;
  font-size: 0.8em;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}
.menu-toggle span {
  width: 18px;
  height: 2px;
  background: var(--ink);
  margin: 0 auto;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}
.nav-mobile {
  display: none;
  flex-direction: column;
  padding: 0.5rem 1.5rem 1.25rem;
  gap: 0.25rem;
  border-top: 1px solid var(--line);
}
.nav-mobile a {
  padding: 0.75rem 0;
  font-weight: 500;
  border-bottom: 1px solid var(--line);
}
.nav.is-open .nav-mobile {
  display: flex;
}

@media (max-width: 860px) {
  .nav-links,
  .nav-cta {
    display: none;
  }
  .menu-toggle {
    display: flex;
  }
}

/* ==========================================================
   HERO
   ========================================================== */
.hero {
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 5rem) 1.5rem 0;
  text-align: center;
  position: relative;
}
.hero-name {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 0.92;
  font-size: clamp(2.6rem, 10vw, 7.2rem);
  letter-spacing: -0.02em;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 0.35em;
}
.hero-name .outline {
  -webkit-text-stroke: 1.5px var(--ink);
  color: transparent;
}
.hero-name .filled {
  color: var(--ink);
}

.hero-photo {
  margin: -1.2rem auto 0;
  width: min(340px, 60vw);
}
.photo-frame {
  aspect-ratio: 3/3.4;
  border-radius: var(--radius-md);
  background: var(--bg-soft);
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(18, 18, 20, 0.14);
}
.photo-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center top;
}

.hero-bottom {
  max-width: var(--container);
  margin: 1.5rem auto 0;
  padding: 0 0 4rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.hero-intro {
  max-width: 380px;
}
.eyebrow {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}
.hero-desc {
  color: var(--ink-soft);
  margin-bottom: 1.4rem;
  max-width: 32ch;
}
.hero-social {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex-shrink: 0;
}
.hero-social a {
  display: block;
  padding: 0.6rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 500;
  text-align: center;
  transition:
    background 0.18s ease,
    border-color 0.18s ease;
}
.hero-social a:hover {
  background: var(--bg-soft);
  border-color: var(--ink);
}

@media (max-width: 700px) {
  .hero-bottom {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  .hero-intro {
    max-width: none;
  }
  .hero-desc {
    margin-left: auto;
    margin-right: auto;
  }
  .hero-social {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* ==========================================================
   SECTION shared spacing
   ========================================================== */
.work,
.service,
.experience {
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(3.5rem, 7vw, 6rem) 1.5rem;
}
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 0;
}

/* ==========================================================
   WORK
   ========================================================== */
.work-controls {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}
.filter-tabs {
  display: flex;
  gap: 0.4rem;
  padding: 0.3rem;
  border: 1px solid var(--line);
  border-radius: 999px;
}
.tab {
  border: none;
  background: transparent;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  transition:
    background 0.18s ease,
    color 0.18s ease;
}
.tab.is-active {
  background: var(--ink);
  color: #fff;
}
.tab:not(.is-active):hover {
  background: var(--bg-soft);
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.75rem;
}
.work-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #fff;
  transition:
    border-color 0.18s ease,
    transform 0.18s ease;
}
.work-card:hover {
  border-color: var(--ink);
  transform: translateY(-3px);
}
.work-thumb {
  aspect-ratio: 16/10;
  position: relative;
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(63, 191, 111, 0.13), rgba(18, 18, 20, 0.05)), var(--bg-soft);
}
.work-gallery {
  padding: 0.8rem;
  background: linear-gradient(135deg, rgba(63, 191, 111, 0.12), rgba(18, 18, 20, 0.03)), #eef6f1;
  overflow: hidden;
}
.work-gallery img {
  width: 100%;
  height: 100%;
  min-width: 0;
  display: block;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid rgba(18, 18, 20, 0.08);
}
.my-gallery {
  display: block;
  padding: 0;
  cursor: zoom-in;
}
.my-gallery img {
  position: absolute;
  inset: 0.75rem;
  width: calc(100% - 1.5rem);
  height: calc(100% - 1.5rem);
  background: #fff;
  opacity: 0;
  transform: translateX(10px);
  pointer-events: none;
  transition:
    opacity 0.28s ease,
    transform 0.28s ease;
}
.my-gallery img.is-active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}
.gallery-arrow {
  position: absolute;
  top: 50%;
  z-index: 3;
  display: grid;
  width: 2.1rem;
  height: 2.1rem;
  place-items: center;
  border: 1px solid rgba(18, 18, 20, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 10px 24px rgba(18, 18, 20, 0.12);
  cursor: pointer;
  transform: translateY(-50%);
  transition:
    background 0.18s ease,
    transform 0.18s ease,
    border-color 0.18s ease;
}
.gallery-arrow:hover {
  border-color: var(--ink);
  background: #fff;
  transform: translateY(-50%) scale(1.04);
}
.gallery-arrow-prev {
  left: 0.9rem;
}
.gallery-arrow-next {
  right: 0.9rem;
}
.gallery-dots {
  position: absolute;
  left: 50%;
  bottom: 0.7rem;
  display: flex;
  gap: 0.35rem;
  transform: translateX(-50%);
  z-index: 2;
}
.gallery-dots span {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: rgba(18, 18, 20, 0.3);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.75);
}
.gallery-dots span.is-active {
  background: var(--accent);
}
.certificate-preview {
  padding: 0.8rem;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(63, 191, 111, 0.12), rgba(18, 18, 20, 0.03)), #eef6f1;
}
.certificate-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  border: 1px solid rgba(18, 18, 20, 0.08);
  border-radius: 12px;
  background: #fff;
}

.gallery-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.gallery-modal.is-open {
  display: flex;
}
.gallery-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 18, 20, 0.82);
  backdrop-filter: blur(8px);
}
.gallery-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(1080px, 100%);
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr) 3rem;
  align-items: center;
  gap: 1rem;
}
.gallery-modal__figure {
  grid-column: 2;
  margin: 0;
  min-width: 0;
}
.gallery-modal__figure img {
  width: 100%;
  max-height: min(78vh, 760px);
  display: block;
  object-fit: contain;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.36);
}
.gallery-modal__figure figcaption {
  margin-top: 0.85rem;
  color: #fff;
  font-size: 0.92rem;
  text-align: center;
}
.gallery-modal__close,
.gallery-modal__arrow {
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    background 0.18s ease;
}
.gallery-modal__close:hover,
.gallery-modal__arrow:hover {
  background: #fff;
  transform: scale(1.04);
}
.gallery-modal__close {
  position: absolute;
  top: -3.8rem;
  right: 0;
  width: 2.6rem;
  height: 2.6rem;
  font-size: 1.45rem;
}
.gallery-modal__arrow {
  width: 3rem;
  height: 3rem;
  font-size: 1.25rem;
}
.gallery-modal__arrow-prev {
  grid-column: 1;
}
.gallery-modal__arrow-next {
  grid-column: 3;
}
.gallery-modal__dots {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  gap: 0.55rem;
}
.gallery-modal__dots button {
  width: 0.65rem;
  height: 0.65rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.38);
  cursor: pointer;
}
.gallery-modal__dots button.is-active {
  background: var(--accent);
  border-color: var(--accent);
}
body.has-gallery-modal {
  overflow: hidden;
}
@media (prefers-reduced-motion: reduce) {
  .my-gallery img,
  .gallery-arrow,
  .gallery-modal__close,
  .gallery-modal__arrow {
    transition: none;
  }
}
@media (max-width: 700px) {
  .gallery-modal {
    padding: 1rem;
  }
  .gallery-modal__dialog {
    grid-template-columns: 2.6rem minmax(0, 1fr) 2.6rem;
    gap: 0.55rem;
  }
  .gallery-modal__figure img {
    max-height: 74vh;
    border-radius: 10px;
  }
  .gallery-modal__close {
    top: -3.2rem;
    width: 2.4rem;
    height: 2.4rem;
  }
  .gallery-modal__arrow {
    width: 2.6rem;
    height: 2.6rem;
  }
}
.project-icon::before,
.project-icon::after {
  content: '';
  display: block;
  position: absolute;
}
.project-icon::before {
  width: 76px;
  height: 76px;
  border: 2px solid var(--ink);
  background: #fff;
  box-shadow: 10px 10px 0 rgba(18, 18, 20, 0.1);
}
.project-mobile::before {
  width: 48px;
  height: 82px;
  border-radius: 14px;
}
.project-mobile::after {
  width: 18px;
  height: 3px;
  border-radius: 999px;
  background: var(--ink);
  bottom: calc(50% - 32px);
}
.project-web::before {
  width: 92px;
  height: 64px;
  border-radius: 10px;
}
.project-web::after {
  width: 92px;
  height: 16px;
  top: calc(50% - 32px);
  border-bottom: 2px solid var(--ink);
  background: linear-gradient(
    90deg,
    var(--accent) 8px,
    transparent 8px 16px,
    var(--line) 16px 24px,
    transparent 24px
  );
  border-radius: 10px 10px 0 0;
}
.project-api::before {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  transform: rotate(45deg);
}
.project-api::after {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow:
    -42px 0 0 var(--ink),
    42px 0 0 var(--ink),
    0 -42px 0 var(--ink),
    0 42px 0 var(--ink);
}
.project-certificate::before {
  width: 66px;
  height: 86px;
  border-radius: 8px;
}
.project-certificate::after {
  width: 34px;
  height: 34px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--accent);
  bottom: calc(50% - 34px);
}
.work-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.3;
  padding: 1.25rem 1.25rem 0;
}
.tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.9rem 1.25rem 1.4rem;
}
.tags span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  font-size: 0.78rem;
  color: var(--ink-soft);
}
.work-card.is-hidden {
  display: none;
}

@media (max-width: 700px) {
  .work-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================
   SERVICE
   ========================================================== */
.service-list li {
  border-top: 1px solid var(--line);
}
.service-list li:last-child {
  border-bottom: 1px solid var(--line);
}
.service-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.7rem 0.25rem;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 4vw, 2.1rem);
  font-weight: 600;
  transition:
    padding-left 0.2s ease,
    color 0.2s ease;
}
.service-list a:hover {
  padding-left: 0.75rem;
  color: var(--ink-soft);
}
.service-list a:hover .arrow {
  color: var(--ink);
  transform: translate(3px, -3px);
}

/* ==========================================================
   EXPERIENCE
   ========================================================== */
.experience {
  background: var(--bg-dark);
  border-radius: var(--radius-md);
  max-width: calc(var(--container) - 3rem);
  margin: 0 auto clamp(3.5rem, 7vw, 6rem);
  color: #fff;
}
.exp-years {
  color: #9a9a9e;
  font-size: 0.95rem;
  margin-bottom: 2.5rem;
}
.experience-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.4rem 0;
  border-top: 1px solid var(--line-dark);
}
.experience-list li:last-child {
  border-bottom: 1px solid var(--line-dark);
}
.exp-company {
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 0.2rem;
}
.exp-role {
  color: #9a9a9e;
  font-size: 0.92rem;
}
.exp-date {
  color: #9a9a9e;
  font-size: 0.92rem;
  white-space: nowrap;
}

@media (max-width: 600px) {
  .experience-list li {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
  }
}

/* ==========================================================
   CONTACT
   ========================================================== */
.contact {
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(4rem, 9vw, 7rem) 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}
.contact h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.2rem, 6.5vw, 4rem);
  letter-spacing: -0.01em;
  max-width: 16ch;
}
.contact p {
  color: var(--ink-soft);
  max-width: 48ch;
}

/* ==========================================================
   FOOTER
   ========================================================== */
.footer {
  border-top: 1px solid var(--line);
  padding: 2rem 1.5rem;
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.88rem;
  color: var(--ink-soft);
}
.footer-social {
  display: flex;
  gap: 1.25rem;
}
.footer-social a:hover {
  color: var(--ink);
}
