/* ==========================================================================
   Portofolio Arham Kamal — tokens, base, komponen, responsif
   ========================================================================== */

:root {
  --blue-800: #1e3a8a;
  --blue-700: #1e40af;
  --blue-100: #dbeafe;
  --blue-50: #eff6ff;
  --teal-600: #059669;
  --teal-500: #10b981;
  --teal-50: #ecfdf5;
  --teal-text: #047857;
  --ink: #0f172a;
  --text: #1f2937;
  --muted: #64748b;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --border: #e2e8f0;
  --focus: #2563eb;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 12px 32px -18px rgba(15, 23, 42, 0.25);

  --container: 1120px;
  --gutter: clamp(20px, 4vw, 32px);
  --section-pad: clamp(56px, 8vw, 96px);

  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

figure {
  margin: 0;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

a {
  color: var(--blue-700);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

h1,
h2,
h3 {
  color: var(--ink);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

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

h3 {
  font-size: 1.125rem;
  font-weight: 600;
}

p {
  max-width: 68ch;
}

/* ---------- Utilities ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--section-pad);
}

.surface-alt {
  background: var(--surface-alt);
  border-block: 1px solid var(--border);
}

.muted {
  color: var(--muted);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.mono-label,
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal-text);
}

.eyebrow {
  margin-bottom: 12px;
  font-weight: 600;
}

.section-head {
  max-width: 640px;
  margin-bottom: clamp(28px, 4vw, 44px);
}

.section-sub {
  margin-top: 12px;
  color: var(--muted);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--blue-700);
  color: #fff;
  border-radius: var(--radius-sm);
}

.skip-link:focus {
  top: 12px;
  text-decoration: none;
}

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.site-header.is-scrolled {
  border-bottom-color: var(--border);
  box-shadow: 0 6px 24px -18px rgba(15, 23, 42, 0.4);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--blue-700), var(--teal-600));
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
}

.brand-name {
  font-size: 1rem;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-link {
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 8px 2px;
  border-bottom: 2px solid transparent;
}

.nav-link:hover {
  color: var(--blue-700);
  text-decoration: none;
}

.nav-link.is-active {
  color: var(--blue-700);
  border-bottom-color: var(--teal-500);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  place-content: center;
  gap: 5px;
}

.nav-toggle-bar {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1;
  color: var(--blue-700);
  background: transparent;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease,
    transform 0.18s ease;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--blue-700);
  color: #fff;
}

.btn-primary:hover {
  background: var(--blue-800);
}

.btn-secondary {
  background: #fff;
  border-color: var(--blue-700);
  color: var(--blue-700);
}

.btn-secondary:hover {
  background: var(--blue-50);
}

.btn-sm {
  min-height: 40px;
  padding: 0 18px;
  font-size: 0.875rem;
}

.btn-on-dark {
  background: #fff;
  color: var(--blue-800);
}

.btn-on-dark:hover {
  background: var(--blue-50);
}

.btn-outline-light {
  border-color: rgba(255, 255, 255, 0.7);
  color: #fff;
}

.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* ---------- Chips & badges ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.875rem;
  line-height: 1.4;
}

.chip-sm {
  padding: 5px 11px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  background: var(--surface-alt);
}

.chip-check {
  width: 14px;
  height: 14px;
  color: var(--teal-600);
  flex: none;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--blue-100);
  color: var(--blue-800);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  width: fit-content;
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(160deg, var(--blue-50) 0%, var(--surface-alt) 55%, var(--teal-50) 100%);
  padding-block: clamp(40px, 7vw, 88px) clamp(48px, 8vw, 96px);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}

.display {
  font-size: clamp(2.5rem, 6vw, 4rem);
  line-height: 1.05;
  margin-bottom: 6px;
}

.role {
  font-size: clamp(1.125rem, 2vw, 1.375rem);
  font-weight: 600;
  color: var(--blue-700);
  margin-bottom: 16px;
}

.lede {
  color: var(--muted);
  max-width: 52ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

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

.hero-visual {
  display: grid;
  gap: 16px;
}

.profile-placeholder {
  position: relative;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  aspect-ratio: 4 / 5;
  max-height: 460px;
  border: 1px solid rgba(30, 64, 175, 0.18);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 70% 20%, rgba(16, 185, 129, 0.35), transparent 55%),
    linear-gradient(150deg, var(--blue-700), var(--blue-800) 55%, #0f766e);
  color: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.profile-placeholder::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.35);
  border-radius: 14px;
}

.placeholder-initials {
  font-family: var(--font-mono);
  font-size: clamp(3rem, 7vw, 4.5rem);
  font-weight: 600;
  letter-spacing: 0.08em;
}

.placeholder-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
}

.hero-note {
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--teal-500);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.hero-note p {
  margin-top: 4px;
  font-size: 0.9375rem;
  color: var(--text);
}

/* ---------- Tentang ---------- */
.split {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: start;
}

.split h2 {
  margin-bottom: 20px;
}

.split p + p {
  margin-top: 16px;
}

.stats {
  display: grid;
  gap: 12px;
}

.stat {
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.stat dt {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat dd {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--blue-700);
  line-height: 1.25;
}

.stat p {
  font-size: 0.875rem;
  color: var(--muted);
}

/* ---------- Cards / keahlian ---------- */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.skill-card h3 {
  margin-bottom: 6px;
}

.skill-card .muted {
  font-size: 0.9375rem;
}

/* ---------- Proyek ---------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.project-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  color: inherit;
  box-shadow: none;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.project-card:hover,
.project-card:focus-visible {
  border-color: var(--teal-500);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.cover {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: top center;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
}

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

.project-body h3 {
  font-size: 1.25rem;
}

.project-body .muted {
  font-size: 0.9375rem;
  flex: 1;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--blue-700);
  margin-top: 4px;
}

/* ---------- Timeline ---------- */
.timeline {
  position: relative;
  display: grid;
  gap: 28px;
  padding-left: 22px;
  border-left: 2px solid var(--border);
  max-width: 760px;
}

.timeline-item {
  position: relative;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -29px;
  top: 8px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--teal-500);
  box-shadow: 0 0 0 4px var(--surface);
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--teal-text);
  margin-bottom: 4px;
}

.timeline-item h3 {
  font-size: 1.0625rem;
}

.timeline-org {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 6px;
}

.timeline-item > p:last-child {
  font-size: 0.9375rem;
}

.subhead {
  margin-top: 40px;
  margin-bottom: 12px;
  font-size: 1.125rem;
}

.cert-list .chip {
  font-size: 0.8125rem;
}

/* ---------- CTA band ---------- */
.cta-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: clamp(28px, 4vw, 48px);
  border-radius: var(--radius-lg);
  background: linear-gradient(110deg, var(--blue-800) 0%, var(--blue-700) 55%, var(--teal-600) 100%);
  color: #fff;
}

.cta-band h2 {
  color: #fff;
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: 8px;
}

.cta-band p {
  color: rgba(255, 255, 255, 0.85);
  max-width: 46ch;
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  flex: none;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding-top: clamp(40px, 6vw, 64px);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1.3fr;
  gap: 32px;
  padding-bottom: 40px;
}

.footer-desc {
  margin-top: 14px;
  font-size: 0.9375rem;
  max-width: 38ch;
}

.footer-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

.footer-links {
  display: grid;
  gap: 8px;
  font-size: 0.9375rem;
}

.footer-links a,
.footer-links li {
  color: var(--text);
  padding-block: 4px;
}

.footer-links a:hover {
  color: var(--blue-700);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 18px;
  border-top: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--muted);
}

/* ---------- Detail proyek ---------- */
.case-header {
  padding-block: clamp(40px, 6vw, 72px);
  background: linear-gradient(160deg, var(--blue-50), var(--surface-alt) 60%, var(--teal-50));
  border-bottom: 1px solid var(--border);
}

.case-header h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin: 12px 0;
}

.case-lede {
  font-size: 1.0625rem;
  color: var(--muted);
  max-width: 60ch;
}

.case-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

/* Galeri hero studi kasus. Tanpa JS, ketiga gambar tampil bertumpuk ke bawah
   (semua konten tetap terbaca — lihat PRD FR-07); kelas .js yang mengubahnya
   jadi satu gambar per layar. Tanpa autoplay: hanya dikendalikan pengguna. */
.slider {
  margin-top: 32px;
}

.slider-slides {
  display: grid;
  gap: 20px;
}

.slider-slide img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: top center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-alt);
}

.slider-slide figcaption {
  margin-top: 8px;
  font-size: 0.8125rem;
  color: var(--muted);
}

.slider-controls {
  display: none;
}

.js .slider-slides {
  display: block;
}

.js .slider-slide {
  display: none;
}

.js .slider-slide.is-active {
  display: block;
}

.js .slider-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.slider-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--blue-700);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.slider-btn:hover {
  border-color: var(--blue-700);
  background: var(--blue-50);
}

.slider-dots {
  display: flex;
  margin-inline: 4px;
}

.slider-dot {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.slider-dot::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
}

.slider-dot.is-active::after {
  background: var(--teal-500);
}

.slider-status {
  margin-left: auto;
  color: var(--muted);
}

.slider-btn:focus-visible,
.slider-dot:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 999px;
}

.case-body {
  display: grid;
  grid-template-columns: minmax(0, 8fr) minmax(0, 4fr);
  gap: clamp(28px, 5vw, 56px);
  padding-block: var(--section-pad);
  align-items: start;
}

.case-content h2 {
  font-size: 1.5rem;
  margin: 32px 0 10px;
}

.case-content h2:first-child {
  margin-top: 0;
}

.case-content p + p {
  margin-top: 12px;
}

.case-content ul {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding-left: 20px;
  list-style: disc;
  color: var(--text);
}

.case-aside {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 16px;
}

.aside-card {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.aside-card h2 {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.note {
  padding: 16px 18px;
  border-left: 3px solid var(--teal-500);
  border-radius: var(--radius-sm);
  background: var(--teal-50);
  color: var(--teal-text);
  font-size: 0.9375rem;
}

.case-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: var(--section-pad);
}

/* ---------- Reveal ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Responsif ---------- */
@media (max-width: 1023px) {
  .hero-grid,
  .split {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    max-width: 420px;
  }

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

  .case-body {
    grid-template-columns: 1fr;
  }

  .case-aside {
    position: static;
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767px) {
  body {
    font-size: 1.0625rem;
  }

  .header-inner {
    min-height: 64px;
  }

  .nav-toggle {
    display: grid;
  }

  .nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    display: none;
    padding: 12px var(--gutter) 20px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 18px 30px -24px rgba(15, 23, 42, 0.5);
  }

  .nav.is-open {
    display: block;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }

  .nav-link {
    display: block;
    min-height: 48px;
    padding: 12px 4px;
    border-bottom: 1px solid var(--border);
  }

  .nav-list .btn {
    margin-top: 10px;
    width: 100%;
  }

  .project-grid,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .cta-band {
    flex-direction: column;
    align-items: flex-start;
  }

  .cta-actions {
    width: 100%;
  }

  .cta-actions .btn {
    flex: 1;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  .case-aside {
    grid-template-columns: 1fr;
  }

  .profile-placeholder {
    max-height: 420px;
  }
}

@media (max-width: 479px) {
  .display {
    font-size: clamp(2.25rem, 11vw, 2.75rem);
  }

  .brand-name {
    font-size: 0.9375rem;
  }

  .stat {
    padding: 16px;
  }

  .timeline {
    padding-left: 18px;
  }

  .timeline-item::before {
    left: -25px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}
