/*
 * style.css — Reggie Griffin Portfolio
 * Improvements added:
 *   - Sticky navbar with shadow on scroll feel
 *   - Active nav link highlight styles
 *   - Smooth scroll behavior (CSS)
 *   - Skill card hover effects with left accent border
 *   - Article card hover lift effect
 *   - Accordion (skill-collapse) animation styles
 *   - Copy email button styles
 *   - Reading time badge styles
 *   - Typo fix: accreditation in HTML (noted here)
 *   - Cert status badge styles
 */

/* ── Colour Variables ── */
:root {
  --bg-color: #f7f7f7;
  --text-color: #1f4369;
  --accent-color: #3fa6de;
  --secondary-bg: #ffffff;
  --hero-overlay: rgba(255, 255, 255, 0.7);
  --skill-bar-bg: #e0e0e0;
  --skill-bar-fill: var(--accent-color);
  --border-color: #e0e0e0;
  --nav-height: 64px;
}

body.dark {
  --bg-color: #121212;
  --text-color: #cbd9e8;
  --accent-color: #5db2e2;
  --secondary-bg: #1e1e1e;
  --hero-overlay: rgba(0, 0, 0, 0.6);
  --skill-bar-bg: #333;
  --border-color: #333;
}

/* ── Reset ── */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ── Smooth scroll (CSS-level, JS handles offset correction) ── */
html {
  font-size: clamp(15px, 1.1vw + 10px, 18px);
  scroll-behavior: smooth;
}

body {
  font-family: 'Roboto', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ── Navigation bar (sticky) ── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-height);
  background-color: var(--secondary-bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  /* Enhanced shadow for sticky feel */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  z-index: 1000;
  /* Subtle border bottom */
  border-bottom: 1px solid var(--border-color);
  transition: box-shadow 0.2s ease;
}

.sidebar .nav-links {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

.sidebar .nav-links a {
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
  transition: color 0.2s ease;
  /* Underline slide-in effect */
  position: relative;
  padding-bottom: 3px;
}

/* Active nav link indicator */
.sidebar .nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--accent-color);
  transition: width 0.2s ease;
  border-radius: 2px;
}

.sidebar .nav-links a:hover::after,
.sidebar .nav-links a.active::after {
  width: 100%;
}

.sidebar .nav-links a:hover,
.sidebar .nav-links a.active {
  color: var(--accent-color);
}

.sidebar #theme-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1.4rem;
  padding: 0.4rem 0.6rem;
  color: var(--accent-color);
  border-radius: 6px;
  transition: background-color 0.2s ease, transform 0.15s ease;
}

.sidebar #theme-toggle:hover {
  background-color: var(--skill-bar-bg);
  transform: scale(1.1);
}

/* ── Logo (headshot) ── */
.logo {
  width: 48px;
  height: 48px;
  margin-right: 1rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.logo img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-color);
}

/* ── Main content ── */
.main-content {
  margin-top: var(--nav-height);
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Top banner ── */
.top-banner {
  width: 100%;
  max-width: 1100px;
  text-align: center;
  margin: 0 auto 1rem auto;
}

.top-banner img {
  max-width: 100%;
  max-height: 200px;
  height: auto;
  object-fit: cover;
  display: inline-block;
  border: none;
  border-radius: 0;
}

/* ── Hero ── */
.hero {
  padding: 2rem 1rem;
  background-color: var(--secondary-bg);
  text-align: center;
}

.hero h1 {
  font-size: 2rem;
  margin-bottom: 1.2rem;
}

.hero h2 {
  font-size: 1rem;
  font-family: 'Source Code Pro', monospace;
  font-weight: 400;
  color: var(--accent-color);
  display: inline-flex;
  align-items: center;
  min-height: 1.5em;
}

.hero-description {
  margin-top: 1rem;
  font-size: 1rem;
  max-width: 550px;
  margin-left: auto;
  margin-right: auto;
  color: var(--text-color);
}

.cta-button {
  background-color: var(--accent-color);
  color: var(--secondary-bg);
  padding: 0.6rem 1.4rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  display: inline-block;
  margin-top: 1.5rem;
  transition: background-color 0.2s ease, transform 0.15s ease;
}

.cta-button:hover {
  background-color: rgba(63, 166, 222, 0.85);
  transform: translateY(-2px);
}

.hero .accent {
  color: var(--accent-color);
}

.cursor {
  font-weight: 600;
  margin-left: 3px;
  animation: blink 0.8s infinite;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* ── Sections ── */
.section {
  padding: 2rem 1.5rem;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}

.section h2 {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--text-color);
}

/* ── About ── */
.about p {
  max-width: 900px;
  margin: 0 0 1rem 0;
  font-size: 1rem;
  text-align: left;
}

.about h2 {
  text-align: center;
}

/* ── Badge list ── */
.badge-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1rem 0;
  padding: 0;
}

.badge-list li {
  background-color: var(--skill-bar-bg);
  padding: 0.25rem 0.6rem;
  border-radius: 5px;
  font-size: 0.9rem;
  color: var(--text-color);
  white-space: nowrap;
}

/* Article badge-list items get card treatment */
#projects .badge-list {
  flex-direction: column;
  gap: 1rem;
}

#projects .badge-list li {
  white-space: normal;
  background-color: var(--secondary-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

#projects .badge-list li:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(63, 166, 222, 0.15);
  border-color: var(--accent-color);
}

#projects .badge-list li h4 {
  font-size: 1rem;
  margin-bottom: 0.3rem;
  color: var(--text-color);
}

#projects .badge-list li p {
  font-size: 0.95rem;
  margin: 0.25rem 0;
}

/* ── Skills ── */
.skills h2 {
  text-align: center;
}

.skill-list {
  max-width: 800px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

/* Skill card with accent left border on hover */
.skill {
  background-color: var(--secondary-bg);
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  border-left: 3px solid transparent;
  transition: border-left-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.skill:hover {
  border-left-color: var(--accent-color);
  box-shadow: 0 4px 12px rgba(63, 166, 222, 0.12);
  transform: translateY(-2px);
}

.skill h3 {
  font-size: 1rem;
  margin-bottom: 0.3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

.skill-arrow {
  font-size: 0.85rem;
  color: var(--accent-color);
  transition: transform 0.25s ease;
  display: inline-block;
}

.skill p {
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Accordion collapse wrapper */
.skill-collapse {
  overflow: hidden;
  max-height: 600px;
  transition: max-height 0.35s ease, opacity 0.25s ease;
  opacity: 1;
}

.skill-collapse.collapsed {
  max-height: 0;
  opacity: 0;
}

/* ── Experience list ── */
.experience-list {
  max-width: 800px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0.5rem;
  margin: 0 auto 1rem auto;
  padding: 0;
}

.experience-list li {
  background-color: var(--skill-bar-bg);
  padding: 0.25rem 0.6rem;
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--text-color);
  list-style: none;
}

.experience-detail {
  max-width: 550px;
  gap: 0.5rem;
  padding: 0;
}

.experience-detail li {
  list-style: none;
}

.experience-detail li ul {
  list-style: none;
}

/* ── Timeline ── */
.timeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  max-width: 1000px;
  margin: 0 auto;
}

.timeline-item {
  background-color: var(--secondary-bg);
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  border-left: 3px solid transparent;
  transition: border-left-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.timeline-item:hover {
  border-left-color: var(--accent-color);
  box-shadow: 0 4px 12px rgba(63, 166, 222, 0.12);
  transform: translateY(-2px);
}

.timeline-item h3 {
  font-size: 1rem;
  margin-bottom: 0.3rem;
}

.timeline-date {
  font-size: 0.9rem;
  color: var(--accent-color);
  display: block;
  margin-bottom: 0.5rem;
}

.timeline-item p {
  font-size: 0.95rem;
  line-height: 1.5;
}

.read-more {
  display: inline-block;
  margin-top: 0.5rem;
  color: var(--accent-color);
  font-weight: 700;
  text-decoration: none;
  transition: color 0.2s ease;
}

.read-more:hover {
  text-decoration: underline;
}

/* ── Reading time badge ── */
.read-time-badge {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--secondary-bg);
  background-color: var(--accent-color);
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  margin-bottom: 0.4rem;
  font-weight: 500;
  opacity: 0.85;
}

/* ── Contact ── */
.contact p {
  max-width: 900px;
  margin: 0 auto 1rem auto;
  font-size: 1rem;
  text-align: left;
}

.contact-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  padding: 0;
}

.contact-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-color);
  font-size: 1rem;
}

.contact-list a {
  text-decoration: none;
  font-weight: 500;
  color: var(--accent-color);
  transition: color 0.2s ease;
}

.contact-list a:hover {
  color: var(--text-color);
}

.contact-list .icon {
  margin-right: 0.25rem;
}

/* ── Copy email button ── */
.copy-email-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  cursor: pointer;
  padding: 3px 6px;
  color: var(--text-color);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  vertical-align: middle;
  margin-left: 4px;
}

.copy-email-btn:hover {
  background-color: var(--skill-bar-bg);
  border-color: var(--accent-color);
  color: var(--accent-color);
}

.copy-email-btn.copied {
  color: #28a745;
  border-color: #28a745;
}

/* ── LinkedIn icon ── */
.linkedin-icon {
  width: 1.1rem;
  height: 1.1rem;
  margin-right: 0.3rem;
  fill: var(--accent-color);
  vertical-align: -0.15rem;
}

/* ── Footer ── */
.footer {
  text-align: center;
  padding: 1rem;
  background-color: var(--secondary-bg);
  font-size: 0.85rem;
  border-top: 1px solid var(--border-color);
}

/* ── Wireshark Captures ── */
.captures {
  width: 640px;
  height: 480px;
  margin-right: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.captures img {
  width: 100%;
  height: 100%;
}

/* ── Project grid (legacy, kept for other pages) ── */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  max-width: 1000px;
  margin: 0 auto;
}

.project-card {
  background-color: var(--secondary-bg);
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.project-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(63, 166, 222, 0.15);
}

.project-card h3 {
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
}

.project-card p {
  font-size: 0.95rem;
  line-height: 1.5;
  flex: 1;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .sidebar {
    height: auto;
    flex-direction: row;
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .sidebar .nav-links {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.9rem;
  }
  .hero h1 {
    font-size: 1.8rem;
  }
  .hero h2 {
    font-size: 1rem;
  }
  .main-content {
    margin-top: 0;
    padding-top: 80px;
  }
}

/* ── Accessibility & focus states ── */
a:focus-visible, button:focus-visible {
  outline: 2px dashed var(--accent-color);
  outline-offset: 2px;
}

/* ── Skip link ── */
.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  position: fixed;
  left: 1rem;
  top: 1rem;
  width: auto;
  height: auto;
  background: var(--secondary-bg);
  color: var(--text-color);
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  z-index: 2000;
  box-shadow: 0 0 0 2px var(--accent-color);
}
