/* seanmcmahon.dev: paper and ink, with an optional blueprint (cyanotype) print. */

@font-face { font-family: "IM Fell English"; src: url("fonts/fell-roman.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IM Fell English"; src: url("fonts/fell-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("fonts/barlow-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("fonts/barlow-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("fonts/barlow-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }

:root {
  --paper: #ECEAE3;      /* laid paper */
  --ink: #1D2330;        /* iron-gall blue-black */
  --ink-soft: #464C57;
  --root: #4A3726;       /* aged ink, for everything below ground */
  --soil-1: #E2D9C9;
  --soil-2: #D5C7AD;
  --accent: #245A4E;     /* verdigris: links and focus only */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .11 0 0 0 0 .13 0 0 0 0 .18 0 0 0 .16 -.04'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --serif: "IM Fell English", Georgia, "Times New Roman", serif;
  --sans: "Barlow", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}

:root[data-theme="blueprint"] {
  --paper: #1F4670;
  --ink: #EEF3F7;
  --ink-soft: #BCCDDD;
  --root: #DCE7F1;
  --soil-1: #1B3E64;
  --soil-2: #153356;
  --accent: #F3DA8E;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .93 0 0 0 0 .96 0 0 0 0 1 0 0 0 .12 -.03'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--soil-2);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-color: var(--ink-soft) var(--paper);
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--grain), var(--paper);
  font: 400 18px/1.6 var(--sans);
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1.5px;
  text-decoration-color: var(--accent);
  text-underline-offset: 0.22em;
}
a:hover { color: var(--accent); }

::selection { color: var(--paper); background: var(--ink); }

section[id] { scroll-margin-top: 28px; }
section[tabindex="-1"]:focus { outline: none; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.sr-only, .summary {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: normal;
}

.skip {
  position: absolute;
  left: 16px; top: -64px;
  z-index: 10;
  padding: 8px 14px;
  background: var(--paper);
  border: 1.5px solid var(--ink);
}
.skip:focus { top: 16px; }

/* ---------- Top bar ---------- */

.topbar {
  position: absolute;
  top: 0; right: 0; left: 0;
  z-index: 5;
  display: flex;
  justify-content: flex-end;
  padding: max(14px, env(safe-area-inset-top)) max(32px, env(safe-area-inset-right)) 14px max(32px, env(safe-area-inset-left));
  pointer-events: none;
}
.topbar nav {
  display: flex;
  gap: 22px;
  align-items: center;
  pointer-events: auto;
  font: 500 15px/1 var(--sans);
}
.topbar a,
.topbar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 3px;
}
.topbar a { text-decoration-thickness: 1px; }
.topbar button {
  font: inherit;
  color: var(--ink-soft);
  background: none;
  border: 0;
  cursor: pointer;
  text-decoration: underline dotted 1px;
  text-underline-offset: 0.22em;
}
.topbar button:hover { color: var(--accent); }
.topbar button[aria-pressed="true"] { color: var(--ink); text-decoration-style: solid; text-decoration-color: var(--accent); }

/* ---------- Hero: the tree ---------- */

.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 720px;
  overflow: hidden;
}
.hero canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: pan-y pinch-zoom;
}

.caption {
  position: absolute;
  left: 50%;
  bottom: max(28px, 5svh);
  transform: translateX(-50%);
  width: max-content;
  max-width: min(calc(100% - 32px), 44em);
  text-align: center;
  pointer-events: auto;
}
.caption h1 {
  margin: 0;
  font: 400 clamp(44px, 6.4vw, 74px)/1 var(--serif);
  letter-spacing: -0.012em;
}
.caption .role {
  margin: 0.35em 0 0;
  font: italic 400 clamp(18px, 2vw, 23px)/1.25 var(--serif);
  color: var(--ink-soft);
  text-wrap: balance;
}
.caption .hook {
  max-width: 36em;
  margin: 14px auto 0;
  font: 400 17px/1.5 var(--sans);
  text-wrap: balance;
}
.caption .cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 18px 0 0;
  pointer-events: auto;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 11px 18px;
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  background: var(--paper);
  color: var(--ink);
  font: 500 15px/1.2 var(--sans);
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.button:hover { border-color: var(--accent); color: var(--accent); }
.button.primary { background: var(--ink); color: var(--paper); }
.button.primary:hover { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.button:active { background: var(--ink-soft); border-color: var(--ink-soft); color: var(--paper); }
.button.primary:active { background: var(--root); border-color: var(--root); }

/* ---------- Roots: the experience ---------- */

/* One continuous wash from paper into soil behind both lower sections. */
.underground {
  background: var(--grain), linear-gradient(var(--paper), var(--soil-1) 22%, var(--soil-2) 70%);
}

.roots {
  position: relative;
  padding: 150px 40px 200px;
}
.rootwork {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.rootwork .root-shape { fill: var(--root); }
.rootwork .stipple { stroke: var(--root); stroke-linecap: round; fill: none; opacity: 0.32; }
.rootwork .root-text {
  font: italic 400 16px var(--serif);
  fill: var(--root);
  opacity: 0;
  transition: opacity 0.8s ease;
}
.rootwork .root-text.is-shown { opacity: 1; }

.roots-inner {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px minmax(0, 1fr);
}

.root {
  max-width: 30em;
  margin: 0 0 56px;
  padding-bottom: 76px;
}
.root:nth-child(odd)  { grid-column: 1; justify-self: end; }
.root:nth-child(even) { grid-column: 3; justify-self: start; }
.root:nth-child(1) { grid-row: 1 / span 2; }
.root:nth-child(2) { grid-row: 2 / span 2; }
.root:nth-child(3) { grid-row: 3 / span 2; }
.root:nth-child(4) { grid-row: 4 / span 2; }
.root:nth-child(5) { grid-row: 5 / span 2; }
.root:nth-child(6) { grid-row: 6 / span 2; }

.root h2 {
  margin: 0 0 0.35em;
  font: 400 36px/1.1 var(--serif);
  letter-spacing: -0.005em;
  text-wrap: balance;
}
.root p { margin: 0 0 1em; }
.root .recognition {
  margin: 0 0 1em;
  font: italic 400 21px/1.4 var(--serif);
}
.root .tools {
  margin: 0;
  font: italic 400 17px/1.45 var(--serif);
  color: var(--ink-soft);
}

/* On wide screens the tools are written along each root instead. */
@media (min-width: 860px) {
  .roots.has-root-text .root .tools {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
}

/* Dimension line for the saving, drawn the way a drawing office would. */
.dimension { margin: 30px 0 22px; }
.dim {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}
.dim::before, .dim::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 1.5px;
  height: 40px;
  transform: translateY(-50%);
  background: var(--ink);
}
.dim::before { left: 0; }
.dim::after { right: 0; }
.dim-arm { position: relative; height: 1.5px; background: var(--ink); }
.dim-arm::before {
  content: "";
  position: absolute;
  top: 50%;
  width: 12px; height: 7px;
  background: var(--ink);
  transform: translateY(-50%);
}
.dim-arm:first-child::before { left: 0; clip-path: polygon(0 50%, 100% 0, 100% 100%); }
.dim-arm:last-child::before { right: 0; clip-path: polygon(100% 50%, 0 0, 0 100%); }
.dim-value {
  font: 400 48px/1 var(--serif);
  letter-spacing: -0.01em;
  font-variant-numeric: lining-nums;
}
.dimension figcaption {
  margin-top: 10px;
  text-align: center;
  font: 400 15px/1.45 var(--sans);
  color: var(--ink-soft);
}

/* ---------- Contact: the title block ---------- */

.contact {
  padding: 0 max(40px, env(safe-area-inset-right)) max(56px, env(safe-area-inset-bottom)) max(40px, env(safe-area-inset-left));
}
.contact-inner { max-width: 1180px; margin: 0 auto; }
.contact h2 {
  margin: 0 0 0.25em;
  font: 400 36px/1.1 var(--serif);
}
.contact-lede { margin: 0 0 28px; max-width: 34em; }

.titleblock {
  margin: 0;
  display: grid;
  grid-template-columns: 1.15fr 1.25fr 1fr;
  grid-template-areas:
    "name role role"
    "name email linkedin"
    "name location sector";
  gap: 1px;
  background: var(--ink);
  border: 2.5px solid var(--ink);
}
.titleblock > div {
  background: var(--grain), var(--soil-2);
  padding: 12px 16px 14px;
  min-width: 0;
}
.titleblock dt {
  margin: 0 0 3px;
  font: 500 13px/1.3 var(--sans);
  color: var(--ink-soft);
}
.titleblock dd { margin: 0; font: 400 18px/1.4 var(--sans); overflow-wrap: anywhere; }
.titleblock a { display: inline-flex; align-items: center; min-height: 44px; max-width: 100%; }
.tb-name { grid-area: name; display: flex; flex-direction: column; justify-content: space-between; }
.tb-name dd { font: 400 clamp(32px, 3.4vw, 48px)/1.05 var(--serif); margin-top: 18px; }
.tb-role { grid-area: role; }
.tb-email { grid-area: email; }
.tb-linkedin { grid-area: linkedin; }
.tb-sector { grid-area: sector; }
.tb-location { grid-area: location; }
.tb-web { display: none; }

.colophon {
  margin: 18px 0 0;
  font: 400 14px/1.4 var(--sans);
  color: var(--ink-soft);
}

/* ---------- Narrow screens ---------- */

@media (max-width: 859px) {
  body { font-size: 17px; line-height: 1.65; }
  .topbar { padding: max(12px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 12px max(20px, env(safe-area-inset-left)); }
  .topbar nav { gap: clamp(12px, 3vw, 22px); }

  .hero {
    --tree-height: clamp(360px, 52svh, 500px);
    display: flow-root;
    height: auto;
    min-height: 0;
    padding-bottom: 40px;
  }
  .caption {
    position: relative;
    left: auto;
    bottom: auto;
    transform: none;
    width: auto;
    max-width: min(calc(100% - 40px), 38em);
    margin: var(--tree-height) auto 0;
  }
  .caption h1 { font-size: clamp(44px, 8.6vw, 64px); }
  .caption .role { font-size: clamp(19px, 3vw, 23px); line-height: 1.35; margin-top: 9px; }
  .caption .hook { font-size: 16.5px; line-height: 1.6; margin-top: 18px; }
  .caption .cta { gap: 10px; margin-top: 22px; }
  .button { padding: 11px 16px; font-size: 15px; }

  .roots { padding: 150px max(20px, env(safe-area-inset-right)) 100px max(20px, env(safe-area-inset-left)); }
  .roots-inner { max-width: 680px; grid-template-columns: minmax(0, 1fr); }
  .root,
  .root:nth-child(odd),
  .root:nth-child(even) {
    grid-column: 1;
    grid-row: auto;
    justify-self: stretch;
    max-width: none;
    margin: 0 0 44px;
    padding: 0 0 60px 32px;
  }
  .root:last-child { margin-bottom: 0; }
  .root h2 { font-size: clamp(29px, 4.3vw, 36px); line-height: 1.15; }
  .root .recognition { font-size: 20px; }
  .dim-value { font-size: 38px; }

  .contact { padding: 0 max(20px, env(safe-area-inset-right)) max(40px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); }
  .contact h2 { font-size: 32px; }
  .titleblock {
    grid-template-columns: 1fr;
    grid-template-areas: "name" "role" "email" "linkedin" "location" "sector";
  }
  .tb-name dd { margin-top: 6px; }
}

@media (max-width: 479px) {
  .caption .cta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .caption .cta .primary { grid-column: 1 / -1; }
  .titleblock > div { padding: 13px 16px 15px; }
}

@media (min-width: 640px) and (max-width: 1059px) {
  .titleblock {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas: "name name" "role role" "email linkedin" "location sector";
  }
  .tb-name dd { margin-top: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .rootwork .root-text { transition: none; }
  .button { transition: none; }
}

/* ---------- Link preview card (rendered at 1200x630 with ?card) ---------- */

.card .topbar, .card .caption .hook, .card .caption .cta, .card .skip { display: none; }
.card .caption { bottom: 44px; }
.card .caption h1 { font-size: 76px; }
.card .caption .role { font-size: 26px; }
.card .hero { min-height: 0; }

/* ---------- Print: a clean CV document ---------- */

@media print {
  @page { size: A4; margin: 12mm 15mm; }
  :root, :root[data-theme="blueprint"] {
    --paper: #fff; --ink: #111; --ink-soft: #444; --root: #111; --soil-1: #fff; --soil-2: #fff; --accent: #111; --grain: none;
  }
  html, body, .underground { background: #fff !important; }
  body { font: 400 9.4pt/1.38 var(--sans); color: #111; }
  .topbar, .skip, .hero canvas, .rootwork, .caption .cta, .dimension .dim, .colophon, .contact h2, .contact-lede { display: none !important; }

  main { display: flex; flex-direction: column; }
  .underground { display: contents; }
  .hero { order: 0; height: auto; min-height: 0; padding-bottom: 0; overflow: visible; }
  .contact { order: 1; padding: 0; }
  .roots { order: 2; padding: 0; }

  .caption { position: static; transform: none; width: auto; max-width: none; margin: 0; text-align: left; }
  .caption h1 { font-size: 24pt; }
  .caption .role { font-size: 12pt; color: #444; }
  .caption .hook { max-width: none; margin: 6pt 0 0; font-size: 10pt; text-wrap: auto; }
  .summary { position: static !important; width: auto !important; height: auto !important; margin: 6pt 0 0 !important; clip: auto !important; overflow: visible !important; font-size: 9.4pt; }

  .titleblock { margin: 8pt 0 8pt; border: 0; border-top: 0.75pt solid #111; border-bottom: 0.75pt solid #111; background: none; gap: 0; grid-template-columns: repeat(4, auto); justify-content: space-between; grid-template-areas: "email linkedin web location"; }
  .tb-name, .tb-role, .tb-sector { display: none; }
  .tb-web { display: block; grid-area: web; }
  .titleblock > div { padding: 4pt 8pt 4pt 0; background: none; }
  .titleblock dt { font-size: 7.5pt; }
  .titleblock dd { font-size: 9.2pt; white-space: nowrap; }
  .titleblock a { display: inline; min-height: 0; text-decoration: none; }

  #roots-title { position: static !important; width: auto; height: auto; margin: 2pt 0 6pt; clip: auto; overflow: visible; font: 400 15pt/1.2 var(--serif); border-bottom: 1pt solid #111; padding-bottom: 3pt; }
  .roots-inner { display: block; max-width: none; }
  .root, .root:nth-child(odd), .root:nth-child(even) { max-width: none; margin: 0 0 6pt; padding: 0; break-inside: avoid; }
  .roots.has-root-text .root .tools, .root .tools { position: static; width: auto; height: auto; margin: 2pt 0 0; overflow: visible; clip: auto; font-size: 9.4pt; color: #444; }
  .root h2 { font-size: 13pt; margin: 0 0 1pt; }
  .root p { margin: 0 0 2pt; }
  .root .recognition { font-size: 10.5pt; }
  .dimension { margin: 2pt 0 4pt; }
  .dimension figcaption { text-align: left; margin: 0; font-size: 9.4pt; color: #111; }
  .dimension figcaption .sr-only { position: static !important; width: auto; height: auto; margin: 0; clip: auto; overflow: visible; font-weight: 600; }
}
