/* johnwsharpe.com */

/* Newsreader and Inter from Google Fonts, served from this site (SIL OFL, see fonts/).
   Newsreader is trimmed to Latin-1, weights 400 to 500, and a single italic. */
@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("fonts/newsreader-roman-s1.woff2") format("woff2");
}
@font-face {
  font-family: "Newsreader";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/newsreader-italic-s1.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("fonts/inter-latin-v20.woff2") format("woff2");
}

/* Metric-matched fallbacks so text does not jump when the web fonts arrive. */
@font-face {
  font-family: "Newsreader Fallback";
  src: local("Georgia");
  size-adjust: 92.5%;
  ascent-override: 79.5%;
  descent-override: 28.6%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Inter Fallback";
  src: local("Arial");
  size-adjust: 107.12%;
  ascent-override: 90.44%;
  descent-override: 22.52%;
  line-gap-override: 0%;
}

/* Tokens */
:root {
  --color-bg: #F4F1EA;
  --color-text: #16191D;
  --color-text-secondary: #2E3339;
  --color-text-muted: #5D636B;
  --color-rule: #D9D3C7;
  --color-link: #A4461E;
  --color-link-underline: #D49C80;
  --color-focus: #A4461E;
  --color-selection: #F0D3C2;
  --image-outline: oklch(0 0 0 / 0.1);
  /* Logos are drawn for white, so their tiles stay white in dark mode too. */
  --color-logo-bg: #FFFFFF;

  --font-serif: "Newsreader", "Newsreader Fallback", Georgia, serif;
  --font-sans: "Inter", "Inter Fallback", system-ui, sans-serif;

  --text-label: 0.75rem;
  --text-small: 0.9375rem;
  --text-body: 1.125rem;
  --text-lead: 1.25rem;
  --text-bio: 1.25rem;
  --text-h3: 1.375rem;
  --text-figure: 1.75rem;
  --text-tagline: 1.25rem;
  --text-h1: 2.375rem;

  --gutter: 1.25rem;
  --section-pad: 3rem;
}

@media (min-width: 48em) {
  :root {
    --text-body: 1.1875rem;
    --text-lead: 1.375rem;
    --text-bio: 1.4375rem;
    --text-h3: 1.5rem;
    --text-figure: 2rem;
    --text-tagline: 1.375rem;
    --text-h1: 3rem;
    --gutter: 2rem;
    --section-pad: 4rem;
  }
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-bg: #111315;
    --color-text: #EDEAE4;
    --color-text-secondary: #D3CFC8;
    --color-text-muted: #A2A8B0;
    --color-rule: #2C3035;
    --color-link: #E89B72;
    --color-link-underline: #8A5A41;
    --color-focus: #E89B72;
    --color-selection: #4A3326;
    --image-outline: oklch(1 0 0 / 0.1);
  }
}
:root[data-theme="dark"] {
  --color-bg: #111315;
  --color-text: #EDEAE4;
  --color-text-secondary: #D3CFC8;
  --color-text-muted: #A2A8B0;
  --color-rule: #2C3035;
  --color-link: #E89B72;
  --color-link-underline: #8A5A41;
  --color-focus: #E89B72;
  --color-selection: #4A3326;
  --image-outline: oklch(1 0 0 / 0.1);
}

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

html {
  background: var(--color-bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-serif);
  font-size: var(--text-body);
  line-height: 1.6;
}

h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { font-weight: 500; text-wrap: balance; }
p { text-wrap: pretty; }
::selection { background: var(--color-selection); color: var(--color-text); }

a {
  color: var(--color-link);
  text-decoration-line: underline;
  text-decoration-color: var(--color-link-underline);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-decoration-skip-ink: auto;
  transition-property: color, text-decoration-color;
  transition-duration: 150ms;
  transition-timing-function: ease-out;
}
@media (hover: hover) {
  a:hover { text-decoration-color: currentColor; }
}
:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Page */
.page,
.page-footer {
  width: 100%;
  max-width: calc(60rem + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));
}
.page { padding-block-start: clamp(3rem, 2rem + 5vw, 6rem); }

/* Intro */
.intro { padding-block-end: var(--section-pad); }
.intro-head {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.headshot {
  flex: none;
  width: 5rem;
  height: 5rem;
  border-radius: 6px;
  outline: 1px solid var(--image-outline);
  outline-offset: -1px;
}
h1 {
  font-size: var(--text-h1);
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.tagline {
  margin-block-start: 0.25rem;
  font-size: var(--text-tagline);
  font-style: italic;
  line-height: 1.3;
  color: var(--color-text-muted);
}
.bio {
  margin-block-start: 2rem;
  max-width: 40rem;
  font-size: var(--text-bio);
  line-height: 1.5;
  color: var(--color-text-secondary);
}
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  margin-block-start: 1.5rem;
  font-family: var(--font-sans);
  font-size: var(--text-small);
  color: var(--color-text-muted);
}
.meta a { display: inline-block; padding-block: 0.25rem; }
.meta li { padding-block: 0.25rem; }
.meta li:has(a) { padding-block: 0; }

/* On wider screens the intro sits on the same two columns as the sections:
   the photo in the label column, the text on the reading edge. */
@media (min-width: 48em) {
  .intro {
    display: grid;
    grid-template-columns: 10rem minmax(0, 1fr);
    column-gap: 3rem;
    align-items: start;
  }
  .intro-head { display: contents; }
  .intro picture { grid-column: 1; grid-row: 1 / span 3; }
  .intro-head > div, .bio, .meta { grid-column: 2; }
  .headshot { width: 6.5rem; height: 6.5rem; }
}

/* Sections: a narrow label column and a reading column */
.section {
  display: grid;
  gap: 1.5rem;
  padding-block: var(--section-pad);
  border-block-start: 1px solid var(--color-rule);
}
.section-label {
  font-family: var(--font-sans);
  font-size: var(--text-label);
  font-weight: 500;
  letter-spacing: 0.14em;
  line-height: 1.6;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.section-body {
  display: grid;
  gap: 2.25rem;
  min-width: 0;
}
@media (min-width: 48em) {
  .section {
    grid-template-columns: 10rem minmax(0, 1fr);
    gap: 3rem;
  }
  .section-label { padding-block-start: 0.5rem; }
}

/* Entries */
.entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.5rem 2.5rem;
}
.entry h3 {
  font-size: var(--text-h3);
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.entry h3 a { color: inherit; }
.entry-role {
  margin-block-start: 0.25rem;
  font-family: var(--font-sans);
  font-size: var(--text-small);
  color: var(--color-text-muted);
}
.entry-text > p:not(.entry-role) {
  margin-block-start: 0.625rem;
  max-width: 38rem;
  color: var(--color-text-secondary);
}
/* The industry above an entry's title */
.entry-text > p.entry-sector {
  margin-block: 0 0.125rem;
  font-size: var(--text-small);
  font-style: italic;
  line-height: 1.4;
  color: var(--color-text-muted);
}

/* Link from a homepage entry to its detail page */
.entry-text > p.entry-more {
  margin-block-start: 0.75rem;
  font-family: var(--font-sans);
  font-size: var(--text-small);
}
.entry-more a { display: inline-block; padding-block: 0.25rem; }
.entry-more a::after {
  content: "\2192" / "";
  display: inline-block;
  margin-inline-start: 0.375em;
}
.entry-figure {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 0.625rem;
}
.figure {
  font-size: var(--text-figure);
  line-height: 1.1;
  letter-spacing: -0.015em;
  font-variant-numeric: lining-nums proportional-nums;
  white-space: nowrap;
}
.figure-label {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}
@media (max-width: 47.9375em) {
  .entry-figure { margin-block-start: 0.25rem; }
}
@media (min-width: 48em) {
  .entry:has(.entry-figure) { grid-template-columns: minmax(0, 1fr) 11rem; }
  .entry-figure {
    flex-direction: column;
    align-items: flex-end;
    text-align: end;
  }
  .figure-label { margin-block-start: 0.25rem; }
}

/* Tenant logos, in rows of three. With a mouse they sit gray and light up in color when
   pointed at, as on the old landing page. Touch screens can't point, so they show color. */
.logos-intro {
  max-width: 38rem;
  color: var(--color-text-secondary);
}
.logos {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  max-width: 30rem;
}
.logos-intro + .logos { margin-block-start: 0.75rem; }
.logos img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: var(--color-logo-bg);
  border-radius: 6px;
  outline: 1px solid var(--image-outline);
  outline-offset: -1px;
}
@media (hover: hover) {
  .logos img {
    filter: grayscale(1);
    opacity: 0.75;
    transition-property: filter, opacity;
    transition-duration: 150ms;
    transition-timing-function: ease-out;
  }
  .logos img:hover {
    filter: grayscale(0);
    opacity: 1;
  }
}

.entry-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  margin-block-start: 1.25rem;
  font-family: var(--font-sans);
  font-size: var(--text-small);
}
.entry-links a { display: inline-block; padding-block: 0.375rem; }

/* Contact */
.contact-body { gap: 1.5rem; }
/* A quote looks the same in Contact and inside an entry (the climbing quote under Interests). */
.contact-quote,
.entry-quote {
  margin: 0;
  max-width: 36rem;
}
/* An entry's quote closes the entry, below its sentences, with enough space to read as its own row. */
.entry-quote { margin-block-start: 2.5rem; }
/* An entry with no title (Interests) opens with its first sentence, or its quote if that is all it has. */
.entry-text > .entry-quote:first-child,
.entry-text > p:first-child:not(.entry-sector) { margin-block-start: 0; }
.contact-quote blockquote,
.entry-quote blockquote { margin: 0; }
.contact-quote p,
.entry-quote p {
  font-size: var(--text-lead);
  font-style: italic;
  line-height: 1.45;
  hanging-punctuation: first;
}
.contact-quote figcaption,
.entry-quote figcaption {
  margin-block-start: 0.5rem;
  font-family: var(--font-sans);
  font-size: var(--text-small);
  color: var(--color-text-muted);
}
.contact-links {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1.75rem;
  font-family: var(--font-sans);
  font-size: var(--text-small);
}
.contact-links a { display: inline-block; padding-block: 0.25rem; }
.contact-email { overflow-wrap: anywhere; }

/* Footer */
.page-footer {
  padding-block: 2rem 2.5rem;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}
.page-footer p {
  padding-block-start: 1.5rem;
  border-block-start: 1px solid var(--color-rule);
}

.page-footer a { color: inherit; }

/* Detail pages (Wing, Real estate) */
.crumb {
  margin-block-end: 2.5rem;
  font-family: var(--font-sans);
  font-size: var(--text-small);
}
.crumb a { display: inline-block; padding-block: 0.25rem; }
.crumb a::before {
  content: "\2190" / "";
  display: inline-block;
  margin-inline-end: 0.375em;
}
.page-head { padding-block-end: var(--section-pad); }
.page-role {
  margin-block-start: 0.625rem;
  font-family: var(--font-sans);
  font-size: var(--text-small);
  color: var(--color-text-muted);
}
.page-lead {
  margin-block-start: 1.75rem;
  max-width: 40rem;
  font-size: var(--text-bio);
  line-height: 1.5;
  color: var(--color-text-secondary);
}
.figures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 1.25rem 2rem;
  max-width: 44rem;
  margin-block-start: 2.25rem;
}
.figures li {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.page-head .entry-links { margin-block-start: 1.75rem; }

/* Body text on detail pages: each "## Heading" is a section label, "###" an entry title */
.prose { display: block; }
.prose > * + * { margin-block-start: 1rem; }
.prose h3 {
  font-size: var(--text-h3);
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.prose > h3:not(:first-child) { margin-block-start: 2.5rem; }
.prose > h3 + * { margin-block-start: 0.625rem; }
.prose p,
.prose ul,
.prose ol {
  max-width: 38rem;
  color: var(--color-text-secondary);
}
.prose ul { list-style: disc; padding-inline-start: 1.25rem; }
.prose ol { list-style: decimal; padding-inline-start: 1.25rem; }
.prose li + li { margin-block-start: 0.375rem; }
.prose strong { font-weight: 500; color: var(--color-text); }
/* A line in italics right under a title reads as the role, like the homepage */
.prose h3 + p:has(> em:only-child) {
  margin-block-start: 0.25rem;
  font-family: var(--font-sans);
  font-size: var(--text-small);
  color: var(--color-text-muted);
}
.prose h3 + p:has(> em:only-child) em { font-style: normal; }
.section-label[id] { scroll-margin-block-start: 1.5rem; }
@media (min-width: 48em) {
  .section-unlabeled .section-body { grid-column: 2; }
}

/* 404 */
.not-found {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: 6rem;
}
.not-found .section-label { margin-block-end: 1rem; }
.not-found h1 { font-size: var(--text-h1); }
.not-found p:last-child { margin-block-start: 1.25rem; font-family: var(--font-sans); font-size: var(--text-small); }

@media print {
  a { color: inherit; text-decoration-color: currentColor; }
}
