/* sailidea: one stylesheet for every page.
   Tokens first. Light by default, dark through prefers-color-scheme. No JavaScript anywhere. */

:root {
  color-scheme: light dark;

  --bg: #f5f4ef;
  --surface: #ffffff;
  --ink: #121211;
  --ink-2: #3a3935;
  --muted: #64625c;
  --line: #e2e0d8;
  --line-strong: #c9c6bb;
  --accent: #1f47d1;
  --badge-bg: #ffe8a3;
  --badge-ink: #5a3a00;
  --draft-bg: #fde2dd;
  --draft-ink: #7a1d0e;
  --shadow-hover: 0 22px 44px -26px rgb(24 20 8 / 0.38);

  --radius: 18px;
  --wrap: 1140px;
  --gutter: clamp(16px, 4vw, 40px);

  --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-body: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1011;
    --surface: #17181a;
    --ink: #f3f2ee;
    --ink-2: #d4d2cb;
    --muted: #a2a09a;
    --line: #26282b;
    --line-strong: #3b3e43;
    --accent: #93b2ff;
    --badge-bg: #3f3007;
    --badge-ink: #ffd772;
    --draft-bg: #45170f;
    --draft-ink: #ffb4a6;
    --shadow-hover: 0 22px 44px -22px rgb(0 0 0 / 0.85);
  }
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;
}

main {
  flex: 1;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: 12px;
  top: -64px;
  z-index: 10;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
  font-weight: 600;
}

.skip:focus {
  top: 12px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

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

/* ---- Wordmark ---------------------------------------------------------------------------- */

.wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.035em;
  text-decoration: none;
}

.wordmark span,
.display span {
  color: var(--accent);
}

.masthead {
  padding-block: 22px 0;
}

.masthead .wordmark {
  font-size: 1.35rem;
  line-height: 1;
}

.masthead .wordmark:hover span {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

/* ---- Page intro --------------------------------------------------------------------------- */

.intro {
  max-width: 50rem;
  padding-block: clamp(40px, 7vw, 88px) clamp(28px, 4.5vw, 52px);
}

.intro h1 {
  margin: 0 0 20px;
  font: 800 clamp(2.35rem, 1.5rem + 4vw, 4.4rem) / 1.02 var(--font-display);
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.intro-home {
  padding-top: clamp(48px, 10vw, 128px);
}

.intro-home .display {
  margin-bottom: clamp(18px, 3vw, 28px);
  font-size: clamp(3.6rem, 1.6rem + 10vw, 8.5rem);
  line-height: 0.92;
  letter-spacing: -0.042em;
}

.lede {
  max-width: 38em;
  margin: 0 0 0.9em;
  color: var(--ink-2);
  font-size: clamp(1.125rem, 1.02rem + 0.45vw, 1.35rem);
  line-height: 1.5;
  text-wrap: pretty;
}

.lede:last-child {
  margin-bottom: 0;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--muted);
  font: 700 0.8rem/1.2 var(--font-body);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.draft-note {
  display: inline-block;
  margin: 0 0 20px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--draft-bg);
  color: var(--draft-ink);
  font-size: 0.875rem;
  font-weight: 600;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  margin-top: 12px;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
}

.button:hover {
  background: var(--accent);
  color: #fff;
}

/* ---- Tile grid ---------------------------------------------------------------------------- */

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(20px, 3vw, 32px);
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 640px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.grid > li {
  display: flex;
  min-width: 0;
}

.tile {
  display: flex;
  flex-direction: column;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}

.tile:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-hover);
}

.tile:focus-visible {
  outline-offset: 4px;
}

.tile-media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--line);
}

.tile-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.tile:hover .tile-media img {
  transform: scale(1.025);
}

.badge {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px 5px 9px;
  border-radius: 999px;
  background: var(--badge-bg);
  color: var(--badge-ink);
  font: 700 0.78rem/1.2 var(--font-body);
  letter-spacing: 0.01em;
}

.badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.badge-draft {
  background: var(--draft-bg);
  color: var(--draft-ink);
}

.tile-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding: 20px 22px 24px;
}

.tile-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6em;
  margin: 0;
  font: 700 clamp(1.2rem, 1.06rem + 0.5vw, 1.45rem) / 1.2 var(--font-display);
  letter-spacing: -0.02em;
}

.arrow {
  flex: none;
  color: var(--muted);
  font-family: var(--font-body);
  font-weight: 600;
  transition:
    transform 0.25s ease,
    color 0.25s ease;
}

.tile:hover .arrow {
  color: var(--accent);
  transform: translateX(3px);
}

.tile[target="_blank"]:hover .arrow {
  transform: translate(2px, -2px);
}

.tile-desc {
  margin: 0;
  color: var(--muted);
}

.tile-meta {
  margin: auto 0 0;
  padding-top: 10px;
  color: var(--ink-2);
  font-size: 0.875rem;
  font-weight: 600;
}

/* ---- Image sources ------------------------------------------------------------------------ */

.credits {
  margin-top: clamp(48px, 7vw, 80px);
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}

.credits h2 {
  margin: 0 0 12px;
  color: var(--ink-2);
  font: 700 0.78rem/1.2 var(--font-body);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.credits ul {
  margin: 0;
  padding-left: 1.1em;
}

.credits li + li {
  margin-top: 6px;
}

.credits a {
  text-underline-offset: 3px;
}

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

.colophon {
  margin-top: clamp(64px, 10vw, 128px);
  padding-block: 26px 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.925rem;
}

.colophon .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 24px;
}

.colophon .wordmark {
  color: var(--ink);
  font-size: 1.1rem;
}

.colophon nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-underline-offset: 3px;
}

.colophon nav a:hover {
  color: var(--ink);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }

  .tile:hover,
  .tile:hover .tile-media img,
  .tile:hover .arrow {
    transform: none;
  }
}
