/* main's top padding. Lives here because .om-hero-viewport subtracts it to land the
   fold exactly on the hero's bottom edge — the two must never drift apart. */
:root {
  --page-pad-top: 60px;
}

body {
  margin: 0;
  background: #F0EEE6;
  font-family: 'Satoshi', Arial, sans-serif;
  font-weight: 500;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Holds the hero to one screen so the next section sits below the fold.
   Three deliberate choices make this survive different screens:
   - min-height, NOT height: on a short laptop the content can push past one screen
     instead of being clipped. Never traps content.
   - dvh, not vh: on phones, vh measures the viewport as if the URL bar were hidden,
     so a vh hero gets its bottom cut off. dvh tracks the bar collapsing. vh first as
     a fallback for browsers without dvh.
   - --page-pad-top is main's own padding-top, subtracted so the fold lands exactly on
     the hero's bottom edge rather than one padding-height past it.
   Content is centred, so tall screens get even air above and below rather than
   stranding everything at the top. */
.om-hero-viewport {
  min-height: calc(100vh - var(--page-pad-top));
  min-height: calc(100dvh - var(--page-pad-top));
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Hero: both columns stretch to the same height, so the photo's crop lands on the text's last line. */
.om-hero {
  display: flex;
  align-items: stretch;
  gap: 44px;
}

.om-hero-text {
  flex: 1 1 52%;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.om-hero-figure {
  flex: 1 1 48%;
  margin: 0;
  position: relative;
}

/* Out of flow so the text column alone sets the row height; the crop then lands on the last line. */
.om-hero-figure img {
  position: absolute;
  inset: 0 0 6px;
  width: 100%;
  height: calc(100% - 6px);
  object-fit: contain;
  object-position: center bottom;
  display: block;
}

/* Hairline under the hero, same weight and grey as the list rules further down.
   Negative top margin pulls it in against the hero, out of the 60px section gap. */
.om-rule-hero {
  height: 1px;
  margin: -32px 0 0;
  border: 0;
  background: oklch(0.86 0.01 250);
}

@media (max-width: 820px) {
  .om-hero {
    flex-direction: column;
    gap: 32px;
  }

  .om-hero-text {
    order: 2;
  }

  .om-hero-figure {
    order: 1;
    aspect-ratio: 4 / 3;
  }
}

a {
  color: oklch(0.36 0.05 220);
  text-decoration: none;
}

/* Same hue, just darker — keeps hover feedback without reintroducing an accent colour. */
a:hover {
  color: oklch(0.24 0.05 220);
}

/* Hero body links (StudyStash, Advisory Board): a real accent colour, but only on hover —
   text stays neutral at rest so it doesn't compete with the rest of the minimal page. */
.om-hero-link {
  border-bottom: 1px solid oklch(0.72 0.03 220);
}

.om-hero-link:hover {
  color: oklch(0.5 0.14 165);
  border-color: oklch(0.5 0.14 165);
}

/* List rows (Recent articles + Connect). Layout lives here rather than inline so the
   mobile rule below can restyle it without needing !important. */
.om-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  padding: 15px 0;
  border-top: 1px solid oklch(0.86 0.01 250);
}

/* Closes off the bottom of each list. */
.om-row:last-child {
  border-bottom: 1px solid oklch(0.86 0.01 250);
}

.om-row:hover {
  background-color: oklch(0.945 0.006 220);
}

.om-row-title {
  font-size: 17px;
  font-weight: 500;
}

.om-row-meta {
  flex: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: oklch(0.36 0.05 220);
}

/* On a phone there isn't room for headline-left / source-right: the headline wraps to
   a narrow ragged column while the meta stays pinned to the edge. Stack them instead. */
@media (max-width: 620px) {
  .om-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }

  .om-row-meta {
    font-size: 11px;
  }
}

.om-tile>* {
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.om-tile:hover>* {
  transform: scale(1.03);
}

/* YouTube video: never enlarge the thumbnail or iframe */
.gallery-video:hover .gallery-image,
.gallery-video:hover iframe {
  transform: none;
}

/* Only enlarge the play button before the video is playing */
.gallery-video:hover .gallery-play {
  transform: translate(-50%, -50%) scale(1.12);
}


@media (prefers-reduced-motion: reduce) {

  .om-tile>*,
  .gallery-image {
    transition: none;
  }
}

/* Row height is tuned, not arbitrary: the YouTube thumbnail is a real 1280x720 file (16:9).
   .gallery-pos-big spans 4 columns / 3 rows; main's content width is its own max-width
   (1120px — padding is content-box, so it adds on top rather than eating into that number).
   At that width a 129.792px row makes the big cell exactly 16:9 — every other tile shares
   this same row unit, so they resize with it rather than independently. */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-rows: 129.792px;
  gap: 14px;
}

.gallery-tile {
  position: relative;
  overflow: hidden;
  display: block;
  background: oklch(0.93 0.014 200);
}

/* Named by grid position, not DOM order — swapping which photo goes where
   is then a one-word class change instead of a reshuffle. */
.gallery-pos-big {
  grid-column: 1 / 5;
  grid-row: 1 / 4;
}

.gallery-pos-top-right {
  grid-column: 5 / 7;
  grid-row: 1 / 3;
}

.gallery-pos-bottom-right {
  grid-column: 5 / 7;
  grid-row: 3 / 6;
}

.gallery-pos-bottom-left {
  grid-column: 1 / 3;
  grid-row: 4 / 6;
}

.gallery-pos-bottom-mid {
  grid-column: 3 / 5;
  grid-row: 4 / 6;
}

/* Below the hero's own breakpoint, the asymmetric collage has no room to work —
   stack every tile full-width instead, each sized by its own aspect ratio. */
@media (max-width: 820px) {
  .gallery-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    gap: 12px;
  }

  .gallery-pos-big,
  .gallery-pos-top-right,
  .gallery-pos-bottom-right,
  .gallery-pos-bottom-left,
  .gallery-pos-bottom-mid {
    grid-column: auto;
    grid-row: auto;
  }

  .gallery-tile {
    aspect-ratio: 4 / 3;
  }

  .gallery-video {
    aspect-ratio: 16 / 9;
  }

  .gallery-placeholder {
    aspect-ratio: auto;
    min-height: 130px;
  }
}

.gallery-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  /* transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1); */
}

/* .gallery-grad {
  object-position: center calc(35% + 20px);
} */

.gallery-video {
  background: #000;
  cursor: pointer;
}

.gallery-video:focus-visible {
  outline: 2px solid oklch(0.36 0.05 220);
  outline-offset: -2px;
}

.gallery-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.gallery-play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  padding-left: 2px;
}

/* Top-left badge on the video tile, e.g. "YOUTUBE · FOUNDER STORY" — kept clear of the
   bottom of the frame, where YouTube thumbnails usually bake in their own title text. */
.gallery-caption {
  position: absolute;
  left: 14px;
  top: 14px;
  padding: 5px 9px;
  background: rgba(20, 22, 26, 0.55);
  backdrop-filter: blur(2px);
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Placeholder tile for a link with no asset yet (e.g. LinkedIn video). */
.gallery-placeholder {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
  padding: 16px;
  border: 1px dashed oklch(0.78 0.02 220);
  background: oklch(0.965 0.012 220);
  box-sizing: border-box;
}

.gallery-placeholder .gallery-caption-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: oklch(0.45 0.05 220);
}

.gallery-placeholder p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: oklch(0.36 0.05 220);
}