/* =========================================================
   Matthew Freriks portfolio styles
   Colours are taken from the Gram stain photo:
   crystal violet, safranin pink, and the white of a glass slide.
   Change a colour here and it updates everywhere.
   ========================================================= */
:root {
  --ink: #1e1630;        /* deep violet-black: hero background, headings */
  --violet: #5b3b8c;     /* crystal violet: links, accents */
  --safranin: #b8386e;   /* safranin pink: "in progress" marker, used sparingly */
  --glass: #f6f5fa;      /* cool white: page background */
  --text: #2b2638;       /* body text */
  --muted: #5e5870;      /* dates and secondary text */
  --line: #dcd8e6;       /* borders and the timeline line */

  /* FONTS
     Current pair: IBM Plex Serif (headings) + IBM Plex Sans (body).
     To switch, change the two lines below AND the Google Fonts <link> in every .html page.
       Option B: "Fraunces" + "Source Sans 3"   (warmer, more bookish)
       Option C: "Space Grotesk" + "Inter"       (modern and technical)
     Get the <link> line for any font at fonts.google.com */
  --heading-font: "IBM Plex Serif", Georgia, serif;
  --body-font: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--glass);
  color: var(--text);
  font-family: var(--body-font);
  font-size: 1.0625rem;   /* 17px */
  line-height: 1.6;
}

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

a { color: var(--violet); text-underline-offset: 3px; }
a:hover { color: var(--safranin); }

/* Visible outline for keyboard users */
a:focus-visible {
  outline: 3px solid var(--safranin);
  outline-offset: 3px;
  border-radius: 2px;
}

h1, h2, h3 {
  font-family: var(--heading-font);
  color: var(--ink);
  line-height: 1.15;
  margin: 0;
}

/* ---------- Hero ---------- */
.hero {
  background: var(--ink);
  color: #eeeaf6;
  padding: 1.5rem 1.5rem 4.5rem;
}

.hero-inner {
  max-width: 1040px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.hero h1 {
  color: #fff;
  font-size: clamp(2.6rem, 6vw, 4.5rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.pitch {
  font-size: 1.25rem;
  max-width: 32ch;
  margin: 1.25rem 0 2rem;
  color: #d9d3e8;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
}

.hero-links a { color: #fff; font-weight: 600; }
.hero-links a:hover { color: #f2b6cf; }

.button {
  background: var(--safranin);
  padding: 0.7rem 1.3rem;
  border-radius: 999px;
  text-decoration: none;
}
.hero-links .button:hover { background: #cf4a83; color: #fff; }

/* The microscope image: a circle with a dark ring, like looking down an eyepiece */
.field { margin: 0; justify-self: center; max-width: 420px; width: 100%; }

.field img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  box-shadow:
    0 0 0 10px #120c1e,
    0 0 0 11px #3a2f52;
}

.field figcaption {
  margin-top: 1.5rem;
  font-size: 0.875rem;
  color: #b3abc6;
  text-align: center;
}

/* ---------- Main content ---------- */
main {
  max-width: 760px;
  margin: 0 auto;
  padding: 1rem 1.5rem 3rem;
}

main section { padding-top: 3.5rem; }

main h2 {
  font-size: 1.9rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

main h3 {
  font-size: 1.25rem;
  font-weight: 500;
}

main p { margin: 0 0 1rem; max-width: 68ch; }

/* ---------- Projects ---------- */
.project {
  position: relative;
  padding: 0 0 1.75rem 1.75rem;
}

/* The coloured dot before each project shows its status */
.project::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45rem;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
}
.project[data-status="done"]::before { background: var(--violet); }
.project[data-status="progress"]::before { background: var(--safranin); }
.project[data-status="planned"]::before { border: 2px solid var(--violet); }

.project .status {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0.2rem 0 0.5rem;
}

/* ---------- Experience timeline ---------- */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 1.75rem;
  border-left: 2px solid var(--line);
}

.timeline > li { position: relative; padding-bottom: 2rem; }

.timeline > li::before {
  content: "";
  position: absolute;
  left: calc(-1.75rem - 7px);
  top: 0.35rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--violet);
  border: 2px solid var(--glass);
}

.role { margin-top: 1rem; }

.role-title {
  font-weight: 600;
  margin: 0 0 0.25rem;
}

.dates {
  display: block;
  font-weight: 400;
  font-size: 0.9rem;
  color: var(--muted);
}

.role ul { margin: 0.4rem 0 0; padding-left: 1.2rem; }
.role li { margin-bottom: 0.3rem; }

/* ---------- Simple two-line lists (community, skills) ---------- */
.plain-list { margin: 0; }
.plain-list dt { font-weight: 600; margin-top: 1rem; }
.plain-list dt:first-child { margin-top: 0; }
.plain-list dd { margin: 0.1rem 0 0; color: var(--muted); }

/* ---------- Site navigation (top of every page) ---------- */
.site-nav {
  max-width: 1040px;
  margin: 0 auto 2.5rem;
  display: flex;
  justify-content: flex-end;
  gap: 1.5rem;
}
.site-nav a { color: #d9d3e8; text-decoration: none; font-weight: 600; }
.site-nav a:hover { color: #fff; }
.site-nav a[aria-current="page"] { color: #fff; border-bottom: 2px solid var(--safranin); }

/* ---------- Shorter header for inner pages ---------- */
.page-header {
  background: var(--ink);
  color: #d9d3e8;
  padding: 2rem 1.5rem 3rem;
}
.page-header-inner { max-width: 760px; margin: 0 auto; padding: 0 1.5rem; }
.page-header h1 { color: #fff; font-size: clamp(2rem, 5vw, 3rem); font-weight: 600; }
.page-header p { margin: 0.75rem 0 0; font-size: 1.15rem; }

/* ---------- "Next page" link box on the homepage ---------- */
.next-page {
  display: block;
  border: 1px solid var(--line);
  border-left: 4px solid var(--violet);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  background: #fff;
  text-decoration: none;
  color: var(--text);
}
.next-page:hover { border-left-color: var(--safranin); }
.next-label { display: block; font-family: var(--heading-font); font-size: 1.3rem; color: var(--ink); font-weight: 600; }
.next-desc { display: block; color: var(--muted); margin-top: 0.25rem; }

/* ---------- Skills in bordered boxes ---------- */
.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}
.skill-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  background: #fff;
}
.skill-box h3 { font-size: 1.1rem; margin-bottom: 0.4rem; }
.skill-box p { margin: 0; color: var(--muted); }

/* ---------- Embedded video ---------- */
.video {
  aspect-ratio: 16 / 9;
  margin: 0.5rem 0 1.5rem;
  border-radius: 8px;
  overflow: hidden;
  background: var(--ink);
}
.video iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ---------- Lab gallery ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
}
.gallery figure { margin: 0; }
.gallery img { border-radius: 6px; aspect-ratio: 1; object-fit: cover; width: 100%; }
.gallery figcaption { font-size: 0.875rem; color: var(--muted); margin-top: 0.5rem; }

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--line);
  max-width: 760px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}
footer p { margin: 0 0 0.5rem; }
.small { font-size: 0.85rem; color: var(--muted); }

/* ---------- Phones and narrow screens ---------- */
@media (max-width: 760px) {
  .hero { padding: 1.5rem 1.25rem 3rem; }
  .site-nav { justify-content: flex-start; margin-bottom: 2rem; }
  .page-header-inner { padding: 0; }
  .hero-inner { grid-template-columns: 1fr; gap: 2.5rem; }
  .field { max-width: 300px; }
}

/* Respect people who turn off animations */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ---------- Photo "veneer" behind the lab page header ----------
   The gradient sits on top of the photo so the white text stays readable.
   Raise the 0.82 values for a darker veneer, lower them to show more of the photo. */
.page-header.lab-bg {
  background:
    linear-gradient(rgba(30, 22, 48, 0.82), rgba(30, 22, 48, 0.82)),
    url("/images/lab-header.jpg") center / cover no-repeat;
}

/* ---------- Site footer with platform buttons ----------
   Replaces the old plain footer styles above */
.site-footer {
  background: var(--ink);
  color: #d9d3e8;
  margin-top: 4rem;
  padding: 3rem 1.5rem calc(2.5rem + env(safe-area-inset-bottom, 0px));
  max-width: none;
  border-top: 0;
}
.footer-inner { max-width: 760px; margin: 0 auto; padding: 0 1.5rem; }
@media (max-width: 760px) { .footer-inner { padding: 0; } }
.footer-title {
  font-family: var(--heading-font);
  font-size: 1.75rem;
  font-weight: 600;
  color: #fff;
  margin: 0 0 0.4rem;
}
.footer-text { margin: 0 0 1.5rem; }

.footer-buttons { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 2rem; }

.pill {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  border: 1.5px solid #4a3d66;
  border-radius: 999px;
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.15s, background-color 0.15s;
}
.pill:hover { border-color: #f2b6cf; background: rgba(255, 255, 255, 0.06); color: #fff; }
.pill-primary { background: var(--safranin); border-color: var(--safranin); }
.pill-primary:hover { background: #cf4a83; border-color: #cf4a83; }

.footer-small { font-size: 0.85rem; color: #a59cbb; margin: 0 0 0.25rem; }

/* ---------- Blog list ---------- */
.post-list { list-style: none; margin: 0; padding: 0; }
.post-list li { padding: 1.5rem 0; border-bottom: 1px solid var(--line); }
.post-list li:first-child { padding-top: 0; }
.post-list h2 { font-size: 1.5rem; margin: 0.2rem 0 0.4rem; }
.post-list h2 a { color: var(--ink); text-decoration: none; }
.post-list h2 a:hover { color: var(--violet); text-decoration: underline; }
.post-list p { margin: 0; color: var(--muted); }
.post-date { font-size: 0.9rem; color: var(--muted); margin: 0; }
.page-header .post-date { color: #b3abc6; margin-bottom: 0.5rem; }

/* ---------- A single blog post ---------- */
.post-body { padding-top: 3rem; font-size: 1.125rem; }
.post-body h2 { font-size: 1.6rem; margin: 2.5rem 0 1rem; }
.post-body h3 { font-size: 1.25rem; margin: 2rem 0 0.75rem; }
.post-body img { border-radius: 6px; margin: 1.5rem 0; }
.post-body blockquote {
  margin: 1.5rem 0;
  padding-left: 1.25rem;
  border-left: 3px solid var(--violet);
  font-family: var(--heading-font);
  font-style: italic;
}
.back-link { margin-top: 3rem; }

/* ---------- 404 page ---------- */
.lost-links { padding-left: 1.2rem; }
.lost-links li { margin-bottom: 0.4rem; font-size: 1.1rem; }

/* ---------- Basic to Brilliant logo on the blog page ---------- */
.blog-brand { display: flex; align-items: center; gap: 1.5rem; }
.blog-brand img { width: 96px; height: 96px; border-radius: 12px; flex-shrink: 0; }
.post-list h3 { font-size: 1.4rem; margin: 0.2rem 0 0.4rem; }
.post-list h3 a { color: var(--ink); text-decoration: none; }
.post-list h3 a:hover { color: var(--violet); text-decoration: underline; }
@media (max-width: 480px) { .blog-brand { flex-direction: column; align-items: flex-start; gap: 1rem; } }

/* ---------- Projects ---------- */
.project h3 a { color: var(--ink); text-decoration: none; }
.project h3 a:hover { color: var(--violet); text-decoration: underline; }

/* Status label at the top of a project page */
.project-status-tag {
  display: inline-block;
  margin: 0 0 0.75rem !important;
  padding: 0.2rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem !important;
  font-weight: 600;
  color: #fff;
  border: 1.5px solid #8b7fb0;
}
.project-status-tag[data-status="progress"] { background: var(--safranin); border-color: var(--safranin); }
.project-status-tag[data-status="done"] { background: var(--violet); border-color: var(--violet); }

/* Quick facts box on project pages */
.project-facts {
  margin-top: 2.5rem;
  padding: 1rem 1.25rem !important;
  border: 1px solid var(--line);
  border-left: 4px solid var(--violet);
  border-radius: 8px;
  background: #fff;
}
.project-facts p { margin: 0 0 0.5rem; }
.project-facts p:last-child { margin-bottom: 0; }
.project-links { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.pill-light {
  display: inline-block;
  padding: 0.35rem 0.9rem;
  border: 1.5px solid var(--violet);
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
}
.pill-light:hover { background: var(--violet); color: #fff; }
.project-facts + .post-body { padding-top: 1.5rem; }


/* ---------- "Used in" project links in skill boxes ---------- */
.used-in {
  margin-top: 0.75rem !important;
  padding-top: 0.6rem;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
}
.used-in span { font-weight: 600; color: var(--ink); }


/* ---------- Code blocks on project pages and posts ---------- */
.post-body pre,
.post-body .highlight pre {
  background: #1e1630;
  color: #eeeaf6;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  overflow-x: auto;              /* long lines scroll instead of breaking the layout */
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 1.25rem 0;
}
.post-body code {
  font-family: "IBM Plex Mono", Consolas, "Courier New", monospace;
}
/* Inline code in a sentence */
.post-body p code, .post-body li code {
  background: #ece9f3;
  color: var(--ink);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.9em;
}
/* Syntax colours (Jekyll's built-in highlighter) */
.highlight .c, .highlight .c1, .highlight .cm { color: #9d93b5; font-style: italic; } /* comments */
.highlight .k, .highlight .kd, .highlight .kn { color: #f2b6cf; }                     /* keywords */
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sa { color: #b8e6c9; }     /* strings */
.highlight .mi, .highlight .mf { color: #ffd59e; }                                    /* numbers */
.highlight .nf, .highlight .nb { color: #a8c8ff; }                                    /* functions */

/* ---------- Image rows on project pages ---------- */
.img-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.img-row figure { margin: 0; }
.img-row img { width: 100%; border-radius: 6px; margin: 0; aspect-ratio: 3 / 4; object-fit: cover; background: var(--ink); }
.img-row figcaption { font-size: 0.85rem; color: var(--muted); margin-top: 0.4rem; }
/* Dashboard screenshots are landscape, so don't force them into portrait */
.img-row img[src*="dashboard"] { aspect-ratio: auto; object-fit: contain; }