/* ==========================================================================
   Tema & Pemboleh Ubah Asas — idrishalim.my
   ========================================================================== */
:root {
  --bg: #faf9f6;
  --bg-alt: #f2efe9;
  --surface: #ffffff;
  --surface-elevated: #ffffff;
  --text: #16181d;
  --text-muted: #525866;
  --border: rgba(22, 24, 29, 0.1);
  --border-strong: rgba(22, 24, 29, 0.2);

  --accent: #0f766e;
  --accent-hover: #0d625b;
  --accent-soft: rgba(15, 118, 110, 0.1);

  --shadow-sm: 0 2px 10px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 14px 36px rgba(16, 24, 40, 0.08);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --container: 1120px;
  --transition: 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

html[data-theme="dark"] {
  --bg: #0e1116;
  --bg-alt: #141922;
  --surface: #181e29;
  --surface-elevated: #1e2634;
  --text: #f3f5f8;
  --text-muted: #9aa4b5;
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.2);

  --accent: #2dd4bf;
  --accent-hover: #5eead4;
  --accent-soft: rgba(45, 212, 191, 0.12);

  --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 18px 40px rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   Reset & Asas Tipografi
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}

body {
  margin: 0;
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--transition), color var(--transition);
}

h1, h2, h3, h4, p, ul, ol, dl {
  margin-top: 0;
}

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

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 12px;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  z-index: 1000;
  font-weight: 600;
}

.skip-link:focus {
  left: 16px;
}

.container {
  width: min(100% - 2rem, var(--container));
  margin-inline: auto;
}

.section {
  padding-block: clamp(4rem, 7vw, 6.25rem);
}

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

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.section-heading h2 {
  font-size: clamp(1.75rem, 3vw, 2.4rem);
  line-height: 1.2;
  letter-spacing: -0.025em;
  margin-bottom: 1.25rem;
}

/* ==========================================================================
   Navigasi
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background-color: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 700;
}

.brand-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  background: #ffffff;
  border: 1.5px solid var(--border-strong);
  flex-shrink: 0;
}

html[data-theme="dark"] .brand-mark {
  color: #081211;
}

.brand-text .accent {
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--text-muted);
}

.nav-links a {
  transition: color var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
}

.nav-links .nav-cta {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.nav-links .nav-cta:hover {
  background: var(--accent);
  color: #ffffff;
}

html[data-theme="dark"] .nav-links .nav-cta:hover {
  color: #081211;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color var(--transition), transform var(--transition);
}

.icon-btn:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

html[data-theme="light"] .icon-sun {
  display: none;
}

html[data-theme="dark"] .icon-moon {
  display: none;
}

.mobile-menu-btn {
  display: none;
}

/* ==========================================================================
   Butang
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.78rem 1.35rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform var(--transition), background-color var(--transition), border-color var(--transition);
}

.btn svg {
  width: 17px;
  height: 17px;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
}

html[data-theme="dark"] .btn-primary {
  color: #081211;
}

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

.btn-secondary {
  background: var(--surface);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  border-color: var(--accent);
}

.btn-ghost {
  color: var(--text-muted);
}

.btn-ghost:hover {
  color: var(--text);
  background: var(--accent-soft);
}

.btn-sm {
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.85fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.availability-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.18);
}

.hero-title {
  font-size: clamp(2.25rem, 4.7vw, 3.6rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
}

.serif-highlight {
  font-family: "Instrument Serif", Georgia, serif;
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
  font-size: 1.08em;
}

.hero-subtitle {
  font-size: clamp(1.02rem, 1.4vw, 1.15rem);
  color: var(--text-muted);
  max-width: 58ch;
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  margin-bottom: 0;
}

.hero-metrics dt {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.hero-metrics dd {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* Kad Profil Hero */
.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
}

.hero-portrait {
  margin-bottom: 1.15rem;
  border-radius: calc(var(--radius-lg) - 6px);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #0f292a;
  aspect-ratio: 5 / 4;
}

.hero-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 14%;
}

.profile-frame {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.15rem;
}

.avatar-placeholder,
.profile-frame img {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  flex-shrink: 0;
}

.profile-frame img {
  object-fit: cover;
  border: 1px solid var(--border);
}

.avatar-placeholder {
  background: linear-gradient(135deg, var(--accent), #0284c7);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  font-weight: 700;
}

.avatar-placeholder.is-hidden,
.profile-frame img.is-hidden {
  display: none;
}

.profile-name {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 0.15rem;
}

.profile-role {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0;
}

.profile-highlights {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.95rem;
}

.profile-highlights li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.92rem;
}

.highlight-label {
  color: var(--text-muted);
  flex-shrink: 0;
}

.highlight-value {
  font-weight: 600;
  text-align: right;
  line-height: 1.45;
}

/* ==========================================================================
   Tentang Saya
   ========================================================================== */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: clamp(1.5rem, 5vw, 4rem);
  align-items: start;
}

.about-body p {
  font-size: 1.05rem;
  color: var(--text-muted);
}

.about-body p:last-child {
  margin-bottom: 0;
}

.about-body strong {
  color: var(--text);
}

.about-identity {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-top: 1.5rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.about-identity-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  background: #ffffff;
  border: 1.5px solid var(--border-strong);
  flex-shrink: 0;
}

.about-identity-name {
  font-weight: 700;
  font-size: 0.98rem;
  margin-bottom: 0.1rem;
}

.about-identity-role {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

/* ==========================================================================
   Projek Portfolio
   ========================================================================== */
.section-header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 2.25rem;
}

.section-header-row .section-heading h2 {
  margin-bottom: 0;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-btn {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  transition: all var(--transition);
}

.filter-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

html[data-theme="dark"] .filter-btn.active {
  color: #081211;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

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

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.project-card.is-hidden {
  display: none;
}

.project-thumb {
  height: 150px;
  padding: 1rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  color: #ffffff;
}

.thumb-teal {
  background: linear-gradient(135deg, #0f766e, #0284c7);
}

.thumb-amber {
  background: linear-gradient(135deg, #b45309, #ea580c);
}

.thumb-indigo {
  background: linear-gradient(135deg, #3730a3, #0f766e);
}

.thumb-emerald {
  background: linear-gradient(135deg, #047857, #0f766e);
}

.project-badge,
.project-year {
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(6px);
}

.project-year {
  white-space: nowrap;
  flex-shrink: 0;
}

.project-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.4rem;
}

.project-body h3 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.project-body p {
  color: var(--text-muted);
  font-size: 0.94rem;
  margin-bottom: 1.15rem;
}

.tech-tags {
  list-style: none;
  padding: 0;
  margin: auto 0 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.tech-tags li {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  background: var(--bg-alt);
  color: var(--text-muted);
}

.project-footer {
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
}

.text-link {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--accent);
}

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

/* ==========================================================================
   Pengalaman (Timeline)
   ========================================================================== */
.timeline {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
  display: grid;
  gap: 1.25rem;
}

.timeline-item {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 1.5rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.timeline-period {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
}

.timeline-content h3 {
  font-size: 1.08rem;
  margin-bottom: 0.45rem;
}

.timeline-content .company {
  color: var(--text-muted);
  font-weight: 500;
}

.timeline-content p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ==========================================================================
   Kemahiran
   ========================================================================== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.skill-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}

.skill-group h3 {
  font-size: 1.05rem;
  margin-bottom: 1rem;
}

.pill-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.pill-list li {
  font-size: 0.86rem;
  font-weight: 500;
  padding: 0.4rem 0.78rem;
  border-radius: 999px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
}

/* ==========================================================================
   Hubungi Saya & Footer
   ========================================================================== */
.contact-box {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 2.5rem;
  align-items: center;
}

.contact-copy h2 {
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  line-height: 1.2;
  margin-bottom: 0.9rem;
}

.contact-copy p {
  color: var(--text-muted);
  margin-bottom: 0;
}

.email-copy-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.email-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
}

.email-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.email-address {
  font-weight: 700;
  font-size: 1.05rem;
  word-break: break-all;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.social-pill {
  padding: 0.55rem 1rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.9rem;
  font-weight: 600;
  transition: border-color var(--transition), transform var(--transition);
}

.social-pill:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.site-footer {
  padding-block: 1.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-inner p {
  margin: 0;
}

.back-top:hover {
  color: var(--text);
}

/* ==========================================================================
   Modal & Toast
   ========================================================================== */
.project-modal {
  border: none;
  padding: 0;
  border-radius: var(--radius-lg);
  background: var(--surface-elevated);
  color: var(--text);
  width: min(100% - 2rem, 620px);
  box-shadow: var(--shadow-md);
}

.project-modal::backdrop {
  background: rgba(10, 14, 20, 0.62);
  backdrop-filter: blur(4px);
}

.modal-card {
  padding: 1.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.modal-eyebrow {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.modal-header h3 {
  font-size: 1.35rem;
  margin: 0;
}

.modal-body {
  padding-block: 1.25rem;
  display: grid;
  gap: 1rem;
}

.modal-block h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.modal-block p {
  margin: 0;
  font-size: 0.96rem;
}

.modal-stack {
  font-weight: 600;
}

.modal-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.modal-note {
  margin-right: auto;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
}

.is-hidden {
  display: none !important;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 0.75rem 1.15rem;
  border-radius: 12px;
  background: var(--text);
  color: var(--bg);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease;
  z-index: 200;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Animasi Reveal & Responsif
   ========================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 480ms ease, transform 480ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

@media (max-width: 960px) {
  .hero-grid,
  .about-grid,
  .contact-box {
    grid-template-columns: 1fr;
  }

  .projects-grid,
  .skills-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .mobile-menu-btn {
    display: grid;
  }

  .nav-links {
    position: absolute;
    top: 72px;
    left: 1rem;
    right: 1rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    padding: 0.9rem;
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    display: none;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
  }

  .projects-grid,
  .skills-grid,
  .timeline-item,
  .hero-metrics {
    grid-template-columns: 1fr;
  }

  .hero-metrics {
    gap: 0.9rem;
  }

  .timeline-item {
    gap: 0.5rem;
  }
}
