/* ============================================
   Dr Rob Firth — robertfirth.co.uk
   Dark theme, amber accent (#f59e0b)
   ============================================ */

:root {
  --bg:        #0f0f0f;
  --bg-raised: #171717;
  --border:    #2a2a2a;
  --text:      #d4d4d4;
  --text-dim:  #737373;
  --text-bright: #f5f5f5;
  --accent:    #f59e0b;
  --accent-dim: #b47008;
  --display:   'Archivo', sans-serif;
  --mono:      'JetBrains Mono', monospace;
  --serif:     'Source Serif 4', Georgia, serif;
  --measure:   960px;
  --gutter:    clamp(1.5rem, 4vw, 3rem);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { font-family: var(--serif); background: var(--bg); color: var(--text); line-height: 1.7; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--accent); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--text-bright); }

header { border-bottom: 1px solid var(--border); }
nav { max-width: var(--measure); margin: 0 auto; padding: 1.25rem var(--gutter); display: flex; justify-content: space-between; align-items: baseline; }
.site-name { font-family: var(--display); font-size: 0.9rem; font-weight: 700; color: var(--text-bright); letter-spacing: -0.02em; }
.site-name:hover { color: var(--accent); }
.nav-links { display: flex; gap: 1.75rem; }
.nav-links a { font-family: var(--mono); font-size: 0.8rem; color: var(--text-dim); text-transform: lowercase; letter-spacing: 0.03em; }
.nav-links a:hover, .nav-links a.active { color: var(--text-bright); }

main { flex: 1; max-width: var(--measure); margin: 0 auto; padding: 0 var(--gutter); width: 100%; }

.hero { padding: 5rem 0 3rem; border-bottom: 1px solid var(--border); }
.hero-layout { display: flex; gap: 2rem; align-items: flex-start; }
.hero-text { flex: 1; }
.hero-photo { flex-shrink: 0; }
.hero-photo img { width: 120px; height: 120px; border-radius: 4px; object-fit: cover; filter: grayscale(20%); }
.hero h1 { font-family: var(--display); font-size: clamp(1.8rem, 4vw, 2.4rem); font-weight: 700; color: var(--text-bright); letter-spacing: -0.03em; margin-bottom: 0.5rem; }
.tagline { font-family: var(--mono); font-size: 0.95rem; color: var(--text-dim); margin-bottom: 1.5rem; }
.tagline a { color: var(--accent); }
.intro { font-size: 1.05rem; line-height: 1.8; max-width: 580px; margin-bottom: 2rem; }
.hero-links { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.hero-links a { font-family: var(--mono); font-size: 0.8rem; color: var(--text-dim); padding: 0.4rem 0; border-bottom: 1px solid var(--border); transition: color 0.15s, border-color 0.15s; }
.hero-links a:hover { color: var(--accent); border-color: var(--accent); }

.interests-preview { padding: 3rem 0 4rem; }
.interests-preview > h2 { font-family: var(--mono); font-size: 0.85rem; font-weight: 400; color: var(--text-dim); text-transform: lowercase; letter-spacing: 0.05em; margin-bottom: 1.5rem; }
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); }
.tile { background: var(--bg); padding: 1.5rem; display: block; color: var(--text); transition: background 0.2s; }
.tile:hover { background: var(--bg-raised); color: var(--text); }
.tile-label { font-family: var(--mono); font-size: 0.8rem; color: var(--accent-dim); display: block; margin-bottom: 0.75rem; }
.tile:hover .tile-label { color: var(--accent); }
.tile h3 { font-family: var(--display); font-size: 0.95rem; font-weight: 700; color: var(--text-bright); margin-bottom: 0.5rem; }
.tile p { font-size: 0.88rem; line-height: 1.6; color: var(--text-dim); }

.photo-feature { margin: 2.5rem 0; }
.photo-feature img { width: 100%; border: 1px solid var(--border); display: block; }
.photo-feature figcaption { font-family: var(--mono); font-size: 0.75rem; color: var(--text-dim); margin-top: 0.5rem; }
.photo-feature figcaption a { color: var(--text-dim); }
.photo-feature figcaption a:hover { color: var(--accent); }

.page-content { padding: 4rem 0; }
.page-content h1 { font-family: var(--display); font-size: clamp(1.4rem, 3vw, 1.8rem); font-weight: 700; color: var(--text-bright); letter-spacing: -0.03em; margin-bottom: 2rem; }
.page-content h2 { font-family: var(--display); font-size: 1rem; font-weight: 700; color: var(--accent); margin-top: 3rem; margin-bottom: 1rem; }
.page-content p { margin-bottom: 1rem; max-width: 600px; }
.page-content strong { color: var(--text-bright); font-weight: 600; }
.interest-block { padding-bottom: 2rem; border-bottom: 1px solid var(--border); }
.interest-block:last-child { border-bottom: none; }

.contact-links { margin-top: 2rem; display: flex; flex-direction: column; gap: 1.5rem; align-items: center; }
.contact-item { padding: 1.25rem; border: 1px solid var(--border); background: var(--bg-raised); width: 100%; max-width: 400px; display: flex; align-items: center; gap: 1.25rem; transition: background 0.2s; }
.contact-item:hover { background: var(--bg); }
.contact-icon { color: var(--accent); flex-shrink: 0; display: flex; align-items: center; }
.contact-icon svg { width: 1.5rem; height: 1.5rem; }
.contact-item:hover .contact-icon { color: var(--text-bright); }
.contact-item-text strong { font-family: var(--display); font-size: 0.85rem; color: var(--text-bright); display: block; margin-bottom: 0.25rem; }
.contact-item-text a { font-size: 0.9rem; }

footer { border-top: 1px solid var(--border); margin-top: auto; }
.footer-inner { max-width: var(--measure); margin: 0 auto; padding: 2rem var(--gutter); }
.footer-links { font-family: var(--mono); font-size: 0.75rem; margin-bottom: 0.5rem; }
.footer-links a { color: var(--text-dim); }
.footer-links a:hover { color: var(--accent); }
.footer-links .sep { color: var(--border); margin: 0 0.25rem; }
.footer-note { font-family: var(--mono); font-size: 0.7rem; color: var(--text-dim); }

/* Publications */
.pub-group { margin-bottom: 3rem; }
.pub-group h2 { font-family: var(--display); font-size: 1rem; font-weight: 700; color: var(--accent); margin-bottom: 1.5rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border); }
.pub-year { display: flex; gap: 2rem; margin-bottom: 1.5rem; }
.pub-year-label { font-family: var(--mono); font-size: 0.8rem; color: var(--text-dim); min-width: 3rem; padding-top: 0.2rem; }
.pub-items { list-style: none; flex: 1; display: flex; flex-direction: column; gap: 1.25rem; }
.pub-item { padding-bottom: 1.25rem; border-bottom: 1px solid var(--border); }
.pub-item:last-child { border-bottom: none; padding-bottom: 0; }
.pub-title { font-family: var(--serif); font-size: 0.95rem; color: var(--text-bright); margin-bottom: 0.35rem; line-height: 1.5; }
.pub-meta { font-size: 0.82rem; color: var(--text-dim); margin-bottom: 0.25rem; line-height: 1.5; }
.pub-venue { font-family: var(--mono); font-size: 0.75rem; color: var(--text-dim); }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.8); display: flex; align-items: center; justify-content: center; z-index: 100; padding: var(--gutter); opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.modal-overlay.is-open { opacity: 1; pointer-events: all; }
.modal { background: var(--bg-raised); border: 1px solid var(--border); max-width: 600px; width: 100%; max-height: 80vh; overflow-y: auto; padding: 2rem; position: relative; transform: translateY(8px); transition: transform 0.2s; }
.modal-overlay.is-open .modal { transform: translateY(0); }
.modal-close { position: absolute; top: 1rem; right: 1rem; background: none; border: none; color: var(--text-dim); font-family: var(--mono); font-size: 1.2rem; cursor: pointer; padding: 0.25rem 0.5rem; line-height: 1; transition: color 0.15s; }
.modal-close:hover { color: var(--text-bright); }
.modal-body h3 { font-family: var(--display); font-size: 1.1rem; font-weight: 700; color: var(--text-bright); letter-spacing: -0.02em; margin-bottom: 1rem; }
.modal-body p { font-size: 0.95rem; line-height: 1.8; margin-bottom: 1rem; }
.modal-body a { color: var(--accent); }
.modal-body a:hover { color: var(--text-bright); }
.modal-footer { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--border); font-family: var(--mono); font-size: 0.75rem; }
.modal-footer a { color: var(--text-dim); }
.modal-footer a:hover { color: var(--accent); }

@media (max-width: 520px) {
  nav { flex-direction: column; gap: 0.75rem; }
  .nav-links { gap: 1.25rem; }
  .tile-grid { grid-template-columns: 1fr; }
  .hero { padding: 3rem 0 2rem; }
  .hero-layout { flex-direction: column; }
  .hero-photo { order: -1; }
}
