/* Design System - Typography, Spacing, Colors, Utilities
   Implements the user's requested system (Space Grotesk primary)
*/
:root {
  /* Font family (primary) and weights */
  --font-primary: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --fw-300: 300;
  --fw-400: 400;
  --fw-500: 500;
  --fw-600: 600;
  --fw-700: 700;

  /* Typography scale (base sizes) */
  --h1-min: 1.125rem; /* ~18px */
  --h1-max: 3rem;     /* ~48px */
  --h2-base: 1.875rem; /* 30px */
  --h3-base: 1.125rem; /* 18px */

  --body-large: 1rem;   /* 16px (will scale up with media queries) */
  --body-regular: 0.875rem; /* 14px */
  --body-small: 0.75rem; /* 12px */

  /* Layout / container */
  --container-max: 72rem; /* 1152px ~= max-w-4xl */
  --section-px-sm: 1rem;  /* 16px */
  --section-px-md: 1.5rem; /* 24px */
  --section-px-lg: 2rem;  /* 32px */
  --section-py: 3rem; /* 48px */

  /* Gaps */
  --gap-sm: 0.75rem; /* 12px */
  --gap-md: 1rem;    /* 16px */
  --gap-lg: 1.5rem;  /* 24px */

  /* Button padding */
  --btn-px-sm: 1.5rem; /* 24px */
  --btn-px-md: 2rem;   /* 32px */
  --btn-py: 0.75rem;   /* 12px */

  /* Color palette (user-specified simplified) */
  --color-bg: #282828;
  --color-foreground: rgba(0,0,0,0.15);
  --color-black-60: rgba(0,0,0,0.6);
  --color-black-80: rgba(0,0,0,0.8);
  --gray-100: #f7fafc;
  --gray-200: #edf2f7;
  --gray-300: #e2e8f0;
  --gray-600: #4a5568;
  --gray-700: #2d3748;
  --gray-800: #1a202c;

  /* Border radius */
  --radius: 0.5rem; /* 8px */
  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(16,24,40,0.05);
  --shadow-md: 0 4px 8px rgba(16,24,40,0.08);
  --shadow-lg: 0 10px 30px rgba(16,24,40,0.12);
  --shadow-xl: 0 20px 50px rgba(16,24,40,0.14);

  /* Transition */
  --transition-standard: all 0.3s ease;

    box-shadow: 0 8px 30px rgba(2,6,23,0.6);
    /* Dark, high-contrast toast to stand out on the site's dark background */
    background: linear-gradient(180deg, rgba(10,12,16,0.88), rgba(20,23,28,0.9));
    color: #f8fafc; /* near-white */
    border: 1px solid rgba(255,255,255,0.04);
  --bp-xl: 1280px;
  --bp-2xl: 1400px;
  /* avatar sizing token */
  --avatar-size: 96px;
}

/* Base font stack override and sensible defaults */
html, body {
  font-family: var(--font-primary);
  color: #111827; /* high contrast default */
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography scale (mobile-first) */
h1 {
  /* clamp approach: min, preferred, max */
  .toast .toast-icon { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 28px; border-radius: 6px; background: rgba(255,255,255,0.04); }
  .toast.toast--success { border-left: 4px solid #10b981; }
  .toast.toast--error { border-left: 4px solid #ef4444; }
  line-height: 1.05;
}

h2 {
  font-weight: var(--fw-600);
  font-size: var(--h2-base);
  line-height: 1.1;
}

h3 {
  font-weight: var(--fw-500);
  font-size: var(--h3-base);
  line-height: 1.2;
}

/* Body text classes for component usage */
.text-body-large { font-size: var(--body-large); font-weight: var(--fw-400); }
.text-body-regular { font-size: var(--body-regular); font-weight: var(--fw-400); }
.text-body-small { font-size: var(--body-small); font-weight: var(--fw-400); }

/* UI elements */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: var(--btn-py) var(--btn-px-sm);
  border-radius: var(--radius-md);
  font-size: 0.875rem; /* text-sm */
  font-weight: var(--fw-500);
  cursor: pointer;
  transition: var(--transition-standard);
  box-shadow: var(--shadow-sm);
}

.btn-primary {
  background: var(--orange-yellow-crayola, #f5a623);
  color: white;
}

.btn:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }

/* Navigation text sizing */
.nav-text { font-size: 0.875rem; }

/* Layout utilities */
.container {
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--section-px-sm);
  padding-right: var(--section-px-sm);
}

.section-padding { padding: var(--section-py) var(--section-px-sm); }
@media (min-width: var(--bp-sm)) {
  .section-padding { padding-left: var(--section-px-md); padding-right: var(--section-px-md); }
}
@media (min-width: var(--bp-lg)) {
  .section-padding { padding-left: var(--section-px-lg); padding-right: var(--section-px-lg); }
}

.card-padding-sm { padding: 1rem; }
.card-padding-md { padding: 1rem; }
@media (min-width: var(--bp-md)) { .card-padding-md { padding: 1.25rem; } }

/* Gaps & spacing */
.gap-sm { gap: var(--gap-sm); }
.gap-md { gap: var(--gap-md); }
.gap-lg { gap: var(--gap-lg); }

.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }

/* Border radius helpers */
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }

/* Shadows helpers */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }

/* Animations */
@keyframes ds-slide-in {
  from { transform: translateX(-20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes ds-float {
  from { transform: translateY(0); }
  to { transform: translateY(-10px); }
}

.animate-slide-in { animation: ds-slide-in 0.6s cubic-bezier(.16,.84,.44,1) both; }
.animate-float { animation: ds-float 1.2s ease-in-out infinite alternate; }

/* Hover lifts and scale effects */
.hover-lift:hover { transform: translateY(-4px); transition: transform 0.3s ease; }
.hover-scale:hover { transform: scale(1.05); transition: transform 0.3s ease; }

/* Transitions tidy */
.transition-all { transition: all 0.3s ease; }
.transition-colors { transition: color 0.25s ease, background-color 0.25s ease; }
.transition-transform { transition: transform 0.25s ease; }

/* Accessibility helpers */
.touch-target { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; }

/* Responsive typography adjustments */
@media (min-width: 640px) {
  h2 { font-size: 2.25rem; } /* sm -> 36px */
  h3 { font-size: 1.25rem; }
  .text-body-large { font-size: 1.125rem; }
  .text-body-regular { font-size: 1rem; }
}
@media (min-width: 768px) {
  h2 { font-size: 2.5rem; }
  h3 { font-size: 1.5rem; }
  .text-body-large { font-size: 1.25rem; }
  .text-body-regular { font-size: 1.0625rem; }
}
@media (min-width: 1024px) {
  h1 { font-size: 3rem; }
  h2 { font-size: 3rem; }
}

/* Small helper to ensure grayscale-style images are consistent and performant */
.ds-img-grayscale { filter: grayscale(60%); -webkit-filter: grayscale(60%); }

/* End of design-system */

/* Technology badge styles used in Experience timeline */
.tech-badges { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.tech-badges .badge {
  display: inline-block;
  background: var(--gray-200, #edf2f7);
  color: var(--gray-800, #1a202c);
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 1px 2px rgba(16,24,40,0.03);
}
.tech-badges .badge--primary { background: var(--orange-yellow-crayola, #f5a623); color: #fff; }

/* Badge icon + color variants */
.badge { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.25rem 0.5rem; border-radius: 999px; font-weight: 500; }
.badge svg { width: 14px; height: 14px; flex: 0 0 14px; }
.badge .badge-label { font-size: 0.75rem; line-height: 1; }

/* Ensure inline SVG icons inherit badge foreground color and align nicely */
.badge svg { display: inline-block; vertical-align: middle; }
.badge svg * { /* override inline fills/strokes so icons match the badge text color */
  fill: currentColor !important;
  stroke: currentColor !important;
}

.badge--react { background: #61dafb; color: #06202a; }
.badge--vue { background: #41b883; color: #05221a; }
.badge--js { background: #f7df1e; color: #000; }
.badge--html { background: #e34f26; color: #fff; }
.badge--css { background: #2965f1; color: #fff; }
.badge--git { background: #f05032; color: #fff; }

/* Fallback neutral badge */
.badge--neutral { background: var(--gray-200, #edf2f7); color: var(--gray-800, #1a202c); }

/* Skill progress bar design improvements */
.skills-list { display: grid; grid-template-columns: repeat(1, 1fr); gap: 1rem; }
.skills-item .title-wrapper { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.skill-progress-bg {
  width: 100%;
  height: 10px;
  background: linear-gradient(90deg, rgba(0,0,0,0.04), rgba(0,0,0,0.02));
  border-radius: 999px;
  overflow: hidden;
  margin-top: 0.5rem;
}
.skill-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--orange-yellow-crayola, #f5a623), #ffb84d);
  border-radius: inherit;
  transition: width 700ms cubic-bezier(.16,.84,.44,1);
}

/* Slightly larger fills on wider screens */
@media (min-width: 768px) {
  .skill-progress-bg { height: 12px; }
}

/* Certificate highlight style */
.timeline-list .timeline-item:first-child {
  border-left: 3px solid var(--orange-yellow-crayola, #f5a623);
  padding-left: 1rem;
  background: linear-gradient(180deg, rgba(245,166,35,0.03), transparent);
  border-radius: 8px;
}

/* Avatar blending: make black & white avatar sit naturally on the background */
.avatar-box {
  width: var(--avatar-size);
  height: var(--avatar-size);
  border-radius: 50%;
  overflow: hidden;
  display: inline-block;
  position: relative;
  /* subtle backing gradient so blend-mode has something to work with */
  background: linear-gradient(135deg, rgba(245,166,35,0.06), rgba(41,101,241,0.04));
  box-shadow: 0 4px 14px rgba(16,24,40,0.08);
  border: 2px solid rgba(255,255,255,0.6);
}

.avatar-box img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* keep black & white but keep details crisp and consistent */
  filter: grayscale(100%) contrast(1.04) brightness(1.06);
  /* don't use blend modes that soften the image — show the image normally */
  mix-blend-mode: normal;
  opacity: 1;
  transition: transform 0.25s ease, filter 0.25s ease, opacity 0.25s ease;
}

.avatar-box::after {
  /* keep a very subtle vignette without blending that changes image appearance */
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 40%, rgba(255,255,255,0.02), rgba(0,0,0,0.02));
  opacity: 0.7;
}

.avatar-box:hover img {
  /* keep appearance consistent on hover; optional slight lift retained */
  transform: scale(1.03);
  filter: grayscale(100%) contrast(1.04) brightness(1.06);
  opacity: 1;
  mix-blend-mode: normal;
}

@media (prefers-reduced-motion: reduce) {
  .avatar-box img { transition: none; transform: none; }
}

/* Small style for project external example links added by the assistant */
.project-external {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.785rem;
  color: var(--gray-700, #2d3748);
  background: transparent;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(16,24,40,0.04);
  text-decoration: none;
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.12s ease;
}
.project-external:hover,
.project-external:focus {
  background: rgba(16,24,40,0.03);
  color: var(--gray-800, #1a202c);
  transform: translateY(-2px);
}

/* Toast notifications (contact form feedback) */
#toast-container {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 9999;
  pointer-events: none; /* allow clicks through empty area */
}

.toast {
  pointer-events: auto; /* enable clicking inside the toast */
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 260px;
  max-width: 420px;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  background: linear-gradient(135deg, rgba(34,197,94,0.08), rgba(16,185,129,0.06));
  color: white;
  border: 1px solid rgba(16,24,40,0.06);
  font-weight: 500;
  transform: translateY(10px) scale(0.98);
  opacity: 0;
  transition: opacity 220ms ease, transform 240ms cubic-bezier(.16,.84,.44,1);
}

.toast.toast--show {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.toast .toast-message { flex: 1; font-size: 0.95rem; line-height: 1.2; }
.toast .toast-close {
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 0.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}
.toast.toast--success { background: linear-gradient(90deg, rgba(99,102,241,0.06), rgba(56,189,248,0.04)); border-color: rgba(56,189,248,0.08); }
.toast.toast--error { background: linear-gradient(90deg, rgba(239,68,68,0.04), rgba(253,224,71,0.03)); border-color: rgba(239,68,68,0.08); }

@media (prefers-reduced-motion: reduce) {
  .toast { transition: none; }
}
