/* =====================================================================
   cioffiscientific.com — shared stylesheet
   Every page links to this one file, so a change here changes the
   whole site. Structure:
     1. Design tokens (colors, fonts, spacing) — edit these first
     2. Base elements (body, headings, links)
     3. Layout pieces (header/nav, sections, footer)
     4. Components (hero, timeline, publication list, project cards)
     5. Small-screen adjustments
   ===================================================================== */

/* ---------- 1. Design tokens ----------------------------------------
   CSS "custom properties" (variables). Change --accent once and every
   link, button and highlight follows. */
:root {
  --bg:        #fbfaf7;   /* warm off-white page background */
  --surface:   #ffffff;   /* cards */
  --text:      #1d2430;   /* near-black body text */
  --muted:     #5b6575;   /* secondary text (dates, journals) */
  --line:      #e3e1da;   /* hairline borders */
  --accent:    #1f5f74;   /* deep teal — links, highlights */
  --accent-2:  #c2703d;   /* copper — small emphasis marks */

  --font-head: "Source Serif 4", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --max-width: 980px;     /* content column width */
  --radius:    10px;
}

/* Dark mode: browsers report the visitor's OS setting; we just swap tokens. */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:       #12161c;
    --surface:  #1a2029;
    --text:     #e6e8eb;
    --muted:    #9aa3b0;
    --line:     #2a323d;
    --accent:   #6fb8cf;
    --accent-2: #e09a6b;
  }
}

/* ---------- 2. Base elements ---------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
}

h1, h2, h3 {
  font-family: var(--font-head);
  line-height: 1.2;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2rem, 5vw, 2.9rem); font-weight: 600; }
h2 { font-size: 1.7rem; font-weight: 600; }
h3 { font-size: 1.15rem; font-weight: 600; }

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

img { max-width: 100%; display: block; }

/* ---------- 3. Layout ----------------------------------------------- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;           /* 16px gutter keeps text off phone edges */
}

/* Header + navigation bar, shared by every page */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky;           /* stays visible while scrolling */
  top: 0;
  z-index: 10;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  flex-wrap: wrap;
}
.brand {
  font-family: var(--font-head);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
}
.brand span { color: var(--accent-2); }
.nav { display: flex; gap: 22px; flex-wrap: wrap; }
.nav a { color: var(--muted); font-size: 0.95rem; font-weight: 500; }
.nav a:hover { color: var(--accent); text-decoration: none; }
/* The page you're on gets aria-current="page" in the HTML */
.nav a[aria-current="page"] { color: var(--text); border-bottom: 2px solid var(--accent-2); }

section { padding: 56px 0; }
section + section { border-top: 1px solid var(--line); }

.eyebrow {                   /* small label above a heading */
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-2);
  font-weight: 600;
  margin-bottom: 8px;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------- 4. Components ------------------------------------------- */

/* Hero: photo on the left, intro text on the right */
.hero {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 44px;
  align-items: center;
}
.headshot {
  width: 240px;
  height: 240px;
  border-radius: 50%;
  object-fit: cover;         /* crops any photo to fill the circle */
  border: 4px solid var(--surface);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
}
/* Shown only if images/headshot.jpg is missing (see onerror in index.html) */
.headshot-placeholder {
  width: 240px;
  height: 240px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-head);
  font-size: 4rem;
}
.lede { font-size: 1.12rem; color: var(--muted); max-width: 60ch; }

.button-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.button {
  display: inline-block;
  padding: 10px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--accent);
  font-weight: 500;
  font-size: 0.95rem;
}
.button.primary { background: var(--accent); color: #fff; }
.button:hover { text-decoration: none; opacity: 0.9; }

/* Expertise tags */
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tag {
  font-size: 0.85rem;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }

/* Career timeline: a vertical line with entries hanging off it */
.timeline { list-style: none; padding: 0; margin: 24px 0 0; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 26px 24px; }
.timeline li::before {       /* the dot on the line */
  content: "";
  position: absolute;
  left: -7px;
  top: 7px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
}
.timeline .when { color: var(--muted); font-size: 0.88rem; }
.timeline .role { font-weight: 600; }
.timeline p { margin: 4px 0 0; }

/* Publication list (publications.html) */
.pub-list { list-style: none; padding: 0; margin: 0; counter-reset: pub; }
.pub {
  counter-increment: pub;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 12px;
}
.pub-year { font-family: var(--font-head); font-size: 1.1rem; color: var(--accent-2); }
.pub-title { font-weight: 600; display: block; margin-bottom: 2px; }
.pub-authors { color: var(--muted); font-size: 0.93rem; }
.pub-authors .me { color: var(--text); font-weight: 600; }  /* highlights your name */
.pub-venue { font-size: 0.93rem; }
.pub-venue em { font-style: italic; }
.pub-links { margin-top: 6px; font-size: 0.88rem; display: flex; gap: 14px; flex-wrap: wrap; }

/* Project cards (projects.html) */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}
.card .status { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.card .status.live { color: var(--accent); }

/* ---------- 5. Small screens ---------------------------------------- */
@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; gap: 24px; text-align: left; }
  .headshot, .headshot-placeholder { width: 160px; height: 160px; font-size: 2.8rem; }
  .two-col { grid-template-columns: 1fr; }
  .pub { grid-template-columns: 1fr; gap: 2px; }
  section { padding: 40px 0; }
}
