/* ============================================
   Wade Derby — Personal Site Revamp
   Software Engineer • Traveller • Business • Basketball
   ============================================ */

/* Dark theme (default) — soft darks, premium feel */
:root {
  --bg: #0B1120;
  --bg-muted: #111827;
  --card: #0F172A;
  --border: #1F2933;
  --text: #E5E7EB;
  --text-muted: #94A3B8;
  --accent: #6366F1;
  --accent-hover: #818CF8;
  --accent-soft: rgba(99, 102, 241, 0.15);
  --font-heading: "Outfit", sans-serif;
  --font-body: "DM Sans", sans-serif;
  --radius: 12px;
  --radius-lg: 20px;
  --transition: 0.25s ease;
  --container: min(90vw, 1100px);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition), border-color var(--transition), background-color var(--transition);
}

.container {
  width: var(--container);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

/* ----- Header ----- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1rem 0;
  transition: background var(--transition), box-shadow var(--transition);
}

.site-header .container {
  position: relative;
}

.site-header.is-scrolled {
  background: rgba(11, 17, 32, 0.9);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-link {
  display: inline-block;
}

.logo-img {
  width: 140px;
  height: auto;
}

.nav-main {
  display: flex;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.theme-toggle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.theme-toggle .theme-icon {
  position: absolute;
  font-size: 1.15rem;
}

.theme-toggle .theme-icon-light {
  display: none;
}

.theme-toggle .theme-icon-dark {
  display: block;
}

[data-theme="light"] .theme-toggle .theme-icon-light {
  display: block;
}

[data-theme="light"] .theme-toggle .theme-icon-dark {
  display: none;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.25rem;
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }
  .nav-main {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 1rem;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    display: none;
  }
  .nav-main.is-open {
    display: flex;
  }
  .nav-main .nav-link {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
  }
  .nav-main .nav-link:last-child {
    border-bottom: none;
  }
}

/* Light theme — clean, breathable */
html[data-theme="light"] {
  --bg: #FFFFFF;
  --bg-muted: #F8FAFC;
  --card: #FFFFFF;
  --border: #E5E7EB;
  --text: #0F172A;
  --text-muted: #475569;
  --accent: #6366F1;
  --accent-hover: #4F46E5;
  --accent-soft: rgba(99, 102, 241, 0.12);
}

html[data-theme="light"] .site-header.is-scrolled {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 1px 0 var(--border);
}

/* ----- Hero ----- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6rem 0 4rem;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.1), transparent),
    radial-gradient(ellipse 60% 40% at 100% 50%, rgba(17, 24, 39, 0.8), transparent),
    radial-gradient(ellipse 50% 30% at 0% 80%, rgba(99, 102, 241, 0.06), transparent),
    var(--bg);
}

html[data-theme="light"] .hero-bg {
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.06), transparent),
    radial-gradient(ellipse 60% 40% at 100% 50%, rgba(248, 250, 252, 0.9), transparent),
    radial-gradient(ellipse 50% 30% at 0% 80%, rgba(99, 102, 241, 0.04), transparent),
    var(--bg);
}

.hero-inner {
  position: relative;
  z-index: 1;
}

.hero-content {
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
}

.hero-avatar {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 1.5rem;
  border: 4px solid var(--accent-soft);
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.2);
}

.hero-title {
  margin: 0 0 0.75rem;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.2;
  color: var(--text);
}

.hero-greeting {
  display: block;
  font-weight: 400;
  font-size: 0.95em;
  color: var(--text-muted);
}

.hero-name {
  display: block;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.hero-tagline {
  margin: 0 0 2rem;
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.hero-br {
  display: none;
}

@media (min-width: 600px) {
  .hero-br {
    display: inline;
  }
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.75rem;
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 0.95rem;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  color: #FFFFFF;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #FFFFFF;
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-outline-light {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-outline-light:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.hero-scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero-scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--text-muted), transparent);
  border-radius: 2px;
  animation: scroll-pulse 2s ease-in-out infinite;
}

@keyframes scroll-pulse {
  0%, 100% { opacity: 0.4; transform: scaleY(0.8); }
  50% { opacity: 1; transform: scaleY(1); }
}

/* ----- About ----- */
.about {
  padding: 5rem 0;
}

.section-title {
  margin: 0 0 0.75rem;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--text);
  text-align: center;
}

.section-intro {
  max-width: 42ch;
  margin: 0 auto 3rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 1.1rem;
}

.pillars {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  max-width: 960px;
  margin: 0 auto;
}

@media (min-width: 640px) {
  .pillars {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .pillars {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
  }
}

.pillar {
  padding: 1.75rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.pillar:hover {
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

html[data-theme="light"] .pillar:hover {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

.pillar-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: var(--radius);
  font-size: 1.25rem;
}

.pillar-title {
  margin: 0 0 0.5rem;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text);
}

.pillar-text {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.link-inline {
  color: var(--accent);
  border-bottom: 1px solid rgba(99, 102, 241, 0.4);
}

.link-inline:hover {
  border-bottom-color: var(--accent);
}

/* ----- Featured posts (2 latest) ----- */
.featured-posts {
  padding: 4rem 0 3rem;
  border-bottom: 1px solid var(--border);
}

.featured-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  max-width: 960px;
  margin: 0 auto;
}

@media (min-width: 640px) {
  .featured-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ----- Blog / Posts ----- */
.blog-section {
  padding: 5rem 0;
}

.blog-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  max-width: 960px;
  margin: 0 auto;
}

@media (min-width: 640px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .blog-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.post-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

html[data-theme="light"] .post-card:hover {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

.post-card-image {
  aspect-ratio: 16 / 10;
  object-fit: cover;
  width: 100%;
}

.post-card-image-wrap {
  display: block;
  overflow: hidden;
  background: var(--bg-muted);
}

.post-card-image-wrap:hover .post-card-image {
  transform: scale(1.03);
}

.post-card-image {
  transition: transform var(--transition);
}

.post-card-body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.post-card-title {
  margin: 0 0 0.5rem;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.15rem;
  line-height: 1.35;
  color: var(--text);
}

.post-card-title a:hover {
  color: var(--accent);
}

.post-card-excerpt {
  margin: 0 0 1rem;
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.6;
  flex: 1;
}

.post-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.post-card-date {
  flex-shrink: 0;
}

.post-card-link {
  display: inline-flex;
  align-items: center;
  color: var(--accent);
  font-weight: 500;
}

.post-card-link:hover {
  color: var(--accent-hover);
}

/* Featured post (larger) */
.post-card.featured {
  grid-column: 1 / -1;
}

@media (min-width: 640px) {
  .post-card.featured {
    grid-column: span 2;
  }
}

@media (min-width: 900px) {
  .post-card.featured {
    grid-column: span 2;
  }
  .post-card.featured .post-card-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 220px;
  }
  .post-card.featured .post-card-image-wrap {
    order: 0;
  }
  .post-card.featured .post-card-image {
    aspect-ratio: auto;
    height: 100%;
  }
  .post-card.featured .post-card-body {
    padding: 2rem;
    justify-content: center;
  }
  .post-card.featured .post-card-title {
    font-size: 1.35rem;
  }
}

/* ----- Pagination ----- */
.pagination-wrap {
  padding: 2rem 0 3rem;
  display: flex;
  justify-content: center;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 0.75rem;
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.pagination a:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.pagination span.current,
.pagination span[aria-current="page"],
.pagination span[aria-disabled="true"] {
  color: var(--text-muted);
  border-color: var(--border);
  cursor: default;
}

.pagination span.current,
.pagination span[aria-current="page"] {
  color: var(--text);
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* ----- Single Post ----- */
.page-content {
  padding-top: 5rem;
  padding-bottom: 4rem;
  min-height: 100vh;
}

.article-header {
  max-width: 720px;
  margin: 0 auto 2.5rem;
}

.article-title {
  margin: 0 0 1rem;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  line-height: 1.25;
  color: var(--text);
}

.article-meta {
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.article-featured-image {
  width: 100%;
  max-width: 900px;
  margin: 0 auto 2rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}

.article-featured-image img {
  width: 100%;
  display: block;
}

.article-featured-caption {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: center;
}

.article-body {
  max-width: 720px;
  margin: 0 auto;
  font-size: 1.0625rem;
  line-height: 1.75;
}

.article-body h1,
.article-body h2,
.article-body h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--text);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.article-body h1 { font-size: 1.5rem; }
.article-body h2 { font-size: 1.3rem; }
.article-body h3 { font-size: 1.15rem; }

.article-body p {
  margin: 0 0 1.25rem;
}

.article-body a {
  color: var(--accent);
  border-bottom: 1px solid rgba(99, 102, 241, 0.4);
}

.article-body a:hover {
  border-bottom-color: var(--accent);
}

.article-body ul,
.article-body ol {
  margin: 0 0 1.25rem;
  padding-left: 1.5rem;
}

.article-body pre,
.article-body code {
  font-family: ui-monospace, monospace;
  font-size: 0.9em;
}

.article-body pre {
  margin: 0 0 1.25rem;
  padding: 1.25rem;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
}

.article-body code {
  padding: 0.2em 0.4em;
  background: var(--accent-soft);
  border-radius: 4px;
}

.article-body pre code {
  padding: 0;
  background: none;
}

/* Rouge highlight block */
.article-body .highlight {
  margin: 0 0 1.25rem;
  padding: 0;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
}

.article-body .highlight pre {
  margin: 0;
  padding: 1.25rem;
  background: transparent;
  border: none;
}

.article-footer {
  max-width: 720px;
  margin: 2.5rem auto 0;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.article-tags a {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  border: 1px solid transparent;
}

.article-tags a:hover {
  border-color: var(--accent);
}

.article-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.article-nav a {
  padding: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.article-nav a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.article-nav .next {
  text-align: right;
}

/* ----- Connect ----- */
.connect {
  padding: 5rem 0;
  background: var(--bg-muted);
  border-top: 1px solid var(--border);
}

.section-title-light {
  color: var(--text);
}

.connect-intro {
  max-width: 40ch;
  margin: 0 auto 2rem;
  text-align: center;
  color: var(--text-muted);
}

.connect-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 2.5rem;
}

.social-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem;
}

.social-list a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 50%;
  font-size: 1.2rem;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.social-list a:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* ----- Footer ----- */
.site-footer {
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
}

.footer-text {
  margin: 0;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ----- Archive / Page ----- */
.archive-section,
.page-section {
  padding: 5rem 0 4rem;
}

.page-section .section-intro {
  margin-bottom: 2rem;
}

/* Utility: no hero on inner pages */
.page-content-with-hero {
  padding-top: 0;
}

/* Skip hero when not on home */
/* Hero removed — posts-only layout */
.hero {
  display: none;
}
