/* ──────────────────────────────────────────────────────────────
   Sage on the homepage (nl + en), loaded after landing.css:
   1. the orange Sage tile in the hero feature row;
   2. the Sage section, with three example topics to try.
   The navigation highlight for Sage lives in features-refresh.css,
   because it appears on every page.

   Sage's orange is the orange of the Hands mark, hotter than the
   site accent, so Sage stands apart from the features around it.
   Nothing here moves on its own for more than a moment: entrances
   play once, and the examples change only when a visitor picks one.
   ────────────────────────────────────────────────────────────── */

/* ── 1. Hero tile ─────────────────────────────────────────────── */

.hero-feature-strip .hero-feature--sage {
  --hf-surface:
    radial-gradient(120% 95% at 10% 0%, rgb(255 224 188 / 62%), transparent 56%),
    linear-gradient(150deg, #ff9a4f 0%, #ff6a1f 48%, #f4530c 100%);
  --hf-rim: linear-gradient(150deg, rgb(255 255 255 / 92%), rgb(255 255 255 / 26%) 42%, rgb(110 30 0 / 32%));
  --hf-rim-hover: linear-gradient(150deg, #fff, rgb(255 255 255 / 50%) 50%, rgb(110 30 0 / 32%));
  --hf-shadow:
    inset 0 1px 0 rgb(255 255 255 / 52%),
    0 22px 44px -20px rgb(255 98 20 / 82%);
  --hf-muted: rgb(28 13 4 / 86%);
  --hf-text-shadow: none;
  --hf-mark: .22;
  --hf-mark-hover: .34;
  --hf-glow: rgb(255 255 255 / 30%);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  color: #1c0d04;
}

/* The burned-in icon is a darker orange here, so the ink on top stays crisp. */
.hero-feature-strip .hero-feature--sage svg {
  color: #a53a00;
  filter: none;
}

/* Two small sparks in the corner of the tile. */
.hero-feature-spark {
  position: absolute;
  z-index: 1;
  background: #fff6ea;
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
  pointer-events: none;
}
.hero-feature-spark--a { top: 15px; right: 17px; width: 15px; height: 15px; }
.hero-feature-spark--b { top: 32px; right: 34px; width: 8px; height: 8px; opacity: .7; }

@media (prefers-reduced-motion: no-preference) {
  .hero-feature-spark { transition: transform 260ms cubic-bezier(.22, 1, .36, 1); }
  .hero-feature-spark--a { animation: sage-spot-twinkle 1.3s cubic-bezier(.22, 1, .36, 1) .9s 2; }
  .hero-feature-spark--b { animation: sage-spot-twinkle 1.3s cubic-bezier(.22, 1, .36, 1) 1.15s 2; }
  .hero-feature--sage:hover .hero-feature-spark--a { transform: rotate(90deg) scale(1.25); }
  .hero-feature--sage:hover .hero-feature-spark--b { transform: rotate(-90deg) scale(1.4); }
}

@keyframes sage-spot-twinkle {
  0%, 100% { transform: rotate(0) scale(1); }
  35% { transform: rotate(45deg) scale(.3); }
  65% { transform: rotate(90deg) scale(1.3); }
}

/* ── 2. Section ───────────────────────────────────────────────── */

.sage-spot {
  --ss-hot: #ff6a1f;
  --ss-ink: #1c0d04;
  --ss-ease: cubic-bezier(.22, 1, .36, 1);
  /* The example wears the dark palette of the Hands console, like Sage itself,
     in both site themes. */
  --ss-panel: #1b1a16;
  --ss-panel-raised: #24211d;
  --ss-panel-text: #f4eadc;
  --ss-panel-soft: #bdb1a0;
  --ss-panel-faint: #9a8f7e;
  --ss-panel-line: rgb(255 245 231 / 9%);
  --ss-panel-accent: #e9955d;
}

.sage-spot-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  grid-template-areas:
    "copy panel"
    "pick panel"
    "action panel";
  grid-template-rows: auto auto 1fr;
  column-gap: clamp(40px, 6vw, 104px);
  align-items: start;
}

.sage-spot-copy { grid-area: copy; margin-bottom: 0; }
/* One step below the section headings: the question has to hold two lines in the narrower column. */
.sage-spot-copy h2 { font-size: clamp(34px, 3.75vw, 54px); }
.sage-spot-copy h2 span { color: var(--color-accent); }

.sage-spot-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.sage-spot-eyebrow svg {
  width: 12px;
  height: 12px;
  flex: none;
  fill: var(--ss-hot);
}
.sage-spot-eyebrow i {
  padding: 3px 8px;
  border: 1px solid color-mix(in srgb, var(--color-accent-700) 45%, transparent);
  border-radius: 999px;
  font-style: normal;
  letter-spacing: .08em;
}

/* Topic buttons: the same pills as the workflow tabs above this section. */
.sage-spot-pick { grid-area: pick; margin-top: 30px; }
.sage-spot:not([data-ready]) .sage-spot-pick-label,
.sage-spot:not([data-ready]) .sage-spot-topics { display: none; }

.sage-spot-pick-label {
  margin: 0 0 12px;
  color: color-mix(in srgb, var(--color-text) 70%, transparent);
  font-size: 13px;
  font-weight: 700;
}

.sage-spot-topics {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.sage-spot-topics button {
  min-height: 44px;
  padding: .5rem 1rem;
  border: 1px solid var(--marketing-panel-border, color-mix(in srgb, var(--color-text) 16%, transparent));
  border-radius: 999px;
  background: var(--marketing-control-bg, transparent);
  color: var(--color-text);
  font: inherit;
  font-size: .9rem;
  font-weight: 650;
  line-height: 1.2;
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease, transform 120ms ease;
}
.sage-spot-topics button:hover {
  border-color: color-mix(in srgb, var(--ss-hot) 60%, transparent);
}
.sage-spot-topics button[aria-pressed="true"] {
  border-color: var(--ss-hot);
  background: var(--ss-hot);
  color: var(--ss-ink);
}
.sage-spot-topics button:active { transform: scale(.97); }
.sage-spot-topics button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--color-accent) 46%, transparent);
  outline-offset: 3px;
}

.sage-spot-own {
  max-width: 44ch;
  margin: 16px 0 0;
  color: color-mix(in srgb, var(--color-text) 72%, transparent);
  font-size: 15px;
  line-height: 1.6;
}

.sage-spot-action {
  grid-area: action;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 12px;
  margin-top: 30px;
}
.sage-spot-note {
  margin: 0;
  color: color-mix(in srgb, var(--color-text) 70%, transparent);
  font-size: 13px;
  line-height: 1.5;
}

/* The example feed. */
.sage-spot-panel {
  grid-area: panel;
  align-self: center;
  position: relative;
  isolation: isolate;
  margin: 0;
  padding: 18px;
  border: 1px solid rgb(255 245 231 / 10%);
  border-radius: 26px;
  background: var(--ss-panel);
  box-shadow: 0 36px 70px -36px rgb(20 10 2 / 72%);
  color: var(--ss-panel-text);
}
.sage-spot-panel::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(62% 46% at 92% 0%, rgb(255 106 31 / 20%), transparent 72%);
  pointer-events: none;
}

.sage-spot-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 4px 14px;
}
.sage-spot-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 700;
}
.sage-spot-brand img { width: 22px; height: 22px; }
.sage-spot-tag {
  color: var(--ss-panel-faint);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.sage-spot-ask {
  margin: 0 0 12px;
  padding: 13px 15px;
  border: 1px solid var(--ss-panel-line);
  border-radius: 16px;
  background: var(--ss-panel-raised);
}
.sage-spot-ask small {
  display: block;
  margin-bottom: 5px;
  color: var(--ss-panel-faint);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.sage-spot-ask p {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
}

.sage-spot-stories {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.sage-spot-story {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
  padding: 9px;
  border: 1px solid rgb(255 245 231 / 7%);
  border-radius: 15px;
  background: rgb(255 245 231 / 4%);
}
.sage-spot-story > img,
.sage-spot-ad-mark {
  width: 76px;
  height: 57px;
  flex: none;
  border-radius: 10px;
}
.sage-spot-story > img { object-fit: cover; }
.sage-spot-story > span { display: grid; gap: 4px; min-width: 0; }
.sage-spot-story small {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  color: var(--ss-panel-soft);
  font-size: 12px;
  line-height: 1.3;
}
.sage-spot-story small b {
  padding: 1px 8px;
  border-radius: 999px;
  background: rgb(233 149 93 / 16%);
  color: #f3aa78;
  font-size: 11px;
  font-weight: 700;
}
.sage-spot-story strong {
  font-size: 15px;
  font-weight: 650;
  line-height: 1.3;
}

/* The advertisement Sage leaves out: dashed, struck through and labelled. */
.sage-spot-story--ad {
  position: relative;
  border-style: dashed;
  border-color: rgb(233 149 93 / 42%);
  background: transparent;
}
.sage-spot-ad-mark {
  display: grid;
  place-items: center;
  background: repeating-linear-gradient(135deg, #2a2722 0 8px, #24211d 8px 16px);
  color: var(--ss-panel-faint);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.sage-spot-story--ad small,
.sage-spot-story--ad strong { color: var(--ss-panel-faint); }
.sage-spot-story--ad strong {
  text-decoration: line-through;
  text-decoration-color: var(--ss-panel-accent);
  text-decoration-thickness: 2px;
}
.sage-spot-story--ad em {
  position: absolute;
  top: -9px;
  right: 12px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--ss-panel-accent);
  color: #171613;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.sage-spot-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  margin: 13px 0 0;
  padding: 0 4px;
  color: var(--ss-panel-faint);
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* Entrance: once as the panel scrolls into view, and again for each topic a
   visitor picks. The advertisement arrives like any other story and is then
   struck through. Without the script, or before it runs, everything is simply
   visible: nothing waits for an animation to appear. */
@media (prefers-reduced-motion: no-preference) {
  .sage-spot-feed.is-entering .sage-spot-ask,
  .sage-spot-feed.is-entering .sage-spot-story {
    animation: sage-spot-rise 340ms var(--ss-ease) both;
    animation-delay: calc(var(--i, 0) * 45ms);
  }
  .sage-spot-feed.is-entering .sage-spot-story--ad strong {
    animation: sage-spot-strike 260ms ease-out 620ms both;
  }
  .sage-spot-feed.is-entering .sage-spot-story--ad em {
    animation: sage-spot-stamp 300ms var(--ss-ease) 760ms both;
  }
}

@keyframes sage-spot-rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes sage-spot-strike {
  from { color: var(--ss-panel-text); text-decoration-color: transparent; }
}
@keyframes sage-spot-stamp {
  from { opacity: 0; transform: scale(.6); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 960px) {
  .sage-spot-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "copy"
      "pick"
      "panel"
      "action";
    grid-template-rows: none;
  }
  .sage-spot-pick { margin-top: 24px; }
  .sage-spot-panel { margin-top: 24px; }
  .sage-spot-action { margin-top: 26px; }
}

@media (max-width: 520px) {
  .sage-spot-panel { padding: 12px; border-radius: 22px; }
  .sage-spot-story { gap: 11px; padding: 8px; }
  .sage-spot-story > img,
  .sage-spot-ad-mark { width: 64px; height: 48px; }
  .sage-spot-story strong { font-size: 14px; }
  .sage-spot-topics button { padding-inline: .85rem; }
}
