/*
Theme Name: Academic Theme
Theme URI: https://solvingpromptinjection.com
Author: Jay Griggs
Author URI: https://solvingpromptinjection.com
Description: A clean, minimal academic theme for a single research paper site.
Version: 1.1.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: academic-theme
*/

:root {
  --hero-start: #0f172a;
  --hero-end: #1e3a5f;
  --accent: #3b82f6;
  --ink: #0f172a;
  --muted: #64748b;
  --paper-bg: #ffffff;
  --border: #e2e8f0;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
  --max-width: 860px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: #f8fafc;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(15, 23, 42, 0.05) 1px, transparent 0),
    linear-gradient(180deg, rgba(226, 232, 240, 0.3), rgba(248, 250, 252, 0));
  background-size: 28px 28px, 100% 600px;
  color: var(--ink);
  line-height: 1.7;
}

img {
  max-width: 100%;
  height: auto;
}

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

a:hover,
a:focus {
  text-decoration: none;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: -999px;
  background: #fff;
  padding: 8px 12px;
  z-index: 1000;
}

.skip-link:focus {
  left: 16px;
  top: 16px;
}

.site-header {
  background: var(--hero-start);
  color: #e2e8f0;
  padding: 24px 20px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.site-branding {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.site-title {
  margin: 0;
  font-size: 1.2rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.site-title a {
  color: #f8fafc;
}

.site-description {
  margin: 0;
  color: rgba(226, 232, 240, 0.8);
  font-size: 0.95rem;
}

.site-nav {
  margin-top: 16px;
  background: rgba(15, 23, 42, 0.6);
  border-top: 1px solid rgba(148, 163, 184, 0.15);
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.site-nav .menu {
  list-style: none;
  padding: 10px 0;
  margin: 0 auto;
  max-width: var(--max-width);
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.site-nav .menu a {
  color: #e2e8f0;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.site-nav .menu a:hover,
.site-nav .menu a:focus {
  color: #fff;
}

.main {
  padding: 0 0 80px;
}

.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--hero-start), var(--hero-end));
  color: #f8fafc;
  padding: 70px 20px 80px;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -30% 0 0 0;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.16) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: 0.6;
  animation: drift 18s linear infinite;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(59, 130, 246, 0.25), transparent 55%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
}

.hero-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.32em;
  font-size: 0.75rem;
  color: rgba(226, 232, 240, 0.75);
  margin: 0 0 12px;
}

.hero-title {
  margin: 0 0 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.4rem, 4vw, 3.4rem);
  line-height: 1.1;
}

.hero-subtitle {
  margin: 0 0 16px;
  font-size: 1.2rem;
  color: rgba(226, 232, 240, 0.9);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.95rem;
  color: rgba(226, 232, 240, 0.8);
}

.hero-actions {
  margin-top: 26px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 12px 22px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, color 0.25s ease;
}

.button-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 14px 30px rgba(59, 130, 246, 0.3);
}

.button-primary:hover,
.button-primary:focus {
  transform: translateY(-2px);
  box-shadow: 0 16px 35px rgba(59, 130, 246, 0.4);
}

.button-ghost {
  border: 1px solid rgba(226, 232, 240, 0.6);
  color: #e2e8f0;
  background: transparent;
}

.button-ghost:hover,
.button-ghost:focus {
  background: rgba(226, 232, 240, 0.15);
}

.content-wrapper {
  max-width: var(--max-width);
  margin: -56px auto 0;
  padding: 0 20px;
}

.paper {
  background: var(--paper-bg);
  border-radius: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 48px 50px 60px;
}

.paper h2,
.paper h3,
.paper h4 {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  line-height: 1.2;
}

.paper-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.2rem;
  margin: 0 0 10px;
}

.paper .subtitle {
  font-size: 1.1rem;
  color: var(--accent);
  margin: 0 0 8px;
  font-weight: 600;
}

.paper .meta {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0 0 6px;
}

.paper p {
  margin: 1rem 0;
}

.section-block {
  position: relative;
  margin: 28px 0;
  padding: 24px 24px 24px 28px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fff;
}

.section-block::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  bottom: 18px;
  width: 4px;
  background: var(--accent);
  border-radius: 999px;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.section-heading h2 {
  margin: 0;
  font-size: 1.3rem;
}

.section-divider {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.4), transparent);
}

.finding-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 16px;
}

.finding-card {
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: 18px 18px 20px;
  background: #f8fafc;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  min-height: 150px;
}

.finding-card:hover,
.finding-card:focus-within {
  transform: translateY(-4px);
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.12);
}

.finding-icon {
  font-size: 1.4rem;
  margin-bottom: 10px;
}

.citation-block {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.citation-text {
  font-size: 0.95rem;
  color: var(--muted);
  background: #f1f5f9;
  padding: 16px 18px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.copy-button {
  align-self: flex-start;
  border: none;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.copy-button:hover,
.copy-button:focus {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(59, 130, 246, 0.35);
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.posts-list article {
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
}

.posts-list h2 {
  margin: 0 0 8px;
}

.entry-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer {
  text-align: center;
  padding: 36px 20px 60px;
  color: rgba(226, 232, 240, 0.7);
  font-size: 0.9rem;
  background: var(--hero-start);
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.sticky-download {
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: var(--accent);
  color: #fff;
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 600;
  box-shadow: 0 16px 30px rgba(59, 130, 246, 0.35);
  transform: translateY(16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 1000;
}

.sticky-download.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

@keyframes drift {
  0% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(-40px, 30px, 0);
  }
  100% {
    transform: translate3d(0, 0, 0);
  }
}

@media (max-width: 768px) {
  .hero {
    padding: 60px 18px 70px;
  }

  .content-wrapper {
    margin-top: -42px;
  }

  .paper {
    padding: 36px 28px 44px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 520px) {
  .paper {
    padding: 28px 20px 38px;
  }

  .paper-title {
    font-size: 1.8rem;
  }

  .sticky-download {
    right: 16px;
    bottom: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .button,
  .finding-card,
  .copy-button,
  .hero::before {
    transition: none;
    animation: none;
  }
}
