/* ============================================
   ARCHITECT'S EDITORIAL THEME
   chris.work - Software Architect Portfolio
   ============================================ */

/* ----------------------------------------
   CSS CUSTOM PROPERTIES
   ---------------------------------------- */
:root {
  /* Typography */
  --font-display: "Playfair Display", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", "SF Mono", monospace;

  /* Type Scale (fluid) */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.8125rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.375vw, 0.9375rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.0625rem);
  --text-lg: clamp(1.125rem, 1rem + 0.625vw, 1.25rem);
  --text-xl: clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem);
  --text-2xl: clamp(1.5rem, 1.25rem + 1.25vw, 2rem);
  --text-3xl: clamp(2rem, 1.5rem + 2.5vw, 3rem);
  --text-4xl: clamp(2.5rem, 1.75rem + 3.75vw, 4rem);

  /* Backgrounds - Deep, sophisticated */
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-tertiary: #1a1a24;
  --bg-elevated: #22232e;

  /* Text */
  --text-primary: #f5f5f7;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;

  /* Accents - The Gradient Line */
  --accent-start: #ff6b6b;
  --accent-mid: #feca57;
  --accent-end: #48dbfb;
  --gradient-accent: linear-gradient(135deg, var(--accent-start), var(--accent-mid), var(--accent-end));

  /* Links */
  --link-color: #feca57;
  --link-hover: #ff6b6b;

  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-default: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.15);

  /* Spacing */
  --space-xs: clamp(0.5rem, 1vw, 0.75rem);
  --space-sm: clamp(1rem, 2vw, 1.5rem);
  --space-md: clamp(2rem, 4vw, 3rem);
  --space-lg: clamp(4rem, 8vw, 6rem);

  /* Layout */
  --content-width: 65ch;
  --page-width: 1200px;
}

/* ----------------------------------------
   BASE OVERRIDES
   ---------------------------------------- */
body.terminal {
  background: var(--bg-primary) !important;
  font-family: var(--font-body) !important;
  color: var(--text-secondary) !important;
  line-height: 1.7;
}

/* Subtle radial gradient for depth */
body.terminal::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60vh;
  background: radial-gradient(
    ellipse 80% 50% at 50% -10%,
    rgba(254, 202, 87, 0.04),
    transparent
  );
  pointer-events: none;
  z-index: 0;
}

/* ----------------------------------------
   TYPOGRAPHY
   ---------------------------------------- */

/* Headlines - Playfair Display */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display) !important;
  color: var(--text-primary) !important;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 {
  font-size: var(--text-4xl) !important;
  font-weight: 700 !important;
  margin-bottom: var(--space-sm) !important;
}

/* Remove terminal underline on h1 */
h1::after {
  display: none !important;
}

h2 {
  font-size: var(--text-2xl) !important;
  margin-top: var(--space-lg) !important;
  margin-bottom: var(--space-sm) !important;
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-subtle);
}

h3 {
  font-size: var(--text-xl) !important;
  margin-top: var(--space-md) !important;
  margin-bottom: var(--space-xs) !important;
}

/* Body text */
p {
  font-size: var(--text-base);
  color: var(--text-secondary);
  max-width: var(--content-width);
}

/* Strong/bold */
strong, b {
  color: var(--text-primary);
  font-weight: 600;
}

/* ----------------------------------------
   LINKS
   ---------------------------------------- */
a {
  color: var(--link-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--link-hover);
  background: none !important;
}

/* Content links with animated underline */
#terminal-mkdocs-main-content a:not(.headerlink):not(.admonition-title):not(.nav-link) {
  position: relative;
  display: inline;
}

#terminal-mkdocs-main-content a:not(.headerlink):not(.admonition-title):not(.nav-link)::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--link-color);
  transition: width 0.3s ease;
}

#terminal-mkdocs-main-content a:not(.headerlink):not(.admonition-title):not(.nav-link):hover::after {
  width: 100%;
}

/* ----------------------------------------
   NAVIGATION
   ---------------------------------------- */

/* Top navigation */
.terminal-nav {
  background: rgba(10, 10, 15, 0.9) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle) !important;
}

/* Site name */
#mkdocs-terminal-site-name {
  font-family: var(--font-body) !important;
  font-weight: 600 !important;
  font-size: var(--text-lg) !important;
  letter-spacing: -0.01em;
  color: var(--text-primary) !important;
}

/* Remove terminal cursor animation */
#mkdocs-terminal-site-name.terminal-prompt::after {
  display: none !important;
}

/* Navigation links */
.terminal-menu li a {
  font-family: var(--font-body) !important;
  font-size: var(--text-xs) !important;
  font-weight: 500 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.1em !important;
  color: var(--text-muted) !important;
  padding: 0.5rem 1rem !important;
  position: relative;
  transition: color 0.2s ease;
}

.terminal-menu li a:hover {
  color: var(--text-primary) !important;
  background: none !important;
}

.terminal-menu li a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 1rem;
  right: 1rem;
  height: 2px;
  background: var(--accent-mid);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.terminal-menu li a:hover::after {
  transform: scaleX(1);
}

/* Side navigation */
.terminal-mkdocs-side-nav a {
  font-family: var(--font-body) !important;
  font-size: var(--text-sm) !important;
  color: var(--text-muted) !important;
  transition: all 0.2s ease;
  border-left: 2px solid transparent;
  padding-left: 1rem !important;
  margin-left: -1rem;
}

.terminal-mkdocs-side-nav a:hover {
  color: var(--text-primary) !important;
  background: none !important;
  border-left-color: var(--accent-mid);
}

.terminal-mkdocs-side-nav-item--active a {
  color: var(--link-color) !important;
  font-weight: 500 !important;
  border-left-color: var(--accent-mid) !important;
  font-style: normal !important;
}

/* ----------------------------------------
   MAIN CONTENT
   ---------------------------------------- */
#terminal-mkdocs-main-content {
  background: transparent !important;
}

main#terminal-mkdocs-main-content {
  animation: fadeInUp 0.5s ease-out;
}

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

/* ----------------------------------------
   CODE BLOCKS (Secondary Content)
   ---------------------------------------- */
.highlight pre {
  background: var(--bg-tertiary) !important;
  border: 1px solid var(--border-default) !important;
  border-radius: 6px !important;
  padding: 1.25rem 1.5rem !important;
  margin: 1.5rem 0 !important;
  overflow-x: auto;
  font-size: 0.875rem !important;
  line-height: 1.6;
}

.highlight {
  background: transparent !important;
}

/* Inline code */
code {
  font-family: var(--font-mono) !important;
  background: var(--bg-tertiary) !important;
  color: var(--accent-end) !important;
  padding: 0.2em 0.4em !important;
  border-radius: 4px !important;
  font-size: 0.9em !important;
}

pre code {
  background: transparent !important;
  padding: 0 !important;
  color: var(--text-primary) !important;
}

/* Syntax Highlighting - Muted palette */
.highlight .c, .highlight .cm, .highlight .c1, .highlight .cs { color: #6b7280; font-style: italic; } /* Comments */
.highlight .k, .highlight .kd, .highlight .kn, .highlight .kp, .highlight .kr { color: #ff8a8a; } /* Keywords - soft coral */
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sb, .highlight .sc { color: #ffe066; } /* Strings - soft yellow */
.highlight .nf, .highlight .fm, .highlight .nc { color: #7dd3fc; } /* Functions/Classes - soft cyan */
.highlight .n, .highlight .na, .highlight .nb, .highlight .nd { color: var(--text-primary); } /* Names */
.highlight .m, .highlight .mf, .highlight .mh, .highlight .mi, .highlight .mo, .highlight .il { color: #c4b5fd; } /* Numbers - soft purple */
.highlight .o, .highlight .p { color: var(--text-secondary); } /* Operators/Punctuation */
.highlight .nt { color: #ff8a8a; } /* Tags */
.highlight .nv, .highlight .vi, .highlight .vg, .highlight .vc { color: #7dd3fc; } /* Variables */
.highlight .no, .highlight .nx { color: #fcd34d; } /* Constants */
.highlight .kt { color: #7dd3fc; } /* Types */
.highlight .se { color: #fca5a5; } /* String escapes */
.highlight .sr { color: #fca5a5; } /* Regex */
.highlight .ss { color: #ffe066; } /* Symbols */
.highlight .bp { color: #7dd3fc; } /* Builtins */
.highlight .ow { color: #ff8a8a; } /* Operator words */
.highlight .w { color: var(--text-secondary); } /* Whitespace */
.highlight .nl { color: #7dd3fc; } /* Labels */
.highlight .nn { color: var(--text-primary); } /* Namespace */
.highlight .py { color: #7dd3fc; } /* Property */
.highlight .ne { color: #ff8a8a; } /* Exception */
.highlight .ni { color: var(--text-primary); } /* Entity */
.highlight .sd { color: #6b7280; } /* Docstrings */
.highlight .sh { color: #ffe066; } /* Heredoc */
.highlight .si { color: #ffe066; } /* Interpolation */
.highlight .sx { color: #ffe066; } /* Other strings */

/* ----------------------------------------
   ARCHITECTURE DIAGRAMS (Hero Content)
   ---------------------------------------- */
.mermaid-rendered {
  text-align: center;
  background: var(--bg-tertiary) !important;
  border: none !important;
  border-left: 4px solid !important;
  border-image: var(--gradient-accent) 1 !important;
  border-radius: 0 6px 6px 0 !important;
  padding: 2rem !important;
  margin: 2.5rem -1rem !important;
  position: relative;
  display: block !important;
  overflow-x: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

/* Diagram label */
.mermaid-rendered::before {
  content: 'ARCHITECTURE';
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
}

.mermaid-rendered svg {
  max-width: 100%;
  height: auto;
}

/* Mermaid node styling */
.mermaid-rendered .node rect,
.mermaid-rendered .node circle,
.mermaid-rendered .node ellipse,
.mermaid-rendered .node polygon,
.mermaid-rendered .node path {
  fill: var(--bg-secondary) !important;
  stroke: var(--accent-end) !important;
  stroke-width: 2px !important;
}

.mermaid-rendered .nodeLabel {
  font-family: var(--font-mono) !important;
  color: var(--text-primary) !important;
  fill: var(--text-primary) !important;
}

.mermaid-rendered .edgeLabel {
  background-color: var(--bg-tertiary) !important;
  color: var(--text-secondary) !important;
  font-family: var(--font-mono) !important;
  font-size: 0.75rem !important;
}

.mermaid-rendered .edgePath .path {
  stroke: var(--text-muted) !important;
  stroke-width: 1.5px !important;
}

.mermaid-rendered .marker {
  fill: var(--text-muted) !important;
}

/* Subgraph styling */
.mermaid-rendered .cluster rect {
  fill: rgba(72, 219, 251, 0.05) !important;
  stroke: var(--border-default) !important;
}

.mermaid-rendered .cluster text {
  fill: var(--text-secondary) !important;
  font-family: var(--font-body) !important;
  font-weight: 500 !important;
}

/* ----------------------------------------
   ADMONITIONS
   ---------------------------------------- */
.admonition {
  background: var(--bg-secondary) !important;
  border: none !important;
  border-left: 4px solid !important;
  border-image: var(--gradient-accent) 1 !important;
  border-radius: 0 6px 6px 0 !important;
  padding: 1.25rem 1.5rem !important;
  margin: 1.5rem 0 !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.admonition::before {
  display: none !important;
}

.admonition-title {
  font-family: var(--font-body) !important;
  font-size: var(--text-xs) !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.1em !important;
  color: var(--accent-mid) !important;
  margin-bottom: 0.75rem !important;
  padding: 0 !important;
  background: none !important;
}

.admonition-title::before {
  display: none !important;
}

.admonition p {
  color: var(--text-secondary) !important;
  margin: 0 !important;
}

.admonition a {
  color: var(--link-color) !important;
}

/* Specific admonition types */
.admonition.tip .admonition-title { color: var(--accent-end) !important; }
.admonition.note .admonition-title { color: var(--accent-mid) !important; }
.admonition.warning .admonition-title { color: var(--accent-start) !important; }
.admonition.example .admonition-title { color: #c4b5fd !important; }

/* ----------------------------------------
   TABLES
   ---------------------------------------- */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: var(--text-sm);
}

th {
  font-family: var(--font-body);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid var(--border-default);
}

td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

tr:hover td {
  background: var(--bg-secondary);
}

/* ----------------------------------------
   LISTS
   ---------------------------------------- */
ul, ol {
  color: var(--text-secondary);
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.5rem;
}

li::marker {
  color: var(--accent-mid);
}

/* ----------------------------------------
   BLOCKQUOTES
   ---------------------------------------- */
blockquote {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-style: italic;
  color: var(--text-primary);
  border-left: 4px solid;
  border-image: var(--gradient-accent) 1;
  padding-left: var(--space-md);
  margin: var(--space-md) 0;
}

blockquote::after {
  display: none !important;
}

/* ----------------------------------------
   HORIZONTAL RULES
   ---------------------------------------- */
hr {
  border: none;
  height: 1px;
  background: var(--border-subtle);
  margin: var(--space-lg) 0;
}

/* ----------------------------------------
   FOOTER
   ---------------------------------------- */
.editorial-footer {
  background: var(--bg-primary);
  border-top: 1px solid var(--border-subtle);
  padding: var(--space-md) 0;
  margin-top: var(--space-lg);
}

.footer-content {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-tagline {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.footer-social {
  display: flex;
  gap: 1.25rem;
}

.footer-social-link {
  color: var(--text-muted);
  font-size: 1.25rem;
  transition: all 0.2s ease;
}

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

.footer-copyright {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* ----------------------------------------
   HOMEPAGE HERO ENHANCEMENTS
   ---------------------------------------- */

/* Gradient text for name */
h1 .gradient-text,
.gradient-text {
  background: var(--gradient-accent);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 8s ease infinite;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Credibility badge styling */
.credibility-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: 4px;
  padding: 0.5rem 1rem;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--accent-mid);
  margin: var(--space-sm) 0;
}

.credibility-badge strong {
  font-size: var(--text-lg);
  color: var(--text-primary);
}

/* ----------------------------------------
   SCROLL REVEAL ANIMATIONS
   ---------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delays */
.reveal-stagger > *:nth-child(1) { transition-delay: 0s; }
.reveal-stagger > *:nth-child(2) { transition-delay: 0.1s; }
.reveal-stagger > *:nth-child(3) { transition-delay: 0.2s; }
.reveal-stagger > *:nth-child(4) { transition-delay: 0.3s; }
.reveal-stagger > *:nth-child(5) { transition-delay: 0.4s; }

/* ----------------------------------------
   RESPONSIVE LAYOUT
   ---------------------------------------- */
@media screen and (min-width: 1440px) {
  :root {
    --page-width: 85vw !important;
  }
  .container {
    max-width: 85vw !important;
  }
}

@media screen and (min-width: 1920px) {
  :root {
    --page-width: 90vw !important;
  }
  .container {
    max-width: 90vw !important;
  }
}

@media screen and (min-width: 2560px) {
  :root {
    --page-width: 2000px !important;
  }
  .container {
    max-width: 2000px !important;
  }
}

@media (max-width: 768px) {
  h1 {
    font-size: var(--text-3xl) !important;
  }

  h2 {
    font-size: var(--text-xl) !important;
  }

  .mermaid-rendered {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 1rem !important;
  }

  .mermaid-rendered::before {
    display: none;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
  }

  .terminal-menu {
    gap: 0.5rem;
  }

  .terminal-menu li a {
    padding: 0.5rem 0.75rem !important;
    font-size: 0.7rem !important;
  }
}

/* ----------------------------------------
   REDUCED MOTION
   ---------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .gradient-text {
    animation: none;
    background-position: 0% 50%;
  }
}

/* ----------------------------------------
   TERMINAL THEME OVERRIDES
   ---------------------------------------- */
.terminal-mkdocs pre {
  background-color: var(--bg-tertiary) !important;
}

.terminal-mkdocs code {
  color: var(--text-primary) !important;
}

/* Remove any default terminal styling that conflicts */
.terminal-prompt::before {
  display: none !important;
}
