/* roryhansen.com — one page, no build step, no third-party requests.
   Type is shared with rorz.net (self-hosted Newsreader + Libre Franklin, OFL). */

@font-face {
  font-family: 'Libre Franklin';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url(../fonts/libre-franklin-var.woff2) format('woff2');
}
@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/newsreader-400.woff2) format('woff2');
}
@font-face {
  font-family: 'Newsreader';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/newsreader-400-italic.woff2) format('woff2');
}

/* Colours are taken from the two illustrations: the dusk navy at the top of
   the sky, the cloud-lit peach, the leaf green and the glass teal. */
:root {
  --bg: #0b1428;
  --bg-2: #111d38;
  --line: rgba(196, 214, 255, 0.14);
  --fg: #f3f5fb;
  --fg-2: #c3cbe0;
  --muted: #8f9bbb;
  --peach: #ffc9a8;
  --sky: #8fb6ff;
  --leaf: #b6dc6a;

  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --sans: 'Libre Franklin', -apple-system, 'Segoe UI', Roboto, sans-serif;

  --col: 34rem;
  --gutter: 1.25rem;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font: 400 1rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

/* ---- Sky banner ------------------------------------------------------- */

.sky {
  position: relative;
  height: clamp(15rem, 44vw, 30rem);
  overflow: hidden;
}
.sky__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 45% 40%;
}
/* Fade the bottom of the city into the page colour. */
.sky::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 55%;
  background: linear-gradient(to bottom, rgba(11, 20, 40, 0) 0%, rgba(11, 20, 40, 0.55) 45%, var(--bg) 100%);
}

/* ---- Card ------------------------------------------------------------- */

.card {
  position: relative;
  width: 100%;
  max-width: calc(var(--col) + 2 * var(--gutter));
  margin: -5.5rem auto 0;
  padding: 0 var(--gutter);
  flex: 1;
}

.portrait {
  display: block;
  width: 8.75rem;
  height: 8.75rem;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--bg);
  box-shadow:
    0 0 0 2px var(--peach),
    0 18px 40px -12px rgba(0, 0, 0, 0.6);
}

.name {
  margin: 1.5rem 0 0.25rem;
  font: 400 clamp(2.5rem, 7vw, 3.25rem)/1.05 var(--serif);
  letter-spacing: -0.015em;
}

.tagline {
  margin: 0 0 0.75rem;
  max-width: 30rem;
  font: 400 1.0625rem/1.55 var(--sans);
  color: var(--fg-2);
}
.tagline--more {
  margin-bottom: 2.5rem;
  font-size: 0.9375rem;
  color: var(--muted);
}
.tagline em {
  font: italic 400 1.1875rem/1.4 var(--serif);
  color: var(--peach);
}

/* ---- Links ------------------------------------------------------------ */

.links {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.link {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    'title arrow'
    'desc  arrow';
  align-items: center;
  column-gap: 1rem;
  padding: 1.05rem 0.25rem;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
  transition: background-color 160ms ease, padding 160ms ease;
}
.link__title {
  grid-area: title;
  font: 400 1.375rem/1.25 var(--serif);
}
.link__desc {
  grid-area: desc;
  font-size: 0.875rem;
  color: var(--muted);
}
.link__arrow {
  grid-area: arrow;
  font-size: 1.25rem;
  color: var(--muted);
  transition: transform 160ms ease, color 160ms ease;
}

.link:hover,
.link:focus-visible {
  background: linear-gradient(90deg, rgba(143, 182, 255, 0.08), rgba(143, 182, 255, 0));
  padding-left: 0.75rem;
}
.link:hover .link__title,
.link:focus-visible .link__title { color: var(--sky); }
.link:hover .link__arrow,
.link:focus-visible .link__arrow {
  color: var(--leaf);
  transform: translateX(4px);
}
.link:focus-visible {
  outline: 2px solid var(--sky);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---- Footer ----------------------------------------------------------- */

.footer {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: calc(var(--col) + 2 * var(--gutter));
  margin: 4rem auto 0;
  padding: 1.25rem var(--gutter) 2rem;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

@media (max-width: 480px) {
  :root { --gutter: 1rem; }
  .card { margin-top: -4.5rem; }
  .portrait { width: 7.5rem; height: 7.5rem; }
  .link__title { font-size: 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  .link, .link__arrow { transition: none; }
}
