/* =============================================================================
   Portfolio v3 - Cameron Redmond
   Minimal, elegant, purposeful
   ============================================================================= */

/* CSS Variables - Theme System
   ============================================================================= */
:root {
  /* Light theme - warm, cream tones */
  --bg: #f8f6f3;
  --text: #2a2a2a;
  --text-muted: #6a6a6a;
  --accent: #8b5cf6;
  --accent-hover: #7c3aed;
  --accent-light: #a78bfa;
  --border: #e8e6e3;
  --status-dot: #10b981;
}

[data-theme="dark"] {
  /* Dark theme - soft charcoal, warm off-whites */
  --bg: #1c1c1c;
  --text: #f0ede8;
  --text-muted: #b0ada8;
  --accent: #a78bfa;
  --accent-hover: #c4b5fd;
  --border: #2a2a2a;
  --status-dot: #34d399;
}

/* Reset & Base
   ============================================================================= */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Space Mono', 'JetBrains Mono', 'SF Mono', 'Consolas', 'Monaco', monospace;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text);
  background-color: var(--bg);
  transition: background-color 0.3s ease, color 0.3s ease;
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Canvas container for halftone pattern */
#halftone-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  opacity: 0.2;
}

::selection {
  background-color: var(--accent);
  color: white;
}

/* Typography
   ============================================================================= */
h1 {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

[data-theme="light"] h1 {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

[data-theme="dark"] h1 {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 50%, var(--text) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 2rem;
  color: var(--text);
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

p {
  margin-bottom: 1.5rem;
  color: var(--text-muted);
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 2px;
}

/* Layout
   ============================================================================= */
main {
  min-height: 80vh;
}

section {
  padding: 6rem 0;
}

section:first-of-type {
  padding-top: 4rem;
}

.content {
  max-width: 800px;
  margin: 0 auto;
}

/* Glassmorphism effect for readability */
.glass {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 16px;
  padding: 2.5rem;
}

[data-theme="dark"] .glass {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .glass {
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.05);
}

/* Subtle purple accent on About section */
#about .glass {
  border: 1px solid rgba(167, 139, 250, 0.15);
}

[data-theme="light"] #about .glass {
  border: 1px solid rgba(139, 92, 246, 0.2);
}

/* Navigation
   ============================================================================= */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  margin-bottom: 2rem;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  font-size: 0.9rem;
  color: var(--text-muted);
  position: relative;
  padding-bottom: 0.25rem;
  transition: color 0.2s ease;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.2s ease;
}

.nav-links a:hover {
  color: var(--text);
}

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

/* Theme Toggle
   ============================================================================= */
#theme-toggle {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  cursor: pointer;
  color: var(--text);
  box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

[data-theme="light"] #theme-toggle {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.05);
}

#theme-toggle:hover {
  border-color: var(--accent);
  transform: scale(1.05);
}

#theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

[data-theme="light"] .moon {
  display: flex;
}

[data-theme="light"] .sun {
  display: none;
}

[data-theme="dark"] .sun {
  display: flex;
}

[data-theme="dark"] .moon {
  display: none;
}

/* Hero Section
   ============================================================================= */
.hero {
  padding: 6rem 0 6rem;
}

.hero-content {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.profile-image {
  flex-shrink: 0;
}

.profile-image img {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}

.hero-text {
  flex: 1;
}

.hero .subtitle {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--text-muted);
  max-width: 600px;
  margin-bottom: 2rem;
  line-height: 1;
}

.hero .subtitle .role {
  display: block;
  line-height: 1.75;
}

.status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.status .divider {
  opacity: 0.5;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--status-dot);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

/* Tech Stack
   ============================================================================= */
.tech-stack {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2rem;
}

.tech-stack span {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: all 0.2s ease;
}

.tech-stack span:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* Section Header
   ============================================================================= */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.section-header h2 {
  margin-bottom: 0;
}

.resume-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1.1rem;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  color: var(--text);
  text-decoration: none;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

[data-theme="light"] .resume-card {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(139, 92, 246, 0.18);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.resume-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  color: var(--text);
}

.resume-card-icon {
  color: var(--accent);
  flex-shrink: 0;
}

.resume-card-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.resume-card-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1;
}

.resume-card-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1;
}

.resume-card-dl {
  color: var(--text-muted);
  margin-left: 0.25rem;
  transition: transform 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
}

.resume-card:hover .resume-card-dl {
  transform: translateY(2px);
  color: var(--accent);
}

/* Work & Education
   ============================================================================= */
.work-item {
  padding-bottom: 2.5rem;
}

.work-item:last-child {
  padding-bottom: 0;
}

.work-item + .work-item {
  border-top: 1px solid var(--border);
  padding-top: 2.5rem;
}

.work-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.25rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

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

.work-company {
  font-size: 0.95rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.work-list {
  list-style: none;
  padding-left: 0;
  margin-top: 1rem;
}

.work-list li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
  line-height: 1.6;
  color: var(--text);
}

.work-list li:last-child {
  margin-bottom: 0;
}

.work-list li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: bold;
}

.education-section {
  margin-top: 2rem;
}

.education-header {
  font-size: 1.5rem;
  margin-bottom: 2rem;
  color: var(--text);
}

/* Projects
   ============================================================================= */
.project-item {
  padding-bottom: 2.5rem;
}

.project-item:last-child {
  padding-bottom: 0;
}

.project-item + .project-item {
  border-top: 1px solid var(--border);
  padding-top: 2.5rem;
}

.project-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.project-header h3 {
  margin-bottom: 0;
}

.project-title {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  transition: color 0.2s ease, transform 0.2s ease;
}

.project-title:hover {
  color: var(--accent);
  transform: translateX(4px);
}

.external-icon {
  opacity: 0.5;
  transition: opacity 0.2s ease;
}

.project-title:hover .external-icon {
  opacity: 1;
}

.github-link {
  display: flex;
  align-items: center;
  color: var(--text-muted);
  transition: color 0.2s ease, transform 0.2s ease;
  margin-left: auto;
}

.github-link:hover {
  color: var(--accent);
  transform: translateY(-2px);
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.project-tech span {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: all 0.2s ease;
}

.project-tech span:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.project-features-label {
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.project-list {
  list-style: none;
  padding-left: 0;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
}

.project-list li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.5rem;
  line-height: 1.6;
  color: var(--text);
}

.project-list li:last-child {
  margin-bottom: 0;
}

.project-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: bold;
  font-size: 1.2rem;
}

/* Elsewhere
   ============================================================================= */
.quote {
  border-left: 2px solid var(--accent);
  padding-left: 1.5rem;
  margin: 0;
}

.quote p {
  font-style: italic;
  line-height: 1.8;
  margin-bottom: 0.75rem;
}

.quote cite {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: normal;
}

.elsewhere-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

.listening-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
  margin-top: 0;
}

.spotify-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Reading / Using Cards
   ============================================================================= */
.reading-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.reading-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.2s ease;
}

[data-theme="dark"] .reading-card {
  background: rgba(255, 255, 255, 0.02);
}

[data-theme="light"] .reading-card {
  background: rgba(255, 255, 255, 0.5);
  border-color: rgba(0, 0, 0, 0.06);
}

.reading-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.reading-tag {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  width: fit-content;
  border: 1px solid currentColor;
  opacity: 0.8;
}

.reading-tag--article { color: #0ea5e9; }
.reading-tag--book    { color: #f97316; }
.reading-tag--tool    { color: var(--accent); }
.reading-tag--essay   { color: #10b981; }
.reading-tag--video   { color: #ef4444; }

.reading-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

.reading-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Contact
   ============================================================================= */
#contact .content {
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.contact-note {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-bottom: 0;
  font-style: italic;
  opacity: 0.7;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: flex-start;
  width: fit-content;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 1rem;
  color: var(--text);
  padding: 0.75rem 0;
  border-bottom: 1px solid transparent;
  transition: all 0.2s ease;
}

.contact-link:hover {
  color: var(--accent);
  transform: translateX(4px);
  border-bottom-color: var(--border);
}

.contact-icon {
  color: var(--accent);
  flex-shrink: 0;
}

/* Footer
   ============================================================================= */
footer {
  margin-top: 8rem;
  padding: 3rem 0 2rem;
  border-top: 1px solid var(--border);
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.footer-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: center;
}

.footer-badges img {
  opacity: 0.7;
  transform: scale(0.85);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.footer-badges img:hover,
.badge-link:hover img {
  opacity: 1;
  transform: scale(0.85) translateY(-2px);
}

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

/* Responsive Design
   ============================================================================= */
@media (max-width: 768px) {
  body {
    padding: 1.5rem 1rem;
  }

  section {
    padding: 4rem 0;
  }

  .hero {
    padding: 4rem 0 3rem;
  }

  .hero-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
  }

  .profile-image img {
    width: 140px;
    height: 140px;
  }

  .nav-links {
    gap: 1.25rem;
  }

  .nav-links a {
    font-size: 0.85rem;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .work-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .tech-stack {
    gap: 0.5rem;
  }

  .project-header {
    flex-wrap: wrap;
  }

  .github-link {
    margin-left: 0;
  }
}

@media (max-width: 480px) {
  body {
    padding: 1rem 0.75rem;
  }

  section {
    padding: 3rem 0;
  }

  .hero {
    padding: 3rem 0 2rem;
  }

  .reading-grid {
    grid-template-columns: 1fr;
  }

  .nav-links {
    gap: 1rem;
  }
}

/* Accessibility
   ============================================================================= */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Touch device hover fix — prevent transform states getting stuck after tap
   ============================================================================= */
@media (hover: none) {
  #theme-toggle:hover,
  .nav-links a:hover::after,
  .tech-stack span:hover,
  .resume-card:hover,
  .resume-card:hover .resume-card-dl,
  .project-title:hover,
  .github-link:hover,
  .project-tech span:hover,
  .contact-link:hover,
  .reading-card:hover,
  .footer-badges img:hover,
  .badge-link:hover img {
    transform: none;
  }
}

/* Focus visible for keyboard navigation */
:focus:not(:focus-visible) {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 2px;
}

/* Print styles
   ============================================================================= */
@media print {
  body {
    background: white;
    color: black;
    max-width: 100%;
    padding: 0;
  }

  nav,
  footer,
  #theme-toggle,
  .profile-image {
    display: none;
  }

  section {
    padding: 2rem 0;
    page-break-inside: avoid;
  }

  a {
    color: black;
    text-decoration: underline;
  }

  a[href^="http"]:after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
  }

  h1 {
    -webkit-text-fill-color: inherit;
    background: none;
    color: black;
  }

  .github-link,
  .external-icon {
    display: none;
  }
}