/* =============================================
   DESIGN SYSTEM — Ammar Portfolio 2026
   Premium · Minimal · Modern · Interactive
   ============================================= */

/* ── 1. DESIGN TOKENS ──────────────────────── */
:root {
  /* Color */
  --bg:           #050505;
  --surface:      #111111;
  --card:         #181818;
  --card-hover:   #1e1e1e;
  --primary:      #0000ff;
  --primary-h:    #3333ff;
  --text:         #FFFFFF;
  --text-2:       #B3B3B3;
  --text-3:       #666666;
  --border:       rgba(255,255,255,0.08);
  --border-h:     rgba(255,255,255,0.14);
  --success:      #22C55E;
  --error:        #EF4444;

  /* Typography */
  --font:         'Inter', 'Manrope', 'Plus Jakarta Sans', system-ui, sans-serif;

  /* Spacing (8pt grid) */
  --s-1: 8px;
  --s-2: 16px;
  --s-3: 24px;
  --s-4: 32px;
  --s-5: 40px;
  --s-6: 48px;
  --s-8: 64px;
  --s-10: 80px;
  --s-12: 96px;

  /* Radius */
  --r-sm:  12px;
  --r:     20px;
  --r-lg:  28px;

  /* Transitions */
  --ease:  cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --t:     0.28s;
  --t-slow: 0.6s;

  /* Shadows */
  --shadow-card: 0 1px 3px rgba(0,0,0,0.4), 0 4px 16px rgba(0,0,0,0.2);
  --shadow-card-h: 0 4px 24px rgba(0,0,0,0.5), 0 1px 3px rgba(0,0,0,0.4);
  --glow-primary: 0 0 40px rgba(0,0,255,0.12);

  /* Layout */
  --container:    1160px;
  --navbar-h:     72px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  tab-size: 4;
  overflow-x: hidden;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea { font-family: inherit; }
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ── 3. LAYOUT ─────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--s-3);
}

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

/* ── 4. TYPOGRAPHY ─────────────────────────── */
.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: var(--s-3);
}
.section-eyebrow::before {
  content: '';
  display: block;
  width: 28px;
  height: 2px;
  background: var(--primary);
  opacity: 0.7;
}

.section-title {
  font-size: clamp(2.2rem, 5.5vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.08;
  margin-bottom: var(--s-4);
}

.section-desc {
  font-size: 1rem;
  color: var(--text-2);
  max-width: 560px;
  margin-bottom: var(--s-6);
  line-height: 1.7;
}

/* ── 5. CARD ───────────────────────────────── */

@keyframes cardSpin {
  to { transform: rotate(360deg); }
}

.card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: none;
  border-radius: var(--r);
  padding: var(--s-4);
  transition: transform var(--t) var(--ease),
              box-shadow var(--t) var(--ease);
  box-shadow: var(--shadow-card);
}

/* Spinning gradient disc — pake transform:rotate() agar works di semua browser */
.card::before {
  content: '';
  position: absolute;
  width: 200%;
  height: 200%;
  top: -50%;
  left: -50%;
  background: conic-gradient(
    from 0deg,
    transparent   0deg,
    var(--primary) 25deg,
    rgba(255,255,255,0.55) 36deg,
    var(--primary-h) 47deg,
    transparent   72deg,
    transparent   360deg
  );
  animation: cardSpin 3.8s linear infinite;
  z-index: -2;
}

/* Inner background fill — menutupi disc kecuali area border 1.5px */
.card::after {
  content: '';
  position: absolute;
  inset: 1.5px;
  background: var(--card);
  border-radius: calc(var(--r) - 1.5px);
  z-index: -1;
  transition: background var(--t) var(--ease);
}

.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-card-h); }
.card:hover::after { background: var(--card-hover); }

/* Kecepatan berbeda per tipe card agar tidak monoton */
.skill-card::before    { animation-duration: 3.1s; }
.stat-card::before     { animation-duration: 2.6s; }
.cert-card::before     { animation-duration: 4.5s; }
.timeline-card::before { animation-duration: 5.2s; }

/* Stagger posisi awal supaya tidak sinkron */
.card:nth-child(2)::before { animation-delay: -1.2s; }
.card:nth-child(3)::before { animation-delay: -2.4s; }
.card:nth-child(4)::before { animation-delay: -3.6s; }
.card:nth-child(5)::before { animation-delay: -0.6s; }

/* ── 6. BUTTONS ────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  padding: 12px 22px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background var(--t) var(--ease),
              color var(--t) var(--ease),
              border-color var(--t) var(--ease),
              transform var(--t) var(--ease),
              box-shadow var(--t) var(--ease);
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--primary);
  color: #fff;
  border: 1px solid transparent;
}
.btn-primary:hover {
  background: var(--primary-h);
  box-shadow: 0 0 24px rgba(0,0,255,0.35);
}

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  color: var(--text);
  border-color: var(--border-h);
  background: rgba(255,255,255,0.04);
}

.btn-sm     { padding: 8px 16px; font-size: 13px; }
.nav-cta    { display: none; }
.btn-full { width: 100%; justify-content: center; }

/* Tag */
.tag {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 50px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-2);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  letter-spacing: 0.02em;
}
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--s-3); }

/* ── 7. LOADER ─────────────────────────────── */
#loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s var(--ease), visibility 0.6s var(--ease);
}
#loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-3);
}

.loader-logo {
  width: 64px;
  height: 64px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.05em;
  color: var(--text);
  animation: logoPulse 1.5s var(--ease) infinite alternate;
}
@keyframes logoPulse {
  from { border-color: var(--border); box-shadow: none; }
  to   { border-color: rgba(0,0,255,0.4); box-shadow: var(--glow-primary); }
}

.loader-bar-track {
  width: 120px;
  height: 2px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.loader-bar-fill {
  height: 100%;
  width: 0;
  background: var(--primary);
  border-radius: 99px;
  transition: width 0.05s linear;
}

.loader-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* ── 8. CUSTOM CURSOR ──────────────────────── */
.cursor-ring, .cursor-dot {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  will-change: transform;
}
.cursor-ring {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255,255,255,0.25);
  transform: translate(-50%, -50%);
  transition: transform 0.12s var(--ease), opacity 0.3s;
  transition-property: width, height, border-color, opacity;
}
.cursor-dot {
  width: 5px;
  height: 5px;
  background: var(--primary);
  transform: translate(-50%, -50%);
}
.cursor-ring.hovering {
  width: 52px;
  height: 52px;
  border-color: var(--primary);
  opacity: 0.6;
}
@media (pointer: coarse) {
  .cursor-ring, .cursor-dot { display: none; }
}

/* ── 9. NAVBAR ─────────────────────────────── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 900;
  height: var(--navbar-h);
  transition: background var(--t) var(--ease),
              backdrop-filter var(--t) var(--ease),
              border-color var(--t) var(--ease);
  border-bottom: 1px solid transparent;
}
.navbar.scrolled {
  background: rgba(5,5,5,0.8);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom-color: var(--border);
}

.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: var(--s-4);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.logo-mark {
  width: 34px;
  height: 34px;
  background: var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.04em;
}
.logo-text {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.logo-img {
  height: 36px;
  width: auto;
  object-fit: contain;
  display: block;
}

.nav-links {
  display: none;
  gap: 4px;
  margin-inline: auto;
}
.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  padding: 6px 12px;
  border-radius: 8px;
  transition: color var(--t) var(--ease), background var(--t) var(--ease);
  position: relative;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 12px;
  right: 12px;
  height: 1px;
  background: var(--primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--t) var(--ease);
}
.nav-link:hover, .nav-link.active {
  color: var(--text);
}
.nav-link:hover::after, .nav-link.active::after {
  transform: scaleX(1);
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 6px;
  margin-left: auto;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--text-2);
  border-radius: 2px;
  transition: transform var(--t) var(--ease), opacity var(--t) var(--ease);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* Mobile menu */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 800;
  background: rgba(5,5,5,0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease), visibility 0.3s var(--ease);
}
.mobile-menu.open {
  opacity: 1;
  visibility: visible;
}
.mobile-menu ul {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-3);
}
.mobile-link {
  font-size: clamp(1.8rem, 7vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-2);
  transition: color var(--t) var(--ease), transform var(--t) var(--ease);
}
.mobile-link:hover { color: var(--text); transform: translateX(8px); }

/* ── 10. HERO ──────────────────────────────── */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding-top: var(--navbar-h);
  padding-bottom: 0;
}
/* Reset .section padding-block for hero only */
.hero.section { padding-block: 0; padding-top: var(--navbar-h); }

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}
.hero-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 40%, transparent 100%);
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 40%, transparent 100%);
}
.hero-glow {
  position: absolute;
  width: 600px;
  height: 600px;
  top: -10%;
  right: -5%;
  background: radial-gradient(circle, rgba(0,0,255,0.07) 0%, transparent 65%);
  border-radius: 50%;
  pointer-events: none;
}
.hero-glow--2 {
  top: 50%;
  right: -20%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(0,0,255,0.04) 0%, transparent 65%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  padding-block: var(--s-6);
}

.hero-content { max-width: 660px; }

/* Availability badge */
.availability-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid rgba(34,197,94,0.25);
  border-radius: 50px;
  background: rgba(34,197,94,0.05);
  font-size: 12px;
  font-weight: 500;
  color: #4ade80;
  margin-bottom: var(--s-4);
}
.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 2s ease infinite;
}
.badge-dot--sm {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  margin-right: 6px;
  animation: pulse 2s ease infinite;
  vertical-align: middle;
}
@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.4); }
  50%      { box-shadow: 0 0 0 6px rgba(34,197,94,0); }
}

.hero-title {
  font-size: clamp(3rem, 10vw, 5.5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.02;
  margin-bottom: var(--s-3);
}
.hero-title-em {
  font-style: italic;
  font-weight: 300;
  color: var(--text-2);
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  color: var(--text-2);
  margin-bottom: var(--s-2);
  min-height: 1.6em;
}
.typing-text { color: var(--text); font-weight: 600; }
.typing-cursor {
  color: var(--primary);
  animation: blink 0.9s step-end infinite;
  font-weight: 300;
}
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }

.hero-desc {
  font-size: 0.95rem;
  color: var(--text-3);
  line-height: 1.7;
  max-width: 460px;
  margin-bottom: var(--s-5);
}

.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-bottom: var(--s-5); }

.hero-social {
  display: flex;
  align-items: center;
  gap: var(--s-1);
}
.social-icon {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  transition: color var(--t) var(--ease), border-color var(--t) var(--ease), background var(--t) var(--ease);
}
.social-icon:hover {
  color: var(--text);
  border-color: var(--border-h);
  background: rgba(255,255,255,0.04);
}

/* Portrait */
.hero-portrait {
  display: flex;
  justify-content: center;
  order: -1;
}
.portrait-frame {
  position: relative;
  width: min(200px, 56vw);
  height: min(240px, 67vw);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--card);
  overflow: hidden;
  flex-shrink: 0;
}
.portrait-img {
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.portrait-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}
.portrait-badge {
  position: absolute;
  bottom: var(--s-3);
  right: var(--s-3);
  background: rgba(5,5,5,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  text-align: center;
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1;
}
.portrait-badge small {
  display: block;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-2);
  margin-top: 3px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Scroll hint */
.scroll-hint {
  position: absolute;
  bottom: var(--s-4);
  left: 50%;
  transform: translateX(-50%);
}
.scroll-hint-line {
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, var(--text-3), transparent);
  margin-inline: auto;
  animation: scrollHint 2s var(--ease) infinite;
}
@keyframes scrollHint {
  0%   { transform: scaleY(1); transform-origin: top; }
  50%  { transform: scaleY(0); transform-origin: top; }
  51%  { transform: scaleY(0); transform-origin: bottom; }
  100% { transform: scaleY(1); transform-origin: bottom; }
}

/* ── 11. ABOUT ─────────────────────────────── */
.about-grid {
  display: grid;
  gap: var(--s-3);
}
.about-title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: var(--s-3);
}
.about-text {
  font-size: 0.95rem;
  color: var(--text-2);
  line-height: 1.75;
  margin-bottom: var(--s-2);
}
.about-text:last-child { margin-bottom: 0; }
.about-main.card:hover { transform: none; }

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-2);
}
.stat-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: center;
}
.stat-number {
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text);
}
.stat-label {
  font-size: 12px;
  color: var(--text-3);
  font-weight: 500;
  letter-spacing: 0.03em;
}

/* ── 12. TIMELINE ──────────────────────────── */
.timeline {
  position: relative;
  padding-left: var(--s-4);
}
.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, var(--primary), transparent);
  opacity: 0.3;
}

.timeline-item {
  position: relative;
  padding-bottom: var(--s-4);
}
.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
  position: absolute;
  left: calc(-1 * var(--s-4) + 3px);
  top: 20px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-3);
  border: 1.5px solid var(--bg);
  transition: background var(--t) var(--ease);
}
.timeline-dot--active {
  background: var(--primary);
  box-shadow: 0 0 0 4px rgba(0,0,255,0.15);
}

.timeline-card { padding: var(--s-3); }
.timeline-header {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
  margin-bottom: var(--s-2);
}
.timeline-role {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.timeline-org {
  font-size: 13px;
  color: var(--text-3);
  font-weight: 500;
}
.timeline-date {
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  flex-shrink: 0;
}
.timeline-desc {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.65;
  margin-bottom: var(--s-2);
}
.timeline-achievements {
  margin-bottom: var(--s-2);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.timeline-achievements li {
  font-size: 13px;
  color: var(--text-2);
  padding-left: 14px;
  position: relative;
  line-height: 1.5;
}
.timeline-achievements li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.6;
}

/* ── 13. SKILLS ────────────────────────────── */
.skills-grid {
  display: grid;
  gap: var(--s-2);
}
.skill-card {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
.skill-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-2);
  transition: color var(--t) var(--ease), background var(--t) var(--ease), border-color var(--t) var(--ease);
}
.skill-card:hover .skill-icon {
  color: var(--primary);
  background: rgba(0,0,255,0.08);
  border-color: rgba(0,0,255,0.2);
}
.skill-info {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.skill-name { font-size: 14px; font-weight: 600; }
.skill-pct  { font-size: 12px; color: var(--text-3); font-weight: 600; font-variant-numeric: tabular-nums; }
.skill-bar {
  height: 3px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.skill-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--primary), var(--primary-h));
  border-radius: 99px;
  transition: width 1.1s var(--ease);
}

/* ── 14. CERTIFICATES ──────────────────────── */
.cert-wrapper { position: relative; }

.cert-track {
  display: flex;
  gap: var(--s-3);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: var(--s-3) var(--s-3) var(--s-5);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.cert-track::-webkit-scrollbar { display: none; }

.cert-card {
  flex: 0 0 min(300px, 80vw);
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  position: relative;
}
.cert-preview {
  width: 56px;
  height: 56px;
  background: rgba(0,0,255,0.06);
  border: 1px solid rgba(0,0,255,0.15);
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}
.cert-issuer {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}
.cert-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--text);
}
.cert-date { font-size: 12px; color: var(--text-3); margin-top: auto; }
.cert-link-btn {
  position: absolute;
  top: var(--s-3);
  right: var(--s-3);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  transition: color var(--t) var(--ease), background var(--t) var(--ease);
}
.cert-link-btn:hover { color: var(--text); background: rgba(255,255,255,0.08); }

.cert-controls {
  display: none;
  gap: var(--s-1);
  justify-content: center;
  margin-top: var(--s-2);
}
.cert-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  transition: color var(--t) var(--ease), border-color var(--t) var(--ease), background var(--t) var(--ease);
}
.cert-btn:hover { color: var(--text); background: var(--card-hover); border-color: var(--border-h); }

/* ── 15. CONTACT ───────────────────────────── */
.contact-grid { display: grid; gap: var(--s-3); }

.contact-form { display: flex; flex-direction: column; gap: var(--s-3); }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.02em;
}
.form-group input, .form-group textarea {
  width: 100%;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 12px 16px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  transition: border-color var(--t) var(--ease), background var(--t) var(--ease), box-shadow var(--t) var(--ease);
  resize: none;
}
.form-group input::placeholder, .form-group textarea::placeholder { color: var(--text-3); }
.form-group input:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(0,0,255,0.04);
  box-shadow: 0 0 0 3px rgba(0,0,255,0.1);
}
.form-group input.error, .form-group textarea.error { border-color: var(--error); }
.field-error { font-size: 12px; color: var(--error); min-height: 1em; }

.form-success {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  background: rgba(34,197,94,0.06);
  border: 1px solid rgba(34,197,94,0.2);
  border-radius: var(--r-sm);
  color: #4ade80;
  font-size: 14px;
  font-weight: 500;
}
.form-success[hidden] { display: none; }

.contact-aside { display: flex; flex-direction: column; gap: var(--s-2); }
.contact-info-card { padding: var(--s-3); }
.info-label { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); margin-bottom: 6px; }
.info-row { display: flex; align-items: center; gap: var(--s-1); }
.info-value { font-size: 14px; font-weight: 500; color: var(--text); }
a.info-value:hover { color: var(--primary); }

.copy-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  transition: color var(--t) var(--ease), background var(--t) var(--ease);
}
.copy-btn:hover { color: var(--text); background: rgba(255,255,255,0.1); }
.copy-btn.copied { color: var(--success); }

.contact-socials {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-size: 13px;
  color: var(--text-3);
}
.social-text-link { color: var(--text-2); font-weight: 500; transition: color var(--t) var(--ease); }
.social-text-link:hover { color: var(--text); }

/* ── 16. FOOTER ────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding-block: var(--s-5);
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-1);
  text-align: center;
}
.footer-copy    { font-size: 13px; color: var(--text-3); }
.footer-tagline { font-size: 12px; color: var(--text-3); opacity: 0.5; }

/* ── 17. BACK TO TOP ───────────────────────── */
.back-to-top {
  position: fixed;
  bottom: var(--s-4);
  right: var(--s-4);
  z-index: 800;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  transition: color var(--t) var(--ease), background var(--t) var(--ease),
              box-shadow var(--t) var(--ease), transform var(--t) var(--ease),
              opacity var(--t) var(--ease);
  opacity: 0;
  transform: translateY(16px);
}
.back-to-top:not([hidden]) {
  opacity: 1;
  transform: translateY(0);
}
.back-to-top:hover {
  color: var(--text);
  background: var(--card-hover);
  border-color: var(--border-h);
  box-shadow: var(--shadow-card-h);
}

/* ── 18. REVEAL ANIMATIONS ─────────────────── */

/* Up (default) */
.reveal, .reveal-item, .reveal-up {
  opacity: 0;
  transform: translateY(38px);
  transition: opacity 0.72s var(--ease), transform 0.72s var(--ease);
}
.reveal.visible, .reveal-item.visible, .reveal-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Slide from left */
.reveal-left {
  opacity: 0;
  transform: translateX(-52px);
  transition: opacity 0.72s var(--ease), transform 0.72s var(--ease);
}
.reveal-left.visible { opacity: 1; transform: translateX(0); }

/* Slide from right */
.reveal-right {
  opacity: 0;
  transform: translateX(52px);
  transition: opacity 0.72s var(--ease), transform 0.72s var(--ease);
}
.reveal-right.visible { opacity: 1; transform: translateX(0); }

/* Scale spring */
.reveal-scale {
  opacity: 0;
  transform: scale(0.84) translateY(22px);
  transition: opacity 0.65s var(--ease-spring), transform 0.65s var(--ease-spring);
}
.reveal-scale.visible { opacity: 1; transform: scale(1) translateY(0); }

/* Pure fade */
.reveal-fade {
  opacity: 0;
  transition: opacity 0.9s var(--ease);
}
.reveal-fade.visible { opacity: 1; }

/* Stagger delays — utility classes */
.reveal-delay-1 { transition-delay: 0.08s !important; }
.reveal-delay-2 { transition-delay: 0.18s !important; }
.reveal-delay-3 { transition-delay: 0.28s !important; }
.reveal-delay-4 { transition-delay: 0.38s !important; }

/* Auto-stagger for reveal-item children */
.reveal-item:nth-child(1) { transition-delay: 0.04s; }
.reveal-item:nth-child(2) { transition-delay: 0.13s; }
.reveal-item:nth-child(3) { transition-delay: 0.22s; }
.reveal-item:nth-child(4) { transition-delay: 0.31s; }
.reveal-item:nth-child(5) { transition-delay: 0.40s; }
.reveal-item:nth-child(6) { transition-delay: 0.49s; }


/* Magnetic button */
.magnetic { transition: transform 0.2s var(--ease), background var(--t) var(--ease),
                        box-shadow var(--t) var(--ease), color var(--t) var(--ease); }

/* ── 19. RESPONSIVE (Tablet) ───────────────── */
@media (min-width: 640px) {
  .skills-grid { grid-template-columns: 1fr 1fr; }
  .timeline-header { flex-direction: row; justify-content: space-between; align-items: flex-start; }
  .cert-track { padding-inline: var(--s-6); }
  .cert-controls { display: flex; }
}

/* ── 20. RESPONSIVE (Desktop) ──────────────── */
@media (min-width: 900px) {
  .nav-links  { display: flex; }
  .nav-toggle { display: none; }
  .nav-cta    { display: inline-flex; }

  .hero-inner { flex-direction: row; align-items: center; gap: var(--s-8); padding-block: var(--s-10); }
  .hero-content { flex: 1; }
  .hero-portrait { justify-content: flex-end; flex: 0 0 360px; order: 0; }
  .portrait-frame { width: 320px; height: 380px; }

  .about-grid { grid-template-columns: 1fr 1fr; }
  .skills-grid { grid-template-columns: repeat(3, 1fr); }
  .contact-grid { grid-template-columns: 1fr 420px; }

  .cert-track { padding-inline: calc((100vw - var(--container)) / 2 + var(--s-3)); }
}

@media (min-width: 1200px) {
  .about-grid { grid-template-columns: 1.4fr 1fr; }
}

/* ── 21. REDUCED MOTION ────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
