/* ==========================================================================
   Miko — personal site
   Rebuilt from the original Canva design. The Canva layout was drawn on a
   ~1009px-wide canvas and scales with the window; --u is "one Canva pixel",
   so calc(var(--u) * N) reproduces the original proportions on laptops.
   max()/clamp() floors keep text readable on phones.
   ========================================================================== */

:root {
  /* Palette (sampled from the Canva site) */
  --cream: #f4f1e8;
  --ink: #000001;
  --text: #191919;
  --rust: #9b4819;
  --nav-ink: #304254;
  --stone: #dbdadd;
  --mist: #c8d1d9;
  --forest: #314028;
  --taupe: #6b635a;
  --paper: #fcf5e7;

  --serif: "Alice", Georgia, "Times New Roman", serif;

  /* 1 design pixel; stops growing past 1440px windows */
  --u: calc(min(100vw, 1440px) / 1009);
  --nav-h: 48px;

  /* Type scale */
  --t-hero: max(40px, calc(var(--u) * 115));
  --t-title: max(36px, calc(var(--u) * 64));
  --t-body: max(17px, calc(var(--u) * 24));
  --t-caption: max(16px, calc(var(--u) * 22.67));
  --tracking: -0.02em;

  /* Media widths (never narrower than a phone-friendly size, never wider than the screen) */
  --gutter: max(20px, calc(var(--u) * 24));
}

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

html {
  scroll-padding-top: var(--nav-h);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--serif);
  color: var(--text);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

body.page-story { background: var(--stone); }
body.page-media { background: var(--forest); }

img,
video {
  display: block;
  max-width: 100%;
}

a { color: inherit; }

h1, h2, h3, p, figure, ul {
  margin: 0;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 8px;
  top: -40px;
  padding: 8px 12px;
  background: var(--ink);
  color: #fff;
  z-index: 100;
}
.skip-link:focus { top: 8px; }

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

/* --------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--nav-h);
  background: var(--cream);
  border-bottom: 1px solid rgba(48, 66, 84, 0.08);
}

.site-nav ul {
  display: flex;
  justify-content: flex-end;
  height: 100%;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 16px;
  font-size: 15px;
  color: var(--nav-ink);
  text-decoration: none;
  white-space: nowrap;
}

.site-nav a:hover {
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
}

.site-nav a[aria-current="page"] {
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   Shared building blocks
   -------------------------------------------------------------------------- */

.page-title {
  padding: calc(var(--u) * 54) var(--gutter) calc(var(--u) * 20);
  font-size: var(--t-title);
  font-weight: 400;
  line-height: 1.39;
  letter-spacing: var(--tracking);
  text-align: center;
  color: var(--rust);
}

.page-title--light { color: var(--cream); }

.band {
  padding: max(6px, calc(var(--u) * 5.5)) var(--gutter);
  font-size: var(--t-body);
  font-weight: 400;
  line-height: 1.375;
  letter-spacing: var(--tracking);
  text-align: center;
  color: #000;
  background: var(--mist);
}

.band--taupe {
  color: #fff;
  background: var(--taupe);
}

/* Scroll-in animation (only when JS is running and motion is OK) */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* --------------------------------------------------------------------------
   Home
   -------------------------------------------------------------------------- */

.home {
  padding: calc(var(--u) * 65) var(--gutter) calc(var(--u) * 96);
}

/* Shared column so the hero and the intro line up on the same left edge */
.home__hero,
.home__intro {
  width: min(100%, calc(var(--u) * 900));
  margin-inline: auto;
}

.home__note {
  font-size: var(--t-body);
  font-style: italic;
  line-height: 1.375;
  letter-spacing: var(--tracking);
  color: #000;
}

.home__hello {
  margin-top: calc(var(--u) * 18);
  font-size: var(--t-hero);
  font-weight: 400;
  line-height: 1.39;
  letter-spacing: var(--tracking);
  color: var(--ink);
}

.home__hello em { font-style: italic; }

/* "What I do" text beside the photo; stacks on narrower screens */
.home__intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) calc(var(--u) * 320);
  align-items: center;
  column-gap: calc(var(--u) * 64);
  margin-top: calc(var(--u) * 56);
}

.home__about h2 {
  font-size: var(--t-title);
  font-weight: 400;
  line-height: 1.39;
  letter-spacing: var(--tracking);
  color: var(--rust);
}

.home__about p {
  margin-top: calc(var(--u) * 28);
  font-size: var(--t-body);
  line-height: 1.375;
}

.home__about h2 + p { margin-top: calc(var(--u) * 36); }

.home__photo img {
  width: 100%;
  height: auto;
}

@media (max-width: 900px) {
  .home__intro {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 40px;
    max-width: 620px;
  }
  .home__photo {
    justify-self: center;
    width: min(100%, 340px);
  }
}

/* --------------------------------------------------------------------------
   Financial storytelling: each section is a wide table of three columns
   -------------------------------------------------------------------------- */

.story {
  --rule: rgba(25, 25, 25, 0.16);
  padding: 0 var(--gutter) calc(var(--u) * 90);
}

.story-table {
  width: min(100%, calc(var(--u) * 960));
  margin: calc(var(--u) * 36) auto 0;
  border: 1px solid var(--rule);
  background: rgba(255, 255, 255, 0.35);
}

.story-table + .story-table { margin-top: calc(var(--u) * 56); }

.story-table > .band { border-bottom: 1px solid var(--rule); }

.story-table__body {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 0;
  list-style: none;
}

/* Each cell borrows the table's rows (subgrid), so labels, media and
   captions line up across the columns however long the text is. */
.story-cell {
  display: grid;
  grid-row: span var(--rows, 3);
  grid-template-rows: subgrid;
  row-gap: calc(var(--u) * 16);
  justify-items: center;
  align-content: start;
  padding: calc(var(--u) * 28) calc(var(--u) * 24) calc(var(--u) * 32);
  text-align: center;
}

.story-cell + .story-cell { border-left: 1px solid var(--rule); }

.story-table__body--vo .story-cell { --rows: 2; }

.clip__label {
  font-size: max(17px, calc(var(--u) * 22));
  font-weight: 400;
  line-height: 1.375;
  letter-spacing: var(--tracking);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  color: var(--text);
}

.clip__thumb {
  display: block;
  width: 100%;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.clip__thumb:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(19, 22, 32, 0.18);
}

.clip__thumb img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.clip__caption {
  max-width: 30ch;
  font-size: max(16px, calc(var(--u) * 19));
  line-height: 1.35;
  letter-spacing: var(--tracking);
  text-wrap: balance;
  color: var(--text);
}

.story-table__body--vo .player { width: 100%; }

@media (max-width: 760px) {
  .story-table { width: min(100%, 460px); }
  .story-table__body { grid-template-columns: minmax(0, 1fr); }
  .story-cell { padding: 24px 20px 28px; row-gap: 12px; }
  .story-cell + .story-cell {
    border-left: 0;
    border-top: 1px solid var(--rule);
  }
}

/* Video player with a click-to-play overlay */
.player {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #0f1015;
}

.player video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.player__play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  width: 100%;
  padding: 0;
  border: 0;
  background: linear-gradient(rgba(0, 0, 0, 0) 40%, rgba(19, 22, 32, 0.35));
  cursor: pointer;
}

.player__play span {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(19, 22, 32, 0.6);
  color: #fff;
  transition: transform 0.2s ease, background 0.2s ease;
}

.player__play:hover span {
  transform: scale(1.08);
  background: rgba(19, 22, 32, 0.8);
}

.player.is-playing .player__play { display: none; }

/* Image/video frames. Canva crops some media inside their frames; .crop--custom
   reproduces that with --cw (media width), --cx / --cy (offsets), all in % of the frame. */
.crop {
  position: relative;
  overflow: hidden;
}

.crop > img,
.crop > video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.crop--custom > img,
.crop--custom > video {
  inset: auto;
  top: var(--cy, 0%);
  left: var(--cx, 0%);
  width: var(--cw, 100%);
  height: auto;
  max-width: none;
}

/* --------------------------------------------------------------------------
   Media relations
   -------------------------------------------------------------------------- */

.media {
  padding-bottom: calc(var(--u) * 80);
  color: var(--paper);
}

.media .page-title { padding-top: calc(var(--u) * 102); padding-bottom: calc(var(--u) * 33); }

.caption-light {
  font-size: var(--t-caption);
  line-height: 1.32;
  text-align: center;
  color: var(--paper);
}

.guests {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, calc(var(--u) * 326)));
  justify-content: center;
  margin-top: calc(var(--u) * 82);
  padding: 0;
  list-style: none;
}

.guest {
  display: grid;
  justify-items: center;
  align-content: start;
}

.guest__frame {
  width: calc(var(--u) * 201);
  aspect-ratio: 201 / 267;
}

.guest .caption-light { margin-top: calc(var(--u) * 30); }

.guests + .band { margin-top: calc(var(--u) * 48); }

/* Each conference: its heading centred over its own photo + clip */
.onsite {
  display: grid;
  gap: calc(var(--u) * 64);
  margin-top: calc(var(--u) * 64);
  padding: 0 var(--gutter);
}

.onsite__row {
  display: grid;
  grid-template-columns: minmax(0, calc(var(--u) * 243)) minmax(0, calc(var(--u) * 275));
  justify-content: center;
  align-items: start;
  column-gap: calc(var(--u) * 29);
  row-gap: calc(var(--u) * 24);
}

.onsite__event {
  grid-column: 1 / -1;
  font-size: var(--t-caption);
  font-weight: 400;
  line-height: 1.32;
  text-align: center;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.onsite__photo { aspect-ratio: 243 / 281; }

.onsite__video {
  aspect-ratio: 275 / 154;
  background: #0f1015;
}

.onsite__clip .caption-light { margin-top: calc(var(--u) * 22); }

/* --------------------------------------------------------------------------
   Small screens
   -------------------------------------------------------------------------- */

@media (max-width: 720px) {
  .site-nav ul { justify-content: center; }
  .site-nav a { padding: 0 12px; }

  .home { padding-top: 32px; }
  .home__hello { margin-top: 12px; line-height: 1.2; }
  .home__intro { margin-top: 40px; }
  .home__about h2 + p { margin-top: 20px; }
  .home__about p { margin-top: 18px; }

  .page-title { padding-top: 40px; padding-bottom: 16px; }
  .media .page-title { padding-top: 48px; padding-bottom: 24px; }

  .guests {
    grid-template-columns: 1fr;
    gap: 40px;
    margin-top: 40px;
  }
  .guest__frame { width: min(70vw, 260px); }
  .guest .caption-light { margin-top: 14px; }
  .guests + .band { margin-top: 48px; }

  .onsite { margin-top: 40px; gap: 56px; }
  .onsite__row {
    grid-template-columns: 1fr;
    justify-items: center;
    row-gap: 16px;
  }
  .onsite__photo,
  .onsite__clip { width: min(100%, 340px); }
  .onsite__clip .caption-light { margin-top: 12px; }
}
