/* ==========================================================================
   Styles for the home page and the work page.
   The CV has its own stylesheet in cv/cv.css.
   ========================================================================== */

/* ------------------------------- SETTINGS -------------------------------- */
:root {
  /* Colours (same as the CV) */
  --accent: #1f5a6b;
  --ink: #10181b;         /* headings */
  --text: #28343a;        /* body text */
  --muted: #5a676b;       /* dates, labels, secondary text */
  --rule: #d5dcde;        /* thin divider lines */

  /* Fonts (loaded in each page from Google Fonts) */
  --serif: "Newsreader", Georgia, serif;
  --sans: "Inter", "Helvetica Neue", Arial, sans-serif;

  /* Icons, from Heroicons (MIT licence), used by the ICONS section below */
  --icon-right: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M3 10a.75.75 0 01.75-.75h10.638L10.23 5.29a.75.75 0 111.04-1.08l5.5 5.25a.75.75 0 010 1.08l-5.5 5.25a.75.75 0 11-1.04-1.08l4.158-3.96H3.75A.75.75 0 013 10z'/%3E%3C/svg%3E");
  --icon-up-right: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M5.22 14.78a.75.75 0 001.06 0l7.22-7.22v5.69a.75.75 0 001.5 0v-7.5a.75.75 0 00-.75-.75h-7.5a.75.75 0 000 1.5h5.69l-7.22 7.22a.75.75 0 000 1.06z'/%3E%3C/svg%3E");
  --icon-star: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M10.868 2.884c-.321-.772-1.415-.772-1.736 0l-1.83 4.401-4.753.381c-.833.067-1.171 1.107-.536 1.651l3.62 3.102-1.106 4.637c-.194.813.691 1.456 1.405 1.02L10 15.591l4.069 2.485c.713.436 1.598-.207 1.404-1.02l-1.106-4.637 3.62-3.102c.635-.544.297-1.584-.536-1.65l-4.752-.382-1.831-4.401z'/%3E%3C/svg%3E");

  /* Layout */
  --column: 720px;        /* width of the text column */
  --side-label: 150px;    /* left column that holds company names and years */
}

/* --------------------------------- PAGE ---------------------------------- */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  border-top: 4px solid var(--accent);
  font: 400 17px / 1.6 var(--sans);
  color: var(--text);
  background: #fff;
}

.page {
  max-width: var(--column);
  margin: 0 auto;
  padding: 0 24px 96px;
}

a { color: inherit; }

/* ------------------------------ NAVIGATION ------------------------------- */
.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px 24px;
  padding: 26px 0;
  font-size: 15px;
}
.site-nav ul {
  display: flex;
  gap: 24px;
  margin-left: auto;      /* keeps the links on the right when there is no name */
  list-style: none;
}
.site-nav a {
  color: var(--muted);
  text-decoration: none;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] { color: var(--ink); }
.site-nav .site-name {
  font-weight: 600;
  color: var(--ink);
}

/* --------------------------------- INTRO --------------------------------- */
.intro { padding: 40px 0 8px; }

/* Photo and name side by side; the name drops below on a narrow phone. */
.identity {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
}

.photo {
  display: block;
  flex: none;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
}

h1 {
  font: 600 clamp(38px, 8vw, 54px) / 1.08 var(--serif);
  letter-spacing: -0.01em;
  color: var(--ink);
}

.lead {
  margin-top: 18px;
  font-size: clamp(19px, 2.8vw, 22px);
  line-height: 1.45;
  color: var(--ink);
}

.proof { margin-top: 14px; }

/* Buttons under the introduction */
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-top: 24px;
  font-size: 16px;
  font-weight: 500;
}
.button {
  padding: 10px 18px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: #fff;
  background: var(--accent);
  text-decoration: none;
}
.button:hover { background: #17485a; }
.button.secondary {
  color: var(--accent);
  background: #fff;
}
.button.secondary:hover { background: #eef3f4; }
.actions .ext {
  margin-left: 4px;
  color: var(--accent);
  text-decoration: none;
}
.actions .ext:hover { text-decoration: underline; }

/* Paragraphs of running text, as in the About section */
.prose p { margin-top: 16px; }
.prose h2 + p { margin-top: 20px; }

/* ------------------------------- SECTIONS -------------------------------- */
section { margin-top: 64px; }

/* Small uppercase section title, as in the CV */
h2 {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
  font: 500 12px / 1.6 var(--sans);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

/* A list of rows: label on the left, content on the right */
.rows { list-style: none; }
.rows > li {
  display: grid;
  grid-template-columns: var(--side-label) minmax(0, 1fr);
  column-gap: 24px;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
}
.rows .label {
  padding-top: 3px;
  font-size: 14px;
  color: var(--muted);
}
.rows h3 {
  font: 600 20px / 1.3 var(--serif);
  color: var(--ink);
}
.rows h3 a { text-decoration: none; }
.rows h3 a:hover { color: var(--accent); }
.rows p {
  margin-top: 4px;
  font-size: 16px;
}
.rows p a {
  color: var(--accent);
  text-decoration: none;
}
.rows p a:hover { text-decoration: underline; }
.rows.compact > li { padding: 12px 0; }
.rows.compact p {
  margin: 0;
  color: var(--ink);
}
.rows.compact .where { color: var(--muted); }

.more {
  display: inline-block;
  margin-top: 18px;
  font-size: 15px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
}
.more:hover { text-decoration: underline; }

/* -------------------------------- CONTACT -------------------------------- */
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  margin-top: 18px;
  list-style: none;
}
.links a {
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
}
.links a:hover { text-decoration: underline; }

/* ------------------------------- WORK PAGE ------------------------------- */
.case {
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
}
.case .label {
  font-size: 14px;
  color: var(--muted);
}
.case h2 {
  margin-top: 4px;
  padding: 0;
  border: 0;
  font: 600 clamp(24px, 4vw, 28px) / 1.2 var(--serif);
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
}
.case p { margin-top: 14px; }
.case ul {
  margin-top: 14px;
  list-style: none;
}
.case li {
  position: relative;
  padding-left: 18px;
}
.case li + li { margin-top: 6px; }
.case li::before {
  content: "";
  position: absolute;
  left: 0;
  top: calc((1lh - 5px) / 2);
  width: 5px;
  height: 5px;
  background: var(--accent);
}
.case .stack {
  font-size: 14px;
  color: var(--muted);
}
.case .links {
  margin-top: 14px;
  font-size: 15px;
}
.case .links li {
  margin: 0;
  padding: 0;
}
.case .links li::before { display: none; }

/* --------------------------------- ICONS --------------------------------- */
/* Add one of these classes to a link:
     go     arrow right, for a page of this site; slides right on hover
     ext    arrow up-right, for another website; lifts on hover
     stars  a star in front of a GitHub star count */
.go,
.ext { margin-right: 1.15em; }   /* room for the arrow */

.go::after,
.ext::after {
  content: "";
  position: absolute;            /* stays with the last word, never wraps alone */
  width: 0.8em;
  height: 0.8em;
  margin: calc((1lh - 0.8em) / 2 + 0.02em) 0 0 0.3em;
  background: currentColor;
  -webkit-mask: var(--icon-right) center / contain no-repeat;
  mask: var(--icon-right) center / contain no-repeat;
  transition: transform 0.15s ease;
}
.ext::after {
  -webkit-mask-image: var(--icon-up-right);
  mask-image: var(--icon-up-right);
}
.go:hover::after { transform: translateX(0.25em); }
.ext:hover::after { transform: translate(0.15em, -0.15em); }

.stars {
  white-space: nowrap;
  color: var(--muted) !important;
}
.stars::before {
  content: "";
  display: inline-block;
  width: 0.85em;
  height: 0.85em;
  margin-right: 0.3em;
  vertical-align: -0.08em;
  background: currentColor;
  -webkit-mask: var(--icon-star) center / contain no-repeat;
  mask: var(--icon-star) center / contain no-repeat;
}

@media (prefers-reduced-motion: reduce) {
  .go::after,
  .ext::after { transition: none; }
}

/* ------------------------------- PICTURES -------------------------------- */
figure { margin-top: 18px; }
figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  border-radius: 4px;
}
figcaption {
  margin-top: 8px;
  font-size: 14px;
  color: var(--muted);
}

/* -------------------------------- FOOTER --------------------------------- */
.site-footer {
  margin-top: 80px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  font-size: 14px;
  color: var(--muted);
}

/* -------------------------------- PHONES --------------------------------- */
@media (max-width: 600px) {
  body { font-size: 16px; }
  .intro { padding-top: 24px; }
  section { margin-top: 48px; }
  .rows > li { grid-template-columns: 1fr; }
  .rows .label { padding: 0 0 2px; }
}
