/* ==========================================================================
   Rich Howell Personal Site Stylesheet
   Main SCSS Entry Point
   ========================================================================== */
/* ==========================================================================
   Variables
   ========================================================================== */
:root {
  --bg: #0d0d0d;
  --text: #e5e5e5;
  --accent: #9b5de5;
  --card-bg: #1a1a1a;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   Mixins
   ========================================================================== */
/* ==========================================================================
   Base Styles & Reset
   ========================================================================== */
html,
body {
  overflow-x: hidden;
  transition: background 0.4s ease, color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

body {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
  margin: 0;
  font-family: "Inter", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}
body.page-loaded {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.2s;
}
body.fade-out {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease-in, transform 0.5s ease-in;
}
body.theme-transition .hero-image::before {
  transition: all 0.8s ease-in-out !important;
}

a {
  color: var(--accent);
}

/* ==========================================================================
   Typography
   ========================================================================== */
.highlight {
  color: var(--accent);
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

a.site-logo {
  text-decoration: none;
  color: #ffffff;
}

.logo {
  font-weight: 700;
  font-size: 1.4rem;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav a {
  margin-left: 1rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
}
.nav a:hover {
  color: var(--accent);
}

#theme-toggle {
  margin-left: 1rem;
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  position: relative;
  overflow: hidden;
  background: var(--accent);
  color: white;
  text-decoration: none;
  padding: 0.65rem 1.2rem;
  border-radius: 0.5rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  border: none;
  display: inline-block;
  box-shadow: 0 3px 10px rgba(155, 93, 229, 0.3);
  transition: all 0.25s ease;
}
.btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: -150%;
  width: 150%;
  height: 100%;
  transform: skewX(-20deg);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(155, 93, 229, 0.4);
}
.btn:hover::after {
  animation: shimmerMove 1.4s ease-in-out;
  opacity: 1;
}
.btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(155, 93, 229, 0.25);
}
.btn.secondary {
  background: transparent;
  border: 2px solid var(--accent);
  color: var(--accent);
  box-shadow: none;
}
.btn.secondary:hover {
  background: var(--accent);
  color: white;
  box-shadow: 0 4px 10px rgba(155, 93, 229, 0.25);
}

body:not(.light) .btn::after {
  background: linear-gradient(120deg, transparent 0%, rgba(155, 93, 229, 0.25) 30%, rgba(255, 255, 255, 0.45) 50%, rgba(155, 93, 229, 0.25) 70%, transparent 100%);
}

body.light .btn::after {
  background: linear-gradient(120deg, transparent 0%, rgba(155, 93, 229, 0.15) 30%, rgba(255, 255, 255, 0.35) 50%, rgba(155, 93, 229, 0.15) 70%, transparent 100%);
}

.hero-buttons {
  margin-top: 1.5rem;
}
.hero-buttons .btn {
  margin-right: 0.5rem;
}

.github-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent);
  color: #fff !important;
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 0.9rem;
  border-radius: 0.4rem;
  transition: background 0.3s ease, transform 0.2s ease;
  box-shadow: 0 0 10px rgba(155, 93, 229, 0.3);
}
.github-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}
.github-btn:hover {
  background: #7e3fd1;
  transform: translateY(-2px);
}

button[type=submit] {
  align-self: flex-start;
  cursor: pointer;
}

/* ==========================================================================
   Cards
   ========================================================================== */
.card,
article {
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: 0.5rem;
  transition: transform 0.2s;
}
.card:hover,
article:hover {
  transition: transform 0.2s ease, box-shadow 0.3s ease;
}
.card:hover:hover,
article:hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 0 15px rgba(155, 93, 229, 0.4);
}

/* ==========================================================================
   Forms & Contact Form
   ========================================================================== */
.contact {
  max-width: 600px;
  margin: 3rem auto;
  text-align: left;
}
.contact h3 {
  text-align: center;
  margin-bottom: 0.5rem;
  font-size: 1.8rem;
}
.contact p {
  text-align: center;
  color: #aaa;
  margin-bottom: 2rem;
  font-size: 1.05rem;
}
.contact .btn {
  margin-top: 1rem;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.form-group {
  display: flex;
  flex-direction: column;
}
.form-group input,
.form-group textarea {
  font-family: inherit;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--accent);
}

input,
textarea,
select {
  background: var(--card-bg);
  border: 1.5px solid rgba(155, 93, 229, 0.15);
  color: var(--text);
  border-radius: 0.4rem;
  padding: 0.6rem 0.8rem;
  font-size: 1rem;
  width: 100%;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none;
  border-color: var(--accent);
  animation: fieldGlowIn 0.25s var(--ease) forwards;
}
input:not(:focus-visible),
textarea:not(:focus-visible),
select:not(:focus-visible) {
  animation: fieldGlowOut 0.25s var(--ease) forwards;
}

fieldset:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(155, 93, 229, 0.2);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  text-align: center;
  padding: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   Easter Egg: CSS Steam Loco (Hooter Hide 2.0)
   ========================================================================== */
.steam-easter-egg {
  position: absolute;
  bottom: 12px;
  right: -100px;
  pointer-events: none;
  overflow: visible;
}

.steam-loco {
  width: 90px;
  height: auto;
  opacity: 0;
  transform: translateX(100px);
  transition: opacity 0.5s ease, transform 10s linear;
  z-index: 1;
}

.site-footer:hover .steam-loco {
  opacity: 1;
  transform: translateX(-110vw);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
  text-align: center;
  padding: 4rem 1rem 2rem;
  max-width: 700px;
  margin: auto;
}

.split-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 1rem 2rem;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 3rem;
  max-width: 1000px;
  width: 100%;
}

.hero-image {
  position: relative;
  display: inline-block;
  isolation: isolate;
  justify-content: center;
}
.hero-image::before {
  content: "";
  position: absolute;
  inset: -20px;
  border-radius: 50%;
  background: conic-gradient(from 180deg, rgba(155, 93, 229, 0.6), rgba(155, 93, 229, 0.15), rgba(255, 255, 255, 0.15), rgba(155, 93, 229, 0.6));
  filter: blur(40px);
  z-index: 0;
  animation: rotateGlow 10s linear infinite;
  opacity: 0.6;
  transition: background 0.8s ease, filter 0.8s ease, opacity 0.8s ease;
}
.hero-image:hover::before {
  opacity: 0.9;
  filter: blur(50px);
}
.hero-image img {
  position: relative;
  z-index: 1;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 25px rgba(155, 93, 229, 0.4);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}
.hero-image img:hover {
  transform: scale(1.05);
  box-shadow: 0 0 35px rgba(155, 93, 229, 0.6);
}

.hero-text {
  text-align: left;
}
.hero-text h2 {
  font-size: 2.2rem;
  margin-bottom: 0.8rem;
}
.hero-text p {
  max-width: 480px;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  color: var(--text);
}

/* ==========================================================================
   Sections
   ========================================================================== */
section {
  padding: 2rem 1rem;
  max-width: 1000px;
  margin: auto;
}
section + section {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.section-divider {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin: 2rem 0 1.5rem;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem 2rem;
  justify-content: center;
  font-size: 1rem;
}

.social {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  transition: color 0.2s ease, transform 0.2s ease;
}
.social:hover {
  color: var(--accent);
  transform: translateY(-2px);
}
.social svg {
  width: 24px;
  height: auto;
  flex-shrink: 0;
  overflow: visible;
}

/* ==========================================================================
   Grid Layouts
   ========================================================================== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.2rem;
}

/* ==========================================================================
   Generic Page Layout (About, Contact)
   ========================================================================== */
.page-layout {
  max-width: 900px;
  margin: 3rem auto;
  padding: 0 1rem;
  line-height: 1.7;
  font-size: 1.05rem;
}

.page-header {
  text-align: center;
  margin-bottom: 2rem;
}
.page-header h2 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.page-content {
  display: flex;
  flex-direction: row;
  gap: 2rem;
  align-items: flex-start;
}

.profile-pic {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.page-text {
  flex: 1;
}
.page-text a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.page-text a:hover {
  text-decoration: underline;
}
.page-text blockquote {
  border-left: 3px solid var(--accent);
  margin: 1.5rem 0;
  padding-left: 1rem;
  font-style: italic;
  color: #ccc;
}

/* ==========================================================================
   Article & Blog Layouts
   ========================================================================== */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 3rem;
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.article-content {
  max-width: 750px;
  line-height: 1.7;
  font-size: 1.05rem;
}

.article-sidebar {
  position: sticky;
  top: 100px;
  align-self: start;
  font-size: 0.9rem;
  color: #bbb;
  padding-top: 1rem;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  padding-left: 1.5rem;
}
.article-sidebar h4 {
  margin-bottom: 0.5rem;
  color: var(--accent);
}

.sidebar-meta p {
  margin: 0.3rem 0;
}

.sidebar-toc ul {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0 0;
}
.sidebar-toc li {
  margin: 0.4rem 0;
}
.sidebar-toc a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s;
}
.sidebar-toc a:hover {
  color: var(--accent);
}

.post-index {
  max-width: 800px;
  margin: 3rem auto;
  padding: 0 1rem;
}

.post-index-header {
  margin-bottom: 3rem;
  text-align: center;
}
.post-index-header h2 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}
.post-index-header .intro {
  color: #aaa;
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

.year-group {
  margin-bottom: 2rem;
}
.year-group h3 {
  font-size: 1.2rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 0.3rem;
}
.year-group ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.year-group li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.year-group li a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}
.year-group li a:hover {
  color: var(--accent);
}
.year-group .date {
  color: #888;
  font-size: 0.9rem;
  margin-left: 1rem;
}

/* ==========================================================================
   Projects Section
   ========================================================================== */
.projects-page {
  max-width: 1000px;
  margin: 3rem auto;
  padding: 0 1rem;
}

.projects-header {
  text-align: center;
  margin-bottom: 3rem;
}
.projects-header h2 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}
.projects-header .intro {
  color: #aaa;
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.project {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.project h4 {
  color: var(--accent);
  margin: 0.2rem 0 0.6rem;
}
.project p {
  flex: 1;
  font-size: 0.95rem;
  margin-bottom: 0.8rem;
}
.project .links a {
  display: inline-block;
  margin-right: 0.5rem;
  text-decoration: none;
  color: var(--accent);
  font-weight: 500;
}
.project .links a:hover {
  opacity: 0.8;
}

.project-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 0.3rem;
}

.project-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 3rem;
  max-width: 1100px;
  margin: 3rem auto;
  padding: 0 1rem;
}

.project-content {
  max-width: 750px;
  line-height: 1.7;
  font-size: 1.05rem;
}

.project-sidebar {
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: 0.6rem;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
  transition: background 0.3s, box-shadow 0.3s;
}
.project-sidebar h4 {
  color: var(--accent);
  margin-bottom: 0.4rem;
  font-size: 1rem;
}
.project-sidebar p,
.project-sidebar li {
  color: var(--text);
  font-size: 0.95rem;
}
.project-sidebar .icon {
  opacity: 0.9;
  margin-right: 0.3rem;
}
.project-sidebar a {
  color: var(--accent);
  text-decoration: none;
}
.project-sidebar a:hover {
  text-decoration: underline;
}

.project-logo {
  width: 80px;
  height: auto;
  margin-bottom: 1rem;
}

.sidebar-section {
  margin-bottom: 1.2rem;
}
.sidebar-section h4 {
  margin-bottom: 0.5rem;
  color: var(--accent);
}
.sidebar-section ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sidebar-section ul li {
  margin: 0.3rem 0;
}

.repo-info {
  margin-top: 1rem;
}

.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
.screenshot-grid img {
  width: 100%;
  border-radius: 0.6rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}
.screenshot-grid img:hover {
  transform: scale(1.03);
  box-shadow: 0 0 15px rgba(155, 93, 229, 0.3);
}

.tech-stack ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.tech-stack li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.3rem 0;
}
.tech-stack .icon {
  font-size: 1.1rem;
}

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  z-index: 999;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  transition: opacity 0.3s ease;
}
.lightbox.show {
  display: flex;
  animation: fadeIn 0.3s forwards;
}
.lightbox.show img {
  opacity: 1;
  transform: translateY(0);
}
.lightbox img {
  z-index: 1;
  max-width: 90%;
  max-height: 75vh;
  border-radius: 0.6rem;
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.5);
  object-fit: contain;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.lightbox-close {
  position: fixed;
  top: 20px;
  right: 30px;
  font-size: 2rem;
  color: var(--accent);
  cursor: pointer;
  user-select: none;
  transition: transform 0.2s ease, color 0.3s ease, opacity 0.2s ease;
  text-shadow: 0 0 10px rgba(155, 93, 229, 0.5);
  z-index: 2;
}
.lightbox-close:hover {
  opacity: 0.7;
  transform: scale(1.1);
  color: var(--accent);
}

.lightbox-prev,
.lightbox-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(155, 93, 229, 0.15);
  color: var(--accent);
  border: 1px solid rgba(155, 93, 229, 0.3);
  font-size: 2.2rem;
  line-height: 1;
  padding: 0.4rem 0.8rem;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.3s ease;
  user-select: none;
  z-index: 2;
}
.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(155, 93, 229, 0.3);
  box-shadow: 0 0 10px rgba(155, 93, 229, 0.6);
  transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
  left: 30px;
}

.lightbox-next {
  right: 30px;
}

.lightbox-caption {
  z-index: 2;
  margin-top: 1rem;
  color: var(--text);
  background: rgba(0, 0, 0, 0.5);
  padding: 0.6rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.95rem;
  max-width: 85%;
  text-align: center;
  line-height: 1.4;
  backdrop-filter: blur(4px);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.lightbox-caption.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Creative Side (Video & Photos)
   ========================================================================== */
.creative-side {
  max-width: 1000px;
  margin: 3rem auto;
  padding: 2rem 1rem;
  padding-bottom: 1rem;
}

.creative-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}
.creative-grid a {
  display: inline-block;
  margin-top: 0.6rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.creative-grid a:hover {
  opacity: 0.8;
}
.creative-grid p {
  margin-top: 0.8rem;
  text-align: left;
}

.video-card {
  background: var(--card-bg);
  padding: 1rem;
  border-radius: 0.7rem;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.3s ease;
}
.video-card:hover {
  transition: transform 0.2s ease, box-shadow 0.3s ease;
}
.video-card:hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 0 15px rgba(155, 93, 229, 0.4);
}
.video-card:hover iframe {
  filter: brightness(1.1);
}
.video-card iframe {
  width: 100%;
  aspect-ratio: 16/9;
  border: none;
  border-radius: 0.5rem;
  display: block;
  overflow: hidden;
}
.video-card p {
  margin-top: 0.8rem;
  text-align: right;
}
.video-card a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.2s ease;
}
.video-card a:hover {
  opacity: 0.8;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  position: relative;
}
.photo-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0.5rem;
  /* opacity: 0;*/  
  transform: translateY(10px) scale(0.97);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
  will-change: opacity, transform;
}
.photo-grid img.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.photo-grid img:hover {
  transform: translateY(-4px) scale(1.03);
  filter: brightness(1.1);
  box-shadow: 0 0 12px rgba(155, 93, 229, 0.4);
  z-index: 2;
}
.photo-grid p {
  margin-top: 0.8rem;
}
.photo-grid a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.2s ease;
}
.photo-grid a:hover {
  opacity: 0.8;
}

/* ==========================================================================
   Now Section (Currently Reading/Listening)
   ========================================================================== */
.now {
  overflow-x: hidden;
}
.now .grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 2rem;
}
.now .card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--card-bg);
  border-radius: 0.7rem;
  overflow: hidden;
  padding: 1rem;
  transition: transform 0.3s ease;
}
.now .card.sleeping {
  justify-content: center;
  flex-direction: column;
  text-align: center;
}
.now .card.sleeping img {
  width: 120px;
  opacity: 0.85;
  animation: snooze 3s ease-in-out infinite;
}
.now .card.sleeping .meta {
  font-style: italic;
  opacity: 0.75;
  margin-top: 0.5rem;
}

@keyframes snooze {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(5px);
  }
}
.vinyl-wrapper {
  position: relative;
  width: 90px;
  height: 90px;
  flex-shrink: 0;
  cursor: pointer;
}
.vinyl-wrapper:hover .vinyl,
.vinyl-wrapper .now-listening:hover .vinyl {
  animation-play-state: running;
}

.vinyl {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: repeating-radial-gradient(circle at center, #111 0px, #111 2px, #000 3px, #000 4px);
  box-shadow: inset 0 0 10px #000, 0 0 4px rgba(0, 0, 0, 0.5);
  position: absolute;
  top: 0;
  left: 0;
  animation: spin 6s linear infinite;
  animation-play-state: paused;
}

@keyframes snooze {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(5px);
  }
}
.album-art {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  position: absolute;
  top: 15px;
  left: 15px;
  object-fit: cover;
  z-index: 2;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

.now-info {
  flex: 1;
}

.song-link,
.artist-link,
.book-link {
  color: var(--accent);
  text-decoration: none;
}
.song-link:hover,
.artist-link:hover,
.book-link:hover {
  text-decoration: underline;
}

.meta {
  color: #999;
  font-size: 0.85rem;
}

.book-cover {
  width: 70px;
  height: 100px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.now-reading .see-all {
  display: inline-block;
  margin-top: 0.5rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
}
.now-reading .see-all:hover {
  opacity: 0.8;
}

/* ==========================================================================
   Writing Section
   ========================================================================== */
.writing {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem 1rem;
  position: relative;
}
.writing::after {
  content: "";
  position: absolute;
  top: 2rem;
  bottom: 2rem;
  left: 50%;
  width: 1px;
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(-50%);
}
.writing h3 {
  margin-bottom: 1rem;
}

.article-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.article-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.article-list a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}
.article-list a:hover {
  color: var(--accent);
}

.date {
  color: #888;
  font-size: 0.85rem;
  margin-left: 1rem;
}

.see-all {
  display: inline-block;
  margin-top: 0.8rem;
  text-decoration: none;
  font-weight: 500;
  color: var(--accent);
  transition: opacity 0.2s ease;
}
.see-all:hover {
  opacity: 0.8;
}

/* ========================================================================== */
/* --- Book Single Page Layout --- */
/* ========================================================================== */
.book-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 3rem;
  max-width: 1100px;
  margin: 3rem auto;
  padding: 0 1rem;
}

.book-content {
  max-width: 750px;
  line-height: 1.7;
  font-size: 1.05rem;
}

.book-header {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: flex-start;
  margin-bottom: 2rem;
}

.book-cover-large {
  width: 180px;
  border-radius: 0.5rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.book-meta h2 {
  margin: 0 0 0.3rem;
}

.book-meta .author {
  color: var(--accent);
  font-size: 1rem;
  margin-bottom: 1rem;
}

.book-summary {
  margin-bottom: 1.5rem;
}

.book-links .btn {
  margin-right: 0.5rem;
}

.book-details,
.book-other {
  margin-top: 2rem;
}

.book-other ul {
  list-style: none;
  padding: 0;
}

.book-other li {
  margin-bottom: 0.4rem;
}

/* Sidebar */
.book-sidebar {
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: 0.6rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.book-sidebar h4 {
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.book-sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.book-sidebar li {
  margin: 0.3rem 0;
}

.book-sidebar a {
  margin-top: 0.3rem;
  text-decoration: none;
}

.book-sidebar a:hover {
  text-decoration: underline;
}

/* Light mode */
body.light .book-sidebar {
  background: #faf7ff;
  box-shadow: 0 2px 12px rgba(92, 47, 191, 0.08);
}

/* Responsive */
@media (max-width: 900px) {
  .book-layout {
    display: block;
  }
  .book-sidebar {
    margin-top: 2rem;
  }
}
/* ==========================================================================
   Light Mode Theme
   ========================================================================== */
body.light {
  --bg: #f9f7fc;
  --text: #1c1c1c;
  --card-bg: #ffffff;
  --accent: #8b4fe8;
}
body.light .hero-image::before {
  background: conic-gradient(from 180deg, rgba(155, 93, 229, 0.4), rgba(155, 93, 229, 0.1), rgba(230, 180, 255, 0.4), rgba(155, 93, 229, 0.4));
  filter: blur(50px);
  opacity: 0.7;
}
body.light .hero-image img {
  box-shadow: 0 0 25px rgba(155, 93, 229, 0.2);
}
body.light .card,
body.light article {
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.05);
}
body.light input,
body.light textarea,
body.light select {
  background: #fff;
  border-color: rgba(155, 93, 229, 0.25);
  color: var(--text);
}
body.light .btn {
  box-shadow: 0 3px 8px rgba(155, 93, 229, 0.25);
}
body.light .btn.secondary {
  border-color: rgba(155, 93, 229, 0.7);
  color: rgba(85, 40, 170, 0.9);
}
body.light .btn.secondary:hover {
  background: var(--accent);
  color: white;
  box-shadow: 0 4px 10px rgba(155, 93, 229, 0.3);
}
body.light .btn:focus-visible {
  outline: 2px solid rgba(85, 40, 170, 0.8);
  box-shadow: 0 0 0 4px rgba(155, 93, 229, 0.25);
}
body.light .github-btn {
  background: var(--accent);
  color: #fff !important;
  box-shadow: 0 0 8px rgba(92, 47, 191, 0.1);
}
body.light .github-btn:hover {
  background: #7e3fd1;
  transform: translateY(-2px);
}
body.light :focus-visible {
  animation: focusGlowIn 0.25s ease forwards;
  box-shadow: 0 0 0 4px rgba(155, 93, 229, 0.25);
}
body.light a:focus-visible {
  outline: 2px solid rgba(85, 40, 170, 0.8);
  box-shadow: 0 0 0 4px rgba(155, 93, 229, 0.25);
}
body.light section + section {
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}
body.light .section-divider {
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}
body.light .writing::after {
  background: rgba(0, 0, 0, 0.1);
}
body.light .article-list li {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
body.light .year-group h3 {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
body.light .project-sidebar {
  background: #faf7ff;
  border: 1px solid rgba(92, 47, 191, 0.08);
  box-shadow: 0 2px 8px rgba(92, 47, 191, 0.06);
  color: #333;
}
body.light .project-sidebar h4 {
  color: #6b2fbf;
}
body.light .project-sidebar .icon {
  opacity: 0.9;
  filter: brightness(0.85);
}
body.light .lightbox {
  background: rgba(255, 255, 255, 0.95);
}
body.light .lightbox-close,
body.light .lightbox-prev,
body.light .lightbox-next {
  color: #6b2fbf;
  border-color: rgba(107, 47, 191, 0.2);
}
body.light .lightbox-prev:hover,
body.light .lightbox-next:hover {
  background: rgba(107, 47, 191, 0.15);
  box-shadow: 0 0 10px rgba(107, 47, 191, 0.3);
}
body.light .lightbox-caption {
  background: rgba(255, 255, 255, 0.8);
  color: #222;
}

/* ==========================================================================
   Animations & Keyframes
   ========================================================================== */
@keyframes rotateGlow {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
@keyframes shimmerMove {
  0% {
    left: -150%;
  }
  100% {
    left: 150%;
  }
}
@keyframes focusGlowIn {
  0% {
    box-shadow: 0 0 0 0 rgba(155, 93, 229, 0);
    outline-color: transparent;
  }
  100% {
    box-shadow: 0 0 0 4px rgba(155, 93, 229, 0.3);
    outline-color: var(--accent);
  }
}
@keyframes focusGlowOut {
  0% {
    box-shadow: 0 0 0 4px rgba(155, 93, 229, 0.3);
    outline-color: var(--accent);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(155, 93, 229, 0);
    outline-color: transparent;
  }
}
@keyframes fieldGlowIn {
  0% {
    box-shadow: 0 0 0 0 rgba(155, 93, 229, 0);
  }
  100% {
    box-shadow: 0 0 0 4px rgba(155, 93, 229, 0.25);
  }
}
@keyframes fieldGlowOut {
  0% {
    box-shadow: 0 0 0 4px rgba(155, 93, 229, 0.25);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(155, 93, 229, 0);
  }
}
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
  will-change: opacity, transform;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Accessibility & Focus Styles
   ========================================================================== */
.btn:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  box-shadow: 0 0 0 4px rgba(155, 93, 229, 0.3);
  transition: box-shadow 0.2s ease, outline 0.2s ease;
}
.btn:focus:not(:focus-visible),
a:focus:not(:focus-visible) {
  outline: none;
  box-shadow: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  box-shadow: 0 0 0 4px rgba(155, 93, 229, 0.3);
  border-radius: 6px;
  transition: box-shadow 0.2s ease, outline 0.2s ease;
  animation: focusGlowIn 0.25s ease forwards;
}

:focus:not(:focus-visible) {
  outline: none !important;
  box-shadow: none !important;
  animation: focusGlowOut 0.25s ease forwards;
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(155, 93, 229, 0.3);
  outline: none;
}

button:focus-visible,
#theme-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(155, 93, 229, 0.3);
  border-radius: 50%;
}

.skip-link {
  position: absolute;
  top: -50px;
  left: 1rem;
  background: var(--accent);
  color: white;
  padding: 0.6rem 1rem;
  border-radius: 0.4rem;
  font-weight: 600;
  z-index: 1000;
  transition: top 0.3s ease;
}
.skip-link:focus {
  top: 1rem;
}
