/*
 * Flute of the Soul — design system
 * ---------------------------------
 * The site carries two worlds: a macOS desktop shell and Krishna's bansuri.
 * What joins them is sound. A flute only speaks when breath passes through
 * emptiness, and the work here is real-time voice AI — so sound is the thesis,
 * not ornament. Marcellus carries the mythic voice, Sora the engineer's, and
 * JetBrains Mono the measurements.
 *
 * Loaded after styles.css so it re-skins the existing Mac shell in place.
 */

/*
 * Palette — a white theme in the feather's own colours.
 * On light ground the accents must carry real weight, so the teal and gold are
 * pulled dark enough to pass contrast on white (peacock #0F7A6E ~4.8:1,
 * gold-ink #8A5E12 ~5.6:1). The bright teal is kept for large marks only.
 */
:root {
  --paper: #fbfaf7;        /* the ground: warm white, never clinical */
  --paper-raised: #ffffff; /* cards and windows */
  --paper-sunk: #f2efe9;   /* wells, hovers, code */
  --peacock: #0f7a6e;      /* primary accent, text-safe on white */
  --peacock-bright: #1b9c93; /* large marks and fills only */
  --peacock-deep: #0b5c53;
  --gold: #8a5e12;         /* temple gold, text-safe */
  --gold-bright: #c08a2e;  /* for strokes and marks */
  --ink: #16181d;          /* primary text */
  --ink-soft: #4a4f57;     /* secondary text */
  --ink-faint: #767c86;    /* tertiary text, still 4.5:1 on paper */
  --hairline: rgba(22, 24, 29, 0.1);
  --hairline-gold: rgba(192, 138, 46, 0.34);
  --shadow-sm: 0 1px 2px rgba(22, 24, 29, 0.06);
  --shadow-md: 0 6px 20px rgba(22, 24, 29, 0.08),
    0 1px 3px rgba(22, 24, 29, 0.06);
  --shadow-lg: 0 20px 50px rgba(22, 24, 29, 0.13),
    0 2px 8px rgba(22, 24, 29, 0.07);

  /* Type */
  --font-display: "Marcellus", "Cormorant Garamond", Georgia, serif;
  --font-ui: "Sora", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Rhythm */
  --step-1: 0.5rem;
  --step-2: 1rem;
  --step-3: 1.75rem;
  --step-4: 3rem;
  --step-5: 5rem;
}

/* ---------------------------------------------------------------- eyebrow */
/* A label, set in mono because it is metadata, not prose. */
.soul-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--peacock);
  display: flex;
  align-items: center;
  gap: 0.7em;
}

.soul-eyebrow::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--hairline-gold), transparent);
}

/* ------------------------------------------------------------------- hero */
.soul-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(3rem, 9vw, 7rem) clamp(1.5rem, 5vw, 4.5rem) var(--step-4);
  background: var(--paper);
  color: var(--ink);
  isolation: isolate;
}

/* Ambient breath — a slow teal/gold bloom, the glow of a feather's eye.
   Sits behind content and never animates layout. */
.soul-hero::before {
  content: "";
  position: absolute;
  inset: -30% -10% auto -10%;
  height: 130%;
  z-index: -1;
  background:
    radial-gradient(
      46% 50% at 20% 22%,
      rgba(27, 156, 147, 0.13),
      transparent 70%
    ),
    radial-gradient(
      40% 42% at 84% 14%,
      rgba(192, 138, 46, 0.1),
      transparent 70%
    );
}

.soul-hero-inner {
  max-width: 62rem;
  margin: 0 auto;
}

.soul-hero-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.6rem, 7.2vw, 5.4rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
  margin: var(--step-3) 0 0;
  text-wrap: balance;
}

/* The one word that carries the thesis. */
.soul-hero-title em {
  font-style: normal;
  color: var(--gold);
}

.soul-hero-lede {
  font-family: var(--font-ui);
  font-size: clamp(1.05rem, 1.9vw, 1.3rem);
  line-height: 1.62;
  color: var(--ink-soft);
  max-width: 38rem;
  margin: var(--step-3) 0 0;
}

/* The name's meaning, set as a quiet aside — earns the domain without
   explaining itself twice. */
.soul-note {
  font-family: var(--font-display);
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--ink-faint);
  max-width: 30rem;
  margin: var(--step-3) 0 0;
  padding-left: 1rem;
  border-left: 1px solid var(--hairline-gold);
}

/* ------------------------------------------------------------ breath line */
/* The signature, carried through from the loader: a bansuri's breath drawn
   as a waveform. Purely decorative, so it is hidden from assistive tech. */
.breath-line {
  margin: var(--step-4) 0 0;
  width: 100%;
  max-width: 34rem;
  height: 48px;
  display: block;
  overflow: visible;
}

.breath-line path {
  fill: none;
  stroke: url(#breathGradient);
  stroke-width: 1.6;
  stroke-linecap: round;
}

/* ------------------------------------------------------------------- CTAs */
.soul-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--step-2);
  margin-top: var(--step-4);
}

.soul-btn {
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 550;
  letter-spacing: -0.005em;
  padding: 0.8em 1.5em;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  transition: transform 0.18s ease, background-color 0.18s ease,
    border-color 0.18s ease, color 0.18s ease;
}

.soul-btn--primary {
  background: var(--peacock);
  color: #ffffff;
}

.soul-btn--primary:hover {
  background: var(--peacock-deep);
  transform: translateY(-1px);
}

.soul-btn--ghost {
  border-color: var(--hairline);
  color: var(--ink);
}

.soul-btn--ghost:hover {
  border-color: var(--gold);
  color: var(--gold);
  transform: translateY(-1px);
}

.soul-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* ------------------------------------------------------------ proof strip */
/* Metrics from shipped work. Mono, because these are measurements. */
.soul-proof {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 1px;
  background: var(--hairline);
  border-block: 1px solid var(--hairline);
  margin-top: var(--step-5);
}

.soul-proof-item {
  background: var(--paper);
  padding: var(--step-3) var(--step-2);
}

.soul-proof-value {
  font-family: var(--font-mono);
  font-size: clamp(1.35rem, 2.6vw, 1.85rem);
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.soul-proof-value span {
  color: var(--peacock);
}

.soul-proof-label {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--ink-faint);
  margin-top: 0.4em;
}

/* ------------------------------------------------------------- section head */
.soul-section {
  padding: var(--step-5) clamp(1.5rem, 5vw, 4.5rem);
  background: var(--paper);
  color: var(--ink);
}

.soul-section + .soul-section {
  padding-top: 0;
}

.soul-section-inner {
  max-width: 62rem;
  margin: 0 auto;
}

.soul-section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin: var(--step-2) 0 0;
}

.soul-section-sub {
  font-family: var(--font-ui);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 34rem;
  margin: 0.75rem 0 0;
}

/* --------------------------------------------------------------- work cards */
.soul-work {
  display: grid;
  gap: var(--step-2);
  margin-top: var(--step-4);
}

.soul-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: clamp(1rem, 3vw, 2.5rem);
  padding: clamp(1.4rem, 3vw, 2rem);
  background: var(--paper-raised);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease, background-color 0.2s ease,
    transform 0.2s ease;
}

.soul-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--hairline-gold);
  transform: translateY(-2px);
}

.soul-card:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.soul-card-role {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--peacock);
}

.soul-card-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.2rem, 2.2vw, 1.5rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0.5rem 0 0;
}

.soul-card-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1rem;
}

.soul-chip {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  padding: 0.32em 0.7em;
  border: 1px solid var(--hairline);
  border-radius: 999px;
}

/* problem → approach → impact, as a real three-beat structure */
.soul-beats {
  display: grid;
  gap: 0.9rem;
  margin: 0;
}

.soul-beat {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  gap: 0.9rem;
  align-items: baseline;
}

.soul-beat dt {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding-top: 0.25em;
}

.soul-beat dd {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

.soul-beat--impact dd {
  color: var(--ink);
}

.soul-beat--impact strong {
  color: var(--gold);
  font-weight: 550;
}

/* ------------------------------------------------------------- writing list */
.soul-writing {
  margin-top: var(--step-4);
  border-top: 1px solid var(--hairline);
}

.soul-post {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr) auto;
  gap: var(--step-2);
  align-items: baseline;
  padding: 1.15rem 0.25rem;
  border-bottom: 1px solid var(--hairline);
  text-decoration: none;
  color: inherit;
  transition: padding-left 0.2s ease, background-color 0.2s ease;
}

.soul-post:hover {
  padding-left: 0.85rem;
  background: linear-gradient(90deg, rgba(15, 122, 110, 0.06), transparent);
}

.soul-post:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.soul-post-date {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  text-transform: uppercase;
}

.soul-post-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.08rem;
  line-height: 1.35;
  letter-spacing: -0.015em;
  margin: 0;
}

.soul-post-arrow {
  font-family: var(--font-mono);
  color: var(--peacock);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.soul-post:hover .soul-post-arrow {
  opacity: 1;
  transform: translateX(2px);
}

.soul-writing-empty {
  font-family: var(--font-ui);
  font-size: 0.95rem;
  color: var(--ink-faint);
  padding: 1.15rem 0.25rem;
}

/* --------------------------------------------------------------- desktop nav */
/* The folder grid stays — it is the Mac metaphor — but it now reads as a
   secondary index below the landing content rather than the front door. */
.soul-index {
  padding: var(--step-5) clamp(1.5rem, 5vw, 4.5rem) var(--step-4);
  background: var(--paper);
  border-top: 1px solid var(--hairline);
}

.soul-index-inner {
  max-width: 62rem;
  margin: 0 auto;
}

/* ------------------------------------------------------------------ reveal */
@media (prefers-reduced-motion: no-preference) {
  .soul-reveal {
    animation: soul-rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  .soul-reveal-2 {
    animation-delay: 0.08s;
  }
  .soul-reveal-3 {
    animation-delay: 0.16s;
  }
  .soul-reveal-4 {
    animation-delay: 0.24s;
  }

  @keyframes soul-rise {
    from {
      opacity: 0;
      transform: translateY(14px);
    }
  }
}

/* ------------------------------------------------------------------ mobile */
@media (max-width: 860px) {
  .soul-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .soul-post {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .soul-post-date {
    grid-column: 1 / -1;
    order: -1;
  }

  .soul-beat {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.2rem;
  }
}

/* ------------------------------------------------------------ dock glyphs */
.dock-glyph {
  width: 21px;
  height: 21px;
}

/* --------------------------------------------------------- section previews */
/* Nine windows, each stating what is behind it. Rows rather than tiles: the
   blurb is the point, and a row gives it somewhere to live. */
.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
  gap: 0.75rem;
  margin-top: var(--step-4);
}

.preview-card {
  width: 100%;
  padding: 1.1rem 1.15rem;
  text-align: left;
  background: var(--paper-raised);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease,
    transform 0.2s ease;
}

.preview-card:hover {
  border-color: var(--hairline-gold);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.preview-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(15, 122, 110, 0.07);
  color: var(--peacock);
  flex-shrink: 0;
}

.preview-glyph {
  width: 19px;
  height: 19px;
}

.preview-title {
  display: block;
  font-family: var(--font-display);
  font-size: 1.06rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.25;
}

.preview-blurb {
  display: block;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--ink-faint);
}

.preview-arrow {
  color: var(--ink-faint);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.preview-arrow svg {
  width: 18px;
  height: 18px;
  display: block;
}

.preview-card:hover .preview-arrow {
  opacity: 1;
  transform: translateX(0);
  color: var(--peacock);
}

/* ----------------------------------------------------------------- footer */
.soul-footer {
  padding: var(--step-5) clamp(1.5rem, 5vw, 4.5rem) var(--step-3);
  border-top: 1px solid var(--hairline);
  background:
    radial-gradient(
      70% 90% at 12% 0%,
      rgba(27, 156, 147, 0.07),
      transparent 70%
    ),
    radial-gradient(
      60% 80% at 92% 10%,
      rgba(192, 138, 46, 0.07),
      transparent 70%
    ),
    var(--paper);
}

.soul-footer-top {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 5rem);
  max-width: 68rem;
  margin: 0 auto;
}

.soul-footer-mark {
  width: 84px;
  height: auto;
  display: block;
  margin-bottom: 1.25rem;
}

.soul-footer-kicker {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0;
}

.soul-footer-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4.4vw, 2.9rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 0.85rem 0 0;
  text-wrap: balance;
}

.soul-footer-sub {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink-soft);
  max-width: 30rem;
  margin: 0.9rem 0 0;
}

.soul-footer-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
  gap: 1.75rem;
  padding-top: 0.5rem;
}

.soul-footer-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.55rem;
}

.soul-footer-head {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 0.2rem;
}

.soul-footer-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 0.92rem;
  color: var(--ink-soft);
  text-decoration: none;
  cursor: pointer;
  position: relative;
  transition: color 0.18s ease;
}

/* The underline grows from the left — small, and it makes the link feel alive. */
.soul-footer-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: var(--peacock);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.soul-footer-link:hover {
  color: var(--peacock);
}

.soul-footer-link:hover::after {
  transform: scaleX(1);
}

.soul-footer-base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  max-width: 68rem;
  margin: var(--step-4) auto 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--hairline);
  font-size: 0.8rem;
  color: var(--ink-faint);
}

.soul-footer-base p {
  margin: 0;
}

.soul-footer-note {
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: var(--ink-soft);
}

@media (max-width: 860px) {
  .soul-footer-top {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5rem;
  }

  .preview-card {
    padding: 0.9rem 1rem;
  }
}

/* -------------------------------------------- preview cards, with substance */
/* Each card now carries the section's actual key points, so the front page
   stands on its own and the windows are for going deeper. */
.preview-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  align-items: stretch;
}

.preview-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.85rem;
}

.preview-heading {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.preview-points {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--hairline);
}

.preview-point {
  position: relative;
  padding-left: 1.05rem;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

/* A hairline tick rather than a bullet — quieter, and it lines up. */
.preview-point::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 7px;
  height: 1px;
  background: var(--peacock);
  opacity: 0.65;
}

/* ------------------------------------------------------------- the loop */
/* Numbered because it genuinely is a sequence — the steps only make sense in
   order, and step 4 refers back to step 1. */
.loop-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
  gap: 1px;
  margin: var(--step-4) 0 0;
  padding: 0;
  list-style: none;
  background: var(--hairline);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  overflow: hidden;
}

.loop-step {
  position: relative;
  background: var(--paper-raised);
  padding: 1.5rem 1.35rem;
  transition: background-color 0.25s ease;
}

.loop-step:hover {
  background: var(--paper-sunk);
}

/* The connecting line: the loop closes back on itself. */
.loop-step::after {
  content: "";
  position: absolute;
  right: -1px;
  top: 2.35rem;
  width: 1px;
  height: 0;
  background: var(--peacock);
  transition: height 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.loop-step.is-in::after {
  height: calc(100% - 3rem);
}

.loop-step:last-child::after {
  display: none;
}

.loop-index {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  color: var(--peacock);
}

.loop-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0.5rem 0 0.5rem;
}

.loop-body {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0;
}

/* The hidden attribute must win over any display rule. The desktop-icon grid
   is kept in the DOM for main.js but should never be seen. */
[hidden] {
  display: none !important;
}

/* ---------------------------------------------------- window intro lines */
/* A short line at the top of each window so the sections read as one voice. */
.window-kicker {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--peacock);
  margin: 0 0 0.4rem;
}

.window-intro {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--hairline);
  max-width: 44rem;
}

/* ------------------------------------------------------- footer wordmark */
/*
 * The name at full width, bleeding to both edges — the last thing you see.
 * Letters rise from a mask as the footer arrives, and the gradient drifts
 * slowly across them so the mark feels lit rather than printed.
 */
.footer-wordmark {
  margin: var(--step-5) 0 0;
  padding: 0 clamp(0.5rem, 2vw, 1.5rem);
  overflow: hidden;
  /* Tight, but not so tight that overflow:hidden crops the ascenders. */
  line-height: 0.95;
  text-align: center;
}

.footer-wordmark-text {
  display: block;
  font-family: var(--font-display);
  /* Sized so the word spans the width at any viewport: 14 characters. */
  font-size: clamp(2.2rem, 13.2vw, 15rem);
  letter-spacing: -0.02em;
  white-space: nowrap;
  background: linear-gradient(
    100deg,
    var(--peacock-deep) 0%,
    var(--peacock-bright) 34%,
    var(--gold-bright) 62%,
    var(--peacock) 100%
  );
  /* The whole gradient spans the word, so the gold end is always visible.
     A 260% background only ever showed the teal start at rest. */
  background-size: 100% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

/* The mark animates as a single element — see anim.js for why it is not
   split into per-letter spans. */
.footer-wordmark-text {
  will-change: transform;
}

@media (prefers-reduced-motion: no-preference) {
  /*
   * The mark rises once as a whole. `both` fill means it always ends visible,
   * and the reveal class is additive — if the observer never fires, the CSS
   * animation below has already left it in place.
   */
  .js-anim .footer-wordmark-text {
    animation: wm-rise 1s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both,
      wordmark-drift 14s ease-in-out 1.2s infinite;
  }

  @keyframes wm-rise {
    from {
      opacity: 0;
      transform: translateY(60%);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* With the gradient fully visible, drift is a slow warmth shift rather than
     a slide — the mark breathes without the colours sliding off the word. */
  @keyframes wordmark-drift {
    0%,
    100% {
      filter: saturate(1) brightness(1);
    }
    50% {
      filter: saturate(1.18) brightness(1.05);
    }
  }
}

/* ---------------------------------------------------- home colour fade */
/*
 * A slow wash of feather colour behind the hero. Two blooms cross-fade and
 * drift on long, offset cycles so the page is never quite still, but nothing
 * moves fast enough to pull the eye off the text.
 */
@media (prefers-reduced-motion: no-preference) {
  .soul-hero::before {
    animation: hero-wash 22s ease-in-out infinite alternate;
  }

  @keyframes hero-wash {
    0% {
      opacity: 0.75;
      transform: translate3d(-2%, -1%, 0) scale(1);
    }
    50% {
      opacity: 1;
      transform: translate3d(2%, 1.5%, 0) scale(1.06);
    }
    100% {
      opacity: 0.85;
      transform: translate3d(-1%, 1%, 0) scale(1.02);
    }
  }

  /* The desktop wallpaper breathes on an even longer, offset cycle, so the
     two never pulse in sync. */
  body::before {
    animation: desktop-wash 34s ease-in-out infinite alternate;
  }

  @keyframes desktop-wash {
    0% {
      opacity: 1;
    }
    50% {
      opacity: 0.82;
    }
    100% {
      opacity: 0.95;
    }
  }
}

/* ------------------------------------------------------------ blog window */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
  gap: 1rem;
  align-content: start;
  padding-right: 0.25rem;
}

.blog-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--paper-raised);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease,
    transform 0.2s ease;
}

.blog-card:hover {
  border-color: var(--hairline-gold);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* The media well shows the placeholder underneath; a real image covers it,
   and onerror removes the image so the placeholder shows through again. */
.blog-card-media {
  position: relative;
  display: grid;
  place-items: center;
  height: 8.5rem;
  background: linear-gradient(
    135deg,
    rgba(15, 122, 110, 0.09),
    rgba(192, 138, 46, 0.09)
  );
  color: var(--peacock);
  overflow: hidden;
}

.blog-card-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.blog-card:hover .blog-card-media img {
  transform: scale(1.05);
}

.blog-card-fallback {
  width: 30px;
  height: 30px;
  opacity: 0.5;
}

.blog-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.95rem 1rem 1.1rem;
  border-top: 1px solid var(--hairline);
  flex: 1;
}

.blog-card-date {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--peacock);
}

.blog-card-title {
  font-family: var(--font-display);
  font-size: 1rem;
  line-height: 1.3;
  letter-spacing: -0.012em;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card-excerpt {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--ink-faint);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-loading {
  color: var(--ink-faint);
  font-size: 0.9rem;
}

/* The split reader */
.blog-reader-sidebar {
  background: var(--paper-sunk);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 0.75rem;
}

.blog-sidebar-head {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: 0.25rem 0.4rem 0.6rem;
}

.blog-sidebar-link {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.5rem 0.55rem;
  border-radius: 8px;
  text-decoration: none;
  transition: background-color 0.16s ease;
}

.blog-sidebar-link:hover {
  background: rgba(15, 122, 110, 0.08);
}

.blog-sidebar-link.is-active {
  background: var(--peacock);
}

.blog-sidebar-title {
  font-size: 0.83rem;
  line-height: 1.35;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-sidebar-date {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.blog-sidebar-link.is-active .blog-sidebar-title,
.blog-sidebar-link.is-active .blog-sidebar-date {
  color: #ffffff;
}

.blog-reader-pane {
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: var(--paper-raised);
  overflow: hidden;
}

#blog-reader-frame {
  border: 0;
  display: block;
  background: var(--paper);
}

/* ------------------------------------------------------------- at a glance */
/* The qualifying facts, as a definition list — because that is literally what
   they are, and it keeps them scannable in a single column on a phone. */
.glance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: 1px;
  margin: var(--step-4) 0 0;
  background: var(--hairline);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  overflow: hidden;
}

.glance-item {
  background: var(--paper-raised);
  padding: 1.1rem 1.25rem;
}

.glance-item dt {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.45rem;
}

.glance-item dd {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

.glance-item dd strong {
  color: var(--ink);
  font-weight: 600;
}

/* Availability reads as a live status, the way it does on a hiring profile. */
.glance-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--peacock);
  font-weight: 500;
}

.glance-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--peacock);
  flex-shrink: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .glance-dot {
    animation: status-pulse 2.4s ease-in-out infinite;
  }

  @keyframes status-pulse {
    0%,
    100% {
      box-shadow: 0 0 0 0 rgba(15, 122, 110, 0.45);
    }
    70% {
      box-shadow: 0 0 0 6px rgba(15, 122, 110, 0);
    }
  }
}

/* The stack, in full, so nobody has to open a window to check for a keyword. */
.stack-strip {
  margin-top: 1rem;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: var(--paper-raised);
}

.stack-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 0.7rem;
}

.stack-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stack-list li {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-soft);
  padding: 0.35em 0.7em;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  transition: border-color 0.16s ease, color 0.16s ease;
}

.stack-list li:hover {
  border-color: var(--peacock);
  color: var(--peacock);
}
