/* Finn Murray, v3. Minimal: white paper, black type, one typeface family plus a mono for dates.
   Motion carries the personality: rising headings, word-by-word intro, reveals on scroll. Light mode only. */

:root {
  --paper: #ffffff;
  --ink: #0b0b0b;
  --graphite: #6a6a6a;
  --rule: #e7e7e7;

  --sans: "Schibsted Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --gutter: max(16px, 3vw);
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);

  color-scheme: light only;
}

/* ---------- Base ---------- */

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p,
ul,
dl,
dd {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

::selection {
  background: var(--ink);
  color: var(--paper);
}

.wrap {
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}

/* every layout row sits on the same 12-column grid */
.top,
.hero-body,
.sec-head,
.entry,
.skills > div {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 16px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 10;
  padding: 8px 12px;
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
}

.skip:focus {
  top: 12px;
}

/* text links: the underline draws in from the left */
:is(.top-name, .top-nav a, .hero-foot a, .contact-links a, .foot a) {
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size 0.35s var(--ease);
}

:is(.top-name, .top-nav a, .hero-foot a, .contact-links a, .foot a):is(:hover, :focus-visible) {
  background-size: 100% 1px;
}

/* the ↗ on external links nudges toward where it goes */
.arr {
  display: inline-block;
  transition: transform 0.3s var(--ease);
}

a:hover .arr {
  transform: translate(2px, -2px);
}

/* ---------- Header: three tiny text blocks, like a title page ---------- */

.top {
  padding-top: max(20px, env(safe-area-inset-top, 0px));
  font-size: 12px;
  line-height: 1.35;
  font-weight: 500;
}

.top-name {
  grid-column: 1 / 4;
  align-self: start;
  font-weight: 700;
}

.top-mid {
  grid-column: 5 / 9;
  color: var(--graphite);
}

.top-nav {
  grid-column: 10 / 13;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* ---------- Compact bar (after the hero scrolls away) ---------- */

.mini {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 48px;
  padding-top: env(safe-area-inset-top, 0px);
  font-size: 12px;
  font-weight: 500;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  -webkit-backdrop-filter: saturate(1.2) blur(10px);
  backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid var(--rule);
  transform: translateY(-100%);
  visibility: hidden;
  transition: transform 0.45s var(--ease), visibility 0s linear 0.45s;
}

.mini.on {
  transform: none;
  visibility: visible;
  transition: transform 0.45s var(--ease);
}

.mini-name {
  font-weight: 700;
}

.mini-nav {
  display: flex;
  gap: 22px;
}

.mini-nav a {
  position: relative;
  color: var(--graphite);
  transition: color 0.2s ease;
}

.mini-nav a:hover,
.mini-nav a.on {
  color: var(--ink);
}

/* the underline slides in under whichever section you're reading */
.mini-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 1.5px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.35s var(--ease);
}

.mini-nav a.on::after {
  transform: scaleX(1);
}

/* ---------- Hero ---------- */

.hero {
  min-height: calc(100svh - 92px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-top: clamp(56px, 12vh, 140px);
}

.hero-body {
  margin-block: auto;
}

.hero-title {
  grid-column: 3 / 13;
  margin-left: -0.04em;
  font-size: clamp(76px, 16.5vw, 268px);
  font-weight: 900;
  line-height: 0.84;
  letter-spacing: -0.055em;
  text-transform: uppercase;
}

/* each line rises out of its own mask */
.ln {
  display: block;
  overflow: hidden;
  padding-bottom: 0.02em;
}

.ln > span {
  display: block;
  animation: rise 1s var(--ease) both;
}

.ln + .ln > span {
  animation-delay: 0.09s;
}

.hero-lede {
  grid-column: 3 / 8;
  max-width: 34ch;
  margin-top: clamp(24px, 3.2vw, 44px);
  font-size: clamp(16px, 1.3vw, 19px);
  line-height: 1.42;
  font-weight: 500;
  letter-spacing: -0.01em;
  animation: fade 0.9s var(--ease) 0.35s both;
}

/* set by site.js: the sentence arrives word by word, each sharpening out of a blur */
.hero-lede.words {
  animation: none;
}

.hero-lede.words .w {
  display: inline-block;
  animation: word 0.8s var(--ease) both;
  animation-delay: calc(0.5s + var(--i) * 40ms);
}

.hero-foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 48px;
  font-size: 12px;
  font-weight: 500;
  color: var(--graphite);
}

.hero-foot a {
  color: var(--ink);
}

.cue {
  display: inline-block;
  animation: bob 2.4s ease-in-out 1.6s infinite;
}

/* ---------- Sections ---------- */

/* the gap between sections comes only from this padding, so every gap matches */
.sec {
  padding-top: clamp(60px, 7.5vw, 112px);
}

.sec-head {
  align-items: end;
  margin-bottom: clamp(40px, 6vw, 88px);
  padding-top: 16px;
  border-top: 1px solid var(--ink);
}

.sec-title {
  grid-column: 1 / 8;
  font-size: clamp(44px, 7.4vw, 120px);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.05em;
  /* mask for the rise-in; padding keeps descenders (the p in Leadership) unclipped */
  overflow: hidden;
  padding-bottom: 0.14em;
  margin-bottom: -0.14em;
}

.sec-title > span {
  display: inline-block;
}

.sec-note {
  grid-column: 8 / 13;
  max-width: 40ch;
  padding-bottom: 0.4em;
  font-size: 14px;
  line-height: 1.45;
  color: var(--graphite);
  text-wrap: pretty;
}

/* ---------- Entries ---------- */

.entry {
  row-gap: 12px;
  scroll-margin-top: 72px;
}

.entry + .entry {
  margin-top: clamp(40px, 5vw, 64px);
  padding-top: clamp(20px, 2vw, 28px);
  border-top: 1px solid var(--rule);
}

.entry-when {
  grid-column: 1 / 4;
  padding-top: 0.5em;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--graphite);
}

.entry-who {
  grid-column: 4 / 8;
}

.entry-who h3 {
  font-size: clamp(22px, 2.1vw, 30px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.entry-who p {
  margin-top: 6px;
  font-size: 15px;
  font-weight: 500;
}

.entry-who .entry-where {
  margin-top: 2px;
  font-weight: 400;
  color: var(--graphite);
}

.entry-what {
  grid-column: 8 / 13;
  padding-top: 0.3em;
  font-size: 15px;
}

.entry-what li {
  position: relative;
  padding-left: 18px;
}

.entry-what li + li {
  margin-top: 10px;
}

.entry-what li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.68em;
  width: 8px;
  height: 1.5px;
  background: var(--ink);
}

/* ---------- Skills ---------- */

.skills > div + div {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
}

.skills dt {
  grid-column: 1 / 4;
  padding-top: 0.25em;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--graphite);
}

.skills dd {
  grid-column: 4 / 13;
  font-size: clamp(18px, 1.7vw, 24px);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.015em;
}

/* the photography link reads as a highlighted word; it inverts on hover */
.mark {
  padding: 0 0.18em;
  margin: 0 -0.04em;
  border-radius: 3px;
  background: #e9e9e9;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.mark:is(:hover, :focus-visible) {
  background: var(--ink);
  color: var(--paper);
}

/* ---------- Contact ---------- */

.contact-mail {
  display: inline-block;
  max-width: 100%;
  padding-bottom: 0.08em;
  font-size: clamp(22px, 3.4vw, 52px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;
  background: linear-gradient(var(--ink), var(--ink)) left bottom / 0 2px no-repeat;
  transition: background-size 0.5s var(--ease);
}

.contact-mail:is(:hover, :focus-visible) {
  background-size: 100% 2px;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 28px;
  margin-top: clamp(28px, 4vw, 48px);
  font-size: 15px;
  font-weight: 500;
}

/* copy: a small pill, the one control on the page that looks like a control */
.copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px 5px 9px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--paper);
  font: inherit;
  font-size: 13px;
  line-height: 1.2;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.copy:hover,
.copy.done {
  border-color: var(--ink);
}

.ico {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ico-done,
.copy.done .ico-copy {
  display: none;
}

.copy.done .ico-done {
  display: block;
}

.copy.done :is(.ico-done, .lbl) {
  animation: pop 0.35s var(--ease);
}

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

.foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: clamp(96px, 12vw, 180px);
  padding-top: 16px;
  padding-bottom: max(20px, env(safe-area-inset-bottom, 0px));
  font-size: 12px;
  font-weight: 500;
  color: var(--graphite);
}

.foot a {
  color: var(--ink);
}

/* ---------- Scroll reveals (site.js adds .reveal to <html>, then .in per element) ---------- */

.reveal .sec-title > span {
  transform: translateY(110%);
  transition: transform 0.9s var(--ease);
}

.reveal .sec-title.in > span {
  transform: none;
}

.reveal :is(.sec-note, .entry > *, .skills > div, .contact-mail, .contact-links) {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.reveal .sec-note {
  transition-delay: 0.15s;
}

.reveal .entry > :nth-child(2) {
  transition-delay: 0.08s;
}

.reveal .entry > :nth-child(3) {
  transition-delay: 0.16s;
}

.reveal .contact-links {
  transition-delay: 0.2s;
}

.reveal :is(.sec-note.in, .entry.in > *, .skills > div.in, .contact-mail.in, .contact-links.in) {
  opacity: 1;
  transform: none;
}

/* caught mid fast-scroll: appear at once instead of animating */
.reveal .now,
.reveal .now > * {
  transition: none !important;
}

/* ---------- Keyframes ---------- */

@keyframes rise {
  from {
    transform: translateY(104%);
  }
}

@keyframes fade {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@keyframes word {
  from {
    opacity: 0;
    filter: blur(8px);
    transform: translateY(6px);
  }
}

@keyframes bob {
  50% {
    transform: translateY(3px);
  }
}

@keyframes pop {
  from {
    opacity: 0.2;
    transform: translateY(4px);
  }
}

/* ---------- Tablet ---------- */

@media (max-width: 960px) {
  .hero-title,
  .sec-title,
  .entry-when,
  .skills dt,
  .skills dd {
    grid-column: 1 / 13;
  }
  .hero-lede {
    grid-column: 1 / 10;
  }
  .sec-note {
    grid-column: 1 / 13;
    margin-top: 16px;
  }
  .entry-when {
    padding-top: 0;
  }
  .entry-who {
    grid-column: 1 / 6;
  }
  .entry-what {
    grid-column: 6 / 13;
  }
  .skills dt {
    padding-bottom: 6px;
  }
}

/* ---------- Phone ---------- */

@media (max-width: 640px) {
  .top {
    grid-template-columns: 1fr auto;
  }
  .top-name {
    grid-column: 1;
  }
  .top-mid {
    display: none;
  }
  .top-nav {
    grid-column: 2;
    align-items: flex-end;
  }
  .mini-nav a:not([href="#contact"]) {
    display: none;
  }
  .hero {
    min-height: calc(100svh - 110px);
  }
  /* "MURRAY" is about 4.25em wide; size it to fill the column exactly */
  .hero-title {
    margin-left: 0;
    font-size: calc((100vw - 2 * var(--gutter)) / 4.35);
    letter-spacing: -0.06em;
  }
  .hero-lede,
  .entry-who,
  .entry-what {
    grid-column: 1 / 13;
  }
  .entry-what {
    padding-top: 4px;
  }
}

/* ---------- Reduced motion: everything lands in its final state at once ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
}

/* ---------- Print / save as PDF: a clean, paged version of the same page ---------- */

@media print {
  @page {
    margin: 14mm;
  }
  body {
    font-size: 10.5pt;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .skip,
  .mini,
  .top-nav,
  .hero-foot,
  .copy,
  .foot a {
    display: none !important;
  }
  .wrap {
    padding-left: 0;
    padding-right: 0;
  }
  .reveal *,
  .ln > span,
  .hero-lede {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
  }
  .hero {
    min-height: 0;
    padding-top: 18pt;
  }
  .hero-title {
    grid-column: 1 / 13;
    font-size: 58pt;
  }
  .hero-lede {
    grid-column: 1 / 10;
    margin-top: 10pt;
    font-size: 11pt;
  }
  .sec {
    padding-top: 22pt;
  }
  .sec-head {
    margin-bottom: 12pt;
    break-after: avoid;
  }
  .sec-title {
    font-size: 26pt;
    overflow: visible;
  }
  .entry,
  .skills > div,
  .contact {
    break-inside: avoid;
  }
  .entry + .entry {
    margin-top: 10pt;
  }
  .contact-mail {
    font-size: 16pt;
  }
  .contact-links {
    margin-top: 8pt;
  }
  :is(.skills, .contact-links) a[href^="http"]::after {
    content: " " attr(href);
    font-size: 8.5pt;
    color: var(--graphite);
  }
  .foot {
    margin-top: 18pt;
  }
}
