/* ------------------------------------------------------------
   Stoa palette — warm linen paper, mauve and plum from the
   brand template, a dusty clay for small warm touches.
   ------------------------------------------------------------ */
:root {
  --paper: #f3ece4;      /* warm linen background */
  --paper-deep: #ebe2d8; /* slightly deeper linen, for depth */
  --mauve: #c9c2d6;      /* brand mauve (template background) */
  --mauve-soft: #e3dce6; /* mauve washed into the paper */
  --plum: #3d2766;       /* brand plum (logo) */
  --violet: #5e3c9c;     /* brighter plum, for title colour */
  --ink: #2f2733;        /* warm near-black for reading */
  --muted: #7a6f7c;
  --clay: #c08a74;       /* dusty terracotta accent */
  --rule: #d9cfc6;
  --measure: 36rem;
  color-scheme: light;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  interpolate-size: allow-keywords; /* lets <details> animate open where supported */
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background-color: var(--paper);
  /* soft warm glow: mauve at the top, linen deepening below */
  background-image:
    radial-gradient(60rem 30rem at 50% -8rem, var(--mauve-soft), transparent 70%),
    linear-gradient(to bottom, var(--paper) 40%, var(--paper-deep));
  background-attachment: fixed;
  font-family: "Newsreader", Georgia, "Times New Roman", serif;
  font-size: clamp(1.15rem, 1.02rem + 0.5vw, 1.35rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--mauve); color: var(--plum); }

main, .top, .foot {
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

/* Language switch */
.top {
  display: flex;
  justify-content: flex-end;
  padding-top: 1.25rem;
}
.lang-switch {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  font-family: "Jost", system-ui, sans-serif;
  font-weight: 300;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.lang-switch button {
  font: inherit;
  letter-spacing: inherit;
  background: none;
  border: 0;
  padding: 0.3rem 0.2rem;
  color: var(--muted);
  cursor: pointer;
}
.lang-switch button:hover { color: var(--plum); }
.lang-switch button[aria-pressed="true"] {
  color: var(--plum);
  font-weight: 400;
}

/* Masthead: small logo between two thin lines, like the brand template */
.masthead {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin: clamp(1.5rem, 5vw, 3rem) 0 clamp(3rem, 9vw, 5.5rem);
  font-weight: normal;
}
.masthead .rule {
  flex: 1;
  height: 1px;
  background: var(--plum);
  opacity: 0.55;
  margin-top: 1.1rem; /* sits on the logo's baseline */
}
.masthead .mark {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}
.masthead img {
  width: clamp(5.5rem, 4.5rem + 4vw, 7.5rem);
  height: auto;
}
.masthead .domain {
  font-family: "Jost", system-ui, sans-serif;
  font-weight: 300;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--plum);
}

/* Intro: large, warm, the voice of the page */
.intro {
  font-size: clamp(1.45rem, 1.1rem + 1.4vw, 2rem);
  line-height: 1.35;
  color: var(--plum);
  margin: 0 0 clamp(2.5rem, 6vw, 4rem);
}
/* hand-marker highlight, for words wrapped in <mark> */
mark {
  color: inherit;
  background: linear-gradient(transparent 55%, var(--mauve) 55%, var(--mauve) 92%, transparent 92%);
  padding: 0 0.1em;
}

/* Title list */
.entries[hidden] { display: none; }

details { border-top: 1px solid var(--rule); }
details:last-of-type { border-bottom: 1px solid var(--rule); }

summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.15rem 0;
  font-size: clamp(1.45rem, 1.15rem + 1.2vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--ink);
}
summary::-webkit-details-marker { display: none; }

/* Title text: plum flowing into a brighter violet, with a mauve
   marker stroke that sweeps in on hover and stays while open */
summary .t {
  --marker: var(--mauve-soft);
  /* layer 1: the text colour (clipped to the letters)
     layer 2: the marker stroke, sitting behind the letters */
  background-image:
    linear-gradient(100deg, var(--plum) 0%, var(--violet) 70%, #8a5fc4 100%),
    linear-gradient(var(--marker), var(--marker));
  -webkit-background-clip: text, border-box;
  background-clip: text, border-box;
  background-repeat: no-repeat;
  background-size: 100% 100%, 100% 0;
  background-position: 0 0, 0 90%;
  color: transparent;
  -webkit-text-fill-color: transparent;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  padding: 0 0.12em;
  margin-left: -0.12em;
  transition: background-size 0.35s ease;
}
summary:hover .t { background-size: 100% 100%, 100% 0.32em; }
details[open] > summary .t {
  --marker: var(--mauve);
  background-size: 100% 100%, 100% 0.38em;
}

/* round mauve button with a plum "+" that turns into "×" */
summary::after {
  content: "";
  flex: none;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  background:
    linear-gradient(var(--plum), var(--plum)) center / 0.8rem 1.5px no-repeat,
    linear-gradient(var(--plum), var(--plum)) center / 1.5px 0.8rem no-repeat,
    var(--mauve-soft);
  transition: transform 0.35s ease, background-color 0.25s ease;
}
summary:hover::after { background-color: var(--mauve); }
summary:hover { color: var(--plum); }

details[open] > summary { color: var(--plum); }
details[open] > summary::after {
  transform: rotate(45deg);
  background-color: var(--mauve);
}

summary:focus-visible {
  outline: 2px solid var(--plum);
  outline-offset: 4px;
  border-radius: 4px;
}

details::details-content {
  block-size: 0;
  overflow: hidden;
  transition: block-size 0.4s ease, content-visibility 0.4s allow-discrete;
}
details[open]::details-content { block-size: auto; }

.body {
  position: relative;
  padding: 0.25rem 0 1.75rem 1.25rem;
  margin-bottom: 1.25rem;
}
/* side line: plum flowing into mauve, like brush ink fading out;
   it draws itself downward when a section opens */
.body::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.35rem;
  bottom: 1.25rem;
  width: 3px;
  border-radius: 3px;
  background: linear-gradient(to bottom, var(--plum) 0%, #6b4f9a 45%, var(--mauve) 100%);
  transform-origin: top;
  transform: scaleY(0);
}
details[open] .body::before {
  animation: ink-down 0.6s 0.1s cubic-bezier(0.22, 0.8, 0.3, 1) forwards;
}
@keyframes ink-down { to { transform: scaleY(1); } }
.body p { margin: 0 0 1em; }
.body p:last-child { margin-bottom: 0; }
.body a {
  color: var(--plum);
  text-decoration-color: var(--clay);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.2em;
}
.body a:hover { background: var(--mauve-soft); }

.body .ps { font-style: italic; color: var(--plum); }

/* Keynote list: plum titles with a short brush-stroke dash */
.body .keynotes {
  list-style: none;
  margin: 0 0 1em;
  padding: 0;
}
.body .keynotes li {
  position: relative;
  padding-left: 1.6rem;
  margin-bottom: 0.35em;
  font-weight: 600;
  color: var(--plum);
}
.body .keynotes li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.8em;
  width: 0.9rem;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--plum), var(--mauve));
}
.body .soon { color: var(--muted); font-style: italic; }

/* Listen buttons (podcast links): plum outline pills with a play mark */
.listen {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.4rem;
}
.listen .pill[hidden] { display: none; }
.body .listen .pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: "Jost", system-ui, sans-serif;
  font-weight: 400;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--plum);
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid var(--plum);
  border-radius: 999px;
  padding: 0.6rem 1.1rem 0.6rem 0.9rem;
  transition: background 0.2s ease, color 0.2s ease;
}
.body .listen .pill::before {
  content: "";
  border-style: solid;
  border-width: 0.3rem 0 0.3rem 0.5rem;
  border-color: transparent transparent transparent currentColor;
}
.body .listen .pill:hover { background: var(--plum); color: var(--paper); }
.body .listen .pill:focus-visible { outline: 2px solid var(--plum); outline-offset: 3px; }

/* Embedded video: 16:9, rounded, soft plum shadow */
.body .video {
  margin: 1.6rem 0 0.5rem;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  background: var(--mauve-soft);
  box-shadow: 0 10px 30px rgba(61, 39, 102, 0.18);
}
.body .video iframe { display: block; width: 100%; height: 100%; border: 0; }
.body .caption {
  font-family: "Jost", system-ui, sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}

/* Audio player: round plum button, thin plum-to-mauve progress line */
.audio {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin: 0.25rem 0 1.5rem;
  padding: 0.7rem 1rem 0.7rem 0.7rem;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid var(--rule);
  border-radius: 999px;
}
.audio[hidden] { display: none; }
.audio .play {
  flex: none;
  width: 2.6rem;
  height: 2.6rem;
  border: 0;
  border-radius: 50%;
  background: var(--plum);
  cursor: pointer;
  position: relative;
  transition: background 0.2s ease, transform 0.15s ease;
}
.audio .play:hover { background: #2c1b4d; }
.audio .play:active { transform: scale(0.96); }
.audio .play:focus-visible { outline: 2px solid var(--plum); outline-offset: 3px; }
/* play triangle */
.audio .play::before {
  content: "";
  position: absolute;
  left: 54%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-style: solid;
  border-width: 0.45rem 0 0.45rem 0.75rem;
  border-color: transparent transparent transparent var(--paper);
}
/* pause bars */
.audio.playing .play::before {
  left: 50%;
  width: 0.7rem;
  height: 0.85rem;
  border: 0;
  background:
    linear-gradient(var(--paper), var(--paper)) left / 0.22rem 100% no-repeat,
    linear-gradient(var(--paper), var(--paper)) right / 0.22rem 100% no-repeat;
}
.audio .track {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 0.75rem;
  row-gap: 0.15rem;
}
.audio .label {
  grid-column: 1 / -1;
  font-family: "Jost", system-ui, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--plum);
}
.audio .time {
  font-family: "Jost", system-ui, sans-serif;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.audio input[type="range"] {
  --p: 0%;
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 1.2rem;
  margin: 0;
  background: transparent;
  cursor: pointer;
}
.audio input[type="range"]::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--plum), #6b4f9a var(--p), var(--mauve) var(--p));
}
.audio input[type="range"]::-moz-range-track {
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--plum), #6b4f9a var(--p), var(--mauve) var(--p));
}
.audio input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 0.8rem;
  height: 0.8rem;
  margin-top: calc(-0.4rem + 1.5px);
  border-radius: 50%;
  background: var(--plum);
  border: 0;
}
.audio input[type="range"]::-moz-range-thumb {
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 50%;
  background: var(--plum);
  border: 0;
}
.audio input[type="range"]:focus-visible { outline: 2px solid var(--plum); outline-offset: 2px; border-radius: 4px; }

/* Contact form */
.contact {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}
.contact label {
  display: grid;
  gap: 0.35rem;
  font-family: "Jost", system-ui, sans-serif;
  font-weight: 400;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--plum);
}
.contact input,
.contact textarea {
  font-family: "Newsreader", Georgia, serif;
  font-size: 1.05rem;
  letter-spacing: normal;
  text-transform: none;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
  width: 100%;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.contact textarea { resize: vertical; min-height: 8rem; line-height: 1.5; }
.contact input:focus,
.contact textarea:focus {
  outline: none;
  background: #fff;
  border-color: var(--plum);
  box-shadow: 0 0 0 3px var(--mauve-soft);
}
.contact .trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.contact button {
  justify-self: start;
  font-family: "Jost", system-ui, sans-serif;
  font-weight: 400;
  font-size: 0.85rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--plum);
  border: 0;
  border-radius: 999px;
  padding: 0.8rem 1.8rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}
.contact button:hover { background: #2c1b4d; }
.contact button:active { transform: translateY(1px); }
.contact button:disabled { opacity: 0.6; cursor: progress; }
.contact button:focus-visible { outline: 2px solid var(--plum); outline-offset: 3px; }
.contact .status { margin: 0; min-height: 1.5em; font-size: 1rem; }
.contact .status.ok { color: var(--plum); }
.contact .status.error,
.contact .status.missing { color: #9a4a35; }

.foot {
  padding-block: 5rem 2.5rem;
  text-align: center;
  font-family: "Jost", system-ui, sans-serif;
  font-weight: 300;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Footer links: plum icons in soft mauve circles, like the + buttons */
.social {
  display: flex;
  justify-content: center;
  gap: 0.9rem;
  margin-bottom: 1.5rem;
}
.social a {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  color: var(--plum);
  background: var(--mauve-soft);
  transition: background 0.25s ease, transform 0.2s ease;
}
.social a:hover { background: var(--mauve); transform: translateY(-2px); }
.social a:focus-visible { outline: 2px solid var(--plum); outline-offset: 3px; }
.social svg { width: 1.3rem; height: 1.3rem; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  details[open] .body::before { animation: none; transform: none; }
}
