/* ==========================================================================
   Max Miller — Academic Site
   Contemporary Academic Editorial
   ========================================================================== */

:root {
  /* Palette — Ink & Parchment */
  --bg: #fafaf7;
  --bg-card: #ffffff;
  --bg-subtle: #f4f2ed;
  --ink: #1c1917;
  --text: #3c3836;
  --text-muted: #8c8580;
  --accent: #8b6f47;
  --accent-hover: #6d5535;
  --accent-light: rgba(139, 111, 71, 0.12);
  --rule: #e5e1da;
  --rule-light: #edeae4;
  --white: #ffffff;

  /* Typography */
  --font-display: "Newsreader", Georgia, serif;
  --font-body: "Outfit", "Helvetica Neue", sans-serif;

  --max-width: 860px;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  font-weight: 400;
}

/* Page load animation */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

main {
  animation: fadeUp 0.5s ease-out;
}

/* ==========================================================================
   Top Accent Stripe
   ========================================================================== */

.top-stripe {
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover), var(--accent));
}

/* ==========================================================================
   Links
   ========================================================================== */

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover {
  color: var(--accent-hover);
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  background: var(--white);
  padding: 1.3rem 0;
  border-bottom: 1px solid var(--rule);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.site-name:hover {
  color: var(--accent);
}

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

.nav-links li a {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.45rem 0.85rem;
  border-radius: 4px;
  position: relative;
  transition: color 0.2s ease;
}

.nav-links li a::after {
  content: "";
  position: absolute;
  bottom: 2px;
  left: 50%;
  right: 50%;
  height: 1.5px;
  background: var(--accent);
  transition: left 0.25s ease, right 0.25s ease;
  border-radius: 1px;
}

.nav-links li a:hover {
  color: var(--ink);
}
.nav-links li a:hover::after {
  left: 0.85rem;
  right: 0.85rem;
}

.nav-links li a.active {
  color: var(--ink);
  font-weight: 600;
}
.nav-links li a.active::after {
  left: 0.85rem;
  right: 0.85rem;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--ink);
  margin: 5px 0;
  border-radius: 1px;
  transition: 0.3s;
}

/* ==========================================================================
   Hero / Homepage
   ========================================================================== */

.hero {
  background: var(--white);
  border-bottom: 1px solid var(--rule-light);
}

.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 4rem 2rem 3.5rem;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 3.5rem;
  align-items: start;
}

.hero-photo img {
  width: 100%;
  border-radius: 8px;
  box-shadow:
    0 8px 30px rgba(28, 25, 23, 0.08),
    0 1px 3px rgba(28, 25, 23, 0.06);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}
.hero-photo img:hover {
  transform: translateY(-3px);
  box-shadow:
    0 14px 40px rgba(28, 25, 23, 0.12),
    0 2px 6px rgba(28, 25, 23, 0.06);
}

.hero-text h1 {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 0.3rem;
}

.hero-text .tagline {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 400;
  font-style: italic;
  color: var(--accent);
  margin-bottom: 0.15rem;
}

.hero-text .institution {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.hero-divider {
  width: 40px;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
  margin: 1.8rem 0;
  opacity: 0.7;
}

.hero-bio p {
  font-size: 0.95rem;
  margin-bottom: 0.8rem;
  line-height: 1.75;
  color: var(--text);
}

.hero-bio ul {
  list-style: none;
  padding-left: 0;
  margin-top: 0.2rem;
  margin-bottom: 0;
}

.hero-bio li {
  font-size: 0.92rem;
  color: var(--text);
  padding: 0.2rem 0;
  padding-left: 1.1rem;
  position: relative;
  line-height: 1.5;
}

.hero-bio li::before {
  content: "\2014";
  position: absolute;
  left: 0;
  top: 0.2rem;
  color: var(--accent);
  font-size: 0.75rem;
}

/* ==========================================================================
   Page Content — Inner Pages
   ========================================================================== */

.page-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3.5rem 2rem 5rem;
}

.page-content h1 {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
}

.page-content h1::after {
  content: "";
  display: block;
  width: 40px;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
  margin-top: 0.8rem;
  margin-bottom: 2.5rem;
  opacity: 0.7;
}

.page-content h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.01em;
  margin-top: 3rem;
  margin-bottom: 1.3rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--rule);
}

.page-content h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  font-style: italic;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--ink);
}

.page-content p {
  margin-bottom: 1rem;
  font-size: 0.93rem;
}

.page-content ul {
  margin-bottom: 1rem;
  padding-left: 1.3rem;
}

.page-content li {
  margin-bottom: 0.5rem;
  font-size: 0.93rem;
}

/* ==========================================================================
   Paper Cards
   ========================================================================== */

.paper {
  background: var(--bg-card);
  border-radius: 8px;
  padding: 1.5rem 1.7rem;
  margin-bottom: 1rem;
  border-left: 3px solid var(--rule);
  box-shadow: 0 1px 3px rgba(28, 25, 23, 0.04);
  transition: box-shadow 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}
.paper:hover {
  box-shadow: 0 4px 20px rgba(28, 25, 23, 0.08);
  border-left-color: var(--accent);
  transform: translateY(-1px);
}

.paper-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--ink);
  margin-bottom: 0.35rem;
  line-height: 1.35;
  letter-spacing: -0.005em;
}

.paper-authors {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
  font-weight: 400;
}

.paper-authors a {
  color: var(--text-muted);
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.paper-authors a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.paper-venue {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.88rem;
  color: var(--accent);
  margin-bottom: 0.6rem;
}

.paper p {
  font-size: 0.88rem;
  color: var(--text);
  margin-bottom: 0.7rem;
  line-height: 1.6;
}

.paper-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.3rem;
}

.paper-links a {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.7rem;
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  background: var(--bg-subtle);
  color: var(--text);
  border: 1px solid var(--rule-light);
  border-radius: 20px;
  transition: all 0.2s ease;
}
.paper-links a:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent-hover);
}

/* Abstract toggle */
.abstract-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--accent);
  cursor: pointer;
  padding: 0.25rem 0.7rem;
  background: none;
  border: 1px dashed var(--rule);
  border-radius: 20px;
  transition: all 0.2s ease;
  font-family: var(--font-body);
}
.abstract-toggle:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  border-style: solid;
}
.abstract-toggle .toggle-icon {
  font-size: 0.68rem;
  transition: transform 0.25s ease;
  display: inline-block;
}
.abstract-toggle.open .toggle-icon {
  transform: rotate(45deg);
}

.paper-abstract {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  margin-top: 0;
  padding: 0 1rem;
  background: var(--bg-subtle);
  border-radius: 6px;
  border-left: 2px solid var(--rule);
  font-size: 0.84rem;
  line-height: 1.7;
  color: var(--text);
  transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.3s ease, margin-top 0.3s ease;
}
.paper-abstract.open {
  max-height: 800px;
  opacity: 1;
  padding: 1rem 1.1rem;
  margin-top: 0.8rem;
}

/* Award badge */
.paper-award {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-body);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--accent-hover);
  background: var(--accent-light);
  border: 1px solid rgba(139, 111, 71, 0.2);
  padding: 0.2rem 0.75rem;
  border-radius: 20px;
  margin-bottom: 0.5rem;
}
.paper-award::before {
  content: "\2605";
  font-size: 0.68rem;
  color: var(--accent);
}

/* Status badge (R&R, etc.) */
.paper-status {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-style: italic;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

/* Media coverage links */
.paper-media {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.5rem;
  align-items: center;
}
.paper-media-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-right: 0.15rem;
}
.paper-media a {
  font-size: 0.73rem;
  color: var(--text-muted);
  padding: 0.12rem 0.5rem;
  border: 1px solid var(--rule-light);
  border-radius: 12px;
  transition: all 0.2s ease;
}
.paper-media a:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-light);
}

/* ==========================================================================
   Press Items
   ========================================================================== */

.press-item {
  background: var(--bg-card);
  border-radius: 8px;
  padding: 1.3rem 1.5rem;
  margin-bottom: 1rem;
  border-left: 3px solid var(--rule-light);
  box-shadow: 0 1px 3px rgba(28, 25, 23, 0.03);
  transition: all 0.3s ease;
}
.press-item:hover {
  border-left-color: var(--accent);
  box-shadow: 0 4px 16px rgba(28, 25, 23, 0.07);
  transform: translateY(-1px);
}

.press-outlet {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 0.3rem;
}

.press-item p {
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
}

/* ==========================================================================
   CV Page
   ========================================================================== */

.cv-download {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.7rem 1.8rem;
  background: var(--ink);
  color: var(--bg);
  border: none;
  border-radius: 6px;
  margin-bottom: 2rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(28, 25, 23, 0.15);
  letter-spacing: 0.02em;
}
.cv-download:hover {
  background: var(--accent-hover);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(28, 25, 23, 0.2);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background: var(--ink);
  padding: 1.6rem 0;
  margin-top: 4rem;
}

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

.footer-left {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.footer-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 500;
  color: var(--bg-subtle);
}

.footer-role {
  font-size: 0.73rem;
  color: rgba(244, 242, 237, 0.5);
  letter-spacing: 0.02em;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  font-size: 0.76rem;
  color: rgba(244, 242, 237, 0.4);
}

.footer-right a {
  color: rgba(244, 242, 237, 0.6);
  border-bottom: 1px solid transparent;
  transition: all 0.2s ease;
}
.footer-right a:hover {
  color: var(--bg-subtle);
  border-bottom-color: var(--bg-subtle);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 700px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 2.5rem 1.5rem 2rem;
  }
  .hero-photo {
    max-width: 180px;
  }
  .hero-text h1 {
    font-size: 2.2rem;
  }
  .page-content {
    padding: 2rem 1.5rem 3rem;
  }
  .page-content h1 {
    font-size: 1.8rem;
  }
  .header-inner {
    padding: 0 1.5rem;
  }
  .site-header {
    position: relative;
  }
  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--rule);
    padding: 0.8rem 1.5rem;
    gap: 0.2rem;
    box-shadow: 0 8px 24px rgba(28, 25, 23, 0.08);
    z-index: 100;
  }
  .nav-links li a::after {
    display: none;
  }
  .nav-links li a:hover {
    background: var(--bg-subtle);
    border-radius: 4px;
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
  .footer-inner {
    flex-direction: column;
    gap: 0.8rem;
    text-align: center;
    padding: 0 1.5rem;
  }
  .footer-left { align-items: center; }
  .paper {
    padding: 1.2rem 1.3rem;
  }
}
