/* ============================================
   UX MEAS PORTFOLIO — BASE STYLES
   Reset, Typography, Layout Utilities
   ============================================ */

/* === RESET === */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text-primary);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  transition: background-color var(--transition-base), color var(--transition-base);
}

img { display: block; max-width: 100%; }
a { text-decoration: none; color: inherit; }
ul, ol { list-style: none; }

/* === TYPOGRAPHY === */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-tight);
  text-wrap: balance;
  color: var(--text-primary);
}

/* MZM-341: Space Grotesk 400 everywhere — size creates hierarchy */
h1 { font-size: clamp(2.5rem, 6vw, var(--text-4xl)); font-weight: 400; }
h2 { font-size: clamp(1.75rem, 4vw, var(--text-3xl)); font-weight: 400; }
h3 { font-size: clamp(1.25rem, 3vw, var(--text-2xl)); font-weight: 500; }
h4 { font-size: var(--text-lg); font-weight: 500; }

p {
  font-size: var(--text-base);  /* Standardized: 16px everywhere */
  line-height: var(--leading-relaxed);  /* 1.75 = 16px/28px */
  color: var(--text-secondary);
}

/* === LABELS === */
.label {
  font-family: var(--font-display);
  font-size: var(--text-xs);  /* 12px — audit: was 11px */
  font-weight: 500;
  letter-spacing: 0.15em;     /* Audit: 1.5-2px at 12px */
  text-transform: uppercase;
  color: var(--text-muted);
}

.label--accent {
  color: var(--text-secondary);  /* Audit B: strip accent from labels */
}

.label--blue {
  color: var(--info);
}

/* === LINKS === */
.link {
  color: var(--accent);
  transition: opacity var(--transition-fast);
}

.link:hover {
  opacity: 0.8;
}

.link-animated {
  background-image: linear-gradient(to right, currentColor, currentColor);
  background-size: 0% 1px;
  background-position: left bottom;
  background-repeat: no-repeat;
  transition: background-size var(--transition-slow);
}

.link-animated:hover {
  background-size: 100% 1px;
}

/* === BUTTONS (MZM-626: v3 monochromatic system) === */
.btn,
.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0;
  padding: var(--btn-padding-y) var(--btn-padding-x);
  border-radius: var(--btn-radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color var(--transition-fast),
              border-color var(--transition-fast),
              color var(--transition-fast),
              transform var(--transition-fast);
}

/* Primary — dark charcoal fill, white text, chevron */
.btn-primary,
.btn--primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  border-color: var(--btn-primary-border);
}

.btn-primary::after,
.btn--primary::after {
  content: '→';
  margin-left: var(--btn-chevron-offset);
  display: inline-block;
  transition: transform var(--transition-fast);
}

.btn-primary:hover,
.btn--primary:hover {
  background: var(--btn-primary-bg-hover);
  border-color: var(--btn-primary-border-hover);
  transform: translateY(-1px);
}

.btn-primary:hover::after,
.btn--primary:hover::after {
  transform: translateX(3px);
}

/* Secondary — text-only, gray, chevron */
.btn-secondary,
.cta-text {
  background: transparent;
  color: var(--btn-secondary-text);
  border-color: transparent;
  padding: var(--btn-padding-y) 4px;
}

.btn-secondary::after,
.cta-text::after {
  content: '→';
  margin-left: var(--btn-chevron-offset);
  display: inline-block;
  transition: transform var(--transition-fast);
}

.btn-secondary:hover,
.cta-text:hover {
  color: var(--btn-secondary-text-hover);
}

.btn-secondary:hover::after,
.cta-text:hover::after {
  transform: translateX(3px);
}

/* Legacy accent button — now monochromatic (no blue/orange) */
.btn--accent {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  border: 1px solid var(--btn-primary-border);
}

.btn--accent:hover {
  background: var(--btn-primary-bg-hover);
  border-color: var(--btn-primary-border-hover);
  transform: translateY(-1px);
}

.btn--accent::after {
  content: '→';
  margin-left: var(--btn-chevron-offset);
}

.btn--outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn--outline:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
}

/* CTA pair layout — primary + secondary side by side */
.cta-pair {
  display: inline-flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

/* === LAYOUT === */
/* === STICKY NAV === */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--divider);
  padding: 16px var(--section-padding-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Nav brand logo */
.nav__brand {
  display: flex;
  align-items: center;
}

.nav__brand img {
  height: 20px;
  width: auto;
}

/* Audit U: nav links use opacity */
.nav__link {
  font-size: var(--text-sm);
  color: var(--text-primary);
  opacity: 0.6;
  transition: opacity var(--transition-fast);
}

.nav__link:hover {
  opacity: 1;
}

/* MZM-622: nav active state is white (v3: no blue active state) */
.nav__link--accent,
.nav__link.active,
.nav__link[aria-current="page"] {
  color: #FFFFFF;
  opacity: 1;
}

/* MZM-351: breadcrumb bar below nav */
.breadcrumb {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px var(--section-padding-x);
  border-bottom: 1px solid var(--divider);
  font-size: 0.8125rem;
}

.breadcrumb__left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.breadcrumb__link {
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.breadcrumb__link:hover {
  color: var(--text-primary);
}

.breadcrumb__sep {
  color: var(--text-muted);
  opacity: 0.4;
}

.breadcrumb__current {
  color: var(--text-primary);
}

.breadcrumb__next {
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.breadcrumb__next:hover {
  color: var(--text-primary);
}

.breadcrumb__arrow {
  display: inline-block;
  margin-left: 4px;
  transition: transform var(--transition-fast);
}

.breadcrumb__next:hover .breadcrumb__arrow {
  transform: translateX(3px);
}

/* MZM-350: footer styling */
.site-footer {
  text-align: center;
  padding: 32px var(--section-padding-x);
  border-top: 1px solid var(--divider);
}

[data-theme="light"] .nav {
  background: rgba(250, 250, 250, 0.85);
}

.page-wrap {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
}

.section {
  padding: var(--section-padding-y) var(--section-padding-x);
}

.container {
  max-width: var(--content-width);
  margin: 0 auto;
}

.narrow {
  max-width: var(--narrow-width);
  margin: 0 auto;
}

/* Audit: constrain body text width for readability */
.prose {
  max-width: var(--narrow-width);
}

/* === FLEX UTILITIES === */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }
.gap-2xl { gap: var(--space-2xl); }
.gap-3xl { gap: var(--space-3xl); }
.gap-4xl { gap: var(--space-4xl); }

/* === TEXT UTILITIES === */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-balance { text-wrap: balance; }

/* === BADGE === */
.badge {
  display: inline-block;
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius-full);
  padding: 6px 20px;
}

/* === CARD — Resend-style glow border on transparent bg === */
.card {
  background: var(--bg-card);
  border: 1px solid var(--glow-border);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  box-shadow: var(--glow-shadow), 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.card:hover {
  border-color: var(--glow-border-hover);
  box-shadow: var(--glow-shadow-hover), 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* === DIVIDER === */
.divider {
  width: 100%;
  height: 1px;
  background: var(--divider);
  border: none;
}

/* === SCROLL REVEAL === */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

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

/* === UTILITY CLASSES (replacing inline styles) === */
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.flex-1 { flex: 1; }
.font-medium { font-weight: 500; }
.font-bold { font-weight: 700; }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-error { color: var(--error); }
.text-info { color: var(--info); }
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }

/* Footer copyright */
.footer-copyright {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* Footer links row */
.footer-links {
  margin-bottom: 16px;
}

/* Reflection icon */
.cs-reflection__icon {
  font-size: 18px;
}

/* Annotation text */
.cs-annotation {
  font-size: var(--text-sm);
  color: var(--warning);
}

/* Testimonial attribution */
.cs-testimonial__attr {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* Design system type samples */
.cs-type-sample--h1 { font-size: var(--text-xl); font-weight: 700; }
.cs-type-sample--h2 { font-size: var(--text-lg); font-weight: 700; }
.cs-type-sample--body { font-size: var(--text-sm); }
.cs-type-sample--caption { font-size: var(--text-xs); color: var(--text-muted); }
.cs-type-samples { margin-top: var(--space-md); display: flex; flex-direction: column; gap: var(--space-sm); }

/* Section padding overrides */
.section--cta { padding-bottom: var(--space-5xl); }

/* CTA heading */
.cs-cta-heading {
  margin-top: var(--space-md);
  margin-bottom: var(--space-lg);
}

/* Hero-area margin wrap */
.hero-mb { margin-bottom: 32px; }

/* 404 page centered layout */
.section--404 {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .flex-row { flex-direction: column; }
  .hide-mobile { display: none; }

  /* Nav */
  .nav { padding: 12px var(--section-padding-x); }
  .nav__brand img { height: 16px; }
  .nav .flex { gap: var(--space-md); }
  .nav__link, .nav__link--accent { font-size: 0.8125rem; }

  /* Breadcrumb */
  .breadcrumb { font-size: 0.75rem; padding: 8px var(--section-padding-x); }
  .breadcrumb__next { display: none; }

  /* Footer */
  .site-footer { padding: 24px var(--section-padding-x); }

  /* Buttons */
  .btn { padding: 12px 24px; font-size: 0.8125rem; }
}

@media (max-width: 400px) {
  .nav .flex { gap: var(--space-sm); }
  .nav__link, .nav__link--accent { font-size: 0.75rem; }
}
