/* ============================================================
   Agro BigGrow - inner pages layer
   Legal / policy pages (terms, privacy, data ownership) and
   the 404 page. Shares tokens, nav and footer with the home
   page but uses a calmer, reading-first layout.
   ============================================================ */

/* ---------- page hero ---------- */
.page-hero {
  position: relative;
  padding-top: calc(var(--nav-h) + clamp(3rem, 7vw, 5.5rem));
  padding-bottom: clamp(2.5rem, 5vw, 4rem);
  overflow: hidden;
}
.page-hero__bg { position: absolute; inset: 0; pointer-events: none; }
.page-hero__bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(105deg, transparent 0 26px, rgba(46, 106, 36, 0.05) 26px 27px);
  -webkit-mask-image: linear-gradient(to bottom, transparent 20%, #000 90%);
  mask-image: linear-gradient(to bottom, transparent 20%, #000 90%);
}
.page-hero .container { position: relative; z-index: 1; }
.page-hero .eyebrow { margin-bottom: 1.3rem; }
.page-hero__title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5.5vw, 3.9rem);
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -0.02em;
  max-width: 18ch;
}
.page-hero__title em { color: var(--green); }
.page-hero__lead {
  margin-top: 1.2rem;
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  color: var(--ink-2);
  max-width: 56ch;
}
.page-hero__meta {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 1.6rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green-deep);
  background: var(--green-pastel);
  border: 1px solid rgba(75, 173, 59, 0.3);
  border-radius: 999px;
  padding: 0.5rem 1rem;
}
.page-hero__meta svg { width: 14px; height: 14px; }

/* ---------- legal layout: content + sticky toc ---------- */
.legal { padding-bottom: var(--section-pad); }
.legal__grid {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}

/* table of contents */
.toc {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.3rem;
  box-shadow: var(--shadow-sm);
}
.toc__title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 0.8rem;
}
.toc a {
  display: block;
  padding-block: 0.34rem;
  font-size: 0.88rem;
  color: var(--ink-2);
  border-left: 2px solid transparent;
  padding-left: 0.7rem;
  margin-left: -0.7rem;
  transition: color 0.25s, border-color 0.25s;
}
.toc a:hover { color: var(--green-deep); border-left-color: var(--green); }

/* ---------- prose ---------- */
.prose { max-width: 70ch; }
.prose section { scroll-margin-top: calc(var(--nav-h) + 20px); }
.prose h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.6vw, 1.9rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-top: 2.6rem;
  margin-bottom: 0.9rem;
  padding-top: 0.6rem;
}
.prose h2:first-child { margin-top: 0; }
.prose h2 .num {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--green);
  letter-spacing: 0.08em;
  display: block;
  margin-bottom: 0.35rem;
}
.prose h3 {
  font-family: var(--font-ui);
  font-size: 1.08rem;
  font-weight: 700;
  margin-top: 1.6rem;
  margin-bottom: 0.5rem;
}
.prose p { color: var(--ink-2); margin-bottom: 1rem; }
.prose ul, .prose ol {
  margin-bottom: 1.1rem;
  padding-left: 0;
  color: var(--ink-2);
}
.prose li {
  position: relative;
  padding-left: 1.6rem;
  margin-bottom: 0.5rem;
}
.prose ul li::before {
  content: "";
  position: absolute;
  left: 0.2rem;
  top: 0.62em;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--green);
  transform: rotate(45deg);
}
.prose ol { counter-reset: legal-ol; }
.prose ol li { counter-increment: legal-ol; padding-left: 2.1rem; }
.prose ol li::before {
  content: counter(legal-ol) ".";
  position: absolute;
  left: 0.2rem;
  font-family: var(--font-mono);
  font-size: 0.85em;
  font-weight: 600;
  color: var(--green-deep);
}
.prose strong { color: var(--ink); font-weight: 600; }
.prose a {
  color: var(--green-deep);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(46, 106, 36, 0.4);
  transition: text-decoration-color 0.25s;
}
.prose a:hover { text-decoration-color: var(--green-deep); }

/* callout boxes inside prose */
.prose .callout {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 1.1rem;
  background:
    radial-gradient(circle at 100% 0%, rgba(110, 212, 90, 0.12), transparent 55%),
    var(--paper);
  border: 1px solid rgba(75, 173, 59, 0.32);
  border-radius: var(--radius);
  padding: 1.5rem 1.6rem;
  margin-block: 1.6rem;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
/* dashed inner frame, echoing the site's stamp/tape character */
.prose .callout::after {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1.5px dashed rgba(75, 173, 59, 0.28);
  border-radius: calc(var(--radius) - 8px);
  pointer-events: none;
}
.callout__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--green-pastel);
  color: var(--green-deep);
  box-shadow: inset 0 0 0 1px rgba(75, 173, 59, 0.25);
}
.callout__icon svg { width: 23px; height: 23px; }
.callout__body { position: relative; z-index: 1; min-width: 0; }
.callout__label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green-deep);
  margin-bottom: 0.45rem;
}
.prose .callout p { margin-bottom: 0; }

/* amber variant */
.prose .callout--amber {
  background:
    radial-gradient(circle at 100% 0%, rgba(245, 158, 11, 0.14), transparent 55%),
    var(--paper);
  border-color: rgba(245, 158, 11, 0.4);
}
.prose .callout--amber::after { border-color: rgba(245, 158, 11, 0.32); }
.callout--amber .callout__icon {
  background: var(--amber-pastel);
  color: #b45309;
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.3);
}
.callout--amber .callout__label { color: #b45309; }

@media (max-width: 560px) {
  .prose .callout { padding: 1.2rem 1.15rem; gap: 0.85rem; }
  .callout__icon { width: 38px; height: 38px; border-radius: 11px; }
  .callout__icon svg { width: 19px; height: 19px; }
}

/* principle cards (data ownership page) */
.principles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.2rem;
  margin-block: 2rem;
}
.principle {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.6rem 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out), border-color 0.3s;
}
.principle:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.principle__icon {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 13px;
  margin-bottom: 1rem;
  background: var(--green-pastel);
  color: var(--green-deep);
}
.principle__icon svg { width: 22px; height: 22px; }
.principle h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 0.45rem;
}
.principle p { font-size: 0.94rem; margin-bottom: 0; }

/* "we never" list */
.never {
  display: grid;
  gap: 0.7rem;
  margin-block: 1.6rem;
}
.never li {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  background: var(--terra-pastel);
  border: 1px solid rgba(167, 95, 74, 0.22);
  border-radius: 14px;
  padding: 0.9rem 1.1rem;
  font-size: 0.96rem;
  font-weight: 500;
  color: var(--ink);
}
.never li svg { width: 19px; height: 19px; flex: none; margin-top: 0.15rem; color: var(--terra); }

/* related links row at the end of legal pages */
.legal__related {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

/* ---------- 404 ---------- */
.nf {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--nav-h) + 3rem) 1.5rem 4rem;
  overflow: hidden;
}
.nf__bg { position: absolute; inset: 0; pointer-events: none; }
.nf__bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(105deg, transparent 0 26px, rgba(46, 106, 36, 0.05) 26px 27px);
}
.nf .blob--1 { width: 480px; height: 480px; top: -160px; right: -100px; }
.nf .blob--2 { width: 380px; height: 380px; bottom: -120px; left: -120px; }
.nf > * { position: relative; z-index: 1; }
.nf__code {
  font-family: var(--font-display);
  font-size: clamp(6rem, 22vw, 12rem);
  font-weight: 600;
  line-height: 0.9;
  letter-spacing: -0.03em;
  color: var(--pine);
  position: relative;
}
.nf__code em {
  color: var(--green);
  font-style: normal;
  display: inline-block;
  animation: nf-sway 3.2s ease-in-out infinite alternate;
  transform-origin: 50% 100%;
}
@keyframes nf-sway {
  from { transform: rotate(-5deg); }
  to { transform: rotate(5deg); }
}
.nf__note {
  font-family: "Caveat", "Segoe Script", cursive;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 600;
  color: var(--terra);
  transform: rotate(-2deg);
  margin-top: 0.6rem;
}
.nf__title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  font-weight: 500;
  letter-spacing: -0.015em;
  margin-top: 1.6rem;
}
.nf__text {
  margin-top: 0.9rem;
  color: var(--ink-2);
  max-width: 44ch;
}
.nf__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.9rem;
  margin-top: 2.2rem;
}
.nf__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 1.6rem;
  margin-top: 2.6rem;
  font-size: 0.92rem;
}
.nf__links a {
  color: var(--ink-3);
  font-weight: 500;
  border-bottom: 1px dashed var(--line-strong);
  padding-bottom: 1px;
  transition: color 0.25s, border-color 0.25s;
}
.nf__links a:hover { color: var(--green-deep); border-color: var(--green); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .legal__grid { grid-template-columns: 1fr; }
  .toc {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem 0.9rem;
    padding: 1.1rem 1.2rem;
  }
  .toc__title { width: 100%; margin-bottom: 0.4rem; }
  .toc a { border-left: 0; padding-left: 0; margin-left: 0; font-size: 0.85rem; }
}

@media (max-width: 560px) {
  .page-hero { padding-top: calc(var(--nav-h) + 2.25rem); }
  .principles { grid-template-columns: 1fr; }
  .prose h2 { margin-top: 2.1rem; }
  .nf__actions { width: 100%; }
  .nf__actions .btn { width: 100%; }
}
