/**
 * MSK Portfolio: Primary Stylesheet (v2.4.2)
 * Agency: HighCrest Digital Corp (https://highcrestmarketing.ca/)
 * Target: manveerkhurana.com
 *
 * Changelog:
 * - v1.0.0 (2026-10-19): Initial tokens, grid system, and typography scale.
 * - v1.4.0 (2026-10-28): Added tournament telemetry bars and project filter UI.
 * - v2.1.0 (2026-11-09): Safari 17+ sticky backdrop-filter compositing fix & WCAG AA contrast pass.
 * - v2.4.1 (2026-11-18): Inline validation states and responsive card refinements.
 */

:root {
  --ink: #0F172A;
  --ink-soft: #1E293B;
  --slate: #334155;
  --muted: #475569;
  --border: #E2E8F0;
  --border-strong: #CBD5E1;
  --surface: #FFFFFF;
  --canvas: #F8FAFC;
  --canvas-warm: #FAF9F6;
  --accent: #B45309;
  --accent-bright: #D97706;
  --accent-soft: #FEF3C7;
  --emerald: #047857;
  --emerald-soft: #D1FAE5;
  --blue: #1D4ED8;
  --red: #B91C1C;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 4px 10px -4px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 20px 40px -12px rgba(15, 23, 42, 0.14);
  --header-h: 72px;
  --container: 1200px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
  -webkit-text-size-adjust: 100%;
}

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--canvas-warm);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Accessibility: Skip Link & Focus States */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 9999;
  background: var(--ink);
  color: #FFFFFF;
  padding: 12px 20px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus {
  left: 0;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  margin: 0 0 0.5em;
  color: var(--ink);
  line-height: 1.2;
  letter-spacing: -0.025em;
  font-weight: 700;
}
h1 { font-size: clamp(2.15rem, 4.2vw, 3.5rem); font-weight: 800; letter-spacing: -0.035em; }
h2 { font-size: clamp(1.65rem, 2.8vw, 2.35rem); }
h3 { font-size: clamp(1.15rem, 1.5vw, 1.35rem); }
p { margin: 0 0 1rem; color: var(--slate); }
a { color: var(--accent); text-underline-offset: 3px; transition: color 0.18s ease; }
a:hover { color: var(--ink); }
code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: #F1F5F9;
  color: var(--ink);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Layout */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}
.container--narrow {
  max-width: 820px;
}
.section {
  padding: clamp(56px, 7vw, 96px) 0;
}
.section--alt {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.section--dark {
  background: var(--ink);
  color: #F8FAFC;
}
.section--dark h2, .section--dark h3, .section--dark strong { color: #FFFFFF; }
.section--dark p { color: #CBD5E1; }

.section-header {
  max-width: 760px;
  margin-bottom: 40px;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 10px;
}
.section--dark .eyebrow { color: #F59E0B; }

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 0;
}
.brand__mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0F172A, #1E293B);
  color: #F8FAFC;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: -0.04em;
  line-height: 1;
  position: relative;
  border: 1px solid #334155;
}
.brand__mark::after {
  content: "";
  width: 20px;
  height: 2.5px;
  background: var(--accent-bright);
  border-radius: 2px;
  margin-top: 3px;
}
.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.brand__name {
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--ink);
}
.brand__handle {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--muted);
}

.primary-nav {
  display: none;
  align-items: center;
  gap: 6px;
}
.primary-nav a {
  text-decoration: none;
  color: var(--slate);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: background-color 0.16s ease, color 0.16s ease;
}
.primary-nav a:hover,
.primary-nav a[aria-current="page"] {
  background: #F1F5F9;
  color: var(--ink);
}
.nav-cta {
  display: none;
}

.mobile-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.mobile-drawer {
  display: none;
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  padding: 16px 24px 24px;
  z-index: 99;
}
.mobile-drawer.is-open {
  display: block;
}
.mobile-drawer a {
  display: block;
  padding: 12px 8px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 500;
  border-bottom: 1px solid var(--border);
}
.mobile-drawer a:last-child {
  border-bottom: 0;
}

@media (min-width: 980px) {
  .primary-nav { display: flex; }
  .nav-cta { display: inline-flex; }
  .mobile-toggle { display: none; }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.2;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.16s ease, background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary {
  background: var(--ink);
  color: #FFFFFF;
}
.btn--primary:hover {
  background: var(--ink-soft);
  color: #FFFFFF;
  box-shadow: var(--shadow-md);
}
.btn--accent {
  background: var(--accent);
  color: #FFFFFF;
}
.btn--accent:hover {
  background: #92400E;
  color: #FFFFFF;
}
.btn--outline {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border-strong);
}
.btn--outline:hover {
  border-color: var(--ink);
  background: var(--canvas);
}
.btn--sm {
  padding: 8px 14px;
  font-size: 0.84rem;
}

/* Hero */
.hero {
  padding: clamp(56px, 8vw, 104px) 0 clamp(48px, 6vw, 80px);
  background:
    radial-gradient(circle at 88% 12%, rgba(217, 119, 6, 0.08), transparent 36%),
    radial-gradient(circle at 10% 90%, rgba(15, 23, 42, 0.05), transparent 40%),
    var(--canvas-warm);
  border-bottom: 1px solid var(--border);
}
.hero__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  align-items: start;
}
@media (min-width: 960px) {
  .hero__grid {
    grid-template-columns: 1.35fr 0.95fr;
    gap: 56px;
  }
}
.hero__meta {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--slate);
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #059669;
  flex-shrink: 0;
}
.hero__lead {
  font-size: clamp(1.08rem, 1.45vw, 1.24rem);
  color: var(--slate);
  max-width: 640px;
  margin-bottom: 18px;
}
.hero__summary {
  font-size: 0.96rem;
  color: var(--muted);
  max-width: 640px;
  margin-bottom: 24px;
}
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
  list-style: none;
  padding: 0;
}
.tag {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: #F1F5F9;
  color: var(--slate);
  border: 1px solid var(--border);
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Metrics Panel */
.metrics-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-md);
}
.metrics-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.metrics-card__title {
  font-size: 0.92rem;
  font-weight: 700;
  margin: 0;
}
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  font-family: var(--font-mono);
}
.badge--emerald { background: var(--emerald-soft); color: #065F46; }
.badge--amber { background: var(--accent-soft); color: #92400E; }
.badge--slate { background: #F1F5F9; color: var(--slate); }

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.metric {
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
}
.metric__val {
  display: block;
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.metric__label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 4px;
}
.metrics-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 0.84rem;
}
.metrics-meta dt { color: var(--muted); font-weight: 500; }
.metrics-meta dd { margin: 2px 0 0; font-weight: 600; color: var(--ink); }

/* Grids & Cards */
.grid {
  display: grid;
  gap: 24px;
}
.grid--2 { grid-template-columns: 1fr; }
.grid--3 { grid-template-columns: 1fr; }
.grid--4 { grid-template-columns: 1fr; }
@media (min-width: 720px) {
  .grid--2 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .grid--4 { grid-template-columns: repeat(4, 1fr); }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 26px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
  display: flex;
  flex-direction: column;
}
.card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}
.card--dark {
  background: var(--ink-soft);
  border-color: #334155;
  color: #F8FAFC;
}
.card--dark p { color: #CBD5E1; }

/* Career Feature Card */
.role-banner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 3vw, 36px);
  box-shadow: var(--shadow-sm);
  margin-bottom: 28px;
}
.role-banner__top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
}
.role-banner__date {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--accent);
}

/* Native Zero-CLS Bar Charts */
.chart-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-top: 28px;
}
.chart-bars {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}
.bar-row__head {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}
.bar-row__val {
  font-family: var(--font-mono);
  color: var(--muted);
}
.bar-track {
  height: 12px;
  background: #F1F5F9;
  border-radius: 999px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Filter Toolbar */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}
.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pill {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--slate);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}
.pill:hover { border-color: var(--ink); color: var(--ink); }
.pill.is-active,
.pill[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: #FFFFFF;
}
.search-input {
  width: 100%;
  max-width: 280px;
  padding: 9px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: var(--font-sans);
  background: var(--surface);
  color: var(--ink);
}

/* Project Cards */
.project-card[hidden] { display: none; }
.project-card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}
.project-card__footer {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

/* Forms */
.form-grid {
  display: grid;
  gap: 16px;
}
.field label {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}
.field input[type="text"],
.field input[type="email"],
.field select,
.field textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.94rem;
  color: var(--ink);
  background: var(--surface);
}
.field textarea { min-height: 110px; resize: vertical; }
.field input.is-invalid,
.field textarea.is-invalid {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.12);
}
.field__error {
  display: block;
  margin-top: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--red);
}
.field__error[hidden] { display: none; }
.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--slate);
}
.consent-row input[type="checkbox"] {
  margin-top: 4px;
  width: 18px;
  height: 18px;
  accent-color: var(--ink);
  flex-shrink: 0;
}
.wa-preview {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  white-space: pre-wrap;
  color: var(--ink);
}
.notice {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 16px;
}
.notice--success { background: var(--emerald-soft); color: #065F46; border: 1px solid #A7F3D0; }
.notice--error { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }

/* Social Hub */
.social-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}
.social-card:hover {
  transform: translateY(-2px);
  border-color: var(--ink);
  box-shadow: var(--shadow-md);
}
.social-card__title { font-weight: 700; font-size: 0.96rem; color: var(--ink); }
.social-card__sub { font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); white-space: nowrap; }

/* Accessible Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 200;
}
.modal-backdrop[hidden] { display: none; }
.modal-dialog {
  background: var(--surface);
  border-radius: var(--radius-lg);
  max-width: 640px;
  width: 100%;
  padding: 28px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.modal-dialog__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

/* Footer */
.site-footer {
  background: var(--ink);
  color: #CBD5E1;
  padding: 48px 0 36px;
  border-top: 1px solid #1E293B;
}
.site-footer__grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding-bottom: 24px;
  border-bottom: 1px solid #1E293B;
  margin-bottom: 24px;
}
.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}
.site-footer a {
  color: #F8FAFC;
  text-decoration: none;
  font-size: 0.9rem;
}
.site-footer a:hover {
  color: #F59E0B;
  text-decoration: underline;
}
.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 0.86rem;
  color: #94A3B8;
}
.site-footer__credit a {
  color: #F59E0B;
  font-weight: 600;
  text-decoration: underline;
}
.site-footer__credit a:hover {
  color: #FDE68A;
}

/* Prose (Single Pages & Case Studies) */
.prose h2 { margin-top: 2rem; }
.prose ul { padding-left: 1.25rem; color: var(--slate); }
.prose li { margin-bottom: 0.5rem; }

/* WP Nav Menu List Normalization & Social Card Icons (v3.0.0) */
.primary-nav ul,
.mobile-drawer ul,
.site-footer__links ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.primary-nav ul {
  display: flex;
  align-items: center;
  gap: 6px;
}
.site-footer__links ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
}
.mobile-drawer li {
  border-bottom: 1px solid var(--border);
}
.mobile-drawer li:last-child {
  border-bottom: 0;
}
.mobile-drawer li a {
  border-bottom: 0;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.social-card__head {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}
.social-card__head svg {
  flex-shrink: 0;
  color: var(--accent);
}

/* Mobile 375px Header Overflow & Hero Status Pill Fix (v3.0.1) */
a.nav-cta,
.btn.nav-cta {
  display: none;
}
@media (min-width: 980px) {
  a.nav-cta,
  .btn.nav-cta {
    display: inline-flex;
  }
}
.mobile-toggle {
  flex-shrink: 0;
  min-width: 44px;
  min-height: 44px;
}
.site-header__inner {
  gap: 12px;
}
.brand {
  min-width: 0;
}
.hero__meta {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  max-width: 100%;
}
.status-dot {
  flex-shrink: 0;
}
