/* ======================================================================
   Academic Website Stylesheet
   Spec: docs/superpowers/specs/2026-04-11-academic-website-design.md
   ====================================================================== */

/* ---- Design tokens ------------------------------------------------- */

:root {
  /* Palette derived from files/headshot.jpg (brick warehouse portrait) */
  --color-cream:       #F6F4F1;                 /* warm paper — clean but not yellow */
  --color-ink:         #1A0B08;                 /* warm near-black, from hair */
  --color-forest:      #7A2611;                 /* deep brick — primary accent */
  --color-coral:       #9A3D22;                 /* mid brick — hover / secondary */
  --color-pink:        #BACDC2;                 /* pale sage, from window glass */
  --color-hairline:    rgba(122, 38, 17, 0.15); /* brick at 15% */
  --color-pink-tint:   rgba(186, 205, 194, 0.22); /* sage at ~22% */

  --font-sans:         "Cabin", system-ui, -apple-system, sans-serif;

  --size-body:         14px;
  --size-body-mobile:  16px;
  --line-height:       1.6;

  --max-home:          680px;
  --max-research:      720px;

  --space-paragraph:   1.5rem;
  --space-section:     2.5rem;
}

/* ---- Base typography ----------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: var(--size-body);
}

body {
  margin: 0;
  padding: 2rem 1.5rem;
  background-color: var(--color-cream);
  color: var(--color-ink);
  font-family: var(--font-sans);
  line-height: var(--line-height);
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: var(--max-home);
  margin: 0 auto;
}

p {
  margin: 0 0 var(--space-paragraph) 0;
}

a {
  color: var(--color-forest);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--color-coral);
}

::selection {
  background-color: var(--color-coral);
  color: var(--color-cream);
}

h1, h2, h3 {
  font-weight: 700;
  margin: 0 0 var(--space-paragraph) 0;
}

/* Section headings: uppercase, same size as body, forest green */
h2 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-forest);
  margin-top: var(--space-section);
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--color-hairline);
}

h2:first-of-type {
  margin-top: 0;
}

/* ---- Shared top nav ------------------------------------------------ */

.site-nav {
  max-width: var(--max-research);  /* widest of the three pages */
  margin: 0 auto var(--space-section) auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-hairline);
}

.site-nav-name {
  font-weight: 700;
  color: var(--color-ink);
  text-decoration: none;
}

.site-nav-name:hover {
  color: var(--color-coral);
}

.site-nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.5rem;
}

.site-nav-links a {
  color: var(--color-forest);
  text-decoration: none;
}

.site-nav-links a.active {
  border-bottom: 2px solid var(--color-forest);
  padding-bottom: 2px;
}

.site-nav-links a:hover {
  color: var(--color-coral);
}

/* ---- Home page ----------------------------------------------------- */

.home {
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
}

.headshot {
  width: 320px;
  height: auto;
  flex-shrink: 0;
}

.home-text {
  flex: 1;
}

.home-name {
  font-size: 1.6rem;
  margin-bottom: 0.3rem;
}

.home-affiliation {
  margin-bottom: 0.3rem;
}

.home-interests {
  margin-bottom: var(--space-section);
  font-style: italic;
  color: rgba(26, 11, 8, 0.75);
}

.home-interests .label {
  font-style: normal;
  font-weight: 500;
  color: var(--color-ink);
}

.home-contact {
  margin-bottom: var(--space-paragraph);
}

.home-profiles {
  margin-top: var(--space-paragraph);
}

/* ---- Research page ------------------------------------------------- */

.research {
  max-width: var(--max-research);
}

.paper {
  margin-bottom: var(--space-section);
}

.paper + .paper {
  padding-top: var(--space-section);
  border-top: 1px solid var(--color-hairline);
}

.paper-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-forest);
  margin-bottom: 0.2rem;
}

.paper-coauthors,
.paper-version {
  margin-bottom: 0.2rem;
}

.paper-version {
  font-style: italic;
  color: rgba(26, 11, 8, 0.7);
}

.paper-links {
  margin-bottom: 0.2rem;
}

.paper-presentations {
  margin-bottom: 0.2rem;
  font-size: 0.95em;
  color: rgba(26, 11, 8, 0.7);
}

/* Last metadata <p> before the <details> abstract gets more breathing room,
   regardless of whether it's links, presentations, or something else. */
.paper > p:last-of-type {
  margin-bottom: 0.8rem;
}

/* ---- <details> abstract with custom disclosure marker -------------- */

.paper-abstract {
  margin: 0;
}

/* Hide the default browser triangle */
.paper-abstract summary {
  list-style: none;
  cursor: pointer;
  color: var(--color-coral);
  font-weight: 500;
  display: inline-block;
}

.paper-abstract summary::-webkit-details-marker {
  display: none;
}

/* Custom triangle: ▸ collapsed, ▾ expanded */
.paper-abstract summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 0.4rem;
  transition: none;
}

.paper-abstract[open] summary::before {
  content: "▾";
}

.paper-abstract summary:hover {
  color: var(--color-forest);
}

.paper-abstract[open] {
  margin-top: 0.6rem;
}

.paper-abstract[open] > p {
  margin-top: 0.6rem;
  padding: 0.8rem 1rem;
  background-color: var(--color-pink-tint);
  border-left: 2px solid var(--color-coral);
  border-radius: 0 2px 2px 0;
}

/* ---- Mobile responsive (single breakpoint) ------------------------- */

@media (max-width: 600px) {
  html {
    font-size: var(--size-body-mobile);
  }

  body {
    padding: 1.5rem 1rem;
  }

  .site-nav {
    margin-bottom: 2rem;
  }

  .site-nav-links {
    gap: 1rem;
  }

  /* Home: stack photo above text, center it, shrink to 220px */
  .home {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    text-align: left;
  }

  .headshot {
    width: 220px;
  }

  .home-text {
    width: 100%;
  }
}
