/* Import Google Fonts: Space Mono (existing) and Inter (new for body text) */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap");

/* Base body styles */
body {
  font-family: "Space Mono", monospace; /* DEFAULT FONT for the entire site */
  background-color: #0f172a; /* slate-900 */
  color: #e2e8f0; /* slate-200 */
  overflow-x: hidden; /* Prevent horizontal scroll */
  line-height: 1.6; /* Default line height for general text */
}

/* Dotted grid background */
.grid-bg {
  background-image: radial-gradient(
    #475569 0.8px,
    transparent 0.8px
  ); /* slate-600 dots */
  background-size: 25px 25px;
}

/* .font-space-mono class is available if needed */
.font-space-mono {
  font-family: "Space Mono", monospace;
}

/* Animated gradient text effect for header (e.g. "cory.computer") */
.gradient-text {
  background: linear-gradient(45deg, #06b6d4, #3b82f6, #8b5cf6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradient 8s ease infinite;
  background-size: 200% 200%;
  padding-bottom: 0.5rem;
  word-break: break-word;
  hyphens: auto;
}

/* Terminal styling */
.terminal {
  background-color: rgba(30, 41, 59, 0.7);
  backdrop-filter: blur(5px);
  border-radius: 0.5rem;
  padding: 1.5rem;
  border: 1px solid #475569;
  min-height: 100px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  /* Font will be 'Space Mono' inherited from body */
}

/* Blinking cursor effect */
.cursor {
  display: inline-block;
  background-color: #e2e8f0;
  width: 10px;
  margin-left: 2px;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

/* Gradient animation keyframes (used by .gradient-text, .contact-btn, and .gradient-button) */
@keyframes gradient {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* --- STYLES FOR ORIGINAL HOME PAGE BUTTONS (.contact-btn) --- */
.contact-btn {
  display: inline-block;
  padding: 10px 20px; /* Original padding */
  font-family: "Space Mono", monospace; /* Ensure Space Mono font */
  font-weight: bold; /* Original font-weight */
  color: white; /* Ensure text is white */
  background: linear-gradient(
    45deg,
    #06b6d4,
    #3b82f6,
    #8b5cf6
  ); /* Original gradient */
  background-size: 200% 200%; /* For animation */
  border: none; /* Assuming no border originally, add if needed */
  border-radius: 5px; /* Original border-radius */
  text-align: center;
  text-decoration: none;
  animation: gradient 8s ease infinite; /* Re-use gradient animation */
  transition: transform 0.2s ease, box-shadow 0.2s ease; /* Original transitions */
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2); /* Original shadow */
}

.contact-btn:hover {
  transform: translateY(-2px); /* Original hover effect */
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3); /* Original hover shadow */
}

/* --- General Purpose Gradient Button (for blog or new elements, uses Inter font) --- */
.gradient-button {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-family: "Inter", sans-serif; /* Uses Inter font */
  font-weight: 600;
  color: white;
  background: linear-gradient(45deg, #06b6d4, #3b82f6, #8b5cf6);
  background-size: 200% 200%;
  border: none;
  border-radius: 0.375rem; /* rounded-md */
  text-align: center;
  text-decoration: none;
  animation: gradient 8s ease infinite;
  transition: all 0.3s ease;
  box-shadow: 0 2px 10px rgba(59, 130, 246, 0.3);
}

.gradient-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.5);
}

/* Smooth transition classes */
.smooth-transition {
  transition: color 0.3s ease, transform 0.3s ease, opacity 0.3s ease;
}

/* Optional: Page transition active state */
body.page-transition-active {
  opacity: 0;
  transition: opacity 0.3s ease-out;
}

/* --- BLOG STYLES (Index Page Previews - index.html for blog) --- */
.blog-post-preview {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.blog-post-preview:hover {
  transform: translateY(-5px);
}

.blog-post-preview header h2,
.blog-post-preview header h2 a {
  font-family: "Inter", sans-serif;
  text-decoration: none;
}

.blog-post-preview .text-slate-300 {
  /* Excerpt text container */
  font-family: "Inter", sans-serif;
  line-height: 1.7;
  color: #cbd5e1;
}

.blog-post-preview .text-sm {
  /* Date/category text */
  font-family: "Space Mono", monospace;
}

/* --- FULL BLOG POST PAGE STYLES (post-template.html) --- */
.full-blog-post header {
  margin-bottom: 1.5rem;
  border-bottom: 1px solid #475569;
  padding-bottom: 1rem;
}

.full-blog-post .post-title {
  /* Blog post title */
  font-family: "Inter", sans-serif;
  font-size: 2.25rem;
  color: #60a5fa;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.25rem;
}

.full-blog-post .post-meta {
  /* Blog post date/category */
  font-family: "Space Mono", monospace;
  color: #94a3b8;
  font-size: 0.875rem;
}

.full-blog-post .post-content {
  /* Main content area of a blog post */
  font-family: "Inter", sans-serif;
  line-height: 1.75;
}

/* Ensure specific text elements within .post-content also use Inter */
.full-blog-post .post-content h1,
.full-blog-post .post-content h2,
.full-blog-post .post-content h3,
.full-blog-post .post-content h4,
.full-blog-post .post-content p,
.full-blog-post .post-content ul,
.full-blog-post .post-content ol,
.full-blog-post .post-content li,
.full-blog-post .post-content blockquote,
.full-blog-post .post-content table,
.full-blog-post .post-content th,
.full-blog-post .post-content td,
.full-blog-post .post-content dl,
.full-blog-post .post-content dt,
.full-blog-post .post-content dd {
  font-family: "Inter", sans-serif; /* Explicitly set Inter for these text elements */
}

.full-blog-post .post-content p {
  margin-bottom: 1.5em;
  text-indent: 2em;
}

.full-blog-post .post-content h2,
.full-blog-post .post-content h3,
.full-blog-post .post-content h4 {
  color: #93c5fd;
  margin-top: 2.25em;
  margin-bottom: 1em;
  font-weight: 600;
  line-height: 1.3;
}

.full-blog-post .post-content a {
  color: #818cf8;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color 0.3s ease;
}
.full-blog-post .post-content a:hover {
  color: #a78bfa;
}

.full-blog-post .post-content blockquote {
  border-left-width: 4px;
  border-left-color: #4f46e5;
  padding-left: 1em;
  margin-top: 1.75em;
  margin-bottom: 1.75em;
  font-style: italic;
  color: #a5b4fc;
}

/* Code blocks and inline code should revert to Space Mono */
.full-blog-post .post-content pre,
.full-blog-post .post-content code {
  font-family: "Space Mono", monospace;
}

.full-blog-post .post-content pre {
  background-color: #1e293b;
  color: #e2e8f0;
  padding: 1.25rem;
  border-radius: 0.375rem;
  overflow-x: auto;
  font-size: 0.9em;
  margin-top: 1.75em;
  margin-bottom: 1.75em;
}
.full-blog-post .post-content code {
  /* Inline code */
  background-color: rgba(51, 65, 85, 0.7);
  padding: 0.2em 0.4em;
  border-radius: 0.25rem;
  font-size: 0.875em;
  color: #c0d0f0;
}
.full-blog-post .post-content pre code {
  /* Reset for code inside pre */
  background-color: transparent;
  padding: 0;
  font-size: inherit;
  color: inherit;
}

.full-blog-post .post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 0.375rem;
  margin-top: 2em;
  margin-bottom: 2em;
}

.full-blog-post .post-content ul,
.full-blog-post .post-content ol {
  margin-bottom: 1.5em;
  padding-left: 1.75em;
}
.full-blog-post .post-content li {
  margin-bottom: 0.5em;
}
.full-blog-post .post-content li::marker {
  color: #60a5fa;
}

.back-to-blog-link {
  /* This is the button on the blog post page */
  display: inline-block;
  margin-top: 2.5rem;
  padding: 0.75rem 1.5rem;
  background-color: #3b82f6; /* Solid blue */
  color: white;
  border-radius: 0.375rem;
  text-decoration: none;
  font-weight: 500;
  transition: background-color 0.3s ease, transform 0.2s ease;
  font-family: "Inter", sans-serif; /* Uses Inter font */
}
.back-to-blog-link:hover {
  background-color: #2563eb;
  transform: translateY(-2px);
}

/* Footer links (applies to both original home and blog pages) */
footer a:hover {
  text-decoration: underline;
}

/* Super blur effect */
.super-blur {
  backdrop-filter: blur(2px) !important;
  -webkit-backdrop-filter: blur(2px) !important;
}

/* Locked post (preview blurred until a target date) */
.locked-post {
  position: relative;
  overflow: visible;
}
.locked-post .blur-content {
  filter: blur(6px) saturate(0.95);
  transition: filter 300ms ease;
  pointer-events: none; /* prevent interaction while blurred */
}
.locked-post .lock-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  z-index: 30;
  border-radius: 0.5rem;
  pointer-events: auto;
}
.locked-post .lock-box {
  text-align: center;
  color: #e6eefc;
  max-width: 560px;
  background: none;
  border: none;
  box-shadow: none;
  padding: 1rem;
  border-radius: 0.75rem;
}
/* Removed subtle floating to keep countdown static and focused. */
/* Promote the lock box to its own compositing layer to reduce repaint/flicker */
.locked-post .lock-box {
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  will-change: transform, opacity;
}

/* --- Digital / countdown styling --- */
.lock-countdown {
  display: inline-flex;
  gap: 0.6rem;
  align-items: center;
  justify-content: center;
  font-family: "Space Mono", monospace;
  color: #c7d2fe;
  margin-top: 0.5rem;
  font-weight: 700;
  /* make it pop on desktop */
  font-size: 1.4rem;
  letter-spacing: 0.6px;
  padding: 0.35rem 0.6rem;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  border-radius: 0.5rem;
  border: 1px solid rgba(124,58,237,0.12);
  box-shadow: 0 6px 30px rgba(124,58,237,0.08), inset 0 -1px 0 rgba(255,255,255,0.02);
}

.lock-countdown .time-seg {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  min-width: 3.25rem;
}
.lock-countdown .time-num {
  display: inline-block;
  font-variant-numeric: tabular-nums;
  font-size: 1.35rem;
  line-height: 1;
  color: #e0e7ff;
  text-shadow: 0 2px 10px rgba(124,58,237,0.15), 0 0 18px rgba(59,130,246,0.03);
  will-change: transform, opacity;
}
.lock-countdown .time-label {
  display: block;
  font-size: 0.65rem;
  color: #9aa7d8;
  letter-spacing: 0.12em;
  margin-top: 0.18rem;
  text-transform: uppercase;
}

/* subtle pulse/tick when numbers update */
@keyframes countdown-tick {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  30% { transform: translateY(-4px) scale(1.06); opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}
.lock-countdown.countdown-tick .time-num {
  animation: countdown-tick 340ms cubic-bezier(.2,.9,.2,1);
}

/* Slight glow when hovering the lock box on desktop */
.locked-post .lock-box:hover .lock-countdown {
  box-shadow: 0 10px 50px rgba(124,58,237,0.12), inset 0 -1px 0 rgba(255,255,255,0.02);
}
.locked-post .lock-box h3 {
  margin: 0 0 0.5rem 0;
  font-family: "Inter", sans-serif;
  font-size: 1.25rem;
  color: #fff;
}
.locked-post .lock-box p {
  margin: 0 0 0.75rem 0;
  color: #a8b3c7;
}
.lock-countdown {
  font-family: "Space Mono", monospace;
  font-size: 1.125rem;
  color: #c7d2fe;
  letter-spacing: 0.6px;
  margin-top: 0.5rem;
  font-weight: 600;
}

/* When unlocked, reveal content */
.locked-post.unlocked .blur-content {
  filter: none;
  pointer-events: auto;
}
.locked-post.unlocked .lock-overlay {
  display: none;
}

/* The locked body container holds only the blurred excerpt so the header/title remain readable */
.locked-post .locked-body {
  position: relative;
}

/* Disable title link in locked posts */
.locked-post header h2 a {
  pointer-events: none;
  cursor: default;
  opacity: 0.8;
}

/* Lock the read-more link until unlocked */
.locked-post .locked-readmore {
  pointer-events: none;
  opacity: 0.7;
  cursor: default;
  text-decoration: underline dotted;
}
.locked-post.unlocked .locked-readmore {
  pointer-events: auto;
  opacity: 1;
  cursor: pointer;
  text-decoration: underline solid;
}

/* When read-more is inside the blurred area we use blur-actions to control pointer-events */
.locked-post .blur-actions {
  pointer-events: none; /* locked by default */
}
.locked-post.unlocked .blur-actions {
  pointer-events: auto;
}

/* --- AI Summary modal/dropdown --- */
.ai-summary-btn {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  padding: 0.5rem 0.9rem;
  font-family: "Inter", sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  color: white;
  background: linear-gradient(90deg,#06b6d4,#3b82f6,#8b5cf6);
  background-size: 200% 200%;
  border-radius: 0.375rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(59,130,246,0.12);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.ai-summary-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(59,130,246,0.16); }

/* subtle shimmer on the label to make it sparkle without being distracting */
.ai-summary-btn { position: relative; overflow: hidden; }
.ai-summary-label { position: relative; z-index: 2; display: inline-block; }
.ai-summary-label::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,0.28), rgba(255,255,255,0));
  transform: translateX(-120%);
  mix-blend-mode: overlay;
  opacity: 0.9;
  pointer-events: none;
  animation: ai-shimmer 4.5s linear infinite;
}

@keyframes ai-shimmer {
  0% { transform: translateX(-120%); opacity: 0; }
  20% { opacity: 0.65; }
  60% { transform: translateX(120%); opacity: 0.35; }
  100% { transform: translateX(120%); opacity: 0; }
}

/* tiny occasional sparkles (two pseudo-elements staggered) */
.ai-summary-btn::after,
.ai-summary-btn::before {
  content: "";
  position: absolute;
  top: 30%;
  left: 12%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,1) 0%, rgba(255,255,255,0.6) 40%, transparent 60%);
  box-shadow: 0 0 8px rgba(255,255,255,0.6);
  opacity: 0;
  pointer-events: none;
}
.ai-summary-btn::after { animation: ai-sparkle 6s linear infinite; left: 12%; width:9px; height:9px; }
.ai-summary-btn::before { animation: ai-sparkle 8.5s linear infinite; left: 72%; width:6px; height:6px; top: 40%; }

@keyframes ai-sparkle {
  0% { opacity: 0; transform: scale(0.2) translateY(0); }
  3% { opacity: 1; transform: scale(1.1) translateY(-4px); }
  10% { opacity: 0; transform: scale(0.6) translateY(0); }
  100% { opacity: 0; }
}

#ai-summary-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 60;
}
#ai-summary-modal.open { display: flex; }

#ai-summary-modal .modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2,6,23,0.6);
  backdrop-filter: blur(4px);
}

#ai-summary-modal .modal-box {
  position: relative;
  z-index: 62;
  background: linear-gradient(180deg,#071027,#0b1220);
  color: #e6eefc;
  padding: 1.25rem 1.25rem;
  border-radius: 0.5rem;
  max-width: 420px;
  width: calc(100% - 3rem);
  text-align: center;
  border: 1px solid rgba(124,58,237,0.08);
  box-shadow: 0 10px 40px rgba(2,6,23,0.6);
  /* keep modal content usable on small screens */
  max-height: calc(100vh - 8vh);
  overflow-y: auto;
}

#ai-summary-modal .modal-actions { margin-top: 0.75rem; display:flex; gap:0.5rem; justify-content:center; }
#ai-summary-modal .modal-cancel {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.06);
  padding: 0.45rem 0.85rem;
  color: #cbd5e1;
  border-radius: 0.375rem;
  cursor: pointer;
}
#ai-summary-modal .modal-confirm { /* reuse gradient look for primary */
  padding: 0.45rem 0.85rem;
  border-radius: 0.375rem;
  border: none;
  cursor: pointer;
  background: linear-gradient(90deg,#06b6d4,#3b82f6,#8b5cf6);
  color: white;
}

/* small responsive tweak so the modal feels native on mobile */
@media (max-width: 640px) {
  .ai-summary-btn { width: 100%; justify-content: center; }
  #ai-summary-modal .modal-box { width: calc(100% - 2rem); }
}

/* Move modal higher on smaller viewports so it isn't pushed too far down */
@media (max-width: 820px) {
  #ai-summary-modal { align-items: flex-start; padding-top: 6vh; }
  #ai-summary-modal .modal-box { margin-top: 0.5rem; }
}

@media (max-width: 420px) {
  /* Give a little more space at the top on very small phones */
  #ai-summary-modal { padding-top: 4vh; }
  #ai-summary-modal .modal-box { width: calc(100% - 1.5rem); margin-top: 0.25rem; }
}

/* --- Burn animation (click -> burn -> hide) --- */
.ai-summary-btn.burn {
  animation: burn-shrink 1200ms cubic-bezier(.2,.9,.2,1) forwards;
  pointer-events: none;
}
.ai-summary-btn.burn .ai-summary-label { opacity: 0; transition: opacity 220ms ease; }

.ai-summary-btn.burn::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: -10%; bottom: -10%;
  background: radial-gradient(circle at 30% 20%, rgba(255,245,200,0.95) 0 6%, rgba(255,140,20,0.9) 10% 18%, rgba(200,40,0,0.8) 22% 28%, transparent 40%),
              linear-gradient(180deg, rgba(255,120,0,0.15), rgba(40,10,0,0.0));
  mix-blend-mode: screen;
  opacity: 1;
  transform-origin: center bottom;
  animation: flame-up 900ms ease-out forwards;
  pointer-events: none;
}

.ai-summary-btn.burn::after {
  content: "";
  position: absolute;
  left: 40%; top: 60%; width: 8px; height: 8px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,1) 0%, rgba(255,200,120,0.9) 30%, transparent 55%);
  box-shadow: 0 0 14px rgba(255,180,80,0.7);
  transform: translateY(0) scale(1);
  animation: ember-pop 900ms ease-out forwards;
}

@keyframes flame-up {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  60% { transform: translateY(-26px) scale(1.18); opacity: 0.95; }
  100% { transform: translateY(-60px) scale(1.6); opacity: 0; }
}

@keyframes ember-pop {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  40% { transform: translateY(-18px) scale(1.2); opacity: 0.9; }
  100% { transform: translateY(-40px) scale(0.6); opacity: 0; }
}

@keyframes burn-shrink {
  0% { transform: scale(1) rotate(0deg); opacity: 1; filter: none; }
  40% { transform: scale(1.03) rotate(-2deg); filter: hue-rotate(10deg) saturate(1.1); }
  75% { transform: scale(0.6) rotate(-8deg); opacity: 0.85; filter: grayscale(0.2) contrast(0.9); }
  100% { transform: scale(0.22) rotate(-20deg); opacity: 0; filter: grayscale(0.6) contrast(0.7); }
}

  /* --- Blog Research Table (post content) --- */
  .blog-research-table {
    width: 100%;
    margin: 1.75rem 0;
    border-collapse: collapse;
    font-family: "Inter", sans-serif;
    font-size: 0.95rem;
    border: 1px solid rgba(124,58,237,0.12);
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(2,6,23,0.3);
  }

  .blog-research-table thead {
    background: linear-gradient(180deg, rgba(67,56,202,0.15), rgba(59,130,246,0.08));
    border-bottom: 2px solid rgba(124,58,237,0.18);
  }

  .blog-research-table th {
    padding: 0.9rem 1rem;
    text-align: left;
    font-weight: 600;
    color: #c7d2fe;
    letter-spacing: 0.05em;
    text-transform: capitalize;
  }

  .blog-research-table td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid rgba(124,58,237,0.08);
    color: #cbd5e1;
    transition: background-color 0.2s ease;
  }

  .blog-research-table tbody tr:hover {
    background-color: rgba(59,130,246,0.04);
  }

  .blog-research-table tbody tr:last-child td {
    border-bottom: none;
  }

  /* Impact badges used inside the 'Conclusion' column */
  .blog-research-table .impact {
    display: inline-block;
    padding: 0.15rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    min-width: 3.5rem;
    text-align: left;
    background: transparent; /* no heavy background */
  }

  /* Simple readable text colors for impact states (accessible contrast) */
  .blog-research-table .impact-neutral {
    color: #cbd5e1; /* muted */
    font-weight: 500;
  }

  .blog-research-table .impact-positive {
    color: #16a34a; /* green-600 */
  }

  .blog-research-table .impact-negative {
    color: #dc2626; /* red-600 */
  }

  /* Optional: row-level accenting — add class to <tr> to highlight the whole row */
  .blog-research-table tbody tr.impact-row-positive td {
    background-color: rgba(16,185,129,0.03); /* very subtle green tint */
    border-color: rgba(16,185,129,0.12);
  }
  .blog-research-table tbody tr.impact-row-negative td {
    background-color: rgba(239,68,68,0.03); /* very subtle red tint */
    border-color: rgba(239,68,68,0.12);
  }
  .blog-research-table tbody tr.impact-row-positive td:first-child {
    box-shadow: inset 4px 0 0 0 rgba(16,185,129,0.18);
  }
  .blog-research-table tbody tr.impact-row-negative td:first-child {
    box-shadow: inset 4px 0 0 0 rgba(239,68,68,0.18);
  }

  /* Keep hover subtle when a row already has an impact color */
  .blog-research-table tbody tr.impact-row-positive:hover td,
  .blog-research-table tbody tr.impact-row-negative:hover td {
    background-color: rgba(59,130,246,0.03);
  }

