/* =============================================================================.
                                       🧠 PORTFOLIO · INIT STYLES.
   Description:
   Core initialization layer for Portfolio app.
   Provides:
   - ♿ Accessibility helpers (skip links)
   - 🚫 Browser support warnings
   - ⚡ Developer performance tooling
   - 🚨 Noscript fallbacks
   - 📱 Mobile optimizations
=============================================================================. */

/* =============================================================================.
                                       ♿ ACCESSIBILITY · SKIP LINK.
   Description:
   Accessible skip link for keyboard users to jump to main content quickly.
=============================================================================. */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  padding: 0.8rem 1.6rem;

  font-size: 1.4rem;
  font-weight: 600;

  background-color: #155dfc;
  color: #fff;

  border-radius: 0.4rem;
  text-decoration: none;

  z-index: 8888;
  transition: top 0.3s ease;
}
.skip-link:focus {
  top: 0;
  outline: none;
}

/* =============================================================================.
                                       🚫 BROWSER WARNING.
   Description:
   Styled banner for unsupported browser warning with suggested browser links.
=============================================================================. */
.browser-warning {
  max-width: 60rem;
  width: 88%;
  margin: 3rem auto;
  padding: 2.4rem;

  text-align: center;

  background-color: #1e1e2f;
  color: #fff;

  border: 2px solid #ff4d4f;
  border-radius: 1.2rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.browser-warning[role="alert"] {
  aria-live: assertive;
}
.browser-warning h2 {
  margin-bottom: 1.6rem;
  font-size: 3.2rem;
  color: #ff7875;
}
.browser-warning p {
  margin-bottom: 1.2rem;
  font-size: 1.4rem;
  line-height: 1.5;
}

/* ── Browser Links ──. */
.browser-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.6rem;
}
.browser-links a {
  display: flex;
  align-items: center;
  gap: 0.6rem;

  padding: 0.6rem 1.2rem;
  font-size: 1.4rem;
  color: #40a9ff;

  background-color: rgba(255,255,255,0.05);
  border-radius: 0.6rem;
  text-decoration: none;

  transition: background-color 0.3s ease, outline 0.3s ease;
}
.browser-links a:hover,
.browser-links a:focus {
  background-color: rgba(255,255,255,0.15);
  outline: 2px solid #40a9ff;
  outline-offset: 2px;
}
.browser-links img {
  width: 2.4rem;
  height: 2.4rem;
}

/* ── Refresh Button ──. */
.browser-warning .refresh-btn {
  margin-top: 3.2rem;
  padding: 0.6rem 1.2rem;

  font-size: 1.4rem;
  font-weight: 600;

  color: #40a9ff;
  background-color: rgba(255,255,255,0.05);

  border-radius: 0.4rem;
  transition: background-color 0.3s ease, outline 0.3s ease;
}
.browser-warning .refresh-btn:hover,
.browser-warning .refresh-btn:focus {
  background-color: rgba(255,255,255,0.15);
  outline: 2px solid #40a9ff;
  outline-offset: 2px;
}

/* =============================================================================.
                                       ⚡ PERFORMANCE METRICS (DEV TOOLING).
   Description:
   Fixed debug panel for displaying runtime performance metrics in development.
=============================================================================. */
.perf-box {
  position: fixed;
  bottom: 1.6rem;
  right: 1.6rem;

  width: 24rem;
  padding: 1.6rem;

  font-family: monospace;
  font-size: 1.4rem;

  color: #0f0;
  background-color: #111;

  border: 1px solid #333;
  border-radius: 0.8rem;
  box-shadow: 0 0 8px rgba(0,255,0,0.2);

  z-index: 8888;
}
.perf-box div {
  margin-top: 0.8rem;
}

/* ── Close Button ──. */
.perf-close {
  position: absolute;
  top: 0.6rem;
  right: 1.2rem;

  font-size: 2.4rem;
  color: #f44;

  background: none;
  border: none;
  cursor: pointer;

  transition: color 0.3s ease;
}
.perf-close:hover,
.perf-close:focus {
  color: #fff;
}

/* ── Refresh Button (Dev Panel) ──. */
.perf-box .refresh-btn {
  display: block;
  margin-top: 1.6rem;
  padding: 0.4rem 0.8rem;

  font-size: 1.2rem;
  font-weight: 600;

  color: #111;
  background-color: #0f0;

  border: none;
  border-radius: 0.4rem;
  cursor: pointer;

  transition: background-color 0.3s ease, outline 0.3s ease;
}
.perf-box .refresh-btn:focus {
  outline: 2px solid #0f0;
  outline-offset: 2px;
}

/* =============================================================================.
                                       🚨 NOSCRIPT FALLBACK.
   Description:
   Full-screen fallback warning when JavaScript is disabled.
=============================================================================. */
.noscript-warning {
  display: flex;
  align-items: center;
  justify-content: center;

  min-height: 100vh;
  padding: 2rem;

  font-family: "Segoe UI", Roboto, sans-serif;

  background-color: #0f0f0f;
  color: #fff;
  text-align: center;

  z-index: 9999;
}
.warning-content {
  max-width: 60rem;
  padding: 2rem;

  background-color: #1a1a1a;
  border: 2px solid #ff4d4f;
  border-radius: 1.2rem;
  box-shadow: 0 0 0 3px #ff4d4f33;
}
.noscript-warning h2 {
  margin-bottom: 1rem;
  font-size: 2rem;
  color: #ff4d4f;
}
.noscript-warning p {
  margin-bottom: 1rem;
  font-size: 1.2rem;
  line-height: 1.6;
}
.noscript-warning a {
  color: #58a6ff;
  text-decoration: underline;
}

/* ── List Styling ──. */
.noscript-warning ul {
  margin-top: 1rem;
  padding-left: 0;
  list-style: none;
}
.noscript-warning li {
  position: relative;
  margin: 0.5rem 0;
  padding-left: 1.2rem;
  text-align: left;
}
.noscript-warning li::before {
  content: "•";
  position: absolute;
  left: 0;

  font-size: 1.2rem;
  color: #ffbb33;
}

/* =============================================================================.
                                       📱 RESPONSIVE.
   Description:
   Small-device adjustments for better readability and usability.
=============================================================================. */
@media (max-width: 480px) {
  .warning-content {
    padding: 1.2rem;
    font-size: 1.2rem;
  }
  .perf-box {
    width: 90%;
    right: 5%;
  }
}

/* =============================================================================.
                                       💡 SUGGESTIONS & IMPROVEMENTS.
=============================================================================.
1. 🔄 Consider converting repeated colors and spacing values to CSS variables for easier theming.
2. ⚡ Use prefers-reduced-motion for animations in perf-box refresh or alert transitions.
3. ♿ Add focus-visible outlines consistently for skip links and browser warning buttons.
4. 🧩 Add optional dark/light mode support using CSS variables for dynamic themes.
5. 📱 Use clamp() for font sizes to improve mobile responsiveness.
=============================================================================. */
