/* =========================================
   joelmcclurg.ai — Shared Styles
   ========================================= */

:root {
  --bg: #FAFAFA;
  --bg-card: #F3F4F6;
  --text: #1A1A2E;
  --text-muted: #6B7280;
  --blue: #2563EB;
  --blue-light: #EFF6FF;
  --blue-hover: #1D4ED8;
  --orange: #E87B35;
  --orange-light: #FFF7ED;
  --white: #FFFFFF;
  --border: #E5E7EB;
  --font-body: 'DM Sans', sans-serif;
  --font-display: 'Fraunces', serif;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font-body);
  font-variation-settings: "WONK" 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

/* Skip to content — accessibility */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--blue);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0 0 8px 8px;
  z-index: 200;
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
}

/* Focus styles */
:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* =========================================
   NAV
   ========================================= */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(250, 250, 250, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  padding: 0 2rem;
}

.nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.25rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav-name span {
  color: var(--blue);
}

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

.nav-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
  letter-spacing: 0.01em;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--blue);
}

/* Hamburger (mobile) */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  width: 40px;
  height: 40px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: rotate(45deg) translate(3px, 5px);
}

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

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: rotate(-45deg) translate(3px, -5px);
}

/* =========================================
   BUTTONS
   ========================================= */
.btn-primary {
  display: inline-block;
  background: var(--blue);
  color: white;
  padding: 0.75rem 1.75rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s;
  border: 2px solid var(--blue);
}

.btn-primary:hover {
  background: var(--blue-hover);
  border-color: var(--blue-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  display: inline-block;
  background: transparent;
  color: var(--text);
  padding: 0.75rem 1.75rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s;
  border: 2px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--text);
  transform: translateY(-1px);
}

/* =========================================
   SECTION LABELS
   ========================================= */
.section-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--orange);
  margin-bottom: 0.75rem;
}

/* =========================================
   HERO
   ========================================= */
.hero {
  max-width: 1120px;
  margin: 0 auto;
  padding: 160px 2rem 100px;
}

.hero-text {
  max-width: 680px;
}

.hero-text h1 {
  font-family: var(--font-display);
  font-size: 3.2rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 1.5rem;
}

.hero-text h1 .accent {
  color: var(--blue);
  font-style: italic;
}

.hero-text p {
  font-size: 1.15rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 520px;
  margin-bottom: 2rem;
}

.hero-cta {
  display: inline-flex;
  gap: 1rem;
}

/* Hero featured card wrapper */
.hero-card-wrapper {
  position: relative;
  margin-top: 2.5rem;
  max-width: 680px;
}

.hero-card {
  width: 100%;
  max-width: 100%;
  background: var(--white);
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 2rem;
  box-shadow: 0 4px 24px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
  text-align: left;
}

.hero-card-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--orange);
  margin-bottom: 0.75rem;
}

.hero-card h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.hero-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.hero-card-stats {
  display: flex;
  gap: 2rem;
  margin-top: 1.25rem;
}

.hero-card-stat {
  display: flex;
  flex-direction: column;
}

.hero-card-stat .num {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--blue);
}

.hero-card-stat .label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hero-card-bar {
  margin-top: 1.25rem;
  height: 6px;
  background: var(--bg-card);
  border-radius: 3px;
  overflow: hidden;
}

.hero-card-bar-fill {
  height: 100%;
  width: 72%;
  background: linear-gradient(90deg, var(--blue), var(--orange));
  border-radius: 3px;
}

.orange-dot {
  position: absolute;
  width: 120px;
  height: 120px;
  background: var(--orange-light);
  border-radius: 50%;
  top: -20px;
  right: -10px;
  z-index: -1;
}

.blue-dot {
  position: absolute;
  width: 80px;
  height: 80px;
  background: var(--blue-light);
  border-radius: 50%;
  bottom: -15px;
  left: 10px;
  z-index: -1;
}

/* =========================================
   PROJECTS GRID
   ========================================= */
.projects {
  max-width: 1120px;
  margin: 0 auto;
  padding: 80px 2rem 100px;
}

.projects h2 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.projects > p {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 3rem;
  max-width: 600px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

/* Project card as a link */
.project-card {
  display: block;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: all 0.3s ease;
  text-decoration: none;
  color: inherit;
  position: relative;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.08);
  border-color: var(--blue);
}

.project-card-image {
  width: 100%;
  height: 200px;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.project-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Preview styles for project card illustrations */
.preview-frac {
  background: linear-gradient(135deg, var(--blue-light) 0%, #F0F4FF 100%);
}

.preview-frac .chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 120px;
  padding: 0 2rem;
}

.preview-frac .bar {
  width: 28px;
  border-radius: 4px 4px 0 0;
}

.preview-food {
  background: linear-gradient(135deg, #FFF7ED 0%, #FEF3E2 100%);
}

.preview-snap {
  background: linear-gradient(135deg, #F0FDF4 0%, #ECFDF5 100%);
}

.preview-hr1 {
  background: linear-gradient(135deg, #FEF2F2 0%, #FFF1F2 100%);
}

.preview-hr1 img {
  object-position: top;
}

.preview-standalone {
  background: linear-gradient(135deg, var(--bg-card) 0%, #E8E8EC 100%);
}

.preview-timeline {
  background: linear-gradient(135deg, var(--bg-card) 0%, #E8E8EC 100%);
}

.project-card-body {
  padding: 1.5rem;
}

.project-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  margin-bottom: 0.75rem;
}

.tag-embedded {
  background: var(--blue-light);
  color: var(--blue);
}

.tag-standalone {
  background: var(--orange-light);
  color: var(--orange);
}

.tag-coming-soon {
  background: var(--bg-card);
  color: var(--text-muted);
}

.tag-building {
  background: #ECFDF5;
  color: #059669;
}

.project-card-body h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  letter-spacing: -0.01em;
}

.project-card-body p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.project-card-arrow {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 32px;
  height: 32px;
  background: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  opacity: 0;
  transition: opacity 0.3s;
  font-size: 0.9rem;
  color: var(--blue);
}

.project-card:hover .project-card-arrow {
  opacity: 1;
}

/* Full-width card (spans both columns) */
.project-card--wide {
  grid-column: span 2;
}

.project-card--wide .project-card-image {
  height: 140px;
}

/* Featured/pinned card — spans both columns with accent border */
.project-card--featured {
  grid-column: span 2;
  border: 2px solid var(--blue);
  box-shadow: 0 4px 24px rgba(0,0,0,0.06), 0 0 0 1px rgba(37,99,235,0.08);
}

.project-card--featured .project-card-image {
  height: 260px;
}

/* =========================================
   ABOUT SECTION (homepage preview + full page)
   ========================================= */
.about-section {
  background: var(--white);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.about-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 80px 2rem;
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 4rem;
  align-items: center;
}

.about-photo {
  width: 100%;
  aspect-ratio: 4/5;
  background: var(--bg-card);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-style: italic;
  border: 1px solid var(--border);
  overflow: hidden;
}

.about-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-text h2 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
}

.about-text p {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.75;
  margin-bottom: 1rem;
  max-width: 540px;
}

.about-text p strong {
  color: var(--text);
}

.about-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.about-tag {
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

/* =========================================
   WRITING & BOOKS
   ========================================= */
.writing-section {
  max-width: 1120px;
  margin: 0 auto;
  padding: 80px 2rem 100px;
}

.writing-section h2 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.writing-section > p {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 3rem;
}

.writing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.writing-card {
  display: block;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.75rem;
  transition: all 0.3s;
  text-decoration: none;
  color: inherit;
}

.writing-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}

.writing-card .date {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.writing-card h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.35;
}

.writing-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.writing-card.book-card {
  border-left: 3px solid var(--orange);
}

.book-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--orange);
  margin-bottom: 0.5rem;
}

/* =========================================
   CONTACT
   ========================================= */
.contact-section {
  background: var(--text);
  color: white;
  padding: 80px 2rem;
}

.contact-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.contact-inner h2 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.contact-inner p {
  color: rgba(255,255,255,0.6);
  font-size: 1rem;
}

.contact-links {
  display: flex;
  gap: 1rem;
}

.contact-link {
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.contact-link.email-link {
  background: var(--blue);
  color: white;
  border: 2px solid var(--blue);
}

.contact-link.email-link:hover {
  background: var(--blue-hover);
}

.contact-link.linkedin-link {
  background: transparent;
  color: white;
  border: 2px solid rgba(255,255,255,0.2);
}

.contact-link.linkedin-link:hover {
  border-color: rgba(255,255,255,0.5);
}

/* =========================================
   FOOTER
   ========================================= */
footer {
  max-width: 1120px;
  margin: 0 auto;
  padding: 2rem;
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* =========================================
   EMBEDDED PROJECT PAGE
   ========================================= */
.project-page-header {
  max-width: 1120px;
  margin: 0 auto;
  padding: 100px 2rem 2rem;
}

.project-page-header .breadcrumb {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.project-page-header .breadcrumb a {
  color: var(--blue);
  text-decoration: none;
}

.project-page-header .breadcrumb a:hover {
  text-decoration: underline;
}

.project-page-header h1 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.project-page-header p {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 640px;
  margin-bottom: 1.5rem;
}

.project-page-header .source-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--blue);
  text-decoration: none;
  font-weight: 500;
}

.project-page-header .source-link:hover {
  text-decoration: underline;
}

.project-embed {
  width: 100%;
  border: none;
  min-height: 80vh;
  background: var(--white);
  border-top: 1px solid var(--border);
}

.coming-soon-banner {
  max-width: 1120px;
  margin: 2rem auto;
  padding: 3rem 2rem;
  background: var(--bg-card);
  border-radius: 14px;
  text-align: center;
  color: var(--text-muted);
}

.coming-soon-banner h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

/* =========================================
   PAGE-SPECIFIC: About full page
   ========================================= */
.page-section {
  max-width: 1120px;
  margin: 0 auto;
  padding: 120px 2rem 80px;
}

.page-section h1 {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

/* =========================================
   ANIMATIONS
   ========================================= */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-text { animation: fadeInUp 0.6s ease-out; }
.hero-card-wrapper { animation: fadeInUp 0.6s ease-out 0.15s both; }

.fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .fade-in { opacity: 1; transform: none; }
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 768px) {
  .hero {
    padding: 120px 1.5rem 60px;
  }

  .hero-text h1 { font-size: 2.4rem; }

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

  /* Reset wide/featured cards on mobile */
  .project-card--wide { grid-column: span 1; }
  .project-card--wide .project-card-image { height: 200px; }
  .project-card--featured { grid-column: span 1; }
  .project-card--featured .project-card-image { height: 200px; }

  .about-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .about-photo {
    max-width: 320px;
    margin: 0 auto;
  }

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

  .contact-inner {
    flex-direction: column;
    gap: 2rem;
    text-align: center;
  }

  footer {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }

  /* Mobile nav */
  .nav-toggle { display: flex; }

  .nav-links {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(250, 250, 250, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    flex-direction: column;
    padding: 1rem 2rem 1.5rem;
    gap: 0;
    border-bottom: 1px solid var(--border);
    display: none;
  }

  .nav-links.open { display: flex; }

  .nav-links li { padding: 0.6rem 0; }

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

  .page-section h1 { font-size: 2.2rem; }
}

@media (max-width: 480px) {
  .hero-text h1 { font-size: 2rem; }
  .hero-cta { flex-direction: column; }
  .hero-cta .btn-primary,
  .hero-cta .btn-secondary { text-align: center; }
  .contact-links { flex-direction: column; }
}
