/* liamduero.info
   Display: Outfit (heavy geometric sans, uppercase). Text: Newsreader.
   Mobile-first; breakpoints at 40rem (640), 60rem (960), 80rem (1280). */

@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/outfit-latin-wght-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("fonts/newsreader-latin-wght-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Newsreader";
  font-style: italic;
  font-weight: 200 800;
  font-display: swap;
  src: url("fonts/newsreader-latin-wght-italic.woff2") format("woff2");
}

:root {
  --ink: #17252a;   /* text, headings, dark pill */
  --deep: #2b7a78;  /* links, hover, labels (on paper) */
  --teal: #3aafa9;  /* decorative only: rules, line motif, highlights. Never text. */
  --mist: #def2f1;  /* alternate section background, photo frame */
  --paper: #feffff; /* page background */

  --display: "Outfit", "Avenir Next", "Century Gothic", system-ui, sans-serif;
  --text: "Newsreader", Charter, "Iowan Old Style", Georgia, serif;

  --bar-h: 3.5rem;
  --maxw: 50rem;
  /* side padding: at least 1rem (or the device inset), growing to centre a --maxw column */
  --pad-l: max(1rem, env(safe-area-inset-left), calc((100% - var(--maxw)) / 2));
  --pad-r: max(1rem, env(safe-area-inset-right), calc((100% - var(--maxw)) / 2));
  --margin-col: 9.5rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--bar-h) + env(safe-area-inset-top) + 0.5rem);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.0625rem; /* 17px */
  line-height: 1.55;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
}

/* every full-width band shares the same side padding */
.hero,
.row,
.site-footer,
.topbar {
  padding-left: var(--pad-l);
  padding-right: var(--pad-r);
}

/* ---------- links ---------- */

a {
  color: var(--deep);
  text-decoration: underline;
  text-decoration-color: var(--teal);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.22em;
}
a:hover {
  text-decoration-color: var(--deep);
  text-decoration-thickness: 3px;
}
a:focus-visible {
  outline: 3px solid var(--deep);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- sticky top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: calc(var(--bar-h) + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
  background: var(--paper);
  border-bottom: 2px solid var(--teal);
  font-family: var(--display);
}
.topbar a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem; /* 44px */
  min-width: 2.75rem;
  text-decoration: none;
}
.brand {
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.topbar nav,
.topbar .actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.topbar .cv {
  justify-content: center;
  padding: 0 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--teal);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.3em;
  white-space: nowrap;
}
.topbar .pill {
  justify-content: center;
  padding: 0 1.125rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.topbar .pill:hover {
  background: var(--deep);
  color: var(--paper);
}

/* ---------- hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  padding-top: 2.25rem;
  padding-bottom: 1.25rem;
}

.portrait {
  margin: 0;
  width: 7.5rem;
}
.portrait img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  padding: 0.35rem;
  background: var(--mist);
  border: 1px solid var(--ink);
  box-shadow: 0.5rem 0.5rem 0 var(--teal);
}

h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.25rem, 12.4vw, 6rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.tagline {
  margin: 0.9rem 0 0;
  font-size: clamp(1.25rem, 4.2vw, 1.75rem);
  font-style: italic;
  line-height: 1.25;
}

.now {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin: 0.75rem 0 0;
  font-size: 0.9375rem;
  line-height: 1.4;
}
.now-label {
  flex: none;
  font-family: var(--display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--deep);
}

.bio {
  margin: 1.25rem 0 0;
  max-width: 34rem;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  font-family: var(--display);
  font-size: 0.9375rem;
  font-weight: 600;
}
.links a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  min-width: 2.75rem;
}

/* the stepped line: a thin teal staircase under the hero text (CSS only, no motion) */
.hero::after {
  content: "";
  grid-column: 1 / -1;
  display: block;
  height: 3rem;
  margin-top: 0.5rem;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 30' preserveAspectRatio='none'%3E%3Cpath d='M0 2H34V15H66V28H100' fill='none' stroke='%233AAFA9' stroke-width='4' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E")
    no-repeat center / 100% 100%;
}

/* ---------- sections ---------- */

.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.5rem;
  padding-top: 2.5rem;
  padding-bottom: 2.5rem;
  scroll-margin-top: calc(var(--bar-h) + env(safe-area-inset-top));
}
/* alternate bands: the map and Education sit on mist; Experience and Selected work (which has links) stay on paper */
main > .row:nth-child(even) {
  background: var(--mist);
}

.label {
  display: flex;
  align-items: center;
  align-self: start;
  gap: 0.6rem;
  margin: 0;
  font-family: var(--display);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--deep);
  line-height: 1.6;
}
.label::before {
  content: "";
  flex: none;
  width: 1.5rem;
  height: 3px;
  background: var(--teal);
}
/* --deep on --mist is 4.35:1, under AA for small text, so labels on mist use ink */
main > .row:nth-child(even) .label {
  color: var(--ink);
}

.body {
  max-width: 36rem;
}

.entries,
.work {
  margin: 0;
  padding: 0;
  list-style: none;
}
.entries > li + li {
  margin-top: 1.5rem;
}
.work > li + li {
  margin-top: 2rem;
}

.entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.15rem;
}
.entry strong,
.work h3 {
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.3;
}
.entry .role {
  font-style: italic;
}
.entry .meta {
  font-family: var(--display);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.work h3 {
  margin: 0 0 0.35rem;
}
.work h3 a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  margin-block: -0.6rem;
}
.work p {
  margin: 0;
}
.work .more {
  display: block;
  margin-top: 0.25rem;
  font-family: var(--display);
  font-size: 0.875rem;
  font-weight: 600;
}
.work .more a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
}

/* ---------- map: world -> Europe / Australia zoom (generated panels, see tools/map) ---------- */

.map {
  margin: 0;
}
.zoom {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}
/* each panel: a lazy-loaded land outline (<img>, reserves the aspect ratio) with the inline SVG overlaid on it */
.panel {
  position: relative;
  margin: 0;
}
.land {
  display: block;
  width: 100%;
  height: auto;
}
.pz {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
}

/* mobile: a short downward connector between stacked panels */
.zoom-v {
  position: relative;
  height: 2.25rem;
}
.zoom-v::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0.2rem;
  height: 1.3rem;
  border-left: 2px solid var(--teal);
  transform: translateX(-1px);
}
.zoom-v::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 0.95rem;
  width: 0.65rem;
  height: 0.65rem;
  border-right: 2px solid var(--teal);
  border-bottom: 2px solid var(--teal);
  transform: translateX(-50%) rotate(45deg);
}
.zoom-gap,
.zl {
  display: none;
}

.pz .frame {
  fill: none;
  stroke: var(--teal);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}
.pz .zbox {
  fill: none;
  stroke: var(--teal);
  stroke-width: 2;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.pz .zl {
  fill: none;
  stroke: var(--teal);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.pz .pin-work,
.pz .dot-work {
  fill: var(--deep);
}
.pz .pin-study,
.pz .dot-study {
  fill: var(--ink);
}
.pz .pin-remote {
  fill: none; /* hollow circle = work, remote */
  stroke: var(--deep);
  stroke-width: 3.5;
}
.pz .dot-work,
.pz .dot-study {
  stroke: var(--paper);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}
.pz .ring {
  fill: none;
  stroke: var(--teal);
  stroke-width: 4;
}
.pz text {
  fill: var(--ink);
  paint-order: stroke;
  stroke: var(--paper);
  stroke-width: 5px;
  stroke-linejoin: round;
}
.pz .c,
.pz .pt,
.pz .bl {
  font-family: var(--display);
  font-weight: 800;
}
.pz .d {
  display: none; /* institution lines: the list below carries them on small screens */
  font-family: var(--text);
}
.pz .e {
  text-anchor: end;
}
.pz .rm {
  display: inline; /* where institution lines are hidden, the city itself says "(remote)" */
}
/* font sizes are in each panel's own units, so they are tuned per panel to land at about 12-13px */
.pz-world .bl { font-size: 40px; }
.pz-eu .c, .pz-eu .pt { font-size: 28px; }
.pz-au .c, .pz-au .pt { font-size: 15px; }
.pz-au .pin-study { stroke: none; }
.map figcaption {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  font-style: italic;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
  font-family: var(--display);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.legend li,
.places li {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}
.places {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 1rem;
}
.places li + li {
  margin-top: 0.4rem;
}
.places strong {
  font-family: var(--display);
  font-weight: 700;
}

/* markers: shape carries the meaning as well as colour (circle = work, square = study) */
.mk {
  flex: none;
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  margin-left: 0.2rem;
  position: relative;
  top: 0.05rem;
}
.mk-work {
  background: var(--deep);
  border-radius: 50%;
}
.mk-study {
  background: var(--ink);
}
.mk-remote {
  box-sizing: border-box;
  border: 2px solid var(--deep);
  border-radius: 50%;
}
.mk-now {
  background: var(--deep);
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--teal);
  margin-right: 0.2rem;
}

/* ---------- footer / chess ---------- */

.site-footer {
  display: grid;
  gap: 0.5rem;
  padding-top: 2.5rem;
  padding-bottom: calc(2.5rem + env(safe-area-inset-bottom));
  border-top: 3px solid var(--teal);
}
.site-footer p {
  margin: 0;
}
.site-footer .links {
  margin-top: 0;
}
.chess {
  font-style: italic;
  max-width: 34rem;
}
.chess .move {
  font-family: var(--display);
  font-style: normal;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--deep);
  margin-right: 0.45em;
}
/* ratings strip: space is reserved so numbers arriving later never move anything */
.ratings {
  display: grid;
  margin-top: 0.25rem;
  font-family: var(--display);
  font-size: 0.875rem;
}
.rating-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  margin: 0;
}
.rating-row a {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  font-weight: 600;
}
.nums {
  min-height: 3em; /* two lines at 1.5, the most it can wrap to on a 320px screen */
  margin-top: -0.35rem;
  line-height: 1.5;
  font-weight: 500;
}
.rt {
  display: inline-block; /* gives the line a break opportunity between ratings */
  white-space: nowrap;
}
.rt:not(:last-child)::after {
  content: " \00b7";
  content: " \00b7" / "";
  margin-right: 0.35em;
}

.copyright {
  margin-top: 0.5rem;
  font-family: var(--display);
  font-size: 0.75rem;
  font-weight: 500;
}

/* ---------- 640px and up ---------- */

@media (min-width: 40rem) {
  body {
    font-size: 1.125rem;
  }
  .hero {
    padding-top: 3.5rem;
  }
  .portrait {
    width: 9rem;
  }
  .hero::after {
    height: 3.5rem;
  }
  .row {
    padding-top: 3rem;
    padding-bottom: 3rem;
  }
  .entry {
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 1.5rem;
    align-items: baseline;
  }
  .entry .meta {
    grid-column: 2;
    grid-row: 1;
    text-align: right;
    white-space: nowrap;
  }
  .body.wide {
    max-width: 42rem;
  }
  .zoom {
    grid-template-columns: minmax(0, 65fr) minmax(0, 33fr);
    column-gap: 2%;
  }
  .panel-world {
    grid-column: 1 / -1;
  }
  .zoom-v {
    display: none;
  }
  .zoom-gap {
    display: block;
    grid-column: 1 / -1;
    aspect-ratio: 1000 / 60; /* matches the connector strip drawn from the world panel */
  }
  .pz-world {
    overflow: visible;
  }
  .zl {
    display: inline;
  }
  .pz .d {
    display: inline;
  }
  .pz .rm {
    display: none;
  }
  .pz-world .bl { font-size: 18px; }
  .pz-eu .c, .pz-eu .pt, .pz-au .c, .pz-au .pt { font-size: 19px; }
  .pz .d { font-size: 18px; }
  .rating-row {
    grid-template-columns: 9rem minmax(0, 1fr);
    align-items: center;
  }
  .nums {
    min-height: 0;
    margin-top: 0;
  }
}

/* ---------- 960px and up: section labels move to the left margin ---------- */

@media (min-width: 60rem) {
  :root {
    --maxw: 58rem;
  }
  body {
    font-size: 1.1875rem;
  }
  .hero,
  .row,
  .site-footer {
    grid-template-columns: var(--margin-col) minmax(0, 1fr);
    column-gap: 2.5rem;
  }
  .hero {
    padding-top: 4.5rem;
    align-items: start;
  }
  .portrait {
    width: 100%;
    margin-top: 0.4rem;
  }
  .hero::after {
    height: 4rem;
  }
  .row {
    row-gap: 0;
  }
  .label {
    line-height: 1.9;
  }
  .site-footer > * {
    grid-column: 2;
  }
}

/* ---------- 1280px and up ---------- */

@media (min-width: 80rem) {
  :root {
    --maxw: 64rem;
    --margin-col: 11rem;
  }
  h1 {
    font-size: 7rem;
  }
  .body,
  .bio,
  .chess {
    max-width: 38rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    transition: none !important;
    animation: none !important;
  }
}

/* ---------- print ---------- */

@media print {
  :root {
    --pad-l: 0;
    --pad-r: 0;
  }
  html,
  body,
  main > .row:nth-child(even) {
    background: #fff;
  }
  body {
    color: #000;
    font-size: 11pt;
  }
  .topbar,
  .hero::after,
  .label::before {
    display: none;
  }
  a,
  .label,
  .chess .move {
    color: #000;
    text-decoration: none;
  }
  .label,
  main > .row:nth-child(even) .label {
    color: #000;
  }
  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    word-break: break-all;
  }
  .portrait img {
    box-shadow: none;
    background: #fff;
  }
  .row,
  .site-footer {
    break-inside: avoid;
    border-top: 1px solid #000;
  }
  .hero,
  .row,
  .site-footer {
    display: block;
    padding-left: 0;
    padding-right: 0;
  }
}
