/* Shared styles for the three project pages.
   Colours match the main site (index.html). */
:root {
  --cream: #FAF6EF;
  --paper: #FFFDF8;
  --ink: #223047;
  --ink-soft: #34435C;
  --muted: #5A6780;
  --blue: #2F5FD0;
  --yellow: #FFCB47;
  --green: #CFDAB4;
  --pink: #F4A3AE;
  --accent: var(--yellow);      /* each page sets its own accent on <body> */
  --tint: #FFF1C9;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: 'Poppins', Helvetica, sans-serif;
  overflow-x: hidden;
}
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--ink); }
img { max-width: 100%; display: block; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 clamp(16px, 5vw, 48px); }
.script { font-family: 'Caveat', cursive; font-weight: 700; }

/* ---------- Header ---------- */
header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 246, 239, 0.92);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 2px solid var(--ink);
}
header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 12px; padding-bottom: 12px; }
.logo { color: var(--ink); font-weight: 800; font-size: 24px; letter-spacing: -0.02em; }
.logo span { color: var(--blue); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--paper); color: var(--ink);
  font-weight: 700; font-size: 15px;
  padding: 11px 22px; border-radius: 999px;
  border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink);
  transition: transform .2s cubic-bezier(.3,1.7,.5,1), box-shadow .2s ease;
}
.btn:hover { color: var(--ink); transform: translate(-2px, -3px); box-shadow: 6px 7px 0 var(--ink); }
.btn.primary { background: var(--yellow); }
.btn.small { font-size: 14px; padding: 8px 16px; }

/* ---------- Hero ---------- */
.hero { padding: clamp(28px, 5vw, 56px) 0 clamp(24px, 4vw, 40px); }
.hero-card {
  background: var(--accent);
  border: 2px solid var(--ink); border-radius: 36px; box-shadow: 8px 8px 0 var(--ink);
  padding: clamp(28px, 5vw, 56px);
  display: flex; flex-wrap: wrap; gap: 36px; align-items: center;
  background-image: radial-gradient(rgba(34,48,71,0.10) 1.4px, transparent 1.6px);
  background-size: 20px 20px;
}
.hero-text { flex: 1 1 380px; min-width: 0; display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.hero-text .script { font-size: clamp(24px, 3vw, 32px); transform: rotate(-3deg); }
.hero h1 { margin: 0; font-size: clamp(38px, 6vw, 68px); font-weight: 800; line-height: 1; letter-spacing: -0.035em; }
.hero p.lead { margin: 0; font-size: clamp(17px, 2vw, 20px); line-height: 1.55; font-weight: 500; max-width: 40ch; }
.hero-img {
  flex: 1 1 300px; min-width: 0;
  background: var(--paper); border: 2px solid var(--ink); border-radius: 24px;
  box-shadow: 5px 5px 0 var(--ink); overflow: hidden; transform: rotate(2deg);
}
.hero-img img { width: 100%; height: auto; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { font-size: 13px; font-weight: 700; background: var(--paper); border: 1.5px solid var(--ink); padding: 5px 12px; border-radius: 999px; }
.buttons { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }

/* ---------- Big number stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 18px; padding: 8px 0 clamp(32px, 5vw, 56px); }
.stat {
  background: var(--paper); border: 2px solid var(--ink); border-radius: 22px;
  box-shadow: 4px 4px 0 var(--ink); padding: 18px 22px;
}
.stat:nth-child(2) { transform: rotate(-1deg); }
.stat:nth-child(3) { transform: rotate(1deg); }
.stat .num { font-size: 38px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.stat .label { font-size: 15px; font-weight: 600; line-height: 1.45; color: var(--ink-soft); }

/* ---------- Story sections ---------- */
section.block { padding: clamp(28px, 4vw, 48px) 0; display: flex; flex-wrap: wrap; gap: 20px 48px; }
.block-head { flex: 0 0 220px; }
.block-head .step {
  display: inline-block; font-family: 'Caveat', cursive; font-weight: 700; font-size: 24px;
  background: var(--accent); border: 2px solid var(--ink); border-radius: 10px;
  padding: 0 14px; transform: rotate(-3deg); margin-bottom: 10px;
}
.block-head h2 { margin: 0; font-size: clamp(26px, 3.2vw, 34px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.block-body { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.block-body p { margin: 0; font-size: 17px; line-height: 1.75; color: var(--ink-soft); max-width: 62ch; }
.block-body strong { color: var(--ink); }

/* Short point list with coloured bullets */
ul.points { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
ul.points li { position: relative; padding-left: 28px; font-size: 16px; line-height: 1.65; color: var(--ink-soft); max-width: 62ch; }
ul.points li::before {
  content: ""; position: absolute; left: 0; top: 7px; width: 14px; height: 14px;
  border-radius: 50%; background: var(--accent); border: 2px solid var(--ink);
}

/* Figures */
figure { margin: 6px 0 0; }
figure .frame {
  background: #fff; border: 2px solid var(--ink); border-radius: 22px;
  box-shadow: 5px 5px 0 var(--ink); overflow: hidden;
}
figure .frame img { width: 100%; height: auto; }
figcaption { font-size: 14px; color: var(--muted); margin-top: 12px; line-height: 1.5; }
.fig-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 22px; }
.fig-row.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); gap: 28px; }

/* Phone screenshots (AgriSense) */
section.block.wide .block-head,
section.block.wide .block-body { flex-basis: 100%; }
.phones { display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; }
@media (max-width: 760px) { .phones { grid-template-columns: repeat(2, 1fr); } }
.phones figure { margin: 0; }
.phones img { width: 100%; height: auto; filter: drop-shadow(4px 5px 0 rgba(34,48,71,0.25)); }
.phones figure:nth-child(odd) img { transform: rotate(-1.5deg); }
.phones figure:nth-child(even) img { transform: rotate(1.5deg); }
.phones figcaption { text-align: center; font-size: 13px; }

/* Results table */
.table-wrap { overflow-x: auto; border: 2px solid var(--ink); border-radius: 18px; background: var(--paper); box-shadow: 4px 4px 0 var(--ink); }
table { border-collapse: collapse; width: 100%; font-size: 15px; min-width: 460px; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1.5px dashed rgba(34,48,71,0.18); }
th { font-weight: 700; background: var(--tint); }
tr:last-child td { border-bottom: none; }
tr.best td { font-weight: 700; color: var(--ink); }
tr.best td:first-child::after { content: " ★"; color: var(--blue); }

/* Small "honest note" box */
.note {
  background: var(--paper); border: 2px dashed var(--ink); border-radius: 18px;
  padding: 16px 20px; font-size: 15px; line-height: 1.6; color: var(--ink-soft);
}
.note b { color: var(--ink); }

/* ---------- Next project + footer ---------- */
.next {
  margin: clamp(32px, 5vw, 56px) 0 clamp(48px, 7vw, 80px);
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 18px;
  background: var(--ink); color: var(--paper);
  border: 2px solid var(--ink); border-radius: 30px; box-shadow: 7px 7px 0 var(--blue);
  padding: clamp(24px, 4vw, 40px);
}
.next, .next:hover { color: var(--paper); }   /* keep text light on the navy card */
.next .script { color: var(--yellow); font-size: 26px; }
.next h3 { margin: 4px 0 0; font-size: clamp(22px, 3vw, 30px); font-weight: 800; }
footer { border-top: 2px solid var(--ink); background: var(--paper); }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 22px; padding-bottom: 22px; font-size: 14px; color: var(--muted); }

@media (max-width: 640px) {
  .block-head { flex-basis: 100%; }
  .hero-img { transform: none; }
}
