/* ============================================================
   BLOG — index (dark, tiles) + article (light, editorial)
   ============================================================ */

:root {
  --bg: #070c16;
  --fg: #f3f5fa;
  --muted: #93a0c2;
  --muted-2: #5c6690;
  --accent: #ff3d81;
  --accent-deep: #d81b60;
  --accent-soft: #ff7bab;      /* passes contrast on paper at body size */
  --line: rgba(243, 245, 250, 0.12);
  --paper: #fafafa;
  --ink: #1d1d1d;
  --ink-soft: #55555a;
  --rule: #e5e5e5;
  --serif: "Instrument Serif", Georgia, serif;
  --display: "Anton", "Arial Narrow", sans-serif;
  --sans: "Bricolage Grotesque", "Inter", sans-serif;
  --body-font: "Inter", -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* ============ SHARED NAV ============ */
.bnav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px clamp(18px, 4vw, 56px);
}
.bnav-mark { font-family: var(--sans); font-weight: 800; font-size: 19px; }
.bnav-back {
  font-size: 14px;
  font-weight: 600;
  border-radius: 100px;
  padding: 9px 18px;
  transition: background 0.25s ease, color 0.25s ease;
}

/* ============================================================
   1. INDEX — dark, square tiles
   ============================================================ */
.blog-index {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body-font);
  -webkit-font-smoothing: antialiased;
}
.blog-index .bnav-mark { color: var(--fg); }
.blog-index .bnav-back { border: 1px solid var(--line); color: var(--fg); }
.blog-index .bnav-back:hover { background: var(--fg); color: var(--bg); }

.blog-head {
  padding: 150px clamp(18px, 4vw, 56px) 54px;
  max-width: 1280px;
  margin: 0 auto;
}
.blog-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
  display: block;
}
.blog-title {
  font-family: var(--display);
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(2.9rem, 8.6vw, 6.2rem);
  line-height: 0.92;
  letter-spacing: -0.018em;
}
.blog-title em { font-style: normal; color: var(--accent); }
.blog-intro {
  margin-top: 22px;
  max-width: 560px;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.75;
}

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
  padding: 0 clamp(18px, 4vw, 56px) 120px;
  max-width: 1280px;
  margin: 0 auto;
}

/* --- the tile --- */
.tile {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #0d1526;
  border-radius: 2px;
}
.tile-img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0.42;
  transform: scale(1);
  /* the very slow creep is the whole effect — you never see it finish */
  transition: transform 9s ease-out, opacity 0.6s ease-out;
}
.tile-frame {
  position: absolute;
  inset: 0;
  border: 10px solid var(--fg);
  opacity: 0;
  z-index: 2;
  pointer-events: none;
  transition: opacity 0.22s ease-out;
}
.tile-body {
  position: absolute;
  left: 0; right: 0; bottom: -0.9em;
  z-index: 3;
  padding: 26px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.82));
  transition: bottom 0.4s ease-in, background 0.4s ease-in;
}
.tile-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.tile-cat {
  background: var(--accent);
  color: #0d0a12;
  padding: 5px 9px 4px;
  border-radius: 2px;
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  transition: opacity 0.4s ease-out, max-width 0.4s ease-out, padding 0.4s ease-out;
}
.tile-date { color: rgba(255, 255, 255, 0.86); }
.tile-h {
  font-family: var(--display);
  text-transform: uppercase;
  font-weight: 400;
  letter-spacing: -0.005em;
  line-height: 1.0;
  font-size: 1.6rem;
}
.tile-go {
  display: block;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.86rem;
  opacity: 0;
  height: 0;
  overflow: hidden;
  transition: opacity 0.4s ease-in, height 0.4s ease-in, margin-top 0.4s ease-in;
}
.tile:hover .tile-img,
.tile:focus-visible .tile-img { transform: scale(1.18); opacity: 0.26; }
.tile:hover .tile-frame,
.tile:focus-visible .tile-frame { opacity: 1; }
.tile:hover .tile-body,
.tile:focus-visible .tile-body { bottom: 0; }
.tile:hover .tile-cat,
.tile:focus-visible .tile-cat { opacity: 1; max-width: 240px; }
.tile:hover .tile-go,
.tile:focus-visible .tile-go { opacity: 1; height: 1.4em; margin-top: 10px; }

/* ============================================================
   2. ARTICLE — light paper, editorial
   ============================================================ */
.post {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body-font);
  -webkit-font-smoothing: antialiased;
}
.post .bnav { background: linear-gradient(var(--paper) 55%, transparent); }
.post .bnav-mark { color: var(--ink); }
.post .bnav-back { border: 1px solid #d9d9d9; color: var(--ink); }
.post .bnav-back:hover { background: var(--ink); color: var(--paper); }

/* the ruled margins that run the whole page */
.rules { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.rules span {
  position: absolute;
  top: 0; bottom: 0;
  width: 1px;
  background: var(--rule);
}
.rules span:nth-child(1) { left: 32px; }
.rules span:nth-child(2) { left: 108px; }
.rules span:nth-child(3) { right: 108px; }
.rules span:nth-child(4) { right: 32px; }
@media (max-width: 900px) { .rules span:nth-child(2), .rules span:nth-child(3) { display: none; } }
@media (max-width: 560px) { .rules { display: none; } }

.post main { position: relative; z-index: 1; }

.post-head {
  padding: 150px clamp(20px, 6vw, 40px) 20px;
  max-width: 1000px;
  margin: 0 auto;
}
.post-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 52px;
}
.post-kicker .cat { background: var(--accent); color: #0d0a12; padding: 5px 10px 4px; border-radius: 2px; }
.post h1 {
  font-family: var(--display);
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(2.5rem, 7vw, 5.2rem);
  line-height: 0.9;
  letter-spacing: -0.015em;
  color: var(--accent);
}
/* Standfirst: the old grey 1.32rem italic read as a caption. Bigger, near-black,
   with a sub-pixel halo so the letterforms look like ink on paper rather than
   pixels on glass, and the turn of the sentence carried in a warmer tone. */
.post-standfirst {
  margin-top: 54px;
  max-width: 720px;
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  line-height: 1.3;
  color: #0e0e11;
  font-style: italic;
  font-family: var(--serif);
  text-shadow: 0 0 0.7px rgba(14, 14, 17, 0.5);
}
.post-standfirst em {
  font-style: italic;
  color: #4a2a18;                      /* burnt umber on paper */
  text-shadow: 0 0 0.8px rgba(74, 42, 24, 0.5);
}
.post-dark .post-standfirst {
  color: #f3f5fa;
  text-shadow: none;
}
.post-dark .post-standfirst em {
  color: var(--accent-soft, #ff7bab);  /* the warm tail, dark-theme equivalent */
  text-shadow: none;
}
.post-byline {
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  font-size: 0.85rem;
  color: var(--ink-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

/* body copy */
.post-body {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 clamp(20px, 6vw, 40px) 100px;
}
.post-body > * { max-width: 660px; }
.post-body h2 {
  font-family: var(--display);
  padding-top: 0.12em;
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(1.85rem, 4.2vw, 3.1rem);
  line-height: 0.98;
  letter-spacing: -0.012em;
  color: var(--accent);
  margin: 84px 0 22px;
}
.post-body h3 {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 1.06rem;
  letter-spacing: 0.02em;
  margin: 40px 0 12px;
  color: var(--ink);
}
.post-body p {
  font-size: 1.06rem;
  line-height: 1.78;
  margin-bottom: 22px;
  color: var(--ink);
}
.post-body p strong { font-weight: 600; }
.post-body a:not(.cta) {
  color: var(--accent-deep);
  border-bottom: 1px solid rgba(216, 27, 96, 0.35);
  transition: border-color 0.2s ease;
}
.post-body a:not(.cta):hover { border-bottom-color: var(--accent-deep); }
.post-body ul { margin: 0 0 24px 0; padding-left: 0; list-style: none; }
.post-body ul li {
  position: relative;
  padding-left: 26px;
  margin-bottom: 12px;
  font-size: 1.04rem;
  line-height: 1.7;
}
.post-body ul li::before {
  content: "";
  position: absolute;
  left: 2px; top: 0.72em;
  width: 9px; height: 1px;
  background: var(--accent);
}

/* pull quote */
.pull {
  max-width: 760px !important;
  margin: 62px 0;
  padding-left: 26px;
  border-left: 2px solid var(--accent);
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3.4vw, 2.3rem);
  line-height: 1.16;
  color: var(--ink);
}

/* figures — feet land on one baseline, so the set reads as a lookbook */
.looks {
  max-width: 100% !important;
  display: grid;
  gap: 12px;
  align-items: end;
  /* Two shared rows — images in one, captions in the other — so every figure
     stands on a common baseline however long its caption runs. */
  grid-template-rows: auto auto;
  margin: 44px 0 18px;
}
.looks.two { grid-template-columns: repeat(2, 1fr); }
.looks.three { grid-template-columns: repeat(3, 1fr); }
.looks.four { grid-template-columns: repeat(4, 1fr); gap: 10px; }
.looks figure {
  margin: 0;
  display: grid;
  grid-row: span 2;
  grid-template-rows: subgrid;
}
.looks figure > picture { align-self: end; }
.looks img { width: 100%; height: auto; border-radius: 2px; }
.looks figcaption {
  margin-top: 10px;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}
.looks figcaption b { color: var(--ink); font-weight: 600; }
@media (max-width: 900px) {
  .looks.four { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}
@media (max-width: 700px) {
  .looks.three { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 460px) {
  .looks.two, .looks.three, .looks.four { grid-template-columns: 1fr; }
}

/* closing CTA */
.post-cta {
  max-width: 760px !important;
  margin: 80px 0 0;
  padding: 40px;
  background: #f1f1f2;
  border-radius: 4px;
}
.post-cta p { font-size: 1rem; margin-bottom: 18px; }
.cta {
  display: inline-block;
  background: var(--accent);
  color: #0d0a12;
  font-weight: 700;
  font-size: 0.94rem;
  padding: 14px 26px;
  border-radius: 100px;
  transition: transform 0.3s cubic-bezier(0.34, 1.4, 0.64, 1), box-shadow 0.3s ease;
}
.cta:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(255, 61, 129, 0.32); }

.post-foot {
  border-top: 1px solid var(--rule);
  padding: 34px clamp(20px, 6vw, 40px);
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--ink-soft);
  position: relative;
  z-index: 1;
}



/* ============================================================
   3. DARK ARTICLE VARIANT  <body class="post post-dark">
   For text-led pieces and for photography that is already dark.
   Pink clears 5.81:1 on this background (vs 3.23:1 on paper), so
   it can carry sub-headings and links here, not just display type.
   ============================================================ */
.post-dark {
  --paper: #070c16;
  --ink: #f3f5fa;
  --ink-soft: #93a0c2;
  --rule: rgba(243, 245, 250, 0.13);
  --accent-deep: #ff7bab;        /* links: the deep pink is too dark on navy */
}
.post-dark .bnav { background: linear-gradient(#070c16 55%, transparent); }
.post-dark .bnav-back { border-color: rgba(243, 245, 250, 0.22); }
.post-dark .bnav-back:hover { background: var(--ink); color: #070c16; }
.post-dark .speckle {
  background-image: url("/assets/blog/dots-light.png");
  opacity: 0.5;
}
.post-dark .post-body h3 { color: var(--ink); }
.post-dark .hl { color: #ffffff; }
.post-dark .mark {
  color: #ffffff;
  background-image: linear-gradient(rgba(255, 61, 129, 0.42), rgba(255, 61, 129, 0.42));
}
.post-dark .post-cta { background: rgba(255, 255, 255, 0.045); }
.post-dark .looks img,
.post-dark .figure-wide img { border-radius: 2px; }
.post-dark .post-body a:not(.cta) { border-bottom-color: rgba(255, 123, 171, 0.4); }

/* full-bleed photograph band, used by the dark posts */
.figure-wide {
  max-width: 100% !important;
  margin: 56px 0 20px;
}
.figure-wide img { width: 100%; height: auto; border-radius: 2px; }
.figure-wide figcaption {
  margin-top: 12px;
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 620px;
}
.figure-wide figcaption b { color: var(--ink); font-weight: 600; }

/* ---- speckle background ----
   Measured off the skyclinics recording: an irregular scatter, not a lattice
   (nearest-neighbour spacing ran 10-36px; a grid would be near-constant),
   dots roughly 2px, about one per 1900px, and static - no animation.
   A 440px seamless tile reproduces it in 2.3KB rather than a WebGL canvas.
   Masked away from the middle so nothing sits under the reading column. */
.speckle {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url("/assets/blog/dots.png");
  background-size: 440px 440px;
  opacity: 0.85;
  -webkit-mask-image: linear-gradient(90deg, #000 0%, transparent 26%, transparent 74%, #000 100%);
          mask-image: linear-gradient(90deg, #000 0%, transparent 26%, transparent 74%, #000 100%);
}
.blog-index .speckle { opacity: 0.5; }
@media (max-width: 900px) {
  /* the reading column fills the screen, so there is no margin left to texture */
  .speckle { display: none; }
}

/* ============ SCROLL REVEAL ============ */
.rv { opacity: 0; transform: translateY(34px); }
.rv.in {
  opacity: 1;
  transform: none;
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Headings wipe up from behind a mask rather than just fading, so a new
   section announces itself instead of appearing. */
h1.rv, h2.rv, .blog-title.rv {
  opacity: 1;
  transform: none;
  clip-path: inset(0 0 105% 0);
}
/* The transition has to live on the .in rule too: `.rv.in` carries two classes
   and would otherwise out-rank `h1.rv`, dropping clip-path from the transition
   list and making headings snap instead of wipe. */
h1.rv.in, h2.rv.in, .blog-title.rv.in {
  clip-path: inset(-25% -8% -25% -8%);
  transition: clip-path 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Figures rise further and settle from slightly small. */
.looks figure.rv { transform: translateY(52px) scale(0.965); }
.looks figure.rv.in {
  transform: none;
  transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1),
              transform 1s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Pull quotes swing in from the accent rule. */
.pull.rv { transform: translateX(-22px); opacity: 0; }
/* opacity must be restated here: `.pull.rv` is declared after `.rv.in` at equal
   specificity, so without it the quote stays at opacity 0 and leaves a hole. */
.pull.rv.in {
  opacity: 1;
  transform: none;
  transition: opacity 0.85s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---- emphasis inside body copy ---- */
/* .hl = the sentence you want them to keep. Near-black, heavier. */
.hl { font-weight: 600; color: #0b0b0d; }

/* .mark = highlighter swipe, drawn left to right as the line arrives */
.mark {
  font-weight: 600;
  color: #0b0b0d;
  padding: 0 0.08em;
  background-image: linear-gradient(rgba(255, 61, 129, 0.32), rgba(255, 61, 129, 0.32));
  background-repeat: no-repeat;
  background-position: 0 86%;
  background-size: 0% 0.44em;
  transition: background-size 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.25s;
}
.rv.in .mark, .mark.rv.in { background-size: 100% 0.44em; }

/* first line of the opening paragraph gets a drop cap */
.post-body > p.lede::first-letter {
  float: left;
  font-family: var(--display);
  font-size: 3.6em;
  line-height: 0.78;
  padding: 0.06em 0.1em 0 0;
  color: var(--accent);
}
@media (prefers-reduced-motion: reduce) {
  .rv, h1.rv, h2.rv, .blog-title.rv, .looks figure.rv, .pull.rv {
    opacity: 1; transform: none; clip-path: none; transition: none;
  }
  .mark { background-size: 100% 0.44em; transition: none; }
  .tile-img, .tile-frame, .tile-body, .tile-cat, .tile-go { transition: none !important; }
  .tile:hover .tile-img { transform: none; }
}


/* ============ BACK TO TOP ============ */
.to-top {
  position: fixed;
  left: 50%;
  margin-left: -29px;
  bottom: clamp(18px, 3vw, 40px);
  z-index: 90;
  width: 58px; height: 58px;
  padding: 0; border: 0; border-radius: 50%;
  background: var(--accent);
  color: #0d0a12;
  display: grid; place-items: center;
  cursor: pointer;
  opacity: 0; visibility: hidden;
  transform: translateY(14px) scale(0.85);
  box-shadow: 0 10px 30px rgba(255, 61, 129, 0.28);
  transition: opacity 0.38s ease, visibility 0.38s,
              transform 0.5s cubic-bezier(0.34, 1.4, 0.64, 1),
              box-shadow 0.3s ease;
}
.to-top.is-in { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { transform: translateY(-3px) scale(1.06); box-shadow: 0 16px 42px rgba(255, 61, 129, 0.45); }
.to-top:active { transform: translateY(-1px) scale(0.98); }
.to-top:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
.to-top svg { width: 24px; height: 24px; display: block; transition: transform 0.32s cubic-bezier(0.34, 1.4, 0.64, 1); }
.to-top:hover svg { transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) {
  .to-top { transition: opacity 0.2s ease, visibility 0.2s; transform: none; }
  .to-top.is-in, .to-top:hover, .to-top:active { transform: none; }
  .to-top svg, .to-top:hover svg { transition: none; transform: none; }
}
