/* ============================================================
   michaelolaiya.com — shared system for the interior pages
   (music · art · travel · causes · opportunity)
   The homepage (index.html) keeps its own bespoke stylesheet;
   this file is the single source of truth for everything else.
   ============================================================ */

:root {
  --bg:       #100D0A;
  --bg-2:     #16120D;
  --panel:    #1A140E;
  --ink:      #ECE5D8;
  --ink-soft: #C6BCA9;
  --muted:    #8C8375;
  --brass:    #C4A461;
  --brass-bright: #DDBE80;
  --rule:     #2B241B;

  --serif: "Fraunces", "Hoefler Text", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --measure: 44rem;   /* prose */
  --wide:    76rem;   /* nav + wide furniture, matches the homepage */
  --gutter:  clamp(1.4rem, 6vw, 3.4rem);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; }

.page {
  position: relative;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---- Ambient depth (same recipe as the homepage) ---- */
.motif {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: radial-gradient(var(--brass) 1px, transparent 1.4px);
  background-size: 30px 30px;
  opacity: 0.085;
  -webkit-mask-image: radial-gradient(ellipse 75% 65% at 50% 38%, transparent 30%, #000 100%);
          mask-image: radial-gradient(ellipse 75% 65% at 50% 38%, transparent 30%, #000 100%);
}
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
}
.glow {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(58rem 40rem at 78% 4%, rgba(196,164,97,0.18), transparent 60%),
    radial-gradient(46rem 38rem at 4% 56%, rgba(168,120,58,0.10), transparent 58%),
    radial-gradient(52rem 42rem at 92% 96%, rgba(150,110,60,0.09), transparent 60%);
}

/* ---- Sticky cross-navigation ---- */
.sitenav {
  position: sticky; top: 0; z-index: 20;
  background: rgba(16,13,10,0.72);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
          backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease;
}
.sitenav.stuck { border-bottom-color: var(--rule); background: rgba(16,13,10,0.88); }
.nav-inner {
  max-width: var(--wide); margin: 0 auto; padding: 0.95rem var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 1.2rem;
}
.mark {
  font-family: var(--serif); font-weight: 500; font-size: 1.2rem;
  letter-spacing: 0.12em; color: var(--ink); text-decoration: none; line-height: 1; white-space: nowrap;
}
.mark .gd { color: var(--brass); }
.nav-links { display: flex; flex-wrap: wrap; gap: clamp(0.9rem, 2.2vw, 1.9rem); }
.nav-links a {
  position: relative; font-family: var(--sans); font-size: 0.7rem; font-weight: 500;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted);
  text-decoration: none; padding-bottom: 0.25rem; transition: color 0.22s ease;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 0;
  background: var(--brass); transition: width 0.3s cubic-bezier(.2,.7,.2,1);
}
.nav-links a:hover { color: var(--brass-bright); }
.nav-links a:hover::after { width: 100%; }
.nav-links a.is-current { color: var(--ink); }
.nav-links a.is-current::after { width: 100%; background: var(--brass); }
.nav-links a:focus-visible { outline: 2px solid var(--brass); outline-offset: 4px; border-radius: 2px; }

/* ---- Page hero: full-bleed cinematic header ---- */
.page-hero {
  position: relative; z-index: 1;
  min-height: clamp(19rem, 54vh, 30rem);
  display: flex; align-items: flex-end;
  margin-top: -3.4rem;            /* slide under the translucent nav */
  padding: 8rem 0 clamp(2.6rem, 6vh, 4.2rem);
  overflow: hidden;
}
.page-hero-img {
  position: absolute; inset: 0; z-index: 0;
  width: 100%; height: 100%; object-fit: cover; object-position: center;
  /* Alpha mask, never a solid colour overlay — a solid scrim would blot out
     the ambient glow and leave a hard seam against the page. */
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 46%, transparent 100%);
          mask-image: linear-gradient(180deg, #000 0%, #000 46%, transparent 100%);
}
/* Scrim is dark where the title sits, then falls to zero at the very bottom so
   the band has no hard step against the page below it. */
.page-hero::before {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background:
    linear-gradient(180deg, rgba(16,13,10,0.66) 0%, rgba(16,13,10,0.22) 32%, rgba(16,13,10,0.58) 78%, rgba(16,13,10,0) 100%);
}
/* Matches the prose measure so the title lines up with the body copy below */
.page-hero-inner {
  position: relative; z-index: 2;
  width: 100%; max-width: var(--measure); margin: 0 auto; padding: 0 var(--gutter);
}
/* Typographic variant — used by the essay, which has no header image */
.page-hero.is-type { min-height: clamp(15rem, 40vh, 22rem); }
.page-hero.is-type::before { background: none; }

.eyebrow {
  font-family: var(--sans); font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.26em; text-transform: uppercase; color: var(--brass); margin: 0 0 1.1rem;
}
h1 {
  font-weight: 300; font-size: clamp(2.8rem, 8.5vw, 6rem);
  font-optical-sizing: auto; line-height: 0.95; letter-spacing: -0.04em;
  margin: 0; text-wrap: balance; text-shadow: 0 2px 30px rgba(16,13,10,0.85);
}
h1 .gd { color: var(--brass); }
/* The essay title is a sentence, not a word — it needs a tighter scale */
.page-hero.is-type h1 {
  font-weight: 400; font-size: clamp(2rem, 5.2vw, 3.5rem); line-height: 1.08;
  letter-spacing: -0.025em; max-width: 24ch; text-shadow: none;
}
.byline {
  font-family: var(--sans); font-size: 0.78rem; letter-spacing: 0.06em;
  color: var(--muted); margin: 1.6rem 0 0;
}

/* ---- Body ---- */
.shell {
  position: relative; z-index: 1;
  max-width: var(--measure); margin: 0 auto;
  padding: clamp(2.4rem, 6vw, 3.8rem) var(--gutter) clamp(3rem, 7vw, 5rem);
}
.lead {
  font-size: clamp(1.14rem, 2.2vw, 1.34rem); line-height: 1.66;
  color: var(--ink-soft); margin: 0; text-wrap: pretty;
}
.lead em { color: var(--brass-bright); font-style: italic; }
.rule { width: 3rem; height: 2px; background: var(--brass); border: none; margin: 2.4rem 0 0; opacity: 0.85; }

.entries { margin-top: clamp(1.8rem, 4vw, 2.8rem); }
.entry { position: relative; padding: 2.3rem 0; border-top: 1px solid var(--rule); }
.entry:first-child { border-top: none; padding-top: 0.6rem; }
.entry h2 {
  font-weight: 400; font-size: clamp(1.7rem, 4vw, 2.2rem); letter-spacing: -0.015em;
  margin: 0 0 0.8rem; color: var(--ink);
}
.entry h2 em { font-family: var(--sans); font-style: normal; font-size: 0.6rem; font-weight: 600;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--brass);
  vertical-align: 0.5em; margin-left: 0.7rem; }
.entry p { font-size: 1.1rem; color: var(--ink-soft); margin: 0; text-wrap: pretty; }
.entry em { color: var(--brass-bright); font-style: italic; }
.entry a, .artlink {
  color: var(--brass-bright); text-decoration: none;
  border-bottom: 1px solid rgba(198,164,100,0.4); transition: border-color 0.22s ease;
}
.entry a:hover, .artlink:hover { border-bottom-color: var(--brass-bright); }
.artlink {
  display: inline-block; margin-top: 1.1rem; font-family: var(--sans);
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em; border-bottom: none;
}
.artlink::after { content: ""; display: block; height: 1px; width: 0; background: var(--brass); transition: width 0.3s cubic-bezier(.2,.7,.2,1); }
.artlink:hover::after { width: 100%; }

/* ---- World map ----------------------------------------------------------
   Land is rendered as a dot matrix on purpose: the same dot motif that sits
   behind every page, so the map reads as part of the brand rather than an
   embedded graphic. Geometry is Natural Earth (public domain), reprojected. */
.worldmap {
  position: relative; margin: clamp(2.4rem, 5vw, 3.4rem) 0 0;
  width: 100vw; margin-left: calc(50% - 50vw);
  padding: 0 clamp(0.6rem, 3vw, 2rem);
}
.worldmap svg { display: block; width: 100%; height: auto; overflow: visible; }

.landdots { opacity: 0.62; }

.maplines { fill: none; }
.mapline {
  stroke: var(--brass); stroke-width: 1.1; opacity: 0.45;
  stroke-linecap: round;
  stroke-dasharray: 1.4 5;
  stroke-dashoffset: 0;
  animation: drift 40s linear infinite;
}
@keyframes drift { to { stroke-dashoffset: -120; } }

.mapmark { cursor: default; }
.mapmark .dot   { fill: var(--brass-bright); }
.mapmark .halo  { fill: var(--brass); opacity: 0.16; transition: opacity 0.3s ease, r 0.3s ease; }
.mapmark .ring  { fill: none; stroke: var(--brass-bright); stroke-width: 1.4; opacity: 0.85; }
.mapmark .lbl {
  font-family: var(--sans); font-size: 11px; font-weight: 500; letter-spacing: 0.12em;
  text-transform: uppercase; fill: var(--ink);
  opacity: 0; transition: opacity 0.28s ease;
  paint-order: stroke; stroke: rgba(16,13,10,0.9); stroke-width: 3px; stroke-linejoin: round;
}
.mapmark:hover .lbl, .mapmark:focus .lbl, .mapmark:focus-visible .lbl { opacity: 1; }
.mapmark:hover .halo, .mapmark:focus .halo { opacity: 0.34; }
.mapmark:focus { outline: none; }
.mapmark:focus-visible .dot { stroke: var(--brass-bright); stroke-width: 2; }
/* Home stays labelled — it is the anchor the whole map radiates from */
.mapmark.is-home .lbl { opacity: 1; }

.worldmap figcaption {
  display: flex; flex-wrap: wrap; gap: 0.4rem 1.6rem; justify-content: center;
  margin-top: clamp(0.6rem, 2vw, 1.2rem);
  font-family: var(--sans); font-size: 0.68rem; font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted);
}
.mapkey { display: inline-flex; align-items: center; gap: 0.5rem; }
.mapkey i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.mapkey .k-home { border: 1.4px solid var(--brass-bright); }
.mapkey .k-been { background: var(--brass-bright); }

/* The SVG scales with the viewport, so on a phone the markers would render
   about two pixels wide. Pins are their own group with the position baked into
   the parent transform, which lets them be scaled back up independently. */
.pin { transform: scale(1); transition: transform 0.3s cubic-bezier(.2,.7,.2,1); }
.mapmark:hover .pin, .mapmark:focus .pin { transform: scale(1.18); }

@media (max-width: 860px) {
  .pin { transform: scale(1.7); }
  .mapmark:hover .pin, .mapmark:focus .pin { transform: scale(1.7); }
  .mapline { stroke-width: 1.8; opacity: 0.5; }
  .landdots { opacity: 0.72; }
  /* Labels can't shrink gracefully at this scale — the list below carries them */
  .mapmark .lbl { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .mapline { animation: none; }
}

/* ---- Photo grid (places, portraits) -------------------------------------
   Sources are CC0 / public-domain. The duotone is applied in CSS rather than
   baked into the files, so one rule keeps every image on-palette. */
.photogrid {
  --grid-cols: 3;
  display: grid; grid-template-columns: repeat(var(--grid-cols), minmax(0, 1fr));
  gap: clamp(0.7rem, 1.6vw, 1.1rem);
  margin: clamp(2.4rem, 5vw, 3.4rem) 0 0;
  /* Break out wider than the prose measure. Done with margin maths, NOT a
     transform — [data-reveal] animates `transform` and would cancel it. */
  --gw: min(64rem, calc(100vw - 2 * var(--gutter)));
  width: var(--gw);
  margin-left: calc(50% - var(--gw) / 2);
}
.photocard {
  position: relative; display: block; overflow: hidden;
  margin: 0;                      /* figure carries UA side margins */
  border-radius: 12px; border: 1px solid var(--rule);
  background: var(--panel); aspect-ratio: 3 / 2;
}
.photocard img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  filter: grayscale(1) sepia(0.62) saturate(1.5) hue-rotate(-8deg) brightness(0.9) contrast(1.06);
  transform: scale(1.02);
  transition: transform 0.7s cubic-bezier(.2,.7,.2,1), filter 0.5s ease;
}
.photocard::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(16,13,10,0) 42%, rgba(16,13,10,0.86) 100%);
}
.photocard figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 0.9rem 1rem;
  font-family: var(--sans); font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink);
}
.photocard:hover img { transform: scale(1.07); filter: grayscale(1) sepia(0.5) saturate(1.7) hue-rotate(-8deg) brightness(1) contrast(1.06); }

/* Portrait variant — taller cards, framed on the face */
.photogrid.is-faces { --grid-cols: 4; --gw: min(58rem, calc(100vw - 2 * var(--gutter))); }
.photocard.is-portrait { aspect-ratio: 3 / 4; }
.photocard.is-portrait img { object-position: center 22%; filter: grayscale(1) sepia(0.55) saturate(1.35) hue-rotate(-8deg) brightness(0.94) contrast(1.04); }
.photocard.is-portrait figcaption { font-size: 0.66rem; letter-spacing: 0.14em; padding: 0.75rem 0.85rem; }
@media (max-width: 900px) { .photogrid.is-faces { --grid-cols: 3; } }
@media (max-width: 560px) { .photogrid.is-faces { --grid-cols: 2; } }

/* ---- Artwork plates ------------------------------------------------------
   Deliberately NOT duotoned. Recolouring a painting misrepresents it —
   Mondrian's primaries are the work. Shown whole, never cropped. */
.plategrid {
  --pw: min(58rem, calc(100vw - 2 * var(--gutter)));
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(0.7rem, 1.6vw, 1.2rem);
  width: var(--pw); margin: clamp(1.8rem, 4vw, 2.6rem) 0 0 calc(50% - var(--pw) / 2);
}
.plate { margin: 0; display: flex; flex-direction: column; gap: 0.7rem; }
.plate img {
  width: 100%; aspect-ratio: 1 / 1; object-fit: contain;
  background: #0C0A07; border: 1px solid var(--rule); border-radius: 10px;
  padding: 0.7rem; transition: border-color 0.3s ease, transform 0.4s cubic-bezier(.2,.7,.2,1);
}
.plate:hover img { border-color: rgba(198,164,100,0.42); transform: translateY(-3px); }
.plate figcaption { display: flex; flex-direction: column; gap: 0.16rem; font-family: var(--sans); line-height: 1.4; }
.plate figcaption b { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--brass-bright); }
.plate figcaption span { font-size: 0.78rem; color: var(--ink-soft); font-style: italic; }
.plate figcaption i { font-size: 0.7rem; color: var(--muted); font-style: normal; letter-spacing: 0.06em; }

@media (max-width: 900px) { .plategrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 460px) { .plategrid { grid-template-columns: 1fr; } }

.photonote {
  margin: 1.1rem 0 0; font-family: var(--sans); font-size: 0.66rem;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted);
}

@media (max-width: 900px) { .photogrid { --grid-cols: 2; } }
@media (max-width: 560px) { .photogrid { --grid-cols: 1; } }

/* ---- Mid-article full-bleed image ---- */
.mid {
  display: block; width: 100vw; margin-left: calc(50% - 50vw);
  height: clamp(14rem, 34vh, 22rem); object-fit: cover; object-position: center;
  margin-top: clamp(2.6rem, 6vw, 4rem); margin-bottom: clamp(2.6rem, 6vw, 4rem);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 18%, #000 82%, transparent 100%);
          mask-image: linear-gradient(180deg, transparent 0%, #000 18%, #000 82%, transparent 100%);
}

/* ---- Closing notes ---- */
.closing { font-style: italic; color: var(--ink-soft); }
.closer {
  margin: clamp(2.4rem, 5vw, 3.4rem) 0 0; padding-top: 1.8rem;
  border-top: 1px solid var(--rule);
  font-size: 1.12rem; color: var(--ink-soft); text-wrap: pretty;
}
.closer a { color: var(--brass-bright); text-decoration: none; border-bottom: 1px solid rgba(198,164,100,0.4); }
.closer a:hover { border-bottom-color: var(--brass-bright); }

/* ---- Essay typography ---- */
article p { font-size: 1.15rem; color: var(--ink-soft); margin: 0 0 1.4rem; text-wrap: pretty; }
article p.lead-para { font-size: 1.3rem; color: var(--ink); }
article p.lead-para::first-letter {
  font-family: var(--serif); font-weight: 300; font-size: 3.4em; line-height: 0.72;
  float: left; margin: 0.06em 0.12em 0 0; color: var(--brass);
}
article em { color: var(--brass-bright); font-style: italic; }
article .pull {
  font-size: clamp(1.5rem, 3.4vw, 2.1rem); line-height: 1.3; color: var(--ink); font-style: italic;
  margin: 2.6rem 0; padding-left: 1.4rem; border-left: 2px solid var(--brass); text-wrap: pretty;
}
article a { color: var(--brass-bright); text-decoration: none; border-bottom: 1px solid rgba(198,164,100,0.4); }
article a:hover { border-bottom-color: var(--brass-bright); }
.sign { margin-top: 2rem; font-style: italic; color: var(--ink); }

/* ---- Continue exploring ---- */
.more {
  max-width: var(--wide); margin: 0 auto;
  padding: clamp(2rem, 5vw, 3rem) var(--gutter) clamp(3rem, 7vw, 4.5rem);
  position: relative; z-index: 1;
}
.more-head {
  font-family: var(--sans); font-size: 0.68rem; font-weight: 600; letter-spacing: 0.26em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 1.4rem;
  padding-top: 1.6rem; border-top: 1px solid var(--rule);
}
.more-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(0.8rem, 1.6vw, 1.1rem); }
.more-card {
  display: flex; flex-direction: column; gap: 0.5rem; text-decoration: none;
  padding: 1.3rem 1.3rem 1.5rem;
  background: linear-gradient(160deg, rgba(255,255,255,0.028), rgba(255,255,255,0) 62%), var(--panel);
  border: 1px solid var(--rule); border-radius: 14px;
  transition: border-color 0.3s ease, transform 0.3s cubic-bezier(.2,.7,.2,1);
}
.more-card::before { content: ""; width: 1.5rem; height: 2px; background: var(--brass); opacity: 0.9; transition: width 0.35s cubic-bezier(.2,.7,.2,1); }
.more-card:hover { border-color: rgba(198,164,100,0.42); transform: translateY(-3px); }
.more-card:hover::before { width: 3rem; }
.more-card h3 { font-weight: 400; font-size: 1.24rem; margin: 0.3rem 0 0; color: var(--ink); letter-spacing: -0.01em; }
.more-card p { font-family: var(--sans); font-size: 0.82rem; line-height: 1.55; color: var(--muted); margin: 0; }
.more-card:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }

/* ---- Footer ---- */
.page-foot {
  position: relative; z-index: 1;
  max-width: var(--wide); margin: 0 auto;
  padding: 2.2rem var(--gutter) clamp(2.6rem, 6vw, 3.6rem);
  border-top: 1px solid var(--rule);
  display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between;
}
.page-foot a.home {
  font-family: var(--sans); font-size: 0.82rem; font-weight: 500; letter-spacing: 0.04em;
  color: var(--brass-bright); text-decoration: none; transition: color 0.2s ease;
}
.page-foot a.home:hover { color: var(--brass); }
.page-foot .fine {
  font-family: var(--sans); font-size: 0.66rem; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--muted); margin: 0;
}

/* ---- Motion ---- */
[data-reveal] { opacity: 0; transform: translateY(20px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(.2,.7,.2,1); }
[data-reveal].in { opacity: 1; transform: none; }

/* ---- Responsive ---- */
@media (max-width: 860px) {
  .nav-inner { flex-direction: column; align-items: flex-start; gap: 0.7rem; padding-bottom: 0.8rem; }
  .page-hero { margin-top: 0; padding-top: clamp(2.4rem, 8vh, 4rem); }
  .more-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .more-grid { grid-template-columns: 1fr; }
  .nav-links { gap: 0.85rem 1.1rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal] { opacity: 1; transform: none; transition: none; }
}
