/*
  Lavender House Studios — styles for the legal pages (terms.html, privacy.html)
  Uses the same tokens as index.html. If you change a colour or font there,
  change it here too.
*/

/* ============ Tokens ============ */
:root {
  --bloom: #9381FF;
  --pale-bloom: #C8BEFF;
  --leaf: #5C9E90;
  --stem: #24453F;
  --stem-deep: #1C3833;
  --dusk: #2B2546;
  --dusk-light: #3A3170;

  --soil: #1B1714;
  --soil-raised: #221D19;
  --linen: #F3EADC;
  --stalk: #A99E8E;
  --hairline: rgba(243, 234, 220, 0.14);

  --font-display: 'Young Serif', Georgia, serif;
  --font-body: 'Literata', Georgia, 'Times New Roman', serif;

  --frame: 72rem;
  --gutter: clamp(0.75rem, 2vw, 1.5rem);
}

/* ============ Base ============ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 1.5rem; }
body {
  margin: 0;
  background: var(--soil);
  color: var(--linen);
  font-family: var(--font-body);
  font-optical-sizing: auto;
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--linen); }
img { max-width: 100%; display: block; }
::selection { background: var(--bloom); color: var(--soil); }
:focus-visible { outline: 2px solid var(--pale-bloom); outline-offset: 3px; }

.display {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.label {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.8rem;
  border: 1px dashed rgba(243, 234, 220, 0.6);
  border-radius: 999px;
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0 1.4rem;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.9375rem;
  transition: background-color 0.2s ease;
}
.btn-ghost { border: 1px solid rgba(243, 234, 220, 0.55); color: var(--linen); }
.btn-ghost:hover { background: rgba(243, 234, 220, 0.10); color: var(--linen); }

/* ============ Nav ============ */
.logo {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 1rem;
  color: var(--linen);
  text-decoration: none;
}
.logo img { height: 3.25rem; width: auto; }
.nav { position: relative; z-index: 3; padding: 0.75rem var(--gutter); }
.nav-inner {
  max-width: var(--frame);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.nav-links { display: flex; align-items: center; gap: 0.25rem; }
.nav-link {
  display: none;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 0.85rem;
  color: var(--linen);
  text-decoration: none;
  font-size: 0.9375rem;
}
.nav-link:hover { color: var(--pale-bloom); }
.nav-links .btn { padding: 0 1.15rem; }
@media (min-width: 40rem) { .nav-link { display: inline-flex; } }

/* ============ Short lava-lamp header ============ */
.page-hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(160deg, var(--stem) 0%, var(--dusk) 55%, var(--dusk-light) 100%);
}
.lava { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.blob {
  position: absolute;
  border-radius: 50%;
  will-change: transform;
  animation: drift-a 26s ease-in-out infinite alternate;
}
.blob.drift-b { animation-name: drift-b; animation-duration: 32s; }
.blob--bloom { background: radial-gradient(closest-side, var(--bloom), transparent); }
.blob--leaf  { background: radial-gradient(closest-side, var(--leaf), transparent); }
.blob--pale  { background: radial-gradient(closest-side, var(--pale-bloom), transparent); }
.page-hero .b1 { left: -20%; top: -60%; width: max(70%, 28rem); aspect-ratio: 1.1; opacity: 0.85; }
.page-hero .b2 { right: -25%; top: -40%; width: max(70%, 30rem); aspect-ratio: 1.2; opacity: 0.9; animation-delay: -10s; }
.page-hero .b3 { left: 20%; bottom: -90%; width: max(60%, 26rem); aspect-ratio: 1.3; opacity: 0.55; }
@keyframes drift-a {
  0%   { transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
  50%  { transform: translate3d(22%, -14%, 0) rotate(25deg) scale(1.12); }
  100% { transform: translate3d(-8%, 10%, 0) rotate(-12deg) scale(0.94); }
}
@keyframes drift-b {
  0%   { transform: translate3d(0, 0, 0) rotate(0deg) scale(1.05); }
  50%  { transform: translate3d(-20%, 16%, 0) rotate(-30deg) scale(0.9); }
  100% { transform: translate3d(12%, -6%, 0) rotate(15deg) scale(1.15); }
}
.scrim {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(ellipse 70% 70% at 50% 60%, rgba(27, 23, 20, 0.45), rgba(27, 23, 20, 0.1));
}
.page-hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
  padding: clamp(2.5rem, 6vw, 4.5rem) 1.25rem clamp(3rem, 7vw, 5rem);
}
.page-hero h1 { font-size: clamp(2.4rem, 6vw, 4rem); line-height: 1.06; letter-spacing: -0.015em; }
.page-hero .lead { margin: 0; max-width: 34rem; font-size: clamp(1.0625rem, 1.5vw, 1.1875rem); line-height: 1.55; }
.page-hero .updated { margin: 0; font-size: 0.875rem; color: rgba(243, 234, 220, 0.8); }

/* ============ Body layout ============ */
.section { padding: 0 var(--gutter); border-top: 1px solid var(--hairline); }
.frame {
  max-width: var(--frame);
  margin: 0 auto;
  border-left: 1px solid var(--hairline);
  border-right: 1px solid var(--hairline);
}
.legal {
  display: grid;
  gap: 2rem;
  padding: clamp(2rem, 5vw, 4rem) 1.25rem clamp(3.5rem, 7vw, 6rem);
}
@media (min-width: 62rem) {
  .legal {
    grid-template-columns: 15rem minmax(0, 44rem);
    justify-content: center;
    gap: 4rem;
  }
}

/* Table of contents: a collapsible box on phones, a sticky sidebar on desktop */
.toc {
  align-self: start;
  border: 1px solid var(--hairline);
  border-radius: 0.75rem;
  background: var(--soil-raised);
}
.toc summary {
  display: flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 1rem;
  cursor: pointer;
  font-size: 0.9375rem;
}
.toc ol { list-style: none; margin: 0; padding: 0 0.5rem 0.75rem; }
.toc a {
  display: block;
  padding: 0.4rem 0.5rem;
  border-radius: 0.375rem;
  color: var(--stalk);
  text-decoration: none;
  font-size: 0.875rem;
  line-height: 1.4;
}
.toc a:hover { color: var(--linen); background: rgba(243, 234, 220, 0.06); }
@media (min-width: 62rem) {
  .toc { position: sticky; top: 1.5rem; max-height: calc(100vh - 3rem); overflow-y: auto; }
}

/* ============ Prose ============ */
.prose { min-width: 0; font-size: 1.0625rem; line-height: 1.7; }
.prose > :first-child { margin-top: 0; }
.prose h2 {
  margin: 3rem 0 1rem;
  padding-top: 2rem;
  border-top: 1px solid var(--hairline);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.5rem, 2.6vw, 1.875rem);
  line-height: 1.15;
}
.prose h2:first-child { padding-top: 0; border-top: 0; }
.prose h3 { margin: 2rem 0 0.5rem; font-size: 1.125rem; font-weight: 600; line-height: 1.35; }
.prose p { margin: 0 0 1rem; }
.prose ul { margin: 0 0 1.25rem; padding-left: 1.25rem; }
.prose li { margin-bottom: 0.5rem; }
.prose li::marker { color: var(--bloom); }
.prose strong { font-weight: 600; }
.prose a { text-decoration-color: var(--bloom); text-underline-offset: 0.2em; }
.prose a:hover { color: var(--pale-bloom); }

/* Tables become stacked cards on phones */
.prose table { width: 100%; margin: 0 0 1.5rem; border-collapse: collapse; font-size: 0.9375rem; line-height: 1.5; }
.prose th {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid rgba(243, 234, 220, 0.3);
  text-align: left;
  font-weight: 500;
  font-size: 0.8125rem;
  color: var(--stalk);
}
.prose td { padding: 0.75rem; border-bottom: 1px solid var(--hairline); vertical-align: top; }
.prose td:first-child { font-weight: 600; }
@media (max-width: 40rem) {
  .prose thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .prose table, .prose tbody, .prose tr, .prose td { display: block; }
  .prose tr {
    margin-bottom: 0.75rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--hairline);
    border-radius: 0.75rem;
    background: var(--soil-raised);
  }
  .prose td { padding: 0.4rem 0; border: 0; }
  .prose td:first-child { font-family: var(--font-display); font-weight: 400; font-size: 1.0625rem; }
  .prose td:not(:first-child)::before {
    content: attr(data-label);
    display: block;
    font-size: 0.75rem;
    color: var(--stalk);
  }
}

/* Placeholders still to fill in. When you replace one, delete the <mark> around it.
   Once none are left, you can delete this rule. */
mark.todo {
  padding: 0 0.2em;
  border-radius: 0.25rem;
  background: rgba(147, 129, 255, 0.22);
  color: var(--pale-bloom);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.next-page {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--hairline);
  border-radius: 1rem;
  background: var(--soil-raised);
}
.next-page p { margin: 0; font-family: var(--font-display); font-size: 1.25rem; }

/* ============ Footer ============ */
.footer { background: var(--soil); padding: 0 var(--gutter); border-top: 1px solid var(--hairline); }
.footer-inner { padding: 2.5rem 1.25rem 3rem; display: flex; flex-direction: column; gap: 2rem; }
.footer-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 0.75rem;
  color: var(--linen);
  text-decoration: none;
  font-size: 0.9375rem;
}
.footer-links a:hover, .footer-links a[aria-current="page"] { color: var(--pale-bloom); }
.footer-small {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem 2rem;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--stalk);
}
.footer-small p { margin: 0; }
.footer-small .ack { max-width: 34rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .blob { animation: none !important; }
}

@media print {
  .nav, .page-hero .lava, .scrim, .toc, .next-page, .footer-top { display: none; }
  body, .page-hero { background: #fff; color: #000; }
  .prose a, a { color: #000; }
}
