/* ==========================================================================
   BASE & RESET STYLES
   MD. YEASIR ARAFAT — ELECTRICAL & ELECTRONIC PORTFOLIO
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&family=Space+Grotesk:wght@500;600;700&display=swap');

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 24px);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.65;
  overflow-x: hidden;
  position: relative;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Background blueprint engineering grid */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: 
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* Subtle circuit ambient overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url('../img/circuit-pattern.svg');
  background-size: 600px 600px;
  color: var(--accent-cyan);
  opacity: var(--pattern-opacity, 0.05);
  pointer-events: none;
  z-index: 0;
}

/* --------------------------------------------------------------------------
   SELECTION & SCROLLBAR
   -------------------------------------------------------------------------- */
::selection {
  background-color: var(--accent-cyan);
  color: #05070a;
}

::-webkit-scrollbar {
  width: 9px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: var(--radius-full);
  border: 2px solid var(--bg-primary);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-cyan);
}

/* --------------------------------------------------------------------------
   TYPOGRAPHY
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 700;
}

h1 {
  font-size: clamp(2.25rem, 5vw + 1rem, 3.85rem);
  letter-spacing: -0.03em;
}

h2 {
  font-size: clamp(1.85rem, 3.5vw + 0.5rem, 2.65rem);
  letter-spacing: -0.025em;
}

h3 {
  font-size: clamp(1.35rem, 2vw + 0.3rem, 1.75rem);
}

h4 {
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

p {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 72ch;
}

p.lead {
  font-size: clamp(1.1rem, 1.5vw + 0.5rem, 1.25rem);
  line-height: 1.6;
  color: var(--text-primary);
}

.mono-tag {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* --------------------------------------------------------------------------
   ACCESSIBILITY & UTILITIES
   -------------------------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 3px;
}

.skip-to-content {
  position: absolute;
  top: -100px;
  left: 20px;
  background: var(--accent-cyan);
  color: #040609;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  z-index: var(--z-toast);
  transition: top var(--transition-fast);
}

.skip-to-content:focus {
  top: 20px;
}

.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;
}

/* --------------------------------------------------------------------------
   PRINT STYLES
   -------------------------------------------------------------------------- */
@media print {
  body::before, body::after, .site-header, .theme-toggle, .mobile-toggle, .cta-group, #contact form {
    display: none !important;
  }
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .card, .timeline-item {
    page-break-inside: avoid;
    border: 1px solid #ccc !important;
    background: #fff !important;
  }
}
