/* ==========================================================================
   Portfolio — Havin Fahru
   Vanilla CSS. Design tokens di :root, tanpa drop-shadow (hairline border).
   ========================================================================== */

:root {
  --bg: #ffffff;
  --ink: #393939;
  --accent: #408175;
  --accent-deep: #2c5c52;
  --tint: #eaf3f1;
  --line: #e2e2df;
}

/* ---------- Reset dasar ---------- */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

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

a {
  color: var(--accent);
}

button {
  font: inherit;
  color: inherit;
}

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

section {
  scroll-margin-top: 72px;
}

.container {
  width: min(1120px, 92%);
  margin-inline: auto;
}

/* ---------- Nav ---------- */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  border-bottom: 1px solid transparent;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.nav.scrolled {
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom-color: var(--line);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}

.nav nav {
  display: flex;
  gap: 28px;
}

.nav nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
}

.nav nav a:hover {
  color: var(--accent);
}

/* ---------- Hero ---------- */

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 96px 0 64px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 56px;
  align-items: center;
}

.eyebrow {
  color: var(--accent-deep);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}

/* Nama hero: font display = Comic Relief (rounded), override Space Grotesk */
.hero h1 {
  font-size: clamp(3rem, 7vw, 5rem);
  font-family: "Comic Relief", "Space Grotesk", sans-serif;
  font-weight: 700;
  letter-spacing: 0;
}

.hero-role {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: clamp(1.25rem, 2.5vw, 1.6rem);
  color: var(--accent);
  margin-top: 12px;
}

.hero-desc {
  margin-top: 20px;
  max-width: 46ch;
  color: #5a5a58;
}

.hero-photo-img {
  width: 100%;
  max-width: 380px;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 16px;
  margin-left: auto;
}

/* ---------- About ---------- */

.about {
  padding: 96px 0;
}

.section-title {
  font-size: 2rem;
  margin-bottom: 40px;
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 48px;
}

.about-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-deep);
  margin-bottom: 20px;
}

.about-edu {
  border-right: 1px solid var(--line);
  padding-right: 48px;
}

.edu-item h4,
.exp-item h4 {
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.edu-org,
.exp-org {
  color: #5a5a58;
  font-size: 0.95rem;
}

.edu-year {
  margin-top: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-deep);
  background: var(--tint);
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
}

.exp-item {
  border-top: 1px solid var(--line);
  padding-top: 24px;
  margin-top: 24px;
}

.exp-item:first-of-type {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

.exp-period {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-deep);
  margin-bottom: 6px;
}

.exp-desc {
  margin-top: 8px;
  max-width: 68ch;
  color: #5a5a58;
  font-size: 0.95rem;
}

/* ---------- Portfolio ---------- */

.portfolio {
  padding: 96px 0;
}

/* Hairline grid: gap 1px dengan background garis, tanpa shadow */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.project-card {
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.project-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: transform 0.35s ease;
}

/* Hover: thumbnail zoom halus + judul berubah warna (tanpa shadow,
   card tidak bergeser agar grid hairline tidak rusak) */
.project-card:hover img,
.project-card:focus-within img {
  transform: scale(1.04);
}

.project-card h3 {
  font-size: 1.05rem;
  transition: color 0.2s ease;
}

.project-card:hover h3,
.project-card:focus-within h3 {
  color: var(--accent-deep);
}

.card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.card-desc {
  color: #5a5a58;
  font-size: 0.9rem;
  max-width: 60ch;
}

.tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  background: var(--tint);
  color: var(--accent-deep);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
}

.card-actions {
  margin-top: auto;
  padding-top: 4px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-detail {
  background: none;
  border: none;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0;
}

.btn-detail:hover {
  text-decoration: underline;
}

.card-link {
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
}

.card-link:hover {
  text-decoration: underline;
}

.portfolio-sentinel {
  height: 1px;
}

/* ---------- Footer ---------- */

.footer {
  background: var(--ink);
  color: #d9d9d6;
  padding: 64px 0;
  margin-top: 96px;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
}

.footer-copy {
  font-size: 0.9rem;
}

.socials {
  list-style: none;
  display: flex;
  gap: 14px;
}

.socials a {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  color: #d9d9d6;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.socials a:hover {
  border-color: var(--tint);
  color: #ffffff;
}

.socials svg {
  width: 18px;
  height: 18px;
}

.icon-fill {
  fill: currentColor;
}

.icon-stroke {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}

.icon-fill-dot {
  fill: currentColor;
  stroke: none;
}

/* Tombol kembali ke atas — fixed, ikon saja, muncul saat sudah scroll */
.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease,
    visibility 0.25s ease, background-color 0.2s ease;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.back-to-top:hover {
  background: var(--tint);
  color: var(--accent-deep);
}

.back-to-top svg {
  width: 20px;
  height: 20px;
}

/* ---------- Modal detail project ---------- */

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(57, 57, 57, 0.55);
}

.modal-panel {
  position: relative;
  width: min(760px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
}

.modal-panel video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 8px;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.modal-body {
  padding-top: 20px;
}

.modal-body h3 {
  font-size: 1.3rem;
  margin-bottom: 16px;
}

.modal-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
  margin-bottom: 16px;
}

.modal-meta dt {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-deep);
  margin-bottom: 2px;
}

.modal-meta dd {
  font-size: 0.95rem;
}

.modal-desc {
  max-width: 68ch;
  color: #5a5a58;
  font-size: 0.95rem;
}

/* ---------- Responsive ---------- */

@media (max-width: 760px) {
  .hero {
    padding-top: 88px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .hero-photo-img {
    max-width: 280px;
    margin-left: 0;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .about-edu {
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding-right: 0;
    padding-bottom: 40px;
  }

  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .nav nav {
    gap: 18px;
  }

  .portfolio-grid {
    grid-template-columns: 1fr;
  }

  .modal-meta {
    grid-template-columns: 1fr;
  }
}

/* ---------- Reduced motion: matikan animasi & transisi ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
