/* ==========================================================================
   Policy and help documents (privacy, child safety, account deletion,
   refunds). Builds on home.css and prophet.css:
   <main class="home prophet policy">, optionally with a product tone class
   (t-redink, t-scribe, t-village, t-soulmate, t-prophet) for the accent.
   ========================================================================== */

/* home.css scopes the product tones to elements inside .home; here they sit on <main> itself */
.policy.t-prophet { --tone: #5b5bd6; --tone-soft: #eef0ff; }
.policy.t-redink { --tone: #d63a2c; --tone-soft: #fdecea; }
.policy.t-scribe { --tone: #2f5ee8; --tone-soft: #e9efff; }
.policy.t-village { --tone: #0e8fa3; --tone-soft: #e3f6f8; }
.policy.t-soulmate { --tone: #db2777; --tone-soft: #fde8f1; }
.policy.t-numerology { --tone: #b45309; --tone-soft: #fef3c7; }
.policy.t-admin { --tone: #334155; --tone-soft: #eef2f7; }

.policy {
  --accent: var(--tone, #4f46e5);
  --grad: linear-gradient(135deg, color-mix(in srgb, var(--accent) 78%, #fff) 0%, var(--accent) 100%);
}

.policy .h-hero::before {
  background:
    radial-gradient(42rem 32rem at 88% 8%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 62%),
    radial-gradient(34rem 26rem at 6% 96%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 62%);
}

.policy .h-kicker::before {
  background: var(--accent);
}

/* ---------- compact hero ---------- */
.home .d-hero {
  padding: clamp(2.5rem, 5vw, 4rem) 0 clamp(2.5rem, 5vw, 3.5rem);
  border-bottom: 1px solid var(--line);
}

.d-hero-inner {
  display: flex;
  align-items: center;
  gap: clamp(1.25rem, 3vw, 2.25rem);
  max-width: 980px;
}

.d-hero-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: clamp(76px, 10vw, 104px);
  aspect-ratio: 1;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow-md);
  animation: h-rise 0.8s var(--ease) both;
}

.d-hero-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 16px;
}

.d-hero-icon .bi {
  font-size: 2.4rem;
  color: var(--accent);
}

.d-hero-copy > * {
  animation: h-rise 0.8s var(--ease) both;
}

.d-hero-copy > :nth-child(2) { animation-delay: 0.06s; }
.d-hero-copy > :nth-child(3) { animation-delay: 0.12s; }
.d-hero-copy > :nth-child(4) { animation-delay: 0.18s; }

.policy .h-kicker {
  color: var(--accent);
}

.home .d-hero h1 {
  margin: 0.6rem 0 0.5rem !important;
  font-size: clamp(1.8rem, 3.6vw, 2.75rem) !important;
  font-weight: 800 !important;
  line-height: 1.12 !important;
  letter-spacing: -0.03em !important;
}

.d-sub {
  font-size: 1.05rem;
  color: var(--muted);
}

.d-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.d-meta span,
.d-meta a,
.d-meta a:visited {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.32rem 0.8rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.d-meta a:hover {
  color: var(--accent);
}

.d-meta .bi {
  color: var(--accent);
}

/* ---------- layout ---------- */
.d-body {
  padding: clamp(2.5rem, 5vw, 4rem) 0 clamp(3.5rem, 7vw, 5.5rem);
  background: var(--soft);
}

.d-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
  max-width: 1080px;
}

.d-layout--single {
  grid-template-columns: minmax(0, 1fr);
  max-width: 860px;
}

.d-toc {
  position: sticky;
  top: 96px;
  padding: 1.1rem 0.9rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
}

.d-toc strong {
  display: block;
  margin: 0 0 0.5rem 0.45rem;
  font-family: var(--font-head);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.d-toc a,
.d-toc a:visited {
  display: block;
  padding: 0.4rem 0.6rem;
  font-size: 0.87rem;
  line-height: 1.35;
  color: var(--text);
  text-decoration: none;
  border-radius: 10px;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.d-toc a:hover {
  color: var(--accent);
  background: var(--tone-soft, #eef0ff);
}

/* ---------- the document ---------- */
.d-doc {
  padding: clamp(1.5rem, 4vw, 3rem);
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow-sm);
}

.d-doc > * + * {
  margin-top: 1rem !important;
}

.d-doc section + section {
  margin-top: 2.25rem !important;
  padding-top: 2.25rem;
  border-top: 1px solid var(--line);
}

.d-doc section > * + * {
  margin-top: 0.9rem !important;
}

.d-doc section[id],
.d-doc [id] {
  scroll-margin-top: 96px;
}

.home .d-doc h2 {
  font-size: clamp(1.3rem, 2.2vw, 1.55rem) !important;
  font-weight: 700 !important;
  line-height: 1.3 !important;
}

.home .d-doc h3 {
  margin-top: 1.5rem !important;
  font-size: 1.12rem !important;
  font-weight: 600 !important;
  line-height: 1.35 !important;
}

.home .d-doc h4 {
  margin-top: 1.25rem !important;
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
}

.d-doc strong {
  font-weight: 600;
  color: var(--ink);
}

.d-doc a:not(.h-btn),
.d-doc a:not(.h-btn):visited {
  font-weight: 500;
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(15, 23, 42, 0.2);
  text-underline-offset: 3px;
}

.d-doc a:not(.h-btn):hover {
  text-decoration-color: currentColor;
}

.d-doc code {
  padding: 0.1rem 0.4rem;
  font-size: 0.86em;
  color: var(--ink);
  background: var(--soft);
  border-radius: 6px;
}

.d-lead {
  font-size: 1.08rem;
  color: var(--ink);
}

/* lists */
.d-doc ul,
.d-doc ol {
  display: grid;
  gap: 0.55rem;
}

.d-doc ul > li {
  position: relative;
  padding-left: 1.5rem;
}

.d-doc ul > li::before {
  content: "";
  position: absolute;
  top: 0.68em;
  left: 0.3rem;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.75;
}

.d-doc ol {
  counter-reset: d-step;
}

.d-doc ol > li {
  position: relative;
  padding-left: 2.4rem;
  min-height: 1.75rem;
}

.d-doc ol > li::before {
  counter-increment: d-step;
  content: counter(d-step);
  position: absolute;
  top: 0.1rem;
  left: 0;
  display: grid;
  place-items: center;
  width: 1.65rem;
  height: 1.65rem;
  font-family: var(--font-head);
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border-radius: 8px;
}

/* key/value cards, e.g. definitions or permissions */
.d-defs {
  display: grid;
  gap: 0.75rem;
}

.d-def {
  padding: 1rem 1.15rem;
  background: var(--soft);
  border-radius: 14px;
}

.d-def dt {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.75rem;
  font-family: var(--font-head);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
}

.d-def dt code {
  font-size: 0.8rem;
  color: var(--accent);
  background: #fff;
  border: 1px solid var(--line);
}

.d-def dd {
  margin: 0.3rem 0 0;
  font-size: 0.94rem;
  line-height: 1.6;
}

/* tables */
.d-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.d-doc table {
  width: 100%;
  font-size: 0.93rem;
  border-collapse: collapse;
}

.d-doc th,
.d-doc td {
  padding: 0.75rem 1rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.d-doc th {
  font-family: var(--font-head);
  font-weight: 600;
  color: var(--ink);
  background: var(--soft);
}

.d-doc tr:last-child td {
  border-bottom: 0;
}

/* callouts */
.d-note {
  display: flex;
  gap: 0.8rem;
  padding: 1rem 1.2rem;
  font-size: 0.95rem;
  line-height: 1.6;
  background: var(--tone-soft, #eef0ff);
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 16px;
}

.d-note > .bi {
  flex-shrink: 0;
  margin-top: 0.1rem;
  font-size: 1.15rem;
  color: var(--accent);
}

.d-note--warn {
  background: #fff7ed;
  border-color: #fed7aa;
}

.d-note--warn > .bi {
  color: #ea580c;
}

/* screenshots */
.d-shots {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  padding: 1.5rem;
  background: var(--soft);
  border-radius: 18px;
}

.d-shots figure {
  flex: 0 1 200px;
  margin: 0;
}

.d-shots button {
  display: block;
  width: 100%;
  padding: 0;
  background: none;
  border: 0;
  cursor: zoom-in;
  transition: transform 0.3s var(--ease);
}

.d-shots button:hover {
  transform: translateY(-4px);
}

.d-shots img {
  display: block;
  width: 100%;
  border-radius: 16px;
  box-shadow: 0 16px 28px -16px rgba(15, 23, 42, 0.45);
}

.d-shots figcaption {
  margin-top: 0.6rem;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--muted);
}

.d-shots--small figure {
  flex-basis: 160px;
}

/* contact card */
.d-contact {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}

.d-contact a,
.d-contact a:visited {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  font-weight: 500;
  color: var(--ink) !important;
  text-decoration: none !important;
  background: var(--soft);
  border: 1px solid transparent;
  border-radius: 14px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.d-contact a:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.d-contact .bi {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  font-size: 1.05rem;
  color: #fff;
  background: var(--grad);
  border-radius: 11px;
}

.d-contact span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.d-contact small {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
}

.d-foot {
  margin-top: 2rem !important;
  font-size: 0.85rem;
  color: var(--muted);
}

/* related policies */
.d-related {
  margin-top: 1.5rem;
}

.d-related strong {
  display: block;
  margin-bottom: 0.6rem;
  font-family: var(--font-head);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.d-related div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ---------- responsive ---------- */
@media (max-width: 991.98px) {
  .d-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
  }

  .d-toc {
    position: static;
  }

  .d-toc nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  .d-toc a {
    padding: 0.35rem 0.7rem;
    background: var(--soft);
    border-radius: 999px;
  }
}

@media (max-width: 575.98px) {
  .d-hero-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .d-hero-icon {
    width: 72px;
    border-radius: 20px;
  }

  .d-shots {
    padding: 1rem;
    gap: 0.9rem;
  }

  .d-shots figure {
    flex-basis: calc(50% - 0.45rem);
  }
}
