/*
 * Group-site theme. Keep the visual language of the personal site—open space,
 * dark text and a restrained burgundy accent—without relying on a copied theme.
 */
:root {
  --ink: #20242a;
  --muted: #606974;
  --line: #d9dde1;
  --paper: #ffffff;
  --wash: #f5f6f6;
  --accent: #0065bd;
  --accent-dark: #004b8d;
  --accent-pale: #e8f2fb;
  --max-width: 72rem;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 17px;
  line-height: 1.65;
}

a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
/* Override Sphinx's default purple visited-link colour. */
a:visited { color: var(--accent-dark); }

div.document, div.documentwrapper, div.bodywrapper, div.body {
  float: none;
  width: auto;
  margin: 0;
  min-width: 0;
}

div.document { background: var(--paper); }

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

/* The landing page repeats its document title in the visual hero. */
.page--index section#edinburgh-hydro-computation-group > h1 { display: none; }

.site-header {
  border-top: 5px solid var(--accent);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .97);
}

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

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  color: var(--ink);
  line-height: 1.15;
  text-decoration: none;
}

.wordmark:hover { color: var(--accent); text-decoration: none; }
.wordmark strong { display: block; font-size: 1rem; letter-spacing: .01em; }
.wordmark small { color: var(--muted); font-size: .78rem; }

.wordmark__mark {
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-family: Georgia, serif;
  font-size: .93rem;
  font-weight: bold;
}

.site-nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 1.25rem; }
.site-nav a { color: var(--ink); font-size: .9rem; font-weight: bold; text-decoration: none; }
.site-nav a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: .35rem; }

h1, h2, h3 { color: var(--ink); font-family: Georgia, 'Times New Roman', serif; font-weight: normal; line-height: 1.15; }
h1 { margin: 0 0 1.2rem; font-size: clamp(2.25rem, 5vw, 4.4rem); letter-spacing: -.025em; }
h2 { margin: 4rem 0 1rem; font-size: clamp(1.7rem, 3vw, 2.5rem); }
h3 { margin: 0 0 .55rem; font-size: 1.3rem; }
p { max-width: 48rem; }
ul { max-width: 48rem; padding-left: 1.2rem; }

.hero {
  position: relative;
  overflow: hidden;
  margin: -3.5rem -2rem 3.8rem;
  padding: clamp(4rem, 9vw, 8rem) max(2rem, calc((100% - var(--max-width)) / 2 + 2rem));
  background: linear-gradient(125deg, #08233f 0%, #004b8d 46%, #0065bd 100%);
  color: #fff;
}

.hero::after {
  position: absolute;
  right: -8rem;
  bottom: -12rem;
  width: 35rem;
  height: 35rem;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 50%;
  box-shadow: 0 0 0 3.5rem rgba(255,255,255,.05), 0 0 0 7rem rgba(255,255,255,.04);
  content: '';
}

.hero > * { position: relative; z-index: 1; }
.hero .eyebrow { margin: 0 0 1rem; color: #d9efff; font-size: .78rem; font-weight: bold; letter-spacing: .13em; text-transform: uppercase; }
.hero h1 { max-width: 15ch; color: #fff; }
.hero .lead { max-width: 43rem; margin: 0; color: #fff; font-size: clamp(1.1rem, 2vw, 1.35rem); line-height: 1.55; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; }
.button {
  display: inline-block;
  padding: .65rem 1rem;
  border: 1px solid #fff;
  color: #fff;
  font-size: .9rem;
  font-weight: bold;
  text-decoration: none;
}
.button:visited { color: #fff; }
.button:hover { border-color: #fff; background: #fff; color: var(--accent-dark); text-decoration: none; }
.button--quiet { border-color: rgba(255,255,255,.55); }

.intro { max-width: 52rem; font-size: 1.18rem; }
.section-kicker { margin-bottom: .4rem; color: var(--accent); font-size: .78rem; font-weight: bold; letter-spacing: .1em; text-transform: uppercase; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.1rem; margin: 1.7rem 0 4rem; }
.card { padding: 1.5rem; border-top: 4px solid var(--accent); background: var(--wash); }
.card p { margin: 0; font-size: .96rem; }
.card a { font-weight: bold; }
.card-meta { color: var(--muted); font-size: .9rem; }
.person-photo { display: block; width: 100%; aspect-ratio: 1 / 1; margin: 0 0 1.1rem; object-fit: cover; object-position: center top; }
.profile-photo { display: block; width: 12rem; max-width: 100%; aspect-ratio: 1 / 1; margin: 0 0 1.5rem; object-fit: cover; object-position: center top; }
.person-photo--connor { object-position: center 11%; }
.card-kicker { margin: 0 0 .7rem !important; color: var(--accent); font-size: .72rem !important; font-weight: bold; letter-spacing: .1em; text-transform: uppercase; }
.consultancy-projects { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 3.6rem; }
.organisation-marks { display: flex; flex-wrap: wrap; gap: .75rem; max-width: 62rem; margin: 1.7rem 0 3.7rem; padding: 0; list-style: none; }
.organisation-marks li { display: flex; align-items: center; justify-content: center; width: 11rem; height: 5.3rem; padding: .8rem 1rem; border: 1px solid var(--line); background: #fff; }
.organisation-marks a { display: flex; width: 100%; height: 100%; }
.organisation-marks a:hover { opacity: .72; }
.organisation-marks img { display: block; width: 100%; height: 100%; object-fit: contain; }
.video-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.1rem; margin: 1.7rem 0 3.7rem; }
.video-grid figure { margin: 0; background: var(--wash); }
.video-grid video { display: block; width: 100%; aspect-ratio: 944 / 1180; background: #dfe3e5; object-fit: contain; }
.video-grid figcaption { padding: .75rem 1rem .9rem; font-family: Georgia, 'Times New Roman', serif; font-size: 1.05rem; line-height: 1.2; }
.project-logo { display: block; width: auto; max-width: 100%; height: 4rem; margin: 0 0 1.1rem; object-fit: contain; object-position: left center; }
.project-logo--square { width: 4rem; }
.software-logo { display: block; width: auto; max-width: 100%; height: 3.1rem; margin: 0 0 1.1rem; object-fit: contain; object-position: left center; }
.software-logo--square { width: 3.1rem; }
.feature { margin: 3.7rem 0; padding: 2rem; border-left: 5px solid var(--accent); background: var(--accent-pale); }
.feature h2 { margin-top: 0; }
.feature p:last-child { margin-bottom: 0; }
.list-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem 3rem; max-width: 56rem; }
.list-grid h3 { margin-top: 1.2rem; }
.notice { margin: 2rem 0; padding: 1.1rem 1.3rem; border-left: 4px solid #66727d; background: var(--wash); color: #39424a; font-size: .94rem; }
.notice p { margin: 0; }
.page-intro { max-width: 47rem; margin-bottom: 2.5rem; color: var(--muted); font-size: 1.16rem; }

.contact-form {
  max-width: 52rem;
  margin: 1.75rem 0 2.5rem;
  padding: clamp(1.3rem, 4vw, 2.3rem);
  border-top: 4px solid var(--accent);
  background: var(--wash);
}
.contact-form p { max-width: none; margin: 0 0 1.15rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.15rem; }
.contact-form label { display: block; margin-bottom: .35rem; font-size: .9rem; font-weight: bold; }
.contact-form input, .contact-form select, .contact-form textarea {
  width: 100%;
  padding: .68rem .72rem;
  border: 1px solid #aeb6bd;
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  font: inherit;
  line-height: 1.35;
}
.contact-form textarea { resize: vertical; }
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus { outline: 3px solid rgba(0, 101, 189, .24); outline-offset: 1px; border-color: var(--accent); }
.contact-form button {
  padding: .7rem 1.1rem;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: .92rem;
  font-weight: bold;
}
.contact-form button:hover, .contact-form button:focus { background: var(--accent-dark); border-color: var(--accent-dark); }
.form-consent { color: var(--muted); font-size: .84rem; line-height: 1.5; }
.form-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* BibBase writes these classes at page load; the rules keep the live list
   consistent with the rest of the site without duplicating bibliography data. */
.bibliography { max-width: 58rem; }
.bibliography .bibbase_group { margin: 2.5rem 0; }
.bibliography .bibbase_group_title {
  margin-bottom: .9rem;
  color: var(--ink);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.5rem;
}
.bibliography .bibbase_paper {
  margin: 0;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
  line-height: 1.55;
}
.bibliography .bibbase_paper:last-child { border-bottom: 1px solid var(--line); }
.bibliography .bibbase_paper_title { font-weight: bold; }
.bibliography .bibbase_icon { margin-left: .4rem; }

.site-footer {
  align-items: flex-start;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.6;
}
.site-footer a { color: var(--muted); }

@media (max-width: 700px) {
  body { font-size: 16px; }
  div.body { padding: 2.5rem 1.25rem 4rem; }
  .site-header__inner, .site-footer { align-items: flex-start; flex-direction: column; gap: 1rem; padding: 1rem 1.25rem; }
  .site-nav { justify-content: flex-start; gap: .65rem 1rem; }
  .hero { margin: -2.5rem -1.25rem 3rem; padding: 4.2rem 1.25rem; }
  .cards, .consultancy-projects, .video-grid, .list-grid, .form-grid { grid-template-columns: 1fr; }
}
