/**
 * Joshua Odmark - Data Science & AI Portfolio
 * Custom Design System: Warm, Human, Organic
 * Color Palette: Terracotta, Sage, Cream with Blue Accent
 */

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

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  overflow-x: hidden;
}

/* ================================================
   CSS Custom Properties (Design Tokens)
   ================================================ */
:root {
  /* Warm Color Palette */
  --terracotta: #C86D5C;
  --terracotta-light: #D88576;
  --terracotta-dark: #A85845;

  --sage: #8B9D83;
  --sage-light: #A5B69D;
  --sage-dark: #6B7D63;

  --cream: #F4EFE7;
  --cream-dark: #E8DFD0;

  --blue-accent: #2563eb;
  --blue-accent-light: #3b82f6;
  --blue-accent-dark: #1d4ed8;

  /* Text Colors */
  --text-primary: #2D2D2A;
  --text-secondary: #5C5C58;
  --text-muted: #8A8A85;
  --text-on-dark: #F4EFE7;

  /* Background Colors */
  --bg-primary: #FDFCFA;
  --bg-secondary: #F4EFE7;
  --bg-accent: #E8DFD0;
  --bg-card: #FFFFFF;

  /* Spacing Scale */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;

  /* Typography Scale */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;
  --text-6xl: 3.75rem;

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;

  /* Shadows - Softer, more organic */
  --shadow-sm: 0 2px 8px rgba(200, 109, 92, 0.08);
  --shadow-md: 0 4px 16px rgba(200, 109, 92, 0.12);
  --shadow-lg: 0 8px 24px rgba(200, 109, 92, 0.16);
  --shadow-xl: 0 12px 32px rgba(200, 109, 92, 0.2);

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode - Disabled (Always Light Theme) */

/* ================================================
   Typography
   ================================================ */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

h1 {
  font-size: clamp(var(--text-4xl), 6vw, var(--text-6xl));
  font-weight: 700;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(var(--text-3xl), 4vw, var(--text-5xl));
  font-weight: 600;
}

h3 {
  font-size: var(--text-2xl);
  font-weight: 600;
}

p {
  margin-bottom: var(--space-md);
  color: var(--text-secondary);
  font-size: var(--text-lg);
  line-height: 1.7;
}

a {
  color: var(--blue-accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

/* ================================================
   Layout Utilities
   ================================================ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

@media (max-width: 768px) {
  .container {
    padding: 0 var(--space-lg);
  }
}

/* ================================================
   Accessibility
   ================================================ */
*:focus-visible {
  outline: 2px solid var(--blue-accent);
  outline-offset: 2px;
}

/* ================================================
   Header & Navigation
   ================================================ */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(253, 252, 250, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--cream-dark);
  z-index: 1000;
  padding: var(--space-lg) 0;
  transition: all var(--transition-base);
}

/* Header dark mode - Disabled (Always Light Theme) */

.header nav {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: var(--space-2xl);
  align-items: center;
  margin: 0;
  padding: 0;
}

.nav-link {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: var(--text-base);
  position: relative;
  padding: var(--space-xs) 0;
  transition: color var(--transition-fast);
}

.nav-link:hover {
  color: var(--terracotta);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--terracotta);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--transition-base);
}

.nav-link:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Mobile Menu */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-sm);
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
  position: absolute;
  right: 0;
}

.menu-toggle:hover {
  background: var(--bg-secondary);
}

.hamburger-line {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: var(--radius-full);
  transition: all var(--transition-base);
}

@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    top: 73px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--cream-dark);
    padding: var(--space-xl);
    transform: translateY(-120%);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-lg);
  }

  .nav-menu.nav-menu-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-menu li {
    width: 100%;
    text-align: center;
    padding: var(--space-lg) 0;
    border-bottom: 1px solid var(--cream-dark);
  }

  .nav-menu li:last-child {
    border-bottom: none;
  }

  .menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
  }

  .menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) {
    opacity: 0;
  }

  .menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
  }
}

/* ================================================
   Main Content
   ================================================ */
main {
  margin-top: 73px;
}

section {
  padding: var(--space-4xl) 0;
  scroll-margin-top: 120px;
}

.section-subtitle {
  font-size: var(--text-xl);
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: var(--space-3xl);
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

/* ================================================
   Hero Section
   ================================================ */
.hero-section {
  min-height: 85vh;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, var(--cream) 0%, var(--bg-primary) 100%);
  padding: var(--space-4xl) 0;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 80%;
  height: 150%;
  background: radial-gradient(circle, rgba(200, 109, 92, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
}

.hero-text {
  text-align: center;
}

.hero-image {
  border-radius: var(--radius-lg);
  object-fit: cover;
  object-position: center;
  margin: 0 auto var(--space-2xl);
  display: block;
  box-shadow: var(--shadow-lg);
  border: 4px solid var(--cream-dark);
}

.hero-text h1 {
  margin-bottom: var(--space-lg);
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--terracotta) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: var(--text-2xl);
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
  font-weight: 500;
  line-height: 1.4;
}

.hero-description {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  margin-bottom: var(--space-2xl);
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: var(--space-lg);
  flex-wrap: wrap;
  justify-content: center;
}

@media (max-width: 768px) {
  .hero-content {
    padding: 0 var(--space-lg);
  }
}

/* ================================================
   Buttons
   ================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md) var(--space-2xl);
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: var(--text-base);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  min-width: 140px;
}

.btn-primary {
  background: var(--blue-accent);
  color: white;
  border-color: var(--blue-accent);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--blue-accent-dark);
  border-color: var(--blue-accent-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

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

.btn-outline:hover {
  background: var(--terracotta);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ================================================
   About Section
   ================================================ */
.about-section {
  background: var(--bg-secondary);
}

.about-section h2 {
  text-align: center;
  margin-bottom: var(--space-lg);
  color: var(--terracotta-dark);
}

.about-content {
  max-width: 800px;
  margin: 0 auto var(--space-3xl);
  text-align: center;
}

.expertise-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-xl);
}

.expertise-item {
  background: var(--bg-card);
  padding: var(--space-2xl);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
  border: 1px solid var(--cream-dark);
}

.expertise-item:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--terracotta-light);
}

.expertise-item h3 {
  color: var(--terracotta);
  margin-bottom: var(--space-md);
  font-size: var(--text-xl);
}

.expertise-item p {
  color: var(--text-secondary);
  font-size: var(--text-base);
  line-height: 1.6;
  margin-bottom: 0;
}

/* ================================================
   Projects Section
   ================================================ */
.projects-section h2 {
  text-align: center;
  margin-bottom: var(--space-lg);
  color: var(--sage-dark);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: var(--space-2xl);
  margin-bottom: var(--space-3xl);
}

.project-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-slow);
  border: 1px solid var(--cream-dark);
}

.project-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
  border-color: var(--sage-light);
}

.project-image {
  height: 220px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--sage-light), var(--terracotta-light));
  position: relative;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.project-card:hover .project-image img {
  transform: scale(1.08);
}

.project-content {
  padding: var(--space-2xl);
}

.project-title {
  font-size: var(--text-xl);
  color: var(--text-primary);
  margin-bottom: var(--space-md);
  font-weight: 600;
}

.project-summary {
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
  line-height: 1.6;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.tech-tag {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 500;
  border: 1px solid var(--cream-dark);
}

.projects-actions {
  text-align: center;
}

/* ================================================
   Blog Section
   ================================================ */
.blog-section {
  background: var(--bg-secondary);
}

.blog-section h2 {
  text-align: center;
  margin-bottom: var(--space-lg);
  color: var(--terracotta-dark);
}

.blog-posts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-2xl);
  margin-bottom: var(--space-3xl);
}

.blog-post {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
  border: 1px solid var(--cream-dark);
}

.blog-post:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--terracotta-light);
}

.blog-post-content {
  display: flex;
  flex-direction: column;
}

.blog-post-header {
  margin-bottom: var(--space-lg);
}

.blog-post-title {
  font-size: var(--text-xl);
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
  font-weight: 600;
  line-height: 1.3;
}

.blog-post-link {
  color: var(--text-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.blog-post-link:hover {
  color: var(--terracotta);
}

.blog-post-meta {
  display: flex;
  gap: var(--space-lg);
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.blog-post-date {
  color: var(--text-muted);
}

.blog-post-reading-time {
  color: var(--text-muted);
}

.blog-post-excerpt {
  margin-bottom: var(--space-lg);
}

.blog-post-excerpt p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 0;
}

.blog-post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.blog-tag {
  display: inline-block;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 500;
  border: 1px solid var(--cream-dark);
}

.blog-post-footer {
  margin-top: auto;
}

.blog-read-more {
  display: inline-flex;
}

.blog-content .post-title {
  font-size: var(--text-xl);
  color: var(--text-primary);
  margin-bottom: var(--space-md);
  font-weight: 600;
}

.post-excerpt {
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
  line-height: 1.6;
}

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

.blog-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: var(--space-2xl);
}

.load-more {
  min-width: 200px;
}

.load-more:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ================================================
   Contact Section
   ================================================ */
.contact-section h2 {
  text-align: center;
  margin-bottom: var(--space-lg);
  color: var(--sage-dark);
}

.contact-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4xl);
  max-width: 1100px;
  margin: 0 auto;
}

.contact-info h3 {
  color: var(--terracotta);
  margin-bottom: var(--space-lg);
  font-size: var(--text-2xl);
}

.contact-info p {
  margin-bottom: var(--space-xl);
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.contact-item {
  color: var(--text-secondary);
  font-size: var(--text-base);
}

.contact-item strong {
  color: var(--text-primary);
  display: block;
  margin-bottom: var(--space-xs);
}

.contact-item-social {
  display: flex;
  flex-direction: column;
}

.contact-item-social strong {
  margin-bottom: var(--space-xs);
}

.contact-social {
  display: flex;
  gap: var(--space-md);
  margin-top: 0;
}

.contact-social a {
  color: var(--sage-dark);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.contact-social a:hover {
  color: var(--terracotta);
  transform: translateY(-3px);
}

.contact-social svg {
  width: 28px;
  height: 28px;
}

.contact-form {
  background: var(--bg-card);
  padding: var(--space-2xl);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--cream-dark);
}

.form-group {
  margin-bottom: var(--space-xl);
}

.form-group label {
  display: block;
  margin-bottom: var(--space-sm);
  font-weight: 600;
  color: var(--text-primary);
  font-size: var(--text-base);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: var(--space-md);
  border: 2px solid var(--cream-dark);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-family: inherit;
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: border-color var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--blue-accent);
}

.form-group textarea {
  resize: vertical;
  min-height: 150px;
}

.form-status {
  margin-top: var(--space-lg);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  text-align: center;
  font-weight: 500;
}

.form-status.success {
  background: rgba(139, 157, 131, 0.15);
  color: var(--sage-dark);
  border: 1px solid var(--sage);
}

.form-status.error {
  background: rgba(200, 109, 92, 0.15);
  color: var(--terracotta-dark);
  border: 1px solid var(--terracotta);
}

.form-status.loading {
  background: rgba(37, 99, 235, 0.15);
  color: var(--blue-accent-dark);
  border: 1px solid var(--blue-accent);
}

@media (max-width: 768px) {
  .contact-content {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
  }
}

/* ================================================
   Footer
   ================================================ */
.footer {
  background: linear-gradient(135deg, var(--text-primary) 0%, #3D3D38 100%);
  color: var(--text-on-dark);
  padding: var(--space-3xl) 0 var(--space-xl);
}

.footer-content {
  display: flex;
  gap: var(--space-3xl);
  align-items: start;
}

.footer-info {
  flex: 0 0 50%;
  text-align: left;
}

.footer-projects {
  flex: 0 0 50%;
  text-align: right;
}

@media (max-width: 768px) {
  .footer-content {
    flex-direction: column;
    gap: var(--space-2xl);
  }

  .footer-info,
  .footer-projects {
    flex: none;
    width: 100%;
    text-align: center;
  }
}

.footer h3,
.footer h4 {
  color: var(--cream);
  margin-bottom: var(--space-md);
}

.footer p {
  color: rgba(244, 239, 231, 0.8);
}

.social-links {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  max-width: 220px;
  margin: 0 auto;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  background: rgba(244, 239, 231, 0.1);
  border-radius: var(--radius-md);
  color: var(--cream);
  font-weight: 500;
  transition: all var(--transition-base);
  border: 1px solid rgba(244, 239, 231, 0.2);
}

.social-link:hover {
  background: var(--terracotta);
  border-color: var(--terracotta);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.project-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: calc(var(--space-sm) / 4);
  align-items: flex-end;
}

.project-links li {
  margin: 0;
}

.project-links a {
  color: var(--cream);
  text-decoration: none;
  font-size: var(--text-base);
  transition: all var(--transition-fast);
  display: inline-block;
  position: relative;
  opacity: 0.9;
}

.project-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  right: 0;
  width: 0;
  height: 2px;
  background: var(--cream);
  transition: width var(--transition-fast);
}

.project-links a:hover {
  color: var(--cream);
  opacity: 1;
}

.project-links a:hover::after {
  width: 100%;
  left: 0;
  right: auto;
}

@media (max-width: 768px) {
  .project-links {
    align-items: center;
  }
}

/* ================================================
   Utility Classes
   ================================================ */
.hidden {
  display: none !important;
}

.loading {
  opacity: 0.6;
  pointer-events: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ================================================
   Accessibility & Performance
   ================================================ */
@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;
  }
}

@media (prefers-contrast: high) {
  :root {
    --shadow-sm: 0 3px 10px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
  }
}

/* Print Styles */
@media print {
  .header,
  .hero-actions,
  .contact-form,
  .load-more,
  .menu-toggle {
    display: none;
  }

  main {
    margin-top: 0;
  }

  section {
    padding: var(--space-lg) 0;
  }

  .hero-content,
  .contact-content {
    grid-template-columns: 1fr;
  }
}
