/* ==========================================================
   SOWAYA INVESTMENT FARMS LIMITED | base.css
   Shared across every page: tokens, reset, typography,
   buttons, top bar, header, footer, CTA band, WhatsApp button.

   Palette (from the content brief):
   Deep Green #1F5A3A | Maize Gold #D9A227 | Warm Cream #F7F3E8 | Charcoal #242B27
   Type: Fraunces (headings) + DM Sans (body)
   Flat colour only. Depth comes from three SVG textures: dots, grid, grain.
   ========================================================== */

:root {
  --green: #1f5a3a;
  --green-deep: #174630;
  --green-ink: #0f3322;
  --gold: #d9a227;
  --gold-soft: #ebcb73;
  --cream: #f7f3e8;
  --sand: #efe9d6;
  --white: #fffdf8;
  --charcoal: #242b27;
  --muted: #566159;
  --line: rgba(36, 43, 39, 0.14);
  --error: #9b2c1f; /* same red as auth.css, portal.css and cart.css */

  --font-head: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body:
    "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --radius: 20px;
  --radius-lg: 32px;
  --wrap: 1200px;
  --gutter: 1.25rem;

  /* spacing scale */
  --s1: 0.5rem;
  --s2: 1rem;
  --s3: 1.5rem;
  --s4: 2.5rem;
  --s5: 4rem;
  --section: clamp(4.5rem, 9vw, 8.5rem);

  /* textures (inline SVG, no gradient functions) */
  --tex-dots: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26'%3E%3Ccircle cx='2' cy='2' r='1.4' fill='%23242B27' fill-opacity='.16'/%3E%3C/svg%3E");
  --tex-grid: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56'%3E%3Cpath d='M56 0H0v56' fill='none' stroke='%231F5A3A' stroke-opacity='.09' stroke-width='1'/%3E%3C/svg%3E");
  --tex-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--cream);
  color: var(--charcoal);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
img,
svg {
  display: block;
  max-width: 100%;
}
img {
  height: auto;
}
a {
  color: inherit;
}
h1,
h2,
h3,
h4 {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin: 0 0 var(--s2);
  color: var(--green-ink);
}
h1 {
  font-size: clamp(2.9rem, 7vw, 6rem);
}
h2 {
  font-size: clamp(2rem, 4.4vw, 3.3rem);
}
h3 {
  font-size: 1.3rem;
}
p {
  margin: 0 0 1.25em;
}
ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}
:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  border-radius: 6px;
}
.wrap {
  width: min(100% - (var(--gutter) * 2), var(--wrap));
  margin-inline: auto;
}
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 300;
  background: var(--gold);
  color: var(--charcoal);
  padding: 0.7rem 1rem;
  font-weight: 700;
}
.skip-link:focus {
  left: 0;
}
.eyebrow {
  display: block;
  margin: 0 0 1.25rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--green);
}
.center {
  text-align: center;
  margin: var(--s5) 0 0;
}

/* ---------- Textures ---------- */
.pattern-dots {
  background-image: var(--tex-dots);
}
.pattern-grid {
  background-image: var(--tex-grid);
}
.grain {
  position: relative;
  isolation: isolate;
}
.grain::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: var(--tex-grain);
  opacity: 0.11;
  pointer-events: none;
  border-radius: inherit;
}
.grain > * {
  position: relative;
  z-index: 1;
}

/* ---------- Buttons & links ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 1.7rem;
  border-radius: 999px;
  border: 2px solid transparent;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition:
    transform 0.2s ease,
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}
.btn:hover {
  transform: translateY(-2px);
}
.btn {
  gap: 0.6rem;
}
.btn svg {
  flex-shrink: 0;
}
.btn--gold {
  background: var(--gold);
  color: var(--green-ink);
}
.btn--gold:hover {
  background: #e4b034;
}
.btn--ghost {
  border-color: var(--green);
  color: var(--green);
}
.btn--ghost:hover {
  background: var(--green);
  color: var(--cream);
}
.btn--light {
  border-color: rgba(247, 243, 232, 0.55);
  color: var(--cream);
}
.btn--light:hover {
  background: var(--cream);
  color: var(--green-ink);
  border-color: var(--cream);
}
.textlink {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  color: var(--green);
  text-decoration: none;
}
.textlink span {
  transition: transform 0.2s ease;
}
.textlink:hover {
  color: var(--green-ink);
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--gold);
}
.textlink:hover span {
  transform: translateX(4px);
}

/* ---------- Top bar ---------- */
.topbar {
  background: var(--green-ink);
  color: var(--cream);
  font-size: 0.85rem;
}
.topbar__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s2);
  padding-block: 0.6rem;
}
.topbar p {
  margin: 0;
}
.topbar__links {
  display: flex;
  gap: 1.5rem;
}
.topbar a {
  text-decoration: none;
}
.topbar a:hover {
  color: var(--gold-soft);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--cream);
  border-bottom: 1px solid var(--line);
}
.header__inner {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding-block: 0.9rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  flex-shrink: 0;
}
.brand__logo {
  display: block;
  width: auto;
  height: 48px;
  max-width: 64px;
  object-fit: contain;
  flex-shrink: 0;
}
.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}
.brand__text strong {
  font-family: var(--font-head);
  font-size: 1.55rem;
  color: var(--green-ink);
}
.brand__text small {
  margin-top: 4px;
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.nav {
  margin-left: auto;
  min-width: 0;
}
.nav ul {
  display: flex;
  align-items: center;
  gap: 0.1rem;
}
.nav a {
  display: block;
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  font-size: 0.94rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color 0.2s,
    color 0.2s;
}
.nav a:hover {
  background: var(--sand);
  color: var(--green);
}
.nav__cta a {
  margin-left: 0.4rem;
  background: var(--green);
  color: var(--cream);
  font-weight: 700;
}
.nav__cta a:hover {
  background: var(--green-deep);
  color: var(--cream);
}
.nav a[aria-current="page"] {
  background: var(--sand);
  color: var(--green);
}
.nav__cta a[aria-current="page"] {
  background: var(--green-deep);
  color: var(--cream);
}
.header__utils {
  display: flex;
  gap: 0.2rem;
  flex-shrink: 0;
}
.util {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: var(--green);
  transition: background-color 0.2s;
}
.util:hover {
  background: var(--sand);
}
.nav-toggle {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.nav-burger {
  display: none;
}

/* ---------- Sections ---------- */
.section {
  padding: var(--section) 0;
}
.section--sand {
  background-color: var(--sand);
}
.section--green {
  background-color: var(--green);
  color: var(--cream);
}
.section__head {
  max-width: 46rem;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}
.section__head h2 {
  margin-bottom: 1rem;
}
.section__sub {
  margin: 0;
  font-size: 1.12rem;
  color: var(--muted);
}
.section__head--light h2 {
  color: var(--cream);
}
.section__head--light .eyebrow {
  color: var(--gold-soft);
}
.section__head--light .section__sub {
  color: rgba(247, 243, 232, 0.85);
}
.checklist {
  display: grid;
  gap: 0.9rem;
  margin: var(--s4) 0;
}
.checklist li {
  position: relative;
  padding-left: 2.1rem;
  line-height: 1.55;
}
.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.28em;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--gold)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10.5l3.2 3.2L15 7' fill='none' stroke='%230f3322' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center / 14px no-repeat;
}

/* CTA */
.cta {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(3.5rem, 6vw, 5rem) 0;
  background-color: var(--green-ink);
  color: var(--cream);
  text-align: center;
}
.cta__grid {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  color: var(--cream);
  /* alpha mask only: fades the grid out in an ellipse */
  -webkit-mask-image: radial-gradient(
    ellipse closest-side at 50% 50%,
    #000 0%,
    rgba(0, 0, 0, 0.4) 40%,
    transparent 85%
  );
  mask-image: radial-gradient(
    ellipse closest-side at 50% 50%,
    #000 0%,
    rgba(0, 0, 0, 0.4) 40%,
    transparent 85%
  );
}
.cta__grid path {
  fill: none;
  stroke: currentColor;
  stroke-opacity: 0.08;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.cta__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.cta .eyebrow {
  color: var(--gold-soft);
}
.cta h2 {
  max-width: 34rem;
  color: var(--cream);
}
.cta__text {
  max-width: 34rem;
  margin: 0 auto var(--s4);
  opacity: 0.9;
}
.cta__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8rem;
}

/* Footer */
.footer {
  overflow: hidden;
  padding-top: clamp(4rem, 7vw, 6rem);
  background: var(--sand);
  color: var(--charcoal);
  font-size: 0.95rem;
}
.footer__main {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: clamp(2rem, 4vw, 4rem);
  padding-bottom: var(--s5);
}
.footer h4 {
  margin-bottom: 1.3rem;
  font-family: var(--font-body);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--green);
}
.footer ul {
  display: grid;
  gap: 0.75rem;
}
.footer a {
  text-decoration: none;
}
.footer__main li a:hover {
  color: var(--green);
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}
.footer__brand p {
  max-width: 21rem;
  margin: 1.3rem 0 0;
  color: var(--muted);
}
.footer__main .footer__social {
  display: flex;
  gap: 0.6rem;
  margin-top: 1.6rem;
}
.footer__main .footer__social a {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--white);
  color: var(--green-ink);
  transition:
    transform 0.2s,
    background-color 0.2s,
    border-color 0.2s,
    color 0.2s;
}
.footer__main .footer__social a:hover {
  transform: translateY(-3px);
  border-color: var(--green);
  background: var(--green);
  color: var(--gold);
  text-decoration: none;
}
.footer__brand .footer__address {
  margin-top: 1.3rem;
  font-size: 0.92rem;
}
.footer__brand .footer__reg {
  margin-top: 0.5rem;
  font-size: 0.82rem;
}
.footer__mark {
  margin: 0;
  padding-top: 1rem;
  font-family: var(--font-head);
  font-size: clamp(3.5rem, 17vw, 17rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: 0.01em;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
  color: #e2d9bd;
  user-select: none;
}
.footer__legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  padding-block: var(--s3);
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
  color: var(--muted);
}
.footer__legal p {
  max-width: 52rem;
  margin: 0;
}
.footer__top {
  font-weight: 700;
  color: var(--green-ink);
}
.footer__top:hover {
  color: var(--green);
}

/* WhatsApp float */
.wa-float {
  position: fixed;
  right: 1.2rem;
  bottom: 1.2rem;
  z-index: 150;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  transition: transform 0.2s;
}
.wa-float:hover {
  transform: scale(1.08);
}

/* ---------- Toasts ---------- */
/* Built by static/js/toast.js. Flat colour, tokens only, no gradients. */
.toast-region {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 5.5rem);
  right: var(--gutter);
  z-index: 250;
  display: grid;
  gap: 0.75rem;
  width: min(24rem, 100% - (var(--gutter) * 2));
  pointer-events: none;
}
.toast {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.85rem;
  padding: 1rem 1rem 1.15rem;
  background: var(--white);
  color: var(--charcoal);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(15, 51, 34, 0.14);
  font-size: 0.95rem;
  line-height: 1.5;
  pointer-events: auto;
}
.toast__icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--green);
  color: var(--cream);
}
.toast--info .toast__icon {
  background: var(--sand);
  color: var(--green);
}
.toast--warning .toast__icon {
  background: var(--gold);
  color: var(--green-ink);
}
.toast--error .toast__icon {
  background: var(--error);
  color: var(--cream);
}
.toast__body {
  padding-top: 0.1rem;
}
.toast__title {
  margin: 0;
  font-family: var(--font-head);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--green-ink);
}
.toast__text {
  margin: 0.25rem 0 0;
  color: var(--muted);
}
.toast__action {
  margin-top: 0.6rem;
  font-size: 0.92rem;
}
.toast__close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin: -0.2rem -0.2rem 0 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition:
    background-color 0.2s,
    color 0.2s;
}
.toast__close:hover {
  background: var(--sand);
  color: var(--green-ink);
}
.toast__bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--gold);
  transform-origin: left center;
  animation: toast-bar var(--toast-time, 6s) linear forwards;
}
.toast.is-paused .toast__bar {
  animation-play-state: paused;
}
@keyframes toast-bar {
  to {
    transform: scaleX(0);
  }
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
  }
}
@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateX(16px);
  }
}
@media (prefers-reduced-motion: no-preference) {
  .toast {
    animation: toast-in 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }
  .toast.is-leaving {
    animation: toast-out 0.25s ease forwards;
  }
}
@media (prefers-reduced-motion: reduce) {
  .toast__bar {
    display: none;
  }
}
@media (max-width: 640px) {
  .toast-region {
    top: calc(env(safe-area-inset-top, 0px) + 4.75rem);
    left: var(--gutter);
    width: auto;
  }
}

/* ---------- Responsive ---------- */

/* Switch to the mobile menu before the nav can overflow */
@media (max-width: 1200px) {
  .header__inner {
    gap: 0.25rem;
  }
  .header__utils {
    margin-left: auto;
    gap: 0;
  }
  .nav-burger {
    display: grid;
    gap: 5px;
    align-content: center;
    order: 3;
    padding: 12px;
    margin-right: -8px;
    border-radius: 12px;
    cursor: pointer;
  }
  .nav-burger span {
    display: block;
    width: 24px;
    height: 2.5px;
    border-radius: 3px;
    background: var(--green-ink);
    transition:
      transform 0.25s,
      opacity 0.25s;
  }
  .nav-burger span:nth-child(2) {
    height: 2px;
  }
  .nav-toggle:focus-visible + .nav-burger {
    outline: 3px solid var(--gold);
  }
  .nav-toggle:checked + .nav-burger span:nth-child(1) {
    transform: translateY(7.25px) rotate(45deg);
  }
  .nav-toggle:checked + .nav-burger span:nth-child(2) {
    opacity: 0;
  }
  .nav-toggle:checked + .nav-burger span:nth-child(3) {
    transform: translateY(-7.25px) rotate(-45deg);
  }
  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    background: var(--cream);
    border-bottom: 1px solid var(--line);
    transition: max-height 0.35s ease;
  }
  .nav-toggle:checked ~ .nav {
    max-height: 640px;
  }
  .nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    padding: 1rem var(--gutter) 1.6rem;
  }
  .nav a {
    padding: 0.9rem 1rem;
    border-radius: 12px;
    font-size: 1.02rem;
    white-space: normal;
  }
  .nav__cta a {
    margin: 0.6rem 0 0;
    text-align: center;
  }
}
@media (max-width: 1024px) {
  .footer__main {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .footer__brand {
    grid-column: 1 / -1;
  }
}
@media (max-width: 900px) {
  .topbar__note {
    display: none;
  }
  .topbar__inner {
    justify-content: center;
  }
}
@media (max-width: 640px) {
  :root {
    --gutter: 1.1rem;
  }
  body {
    font-size: 1rem;
  }
  .brand__text small {
    display: none;
  }
  .brand__logo {
    height: 42px;
  }
  .footer__main {
    grid-template-columns: minmax(0, 1fr);
  }
  .cta__actions {
    width: 100%;
  }
  .cta__actions .btn {
    flex: 1 1 100%;
  }
}
