/*––––– Variables –––––*/
:root {
  --bg: #111;
  --fg: #ddd;
  --muted: #777;
  --highlight: #e54e3b;
  --font-sans: 'Montserrat', sans-serif;
  --transition: 0.3s ease;
}

/*––––– Global Reset –––––*/
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/*––––– Base & Layout –––––*/
body.dark-theme {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  line-height: 1.5;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/*––––– Skip Link –––––*/
.skip-link {
  position: absolute;
  top: -40px;
  left: 1rem;
  background: var(--highlight);
  color: #fff;
  padding: 0.5rem;
  text-decoration: none;
  transition: top var(--transition);
}
.skip-link:focus {
  top: 1rem;
}

/*––––– Header & Nav –––––*/
header {
  position: relative;
  z-index: 10;
}
.nav--primary {
  display: flex;
  align-items: center;
  padding: 1rem 2rem;
}
.nav--primary .logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--fg);
  text-decoration: none;
}

/*––––– Hero Section –––––*/
.portfolio-hero {
  position: relative;
  height: 50vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0 1rem;
}
.portfolio-hero .eyebrow {
  font-size: 0.875rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  color: var(--fg);
}
.portfolio-hero .hero-title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  line-height: 1.1;
  font-weight: 700;
}
.portfolio-hero .accent-dot {
  position: absolute;
  top: 20%;
  right: 25%;
  width: 1rem;
  height: 1rem;
  background: var(--highlight);
  border-radius: 50%;
  opacity: 0.8;
  animation: float 6s ease-in-out infinite;
  aria-hidden: true;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-1rem); }
}
@media (prefers-reduced-motion: reduce) {
  .accent-dot { animation: none; }
}

/*––––– Article Container –––––*/
.article-container {
  max-width: 800px;
  width: 90%;
  margin: 4rem auto;
  padding: 2rem;
  background: var(--bg);
  color: var(--fg);
}
.article-header {
  text-align: center;
  margin-bottom: 2rem;
}
.article-header h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 0.5rem;
}
.article-meta {
  font-size: 0.875rem;
  color: var(--muted);
}
.article-container p {
  margin-bottom: 1.5rem;
  font-size: 1rem;
}
.article-container h2 {
  margin: 2rem 0 1rem;
  font-size: clamp(1.5rem, 4vw, 2rem);
  color: var(--highlight);
}
.article-container code {
  background: rgba(255,255,255,0.1);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: monospace;
}
.article-container figure {
  margin: 2rem 0;
  text-align: center;
}
.article-container img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
}
.article-container figcaption {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: #aaa;
}
.article-footer {
  text-align: center;
  margin-top: 3rem;
  font-size: 0.875rem;
  color: var(--muted);
}

/*––––– Side‐bars –––––*/
.side-bar {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
}
.side-bar--left { left: 1rem; }
.side-bar--right { right: 0; }

/* Social Links */
.social-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.social-list a {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--fg);
  text-decoration: none;
  transition: color var(--transition);
}
.social-list a:hover,
.social-list a:focus {
  color: var(--highlight);
}

/* Nav Tabs */
.external-tab {
  display: block;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  background: var(--highlight);
  color: #fff;
  padding: 0.75rem 0.5rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-decoration: none;
  border-top-left-radius: 0.5rem;
  border-bottom-left-radius: 0.5rem;
  margin: 3rem 0;
  transition: transform var(--transition);
}
.external-tab:hover,
.external-tab:focus {
  transform: translateX(-0.5rem);
}

/*––––– Footer –––––*/
footer {
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.875rem;
  color: var(--muted);
}

/*––––– Responsive Breakpoints –––––*/
@media (max-width: 600px) {
  .portfolio-hero {
    height: 40vh;
  }
  .portfolio-hero .hero-title {
    font-size: clamp(2rem, 8vw, 3rem);
  }
  .accent-dot {
    display: none;
  }
  .side-bar--left { left: 0.5rem; }
  .side-bar--right { right: 0.5rem; }
  .article-container {
    margin: 2rem auto;
    padding: 1rem;
  }
  .article-header h1 {
    font-size: clamp(1.5rem, 7vw, 2.5rem);
  }
}
