/* ==========================================================================
   Swaraj Plant Nutrition — stylesheet
   Colours and spacing live in the :root block below. Change them there.
   ========================================================================== */

:root {
  --ink:        #2A1C10;
  --ink-soft:   #5C4835;
  --ink-faint:  #8A7863;
  --gold:       #B8862B;
  --leaf:       #3F8E36;
  --paper:      #FFFFFF;
  --husk:       #F3EFE6;
  --husk-deep:  #EAE3D4;
  --rule:       #E0D6C3;

  --cat-soluble:  #2E7D4F;
  --cat-granular: #1E5FA8;
  --cat-foliar:   #AF3030;
  --cat-calcium:  #1F91B8;
  --cat-micro:    #D07714;
  --cat-bio:      #6B3F8E;
  --cat-protect:  #2A1C10;

  --wrap: 1180px;
  --gap: clamp(1.25rem, 3vw, 2.5rem);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.62;
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }

/* --- Type ---------------------------------------------------------------- */

h1, h2, h3, h4 { margin: 0 0 .5em; font-weight: 650; line-height: 1.14; letter-spacing: -.018em; }
h1 { font-size: clamp(2.1rem, 5.2vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.3rem); }
h3 { font-size: clamp(1.1rem, 1.8vw, 1.32rem); letter-spacing: -.012em; }
p  { margin: 0 0 1.1em; max-width: 68ch; }

.lede { font-size: clamp(1.05rem, 1.7vw, 1.25rem); color: var(--ink-soft); }
.muted { color: var(--ink-soft); }
.small { font-size: .875rem; }

/* The signature element: nutrient ratio figures, set wide. */
.ratio {
  font-variation-settings: "wdth" 122;
  font-weight: 700;
  letter-spacing: -.01em;
  font-variant-numeric: lining-nums tabular-nums;
}

/* --- Skip link & focus --------------------------------------------------- */

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--ink); color: #fff; padding: .7rem 1.1rem;
}
.skip:focus { left: .75rem; top: .75rem; }

:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* --- Header -------------------------------------------------------------- */

.masthead {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  position: sticky; top: 0; z-index: 40;
}
.masthead .wrap {
  display: flex; align-items: center; gap: 1.5rem;
  min-height: 76px;
}
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; margin-right: auto; }
.brand img { height: 46px; width: auto; }
.brand b { display: block; font-size: 1.02rem; font-weight: 650; letter-spacing: -.02em; line-height: 1.15; }
.brand span { display: block; font-size: .74rem; color: var(--ink-faint); letter-spacing: .02em; }

.nav { display: flex; gap: 1.6rem; align-items: center; }
.nav a {
  text-decoration: none; font-size: .95rem; font-weight: 500;
  padding: .3rem 0; border-bottom: 2px solid transparent; color: var(--ink-soft);
}
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--gold); }

.navtoggle {
  display: none; background: none; border: 1px solid var(--rule);
  padding: .45rem .7rem; font: inherit; font-size: .9rem; cursor: pointer; color: var(--ink);
}

@media (max-width: 820px) {
  .navtoggle { display: block; }
  .nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: var(--paper); border-bottom: 1px solid var(--rule);
    flex-direction: column; align-items: stretch; gap: 0; padding: .5rem 0;
  }
  .nav.open { display: flex; }
  .nav a { padding: .8rem 1.25rem; border-bottom: none; }
}

/* --- Buttons ------------------------------------------------------------- */

.btn {
  display: inline-block; text-decoration: none; font: inherit; font-weight: 600;
  padding: .78rem 1.5rem; border: 1.5px solid var(--ink); background: var(--ink); color: #fff;
  cursor: pointer; transition: background .15s ease, color .15s ease;
}
.btn:hover { background: #3D2A19; border-color: #3D2A19; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--husk); }
.btn.light { background: var(--gold); border-color: var(--gold); color: #2A1C10; }
.btn.light:hover { background: #C9962F; border-color: #C9962F; }

/* --- Hero ---------------------------------------------------------------- */

.hero { position: relative; background: var(--ink); overflow: hidden; }
.hero img.bg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: .5;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(42,28,16,.92) 0%, rgba(42,28,16,.72) 45%, rgba(42,28,16,.35) 100%);
}
.hero .wrap { position: relative; z-index: 2; padding: clamp(3.5rem, 9vw, 7rem) 0 clamp(2.5rem, 6vw, 4.5rem); }
.hero h1 { color: #fff; max-width: 16ch; }
.hero p { color: #EADFCC; max-width: 56ch; font-size: clamp(1rem, 1.6vw, 1.16rem); }
.hero .actions { display: flex; flex-wrap: wrap; gap: .85rem; margin-top: 1.7rem; }
.hero .btn.ghost { color: #fff; border-color: rgba(255,255,255,.55); }
.hero .btn.ghost:hover { background: rgba(255,255,255,.12); }

.factbar { border-top: 1px solid rgba(255,255,255,.18); position: relative; z-index: 2; background: #23170C; }
.factbar .wrap { display: flex; flex-wrap: wrap; gap: 0; padding: 0; }
.factbar div {
  flex: 1 1 190px; padding: 1.4rem 1.5rem 1.5rem;
  border-left: 1px solid rgba(255,255,255,.18);
}
.factbar div:first-child { border-left: none; padding-left: 0; }
.factbar strong {
  display: block; color: var(--gold); font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  font-weight: 700; font-variation-settings: "wdth" 118; line-height: 1.1;
}
.factbar span { color: #CBBCA5; font-size: .9rem; }

/* --- Sections ------------------------------------------------------------ */

.section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section.husk { background: var(--husk); }
.section.ink { background: var(--ink); color: #F0E7D8; }
.section.ink h2 { color: #fff; }
.section.ink p { color: #DCCEB8; }

.section-head { max-width: 62ch; margin-bottom: clamp(1.8rem, 4vw, 2.8rem); }
.section-head p { color: var(--ink-soft); }

.goldrule { width: 54px; height: 3px; background: var(--gold); margin-bottom: 1.4rem; }

/* --- Pillars: bordered rows, not floating cards -------------------------- */

.pillars { display: grid; gap: 0; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--rule); }
@media (max-width: 1100px) { .pillars { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .pillars { grid-template-columns: 1fr; } }
.pillars > div { padding: 1.7rem 1.6rem 1.9rem; border-bottom: 1px solid var(--rule); border-right: 1px solid var(--rule); }
.pillars > div:first-child { border-left: 1px solid var(--rule); }
.pillars h3 { margin-bottom: .45rem; }
.pillars p { margin: 0; color: var(--ink-soft); font-size: .97rem; }
@media (max-width: 600px) {
  .pillars > div { border-left: 1px solid var(--rule); }
}

/* --- Category filter ----------------------------------------------------- */

.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 2rem; }
.filters button {
  font: inherit; font-size: .9rem; font-weight: 500; cursor: pointer;
  padding: .5rem 1rem; border: 1px solid var(--rule); background: var(--paper); color: var(--ink-soft);
}
.filters button:hover { border-color: var(--ink-faint); color: var(--ink); }
.filters button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

/* --- Product grid -------------------------------------------------------- */

.grid { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }

.card {
  display: grid; grid-template-columns: 104px 1fr; gap: 1.05rem;
  text-decoration: none; color: inherit;
  border: 1px solid var(--rule); border-top: 3px solid var(--cat);
  padding: 1.15rem 1.2rem 1.25rem; background: var(--paper);
  align-items: start; transition: border-color .15s ease;
}
.card:hover { border-color: var(--ink-faint); border-top-color: var(--cat); }
.card .shot { display: flex; align-items: center; justify-content: center; height: 124px; }
.card .shot img { max-height: 124px; max-width: 104px; width: auto; object-fit: contain; }
.card .cat { font-size: .74rem; font-weight: 600; color: var(--cat); letter-spacing: .015em; }
.card h3 { font-size: 1.06rem; margin: .18rem 0 .3rem; }
.card .ratio { display: block; font-size: 1.5rem; color: var(--ink); margin-bottom: .35rem; }
.card p { font-size: .9rem; color: var(--ink-soft); margin: 0; }

/* --- Product detail ------------------------------------------------------ */

.detail { display: grid; grid-template-columns: minmax(200px, 320px) 1fr; gap: clamp(1.75rem, 5vw, 3.5rem); align-items: start; }
@media (max-width: 800px) { .detail { grid-template-columns: 1fr; } }

.detail .shotbox {
  background: var(--husk); border: 1px solid var(--rule);
  display: flex; align-items: center; justify-content: center; padding: 1.75rem; min-height: 340px;
}
.detail .shotbox img { max-height: 340px; width: auto; }

.detail .cat { color: var(--cat); font-weight: 600; font-size: .88rem; }
.detail h1 { margin: .3rem 0 .2rem; font-size: clamp(1.8rem, 4vw, 2.7rem); }
.detail .ratio.big { font-size: clamp(2.2rem, 6vw, 3.4rem); color: var(--cat); line-height: 1; margin: .5rem 0 1rem; display: block; }

.spec { border-top: 1px solid var(--rule); margin-top: 2rem; padding-top: 1.5rem; }
.spec h2 { font-size: 1.02rem; margin-bottom: .7rem; }
.spec ul { margin: 0 0 1.5rem; padding: 0; list-style: none; max-width: 66ch; }
.spec li { padding: .5rem 0 .5rem 1.15rem; border-bottom: 1px solid var(--husk-deep); position: relative; font-size: .97rem; }
.spec li::before { content: ""; position: absolute; left: 0; top: 1.05em; width: 5px; height: 5px; background: var(--cat); }
.spec .dose { background: var(--husk); border-left: 3px solid var(--cat); padding: 1rem 1.2rem; max-width: 66ch; }
.spec .dose strong { display: block; font-size: .8rem; color: var(--ink-soft); margin-bottom: .2rem; font-weight: 600; }
.spec .note { font-size: .9rem; color: var(--ink-soft); font-style: italic; }

.backlink { display: inline-block; margin-bottom: 1.5rem; font-size: .92rem; color: var(--ink-soft); text-decoration: none; border-bottom: 1px solid var(--rule); }
.backlink:hover { color: var(--ink); border-bottom-color: var(--ink); }

/* --- Crops --------------------------------------------------------------- */

.crops { display: flex; flex-wrap: wrap; gap: .55rem; }
.crops span {
  border: 1px solid rgba(255,255,255,.28); padding: .45rem 1rem; font-size: .93rem; color: #EADFCC;
}

/* --- Split (about / dealer) ---------------------------------------------- */

.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.75rem, 5vw, 4rem); align-items: center; }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } }
.split img { border: 1px solid var(--rule); }

.ticks { list-style: none; margin: 1.2rem 0 1.8rem; padding: 0; }
.ticks li { padding: .45rem 0 .45rem 1.5rem; position: relative; }
.ticks li::before {
  content: ""; position: absolute; left: 1px; top: .72em;
  width: 10px; height: 6px; border-left: 2px solid var(--gold); border-bottom: 2px solid var(--gold);
  transform: rotate(-45deg);
}

/* --- Contact ------------------------------------------------------------- */

.contactgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--rule); }
.contactgrid > div { padding: 1.7rem 1.6rem; border-bottom: 1px solid var(--rule); border-right: 1px solid var(--rule); border-left: 1px solid var(--rule); }
.contactgrid h3 { font-size: .95rem; margin-bottom: .5rem; }
.contactgrid a { color: var(--ink); }
.contactgrid p { margin: 0; color: var(--ink-soft); }
@media (max-width: 860px) { .contactgrid { grid-template-columns: 1fr; } }

/* --- Footer -------------------------------------------------------------- */

.foot { background: var(--ink); color: #C4B49B; padding: 3rem 0 2rem; font-size: .92rem; }
.foot a { color: #E3D6BF; text-decoration: none; }
.foot a:hover { color: #fff; text-decoration: underline; }
.foot .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 2rem; }
.foot h4 { color: #fff; font-size: .9rem; margin-bottom: .7rem; }
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li { padding: .2rem 0; }
.foot .base { border-top: 1px solid rgba(255,255,255,.14); margin-top: 2.5rem; padding-top: 1.5rem; font-size: .82rem; color: #9C8B72; }
.foot .base p { max-width: none; }

/* --- Small screens ------------------------------------------------------- */
@media (max-width: 520px) {
  .brand span span { display: none; }
  .brand img { height: 40px; }
  .factbar div { flex-basis: 100%; border-left: none; border-top: 1px solid rgba(255,255,255,.14); padding-left: 0; }
  .factbar div:first-child { border-top: none; }
  .card { grid-template-columns: 88px 1fr; }
  .card .shot { height: 104px; }
  .card .shot img { max-height: 104px; max-width: 88px; }
}

/* --- Category jump nav and category blocks (products index) -------------- */

.jump { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.jump a {
  text-decoration: none; font-size: .9rem; font-weight: 500;
  padding: .5rem 1rem; border: 1px solid var(--rule); color: var(--ink-soft); background: var(--paper);
}
.jump a:hover { border-color: var(--ink-faint); color: var(--ink); }

.catblock { padding: clamp(2.2rem, 5vw, 3.2rem) 0; scroll-margin-top: 90px; }
.catblock:nth-of-type(even) { background: var(--husk); }
.catblock:nth-of-type(even) .card { background: var(--paper); }

.cathead {
  display: flex; align-items: baseline; gap: .7rem;
  font-size: clamp(1.25rem, 2.4vw, 1.55rem);
  padding-bottom: .7rem; margin-bottom: 1.4rem;
  border-bottom: 2px solid var(--cat);
}
.cathead span {
  font-size: .8rem; font-weight: 600; color: #fff; background: var(--cat);
  padding: .1rem .5rem; border-radius: 2px; align-self: center;
}
