/* World Soil Organization — site styles
   Light theme is the default; dark theme applies with <html data-theme="dark">. */

:root {
  --bg: #ffffff;
  --bg-soft: #f6f6f6;
  --text: #1f1a16;
  --muted: #5f5751;
  --brown: #4f371f;
  --brown-strong: #3a2715;
  --on-brown: #ffffff;
  --line: #e4ded8;
  --deep: #2e1f12;
  --deep-text: #f4eee7;
  --deep-muted: #cdbfb1;
  --field-bg: #ffffff;
  --field-border: #b9aa9b;
  --error: #a3341f;
  --ok-bg: #f1ebe4;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Public Sans", "Helvetica Neue", Arial, sans-serif;
  --wrap: 76rem;
  --gutter: clamp(1rem, 4vw, 3rem);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #15100c;
  --bg-soft: #1d1611;
  --text: #f2ece5;
  --muted: #bcb0a4;
  --brown: #d2a679;
  --brown-strong: #e4bf98;
  --on-brown: #15100c;
  --line: #3a2e25;
  --deep: #0e0a07;
  --deep-text: #f2ece5;
  --deep-muted: #bcb0a4;
  --field-bg: #201812;
  --field-border: #5a4a3c;
  --error: #ff9c86;
  --ok-bg: #2a2018;
  color-scheme: dark;
}

/* Fluid base size: 16px on phones, ~18px on laptops, up to 26px on TVs and very large screens */
html { font-size: clamp(16px, 0.35vw + 13px, 26px); scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; }
img { max-width: 100%; display: block; }
a { color: var(--brown); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--brown-strong); }
:focus-visible { outline: 3px solid var(--brown); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding-inline: var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; top: 0; inset-inline-start: 0; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { width: auto; height: auto; clip: auto; top: 1rem; inset-inline-start: 1rem; background: var(--bg); color: var(--text); padding: .5rem .75rem; z-index: 50; }
html, body { overflow-x: clip; }
[hidden] { display: none !important; }

h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.12; letter-spacing: -0.015em; margin: 0; color: var(--text); }
h1 { font-size: clamp(2.3rem, 4.2vw + 0.6rem, 4.1rem); }
h2 { font-size: clamp(1.9rem, 2.4vw + 0.8rem, 2.9rem); }
h3 { font-size: 1.45rem; }
.eyebrow { font-family: var(--sans); font-size: .8rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--brown); margin: 0 0 1rem; }
:lang(zh) .eyebrow, :lang(ja) .eyebrow, :lang(ko) .eyebrow, :lang(ar) .eyebrow, :lang(ur) .eyebrow,
:lang(hi) .eyebrow, :lang(mr) .eyebrow, :lang(bn) .eyebrow, :lang(ta) .eyebrow, :lang(te) .eyebrow,
:lang(kn) .eyebrow, :lang(ml) .eyebrow, :lang(gu) .eyebrow, :lang(pa) .eyebrow, :lang(th) .eyebrow { letter-spacing: 0; text-transform: none; }

/* Logo: brown on light, cream on dark */
.logo-dark { display: none; }
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 1rem; min-height: 4.5rem; }
.brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; color: var(--text); margin-inline-end: auto; }
/* Logo and controls share one height so the whole header row lines up */
.brand img { height: 2.75rem; width: auto; aspect-ratio: 624 / 640; }
.brand span { font-family: var(--serif); font-size: 1.2rem; font-weight: 500; line-height: 1; padding-top: .14em; }
/* Where supported, trim the text box to cap height so the title centres on the logo identically in every browser */
@supports (text-box: trim-both cap alphabetic) {
  .brand span { text-box: trim-both cap alphabetic; padding-top: .1em; }
}
.nav { display: flex; align-items: center; gap: 1.75rem; }
.nav .nav-link { color: var(--muted); text-decoration: none; font-size: .95rem; line-height: 1; }
.nav .nav-link:hover { color: var(--text); }
.nav .btn { color: var(--on-brown); margin-inline-start: .25rem; }
.nav .btn:hover { color: var(--on-brown); }
.controls { display: flex; align-items: center; gap: .5rem; }

.lang-wrap { position: relative; display: flex; align-items: center; }
.lang-wrap svg { position: absolute; inset-inline-start: .7rem; width: 1.05rem; height: 1.05rem; pointer-events: none; color: var(--muted); }
.lang-select {
  appearance: none; -webkit-appearance: none;
  min-height: 2.75rem; max-width: 11rem;
  padding-block: 0; padding-inline: 2.1rem 1.9rem;
  border: 1px solid var(--line); border-radius: 0; background-color: var(--bg); color: var(--text);
  font: inherit; font-size: .9rem; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 1rem) 55%, calc(100% - .7rem) 55%;
  background-size: .3rem .3rem, .3rem .3rem; background-repeat: no-repeat;
}
[dir="rtl"] .lang-select { background-position: .7rem 55%, 1rem 55%; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.75rem; height: 2.75rem; padding: 0;
  border: 1px solid var(--line); background: var(--bg); color: var(--text); cursor: pointer;
}
.icon-btn:hover, .lang-select:hover { border-color: var(--brown); }
.icon-btn svg { width: 1.2rem; height: 1.2rem; }
.icon-sun { display: none; }
:root[data-theme="dark"] .icon-sun { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }

/* Buttons and forms */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3.1rem; padding: 0 1.5rem; border: 0; border-radius: 0;
  background: var(--brown); color: var(--on-brown); font: 600 1rem/1.2 var(--sans);
  text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--brown-strong); color: var(--on-brown); }
.btn[disabled] { opacity: .6; cursor: wait; }
.btn-small { min-height: 2.75rem; padding: 0 1rem; font-size: .9rem; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--bg-soft); color: var(--text); }

.signup { max-width: 34rem; position: relative; }
.signup label { display: block; font-size: .92rem; font-weight: 600; margin-bottom: .4rem; }
.signup-row { display: flex; flex-wrap: wrap; gap: .6rem; }
.signup input[type="email"], .field input {
  flex: 1 1 15rem; min-width: 0; min-height: 3.1rem; padding: 0 1rem; border-radius: 0;
  border: 1px solid var(--field-border); background: var(--field-bg); color: var(--text); font: 1rem var(--sans);
}
.signup input::placeholder { color: var(--muted); opacity: .8; }
.signup .fine { font-size: .85rem; color: var(--muted); margin: .7rem 0 0; }
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.form-msg { margin: .8rem 0 0; font-size: .95rem; }
.form-msg:empty { display: none; }
.form-msg.ok { background: var(--ok-bg); padding: .8rem 1rem; color: var(--text); border-inline-start: 3px solid var(--brown); }
.form-msg.err { color: var(--error); }

/* Layout grid used by the main sections */
.split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.5rem; align-items: center; }
section { padding-block: clamp(3.5rem, 7vw, 7rem); }
.band { background: var(--bg-soft); border-block: 1px solid var(--line); }

/* Photos: square corners and a crop chosen for each picture */
.photo { margin: 0; overflow: hidden; background: var(--bg-soft); }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.credit { font-size: .75rem; color: var(--muted); margin-top: .5rem; }
.credit a { color: inherit; }

/* Hero */
.hero { padding-block: clamp(2.5rem, 6vw, 6rem); }
.hero .lede { font-size: 1.15rem; color: var(--muted); max-width: 36em; margin: 1.4rem 0 2rem; }
.hero .photo { aspect-ratio: 4 / 3; }
.hero .photo img { object-position: 62% 58%; }

/* Mission */
.big-statement { font-family: var(--serif); font-size: clamp(1.6rem, 1.6vw + 1rem, 2.3rem); line-height: 1.25; color: var(--brown); margin: 0 0 1.5rem; }
.mission p { max-width: 40em; }

/* Plan */
.plan .intro { color: var(--muted); max-width: 36em; margin: .9rem 0 2.5rem; }
.cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.5rem; }
.card .photo { aspect-ratio: 4 / 3; }
.card .num { font-size: .8rem; font-weight: 600; letter-spacing: .12em; color: var(--brown); margin: 1.2rem 0 .3rem; }
.card p { margin: .6rem 0 0; color: var(--muted); }
.pos-awareness img { object-position: 50% 50%; }
.pos-policy img { object-position: 55% 50%; }
.pos-ground img { object-position: 45% 50%; }

/* Founder */
.founder .photo { aspect-ratio: 4 / 3; }
.founder .photo img { object-position: 50% 50%; }
.founder p { color: var(--muted); max-width: 36em; }
.stats { display: flex; flex-wrap: wrap; gap: 1.5rem 2.5rem; margin: 1.8rem 0; padding: 0; list-style: none; }
.stats strong { display: block; font-family: var(--serif); font-weight: 500; font-size: 2.1rem; color: var(--brown); line-height: 1.1; }
.stats span { font-size: .9rem; color: var(--muted); }

/* Join */
.join { background: var(--deep); color: var(--deep-text); }
.join h2 { color: var(--deep-text); }
.join p { color: var(--deep-muted); max-width: 32em; }
.join .signup label { color: var(--deep-text); }
.join .signup .fine { color: var(--deep-muted); }
.join .signup .fine a { color: var(--deep-text); }
.join .signup input[type="email"] { background: #ffffff; color: #1f1a16; border-color: #ffffff; }
.join .btn { background: #e9d7c3; color: #2e1f12; }
.join .btn:hover { background: #ffffff; color: #2e1f12; }
.join .form-msg.ok { background: rgba(255,255,255,.08); color: var(--deep-text); border-color: #e9d7c3; }
.join .form-msg.err { color: #ffb4a3; }

/* Footer */
.site-footer { background: var(--deep); color: var(--deep-muted); border-top: 1px solid rgba(255,255,255,.08); padding-block: 2.5rem; font-size: .9rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem 2rem; }
.site-footer img { width: 3.5rem; height: 3.5rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 1.5rem; margin-inline-end: auto; }
.site-footer a { color: var(--deep-text); }
.site-footer p { margin: 0; }

/* Plain pages: contact, privacy */
.page { padding-block: clamp(3rem, 6vw, 6rem); min-height: 60vh; }
.prose { max-width: 46rem; }
.prose h1 { font-size: clamp(2.1rem, 3vw + 1rem, 3.2rem); margin-bottom: .5rem; }
.prose h2 { font-size: 1.55rem; margin: 2.6rem 0 .6rem; }
.prose .meta { color: var(--muted); margin: 0 0 2rem; }
.prose ul { padding-inline-start: 1.2em; }
.prose li { margin: .35rem 0; }
.notice { background: var(--bg-soft); border-inline-start: 3px solid var(--brown); padding: .8rem 1rem; color: var(--muted); font-size: .92rem; margin: 0 0 2rem; }
.contact-email { font-family: var(--serif); font-size: clamp(1.6rem, 3vw + .6rem, 2.6rem); word-break: break-word; }

/* Admin */
.admin { padding-block: 3rem 6rem; }
.panel { background: var(--bg); border: 1px solid var(--line); padding: 2rem; }
.login { max-width: 26rem; margin: 2.5rem auto; }
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: .4rem; }
.field input { width: 100%; }
.toolbar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.toolbar .actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.count { font-family: var(--serif); font-size: 1.8rem; color: var(--brown); }
.table-box { overflow-x: auto; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: start; padding: .75rem 1rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: var(--bg-soft); font-weight: 600; font-size: .8rem; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
tr:last-child td { border-bottom: 0; }
.empty { padding: 2rem; text-align: center; color: var(--muted); }

/* Tablets and up */
@media (min-width: 48rem) {
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; }
}

/* Laptops and up: two-column sections */
@media (min-width: 60rem) {
  .split { gap: clamp(3rem, 5vw, 6rem); }
  .hero .split { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
  .hero .photo { aspect-ratio: 4 / 5; }
  .hero .photo img { object-position: 62% 50%; }
  .mission .split { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); align-items: start; }
  .founder .split { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .join .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

/* Header: hide section links on smaller screens so the language and theme controls always fit */
@media (max-width: 63.99rem) { .nav .nav-link { display: none; } }
@media (max-width: 34rem) {
  .brand span { display: none; }
  .nav .btn { display: none; }
  .lang-select { max-width: 8.5rem; }
}

/* Motion: quiet and slow. Content fades up a little as it comes into view; nothing bounces or loops.
   Everything here is skipped for visitors who ask their device for reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  :root { --ease: cubic-bezier(.22, .61, .36, 1); }
  body, .site-header, .band, .lang-select, .icon-btn, .signup input, .notice {
    transition: background-color .45s var(--ease), color .45s var(--ease), border-color .45s var(--ease);
  }
  .btn { transition: background-color .25s var(--ease), color .25s var(--ease); }
  .nav .nav-link, .site-footer a, .prose a, .fine a { transition: color .25s var(--ease); }
  .icon-btn svg { transition: transform .6s var(--ease); }
  .icon-btn:hover svg { transform: rotate(-12deg); }

  .card .photo img { transition: transform 1.4s var(--ease); }
  .card:hover .photo img { transform: scale(1.025); }

  .motion .reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 1s var(--ease), transform 1s var(--ease);
    transition-delay: var(--d, 0s);
  }
  .motion .reveal.in { opacity: 1; transform: none; }

  /* Photos settle gently instead of sliding */
  .motion .photo.reveal { transform: none; }
  .motion .photo.reveal img { transform: scale(1.035); transition: transform 2s var(--ease); transition-delay: var(--d, 0s); }
  .motion .photo.reveal.in img { transform: scale(1); }
  .motion .card:hover .photo.reveal.in img { transform: scale(1.025); }

  .site-header { transition: box-shadow .4s var(--ease), background-color .45s var(--ease), border-color .45s var(--ease); }
  .site-header.scrolled { box-shadow: 0 1px 12px rgba(31, 26, 22, .06); }
  :root[data-theme="dark"] .site-header.scrolled { box-shadow: 0 1px 12px rgba(0, 0, 0, .4); }
}

.site-footer .legal p { margin: 0; line-height: 1.5; }
.site-footer .legal p + p { color: var(--deep-muted); font-size: .85rem; }
