/* Include padding and borders in element widths. */
:root {
  color-scheme: dark;
  --background: #0b1120;
  --surface: #111c30;
  --text: #e6edf7;
  --muted: #a8b5c9;
  --border: #29364c;
  --accent: #8ab4ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--background);
}

a {
  color: var(--accent);
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

/* Keep content centred and readable on wide screens. */
header,
main,
footer {
  width: min(1100px, 90%);
  margin-inline: auto;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding-block: 1.5rem;
  border-bottom: 1px solid var(--border);
}

header > a {
  color: inherit;
  font-weight: 700;
  text-decoration: none;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

section {
  padding-block: 4rem;
}

#home {
  position: relative;
  isolation: isolate;
  padding-block: clamp(3rem, 7vw, 5.5rem);
}

/* A subtle wash of colour behind the introduction. */
#home::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(
    ellipse at 75% 35%,
    rgba(72, 124, 220, 0.14),
    transparent 65%
  );
}

h1,
h2,
h3 {
  line-height: 1.2;
}

h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  letter-spacing: -0.04em;
  margin: 0 0 1rem;
  overflow-wrap: break-word;
}

h2 {
  font-size: 2rem;
  margin: 0 0 2rem;
}

h3 {
  font-size: 1.25rem;
  margin: 0 0 1rem;
}

p {
  max-width: 65ch;
}

.button:hover {
  background: var(--text);
}

.eyebrow {
  margin: 0 0 1.5rem;
  color: #80d8cf;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-description {
  max-width: 52ch;
  margin: 1.5rem 0 2rem;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
}

.button-secondary {
  background: transparent;
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border);
}

.button-secondary:hover {
  background: var(--surface);
}

/* Three project columns on larger screens. */
/* Full-width project rows. */
.project-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.project-card {
  min-width: 0;
  padding: clamp(1.5rem, 4vw, 3rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.project-card h3 {
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
}

.project-card p {
  color: var(--muted);
}

.project-card > a {
  display: inline-block;
  margin-top: 1rem;
}

/* Fade the text area into the screenshot's background colour. */
.featured-project {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
  background: linear-gradient(
    110deg,
    var(--surface) 15%,
    #0e1117 65%
  );
}

.project-card .project-label {
  margin: 0 0 1rem;
  color: #80d8cf;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin-top: 1.75rem;
}

.project-preview {
  min-width: 0;
  margin: 0;
}

.project-preview img {
  display: block;
  width: 100%;
  max-width: 460px;
  height: auto;
  margin-inline: auto;
}

.project-preview figcaption {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.button {
  display: inline-block;
  padding: 0.75rem 1.25rem;
  border-radius: 6px;
  background: var(--accent);
  color: var(--background);
  font-weight: 600;
  text-decoration: none;
}

.back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem;
}

footer {
  padding-block: 2rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
}

/* Stack the projects on smaller screens. */
@media (max-width: 800px) {
  .project-grid {
    grid-template-columns: 1fr;
  }

  section {
    padding-block: 2.5rem;
  }
}

nav a {
  color: var(--muted);
  text-decoration: none;
}

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

.results-table {
  width: 100%;
  max-width: 700px;
  margin-block: 2rem;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.results-table caption {
  text-align: left;
  color: var(--muted);
  margin-bottom: 1rem;
}

.results-table th,
.results-table td {
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--border);
  text-align: right;
}

.results-table th:first-child {
  text-align: left;
}

.results-table thead {
  background: var(--surface);
}

details {
  max-width: 700px;
  margin-block: 1.5rem;
}

summary {
  color: var(--accent);
  cursor: pointer;
}

.featured-project {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 2.5rem;
  padding: clamp(1.25rem, 4vw, 2.5rem);
}

.featured-project h3 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.project-card .project-label {
  margin: 0 0 1rem;
  color: #80d8cf;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin-top: 1.75rem;
}

.project-preview {
  min-width: 0;
  margin: 0;
}

.project-preview img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.project-preview figcaption {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.button.button-secondary {
  background: transparent;
  color: var(--text);
}

.button.button-secondary:hover {
  background: var(--surface);
}

@media (max-width: 800px) {
  .featured-project {
    grid-template-columns: 1fr;
    background: linear-gradient(
      to bottom,
      var(--surface),
      #0e1117 65%
    );
  }
}

.project-preview img {
  border: none;
  border-radius: 0;
}

.beer-project {
  background: linear-gradient(110deg, var(--surface), #211b14);
}

.beer-project .project-label {
  color: #efbd75;
}

.beer-diagram {
  min-width: 0;
  margin: 0;
  text-align: center;
}

.beer-history {
  display: inline-block;
  padding: 0.65rem 1.25rem;
  border: 1px solid #705534;
  border-radius: 999px;
  color: #f4d4a5;
  background: #efbd7508;
}

.beer-paths {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.beer-path {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.beer-arrow {
  padding-block: 0.65rem;
  color: #efbd75;
  font-size: 1.5rem;
}

.beer-path-label {
  color: #efbd75;
  font-size: 0.75rem;
}

.beer-path > span:last-child {
  color: var(--muted);
  font-size: 0.8rem;
}

.beer-discovery {
  padding: 1rem;
  background: radial-gradient(
    ellipse at center,
    #efbd7515,
    transparent 70%
  );
}

.beer-glasses {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.beer-glasses span {
  width: 28px;
  height: 42px;
  border: 1px solid #efbd75;
  border-top: 6px solid #f5e6cc;
  border-radius: 3px 3px 8px 8px;
  background: linear-gradient(#e4a344, #a65f20);
  transform: rotate(-8deg);
}

.beer-glasses span:nth-child(2) {
  height: 52px;
  background: linear-gradient(#c78035, #653719);
  transform: none;
}

.beer-glasses span:nth-child(3) {
  background: linear-gradient(#f3cd73, #c58b32);
  transform: rotate(8deg);
}

.beer-diagram figcaption {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.8rem;
}

@media (max-width: 800px) {
  .beer-project {
    background: linear-gradient(to bottom, var(--surface), #211b14);
  }
}

.thesis-project {
  background: linear-gradient(110deg, var(--surface), #1c172b);
}

.thesis-project .project-label {
  color: #c4adff;
}

.thesis-diagram {
  min-width: 0;
  margin: 0;
  text-align: center;
}

.thesis-diagram .thesis-tools {
  margin: 0 0 1.5rem;
  color: #c4adff;
  font-size: 0.75rem;
}

.thesis-inputs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.thesis-inputs > div {
  min-width: 0;
  padding-inline: 4px;
}

.thesis-inputs span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  font-size: 0.7rem;
  color: var(--muted);
}

.thesis-inputs img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #c4adff30;
  border-radius: 8px;
}

.thesis-connectors {
  display: block;
  width: 100%;
  height: 48px;
  fill: none;
  stroke: #a78bda;
  stroke-width: 1.5;
}

.thesis-classifier {
  display: inline-flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.85rem 1.5rem;
  border: 1px solid #c4adff50;
  border-radius: 12px;
  background: #c4adff0a;
}

.thesis-classifier strong {
  color: #dfd2ff;
}

.thesis-classifier span,
.thesis-diagram figcaption {
  color: var(--muted);
  font-size: 0.75rem;
}

.thesis-diagram figcaption {
  margin-top: 1rem;
}

@media (max-width: 800px) {
  .thesis-project {
    background: linear-gradient(to bottom, var(--surface), #1c172b);
  }
}