/* ============================================================
   DESIGN SYSTEM — Tyler W. Hughes
   Direction: Scientific Journal 2.0
   Fonts: Fraunces (headings) + Inter (body)
   Palette: Warm cream · Near-black · Rust accent
   ============================================================ */

:root {
  --bg:           #faf8f5;
  --bg-alt:       #f3f0eb;
  --surface:      #ffffff;
  --text:         #1a1714;
  --text-muted:   #78716c;
  --text-light:   #a8a29e;
  --accent:       #c2410c;
  --accent-hover: #9a3412;
  --accent-light: #fff7ed;
  --green:        #166534;
  --green-light:  #f0fdf4;
  --border:       #e6e0d8;
  --border-dark:  #d4cec6;
  --radius:       6px;
  --shadow-sm:    0 1px 3px rgba(26, 23, 20, 0.06);
  --shadow:       0 4px 16px rgba(26, 23, 20, 0.10);
  --max-w:        960px;
  --font-head:    'Fraunces', Georgia, serif;
  --font-body:    'Inter', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', monospace;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

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

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

ul, ol {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* ============================================================
   NAVIGATION
   ============================================================ */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 248, 245, 0.90);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

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

.nav-name {
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 700;
  font-style: italic;
  color: var(--text);
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  gap: 28px;
}

.nav-links a {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  transition: color 0.15s;
}

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

/* ============================================================
   HERO / HEADER
   ============================================================ */
.hero {
  padding: 80px 2rem 72px;
  border-bottom: 1px solid var(--border);
}

.hero-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 52px;
}

.hero-photo {
  flex-shrink: 0;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  border: 3px solid var(--surface);
  box-shadow: 0 0 0 1px var(--border-dark), var(--shadow);
}

.hero-name {
  font-family: var(--font-head);
  font-size: clamp(2.25rem, 5vw, 3rem);
  font-weight: 900;
  font-style: italic;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--text);
  margin-bottom: 8px;
}

.hero-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.hero-email {
  font-size: 13px;
  color: var(--text-light);
  font-family: var(--font-mono);
  margin-bottom: 22px;
}

.hero-icons {
  display: flex;
  gap: 10px;
}

.hero-icons a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border-dark);
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.hero-icons a:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
  transform: translateY(-1px);
}

.hero-icons img {
  width: 17px;
  height: 17px;
  object-fit: contain;
}

.hero-github-handles {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-light);
}

.hero-github-handles a {
  color: var(--text-muted);
  text-decoration: none;
}

.hero-github-handles a:hover {
  color: var(--accent);
}

.hero-github-handles span {
  color: var(--text-light);
}

.hero-icon-label {
  width: auto;
  border-radius: 20px;
  padding: 0 10px;
  gap: 5px;
}

.hero-icons a.hero-icon-label span {
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.hero-icons a.hero-icon-label:hover span {
  color: var(--accent);
}

/* ============================================================
   SECTIONS
   ============================================================ */
.section {
  padding: 68px 2rem;
  border-bottom: 1px solid var(--border);
}

.section:last-of-type {
  border-bottom: none;
}

.section-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}

.section-label {
  font-size: 11px;
  font-family: var(--font-body);
  font-weight: 700;
  font-style: normal;
  line-height: 1;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

h2.section-heading {
  font-family: var(--font-head);
  font-size: clamp(1.6rem, 3vw, 2rem);
  font-weight: 700;
  font-style: italic;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 32px;
  line-height: 1.2;
}

/* ============================================================
   STATS STRIP
   ============================================================ */
.stats-strip {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
}

.stats-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: stretch;
  gap: 0;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px 28px;
  border-right: 1px solid var(--border);
  text-decoration: none;
  transition: background 0.15s;
  gap: 2px;
}

.stat:last-child {
  border-right: none;
}

.stat:hover {
  background: var(--border);
}

.stat-num {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1;
}

.stat-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

@media (max-width: 640px) {
  .stats-inner {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }
  .stat {
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 14px 10px;
  }
  .stat:nth-child(3n) {
    border-right: none;
  }
  .stat:nth-last-child(-n+3) {
    border-bottom: none;
  }
}

/* ============================================================
   BIO
   ============================================================ */
.bio-body {
  font-size: 17px;
  line-height: 1.8;
  color: var(--text);
  max-width: 68ch;
}

.bio-body p + p {
  margin-top: 1.3rem;
}

/* ============================================================
   TIMELINE
   ============================================================ */
.timeline {
  position: relative;
  padding-left: 32px;
  border-left: 2px solid var(--border-dark);
  margin-left: 6px;
}

.timeline-item {
  position: relative;
  padding-bottom: 32px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -38px;
  top: 7px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 1px var(--accent);
}

.tl-date {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-light);
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
  margin-bottom: 2px;
}

.tl-logo {
  width: 22px;
  height: 22px;
  object-fit: contain;
  border-radius: 4px;
  margin-right: 8px;
  vertical-align: middle;
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 1px;
}

.tl-org {
  display: flex;
  align-items: center;
  font-family: var(--font-head);
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
  letter-spacing: -0.01em;
}

.tl-org a {
  color: inherit;
  text-decoration: none;
}

.tl-org a:hover {
  color: var(--accent);
}

.tl-desc {
  font-size: 14.5px;
  color: var(--text-muted);
  line-height: 1.6;
}

.tl-desc a {
  color: var(--text-muted);
}

/* ============================================================
   PUBLICATIONS
   ============================================================ */
.pub-list {
  display: flex;
  flex-direction: column;
}

.pub-item {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 28px;
  padding: 32px 0;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.pub-item:first-child {
  padding-top: 0;
}

.pub-item:last-child {
  border-bottom: none;
}

.pub-thumb {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-alt);
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.pub-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--bg-alt);
}

.pub-content {}

.pub-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.pub-venue {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--green);
  background: var(--green-light);
  padding: 2px 8px;
  border-radius: 3px;
}

.pub-first-author-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 2px 7px;
  border-radius: 3px;
  opacity: 0.8;
}

.pub-section-divider {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 24px 0 16px;
  border-top: 1px solid var(--border-dark);
  margin-top: 8px;
}

.pub-title {
  font-family: var(--font-head);
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.pub-desc {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 8px;
}

.pub-authors {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 12px;
  line-height: 1.5;
}

.pub-authors strong {
  color: var(--text-muted);
  font-weight: 600;
}

.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pub-links a {
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  border: 1px solid currentColor;
  padding: 3px 10px;
  border-radius: 4px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  opacity: 0.85;
}

.pub-links a:hover {
  background: var(--accent);
  color: white;
  opacity: 1;
}

/* ============================================================
   SHOW MORE
   ============================================================ */
.show-more-btn {
  display: block;
  width: fit-content;
  margin: 28px auto 0;
  padding: 9px 28px;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-body);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border-dark);
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.show-more-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

#morepubs,
#moreprojects {
  display: none;
}

/* ============================================================
   OPEN SOURCE
   ============================================================ */
.oss-list {
  display: flex;
  flex-direction: column;
}

.oss-item {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

.oss-item:first-child { padding-top: 0; }
.oss-item:last-child  { border-bottom: none; }

.oss-meta {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 7px;
}

.oss-name {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: -0.01em;
  transition: color 0.15s;
}

.oss-name:hover { color: var(--accent-hover); }

.oss-stars {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-light);
  letter-spacing: 0.02em;
}

.oss-desc {
  font-size: 14.5px;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 68ch;
}

/* ============================================================
   COURSES
   ============================================================ */
.courses-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 56px;
}

.course-category {
  margin-bottom: 28px;
}

.course-cat-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.course-school {
  font-size: 10px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--text-light);
  letter-spacing: 0.05em;
  text-transform: none;
  margin-left: 4px;
}

.course-list li {
  font-size: 13.5px;
  color: var(--text-muted);
  padding: 4px 0;
  line-height: 1.45;
  border-bottom: 1px solid var(--bg-alt);
}

/* ============================================================
   HERO TAGS
   ============================================================ */
.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.hero-tag {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-alt);
  border: 1px solid var(--border-dark);
  padding: 4px 12px;
  border-radius: 20px;
  letter-spacing: 0.01em;
}

/* ============================================================
   WRITING
   ============================================================ */
.writing-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.writing-item {
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 180px 1fr auto;
  gap: 0 24px;
  align-items: start;
}

.writing-thumb {
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-alt);
  flex-shrink: 0;
  align-self: start;
}

.writing-thumb img {
  width: 180px;
  height: 160px;
  display: block;
  object-fit: contain;
  background: var(--bg-alt);
  transition: opacity 0.2s;
}

.writing-item:hover .writing-thumb img {
  opacity: 0.85;
}

.writing-item:first-child {
  padding-top: 0;
}

.writing-item:last-child {
  border-bottom: none;
}

.writing-body {}

.writing-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.writing-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-light);
  padding: 2px 8px;
  border-radius: 3px;
}

.writing-source {
  font-size: 12px;
  color: var(--text-light);
  font-family: var(--font-mono);
}

.writing-title {
  display: block;
  font-family: var(--font-head);
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin-bottom: 8px;
  transition: color 0.15s;
}

.writing-title:hover {
  color: var(--accent);
}

.writing-desc {
  font-size: 14.5px;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 62ch;
}

.writing-arrow {
  font-size: 20px;
  color: var(--border-dark);
  margin-top: 4px;
  transition: color 0.15s, transform 0.15s;
  text-decoration: none;
  align-self: center;
}

.writing-item:hover .writing-arrow {
  color: var(--accent);
  transform: translateX(3px);
}

/* ============================================================
   TALKS
   ============================================================ */
.talks-list {
  display: flex;
  flex-direction: column;
}

.talk-item {
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
}

.talk-item:first-child { padding-top: 0; }
.talk-item:last-child  { border-bottom: none; }

.talk-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.talk-venue {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-light);
  letter-spacing: 0.02em;
}

.talk-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-light);
  border: 1px solid #fed7aa;
  border-radius: 3px;
  padding: 2px 8px;
  line-height: 1.6;
}

.talk-title {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 700;
  font-style: italic;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.35;
}

/* ============================================================
   PATENTS
   ============================================================ */
.patents-list {
  display: flex;
  flex-direction: column;
}

.patent-item {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 0 20px;
  align-items: baseline;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.patent-item:first-child { padding-top: 0; }
.patent-item:last-child  { border-bottom: none; }

.patent-year {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-light);
  letter-spacing: 0.02em;
  padding-top: 2px;
}

.patent-title {
  font-size: 15px;
  color: var(--text);
  line-height: 1.55;
}

/* ============================================================
   CONTACT
   ============================================================ */
.contact-blurb {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.contact-link {
  display: flex;
  flex-direction: column;
  padding: 16px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
  min-width: 160px;
}

.contact-link:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
  transform: translateY(-1px);
}

.contact-link-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 4px;
}

.contact-link-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
}

/* Fix Google Scholar icon (likely white on transparent → make it dark) */
a[href*="scholar.google"] img {
  filter: brightness(0) opacity(0.75);
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  padding: 28px 2rem;
  text-align: center;
  font-size: 13px;
  color: var(--text-light);
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Tighten nav before it wraps (~820–1000px range) */
@media (max-width: 1000px) {
  .nav-links {
    gap: 18px;
  }

  .nav-links a {
    font-size: 11px;
  }
}

@media (max-width: 768px) {
  .hero-inner {
    flex-direction: column;
    text-align: center;
    gap: 24px;
  }

  .hero-icons {
    justify-content: center;
  }

  .pub-item {
    grid-template-columns: 1fr;
  }

  .pub-thumb {
    height: 180px;
    width: 100%;
  }

  .projects-grid {
    grid-template-columns: 1fr 1fr;
  }

  .courses-grid {
    grid-template-columns: 1fr;
  }

  .nav-links {
    gap: 16px;
  }

  .section-label::after {
    display: none;
  }
}

@media (max-width: 520px) {
  .nav-links {
    display: none;
  }

  .hero {
    padding: 48px 1.25rem 48px;
  }

  .section {
    padding: 48px 1.25rem;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }
}
