/* Portfolio Styles - Minimal & Clean (Dark Mode) */
/* Extends global.css */

:root {
  /* Dark mode muted color system */
  --pf-bg-base: #1a1a1a;
  --pf-bg-elevated: #242424;
  --pf-text-primary: #e8e8e8;
  --pf-text-secondary: #a0a0a0;
  --pf-border-subtle: #2f2f2f;
  --pf-accent: #9b8bb8;
  --pf-accent-muted: color-mix(in srgb, #9b8bb8 70%, transparent);
}

body {
  line-height: 1.7;
  background: var(--pf-bg-base);
  color: var(--pf-text-primary);
}

/* Header overrides */
.site-header {
  background: rgba(26, 26, 26, 0.95);
  border-bottom: 1px solid var(--pf-border-subtle);
}

.portfolio-link {
  color: var(--pf-text-secondary);
  text-decoration: none;
  font-size: var(--font-size-sm);
  transition: color var(--transition-base);
}

.portfolio-link:hover {
  color: var(--pf-accent);
}

/* Main Content */
.case-study {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 2rem 4rem;
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 4rem 0 3rem;
  border-bottom: 1px solid var(--pf-border-subtle);
  margin-bottom: 3rem;
}

.meta-badges {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.badge {
  display: inline-block;
  background: var(--pf-bg-elevated);
  color: var(--pf-text-secondary);
  padding: 0.35rem 0.85rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid var(--pf-border-subtle);
}

.hero h1 {
  font-size: 2.75rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.75rem;
  color: var(--pf-text-primary);
}

.hero h2 {
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1.4;
  color: var(--pf-text-secondary);
  margin-bottom: 0.5rem;
}

.hero .subtitle {
  font-size: 1rem;
  color: var(--pf-text-secondary);
  font-style: italic;
  margin-top: 1rem;
}

/* Overview Section */
.overview {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 4rem;
}

.summary h3,
.details-box h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--pf-text-primary);
  font-weight: 600;
}

.summary p {
  margin-bottom: 1rem;
  font-size: 1.05rem;
  line-height: 1.75;
}

.details-box {
  background: var(--pf-bg-elevated);
  padding: 1.75rem;
  border-radius: 8px;
  border: 1px solid var(--pf-border-subtle);
}

.details-box dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem 1.5rem;
}

.details-box dt {
  font-weight: 600;
  color: var(--pf-text-secondary);
  font-size: 0.9rem;
}

.details-box dd {
  color: var(--pf-text-primary);
}

/* Section Headings */
h2 {
  font-size: 2rem;
  margin-top: 4rem;
  margin-bottom: 1.5rem;
  color: var(--pf-text-primary);
  font-weight: 700;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid var(--pf-accent);
}

h3 {
  font-size: 1.4rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  color: var(--pf-text-primary);
  font-weight: 600;
}

h4 {
  font-size: 1.15rem;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--pf-text-primary);
  font-weight: 600;
}

/* Paragraphs */
p {
  margin-bottom: 1.25rem;
  font-size: 1.05rem;
  line-height: 1.75;
}

/* Lists */
ul, ol {
  margin-left: 1.5rem;
  margin-bottom: 1.25rem;
}

li {
  margin-bottom: 0.5rem;
  line-height: 1.75;
}

li strong {
  color: var(--pf-text-primary);
}

/* Blockquote / Research Question */
.research-question {
  background: var(--pf-bg-elevated);
  padding: 1.75rem;
  border-radius: 8px;
  border-left: 4px solid var(--pf-accent);
  margin: 2rem 0;
}

.research-question h4 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--pf-text-secondary);
}

blockquote {
  font-size: 1.2rem;
  line-height: 1.6;
  color: var(--pf-text-primary);
  font-style: italic;
  margin: 0;
}

/* Highlight Boxes - Muted dark mode */
.highlight-box,
.insight-box {
  background: color-mix(in srgb, #f59e0b 12%, var(--pf-bg-elevated));
  border-left: 4px solid color-mix(in srgb, #f59e0b 70%, transparent);
  padding: 1.5rem;
  border-radius: 8px;
  margin: 2rem 0;
}

.highlight-box h4,
.insight-box h4 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  color: color-mix(in srgb, #f59e0b 90%, var(--pf-text-primary));
}

.highlight-box ul {
  margin-left: 1.25rem;
  margin-bottom: 0;
}

.insight-box p {
  margin-bottom: 0;
  color: var(--pf-text-primary);
  font-weight: 500;
}

/* Findings */
.finding {
  background: var(--pf-bg-elevated);
  padding: 1.75rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  border: 1px solid var(--pf-border-subtle);
}

.finding h4 {
  margin-top: 0;
  color: var(--pf-accent);
}

.finding p {
  margin-bottom: 0.75rem;
}

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

/* Publication Box - Muted dark mode */
.publication-box {
  background: color-mix(in srgb, #10b981 12%, var(--pf-bg-elevated));
  border-left: 4px solid color-mix(in srgb, #10b981 70%, transparent);
  padding: 1.5rem;
  border-radius: 8px;
  margin: 2rem 0;
}

.publication-box p {
  margin-bottom: 0.75rem;
  color: var(--pf-text-primary);
}

.publication-box p:last-child {
  margin-bottom: 0;
}

/* Pullquote */
.pullquote {
  margin: 3rem 0;
  padding: 2rem;
  text-align: center;
  border-top: 1px solid var(--pf-border-subtle);
  border-bottom: 1px solid var(--pf-border-subtle);
}

.pullquote p {
  font-size: 1.35rem;
  line-height: 1.6;
  color: var(--pf-accent);
  font-style: italic;
  font-weight: 500;
  margin: 0;
}

/* Navigation */
.case-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--pf-border-subtle);
}

.btn-secondary {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: var(--pf-bg-elevated);
  color: var(--pf-text-primary);
  text-decoration: none;
  border-radius: 6px;
  border: 1px solid var(--pf-border-subtle);
  font-weight: 500;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: var(--pf-accent);
  color: var(--pf-bg-base);
  border-color: var(--pf-accent);
}

.btn-secondary.disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* Footer override */
.site-footer {
  margin-top: var(--spacing-3xl);
}

/* Definition Tooltips */
.term {
  color: var(--pf-accent);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  cursor: help;
  transition: all 0.2s;
}

.term:hover {
  text-decoration-style: solid;
  text-decoration-thickness: 2px;
}

.definition-tooltip {
  position: absolute;
  background: var(--pf-bg-elevated);
  color: var(--pf-text-primary);
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  line-height: 1.5;
  max-width: 320px;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--pf-border-subtle);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.definition-tooltip.show {
  opacity: 1;
}

.definition-tooltip::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid var(--pf-bg-elevated);
}

/* Progress Navigation */
.progress-nav {
  position: fixed;
  left: calc(50% - 400px - 30px);
  top: 100px;
  bottom: 100px;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.progress-nav.visible {
  opacity: 1;
  pointer-events: auto;
}

.progress-bar {
  position: relative;
  width: 2px;
  height: 100%;
  background: var(--pf-border-subtle);
  border-radius: 2px;
  opacity: 0.6;
}

.progress-indicator {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 34px;
  background: var(--pf-accent);
  opacity: 0.8;
  border-radius: 2px;
  margin-left: 0;
  transition: top 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.progress-sections {
  list-style: none;
  margin: 0;
  padding: 0;
  position: absolute;
  right: 15px;
  top: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.progress-sections li {
  margin: 0;
}

.progress-sections a {
  color: var(--pf-text-secondary);
  text-decoration: none;
  font-size: 0.8rem;
  white-space: nowrap;
  transition: color 0.2s, background 0.2s;
  display: block;
  text-align: right;
  padding: 0.5rem 0.75rem;
  margin: -0.5rem -0.75rem;
  border-radius: 4px;
  opacity: 0.6;
}

.progress-sections a:hover,
.progress-sections a.active {
  color: var(--pf-accent);
  font-weight: 600;
  background: color-mix(in srgb, var(--pf-accent) 10%, transparent);
  opacity: 1;
}

/* Responsive */
@media (max-width: 1200px) {
  .progress-sections a {
    font-size: 0.75rem;
  }
}

@media (max-width: 1024px) {
  .progress-sections a {
    font-size: 0.7rem;
  }
}

@media (max-width: 900px) {
  /* Switch to mobile progress nav - horizontal bars instead of text */
  .progress-sections a {
    font-size: 0;
    width: 17px;
    height: 3px;
    background: var(--pf-border-subtle);
    border-radius: 1.5px;
    padding: 0.75rem;
    margin: -0.75rem;
  }

  .progress-sections a.active {
    background: var(--pf-accent);
    opacity: 0.8;
  }

  .progress-sections a:hover {
    background: var(--pf-accent);
    opacity: 0.8;
  }

  .progress-sections {
    right: 10px;
  }

  .progress-nav {
    left: 0.5rem;
    top: 80px;
    bottom: 80px;
  }
}

@media (max-width: 768px) {
  .case-study {
    padding: 0 1.5rem 3rem;
  }

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

  .hero h1 {
    font-size: 2rem;
  }

  .hero h2 {
    font-size: 1.25rem;
  }

  h2 {
    font-size: 1.65rem;
    margin-top: 3rem;
  }

  h3 {
    font-size: 1.25rem;
  }

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

  .details-box dl {
    grid-template-columns: 1fr;
    gap: 0.25rem 0;
  }

  .details-box dd {
    margin-bottom: 1rem;
  }

  .case-nav {
    flex-direction: column;
    gap: 1rem;
  }

  /* Adjust definition tooltips for mobile */
  .definition-tooltip {
    max-width: 280px;
    font-size: 0.85rem;
  }
}

/* Print Styles */
@media print {
  .site-header,
  .case-nav,
  .site-footer {
    display: none;
  }

  .case-study {
    max-width: 100%;
    padding: 0;
  }

  .hero {
    page-break-after: avoid;
  }

  h2, h3, h4 {
    page-break-after: avoid;
  }
}
