/* ==========================================================================
   BASE — Agro-Kaolin landing. Bold Modern Bento.
   Layered on top of styles.css (brand tokens). Does NOT redefine brand vars.
   ========================================================================== */

:root {
  --font-display: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0.32, 0.72, 0, 1);
  --dur: 0.6s;

  --maxw: 1320px;
  --gut: clamp(1rem, 4vw, 3rem);
  --sec-y: clamp(4.5rem, 9vw, 9rem);

  --r-lg: 28px;
  --r-md: 18px;
  --r-sm: 12px;

  --hair-dark: rgba(255, 255, 255, 0.10);
  --hair-light: rgba(29, 39, 51, 0.12);

  --bento-gap: 1px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--font-body);
  background: var(--light-color);
  color: var(--text-color-main);
  line-height: 1.6;
  font-size: clamp(1rem, 0.95rem + 0.2vw, 1.0625rem);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, video, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
ul { list-style: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text-color-main);
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100000;
  background: var(--shadow-color); color: var(--white);
  padding: 12px 20px; border-radius: 0 0 var(--r-sm) 0;
}
.skip-link:focus { left: 0; }

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

/* ---- Layout primitives -------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gut);
}

.section {
  padding-block: var(--sec-y);
  position: relative;
  scroll-margin-top: clamp(88px, 11vh, 116px); /* clear the fixed navbar on anchor jumps */
  /* Skip rendering work for off-screen sections (big Speed Index / TBT win).
     `auto` remembers the real size after first render to avoid scroll jumps. */
  content-visibility: auto;
  contain-intrinsic-size: auto 720px;
}
/* First section sits near the fold — keep it always rendered. */
.section:first-of-type { content-visibility: visible; }
.section--dark { background: var(--shadow-color); color: var(--text-on-dark); }
.section--dark h1, .section--dark h2, .section--dark h3, .section--dark h4 { color: var(--white); }
.section--cream { background: var(--light-color); }
.section--tight { padding-block: clamp(3rem, 6vw, 5rem); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 0.55em;
  font-family: var(--font-body);
  font-size: 0.6875rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.22em;
  color: var(--tertiary-color);
  padding: 0.5em 1em;
  border: 1px solid currentColor;
  border-radius: 999px;
  line-height: 1;
}
.eyebrow::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--tertiary-color);
}

.section-head { max-width: min(78rem, 100%); }
.section-head .eyebrow { margin-bottom: 1.4rem; }
.section-title {
  font-size: clamp(1.9rem, 1.25rem + 2.9vw, 3.3rem);
  line-height: 1.08;
  margin-bottom: 1.1rem;
  max-width: 16em;            /* scales with the title's own size, wraps cleanly */
}
/* Long sentence-style headlines: smaller, calmer, full measure. */
.section-title--statement {
  font-size: clamp(1.45rem, 1.1rem + 1.5vw, 2.3rem);
  line-height: 1.22;
  letter-spacing: -0.01em;
  max-width: 30ch;
}
.section-sub {
  font-size: clamp(1.05rem, 0.98rem + 0.5vw, 1.3rem);
  color: var(--text-on-light-muted);
  max-width: 60ch;            /* readable measure for prose only */
}
.section--dark .section-sub { color: var(--text-on-dark-muted); }

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

.btn {
  display: inline-flex; align-items: center; gap: 0.75rem;
  font-family: var(--font-display); font-weight: 600;
  font-size: 0.9375rem; letter-spacing: -0.01em;
  padding: 0.95rem 1.35rem 0.95rem 1.6rem;
  border-radius: 999px;
  transition: transform var(--dur) var(--ease), background-color var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  will-change: transform;
}
.btn:active { transform: scale(0.97); }

.btn__ico {
  width: 2rem; height: 2rem; flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  transition: transform var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.btn__ico svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 1.6; fill: none; }
.btn:hover .btn__ico { transform: translate(3px, -2px); }

.btn--primary { background: var(--primary-color); color: var(--white); }
.btn--primary .btn__ico { background: rgba(255, 255, 255, 0.16); }
.btn--primary:hover { background: var(--primary-dark); box-shadow: 0 14px 34px -14px rgba(196, 30, 30, 0.7); }

.btn--gold { background: var(--tertiary-color); color: var(--white); }
.btn--gold .btn__ico { background: rgba(255, 255, 255, 0.18); }
.btn--gold:hover { background: var(--tertiary-dark); }

.btn--ghost {
  background: transparent; color: var(--text-color-main);
  border: 1px solid var(--hair-light);
  padding-inline: 1.5rem;
}
.btn--ghost .btn__ico { background: rgba(29, 39, 51, 0.06); }
.btn--ghost:hover { background: rgba(29, 39, 51, 0.04); border-color: var(--tertiary-color); }

.section--dark .btn--ghost {
  color: var(--white); border-color: var(--hair-dark);
}
.section--dark .btn--ghost .btn__ico { background: rgba(255, 255, 255, 0.10); }
.section--dark .btn--ghost:hover { background: rgba(255, 255, 255, 0.06); border-color: var(--tertiary-light); }

/* ---- Bento grid + double-bezel surfaces --------------------------------- */

.bento {
  display: grid;
  gap: var(--bento-gap);
  background: var(--hair-light);
  border: 1px solid var(--hair-light);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.section--dark .bento { background: var(--hair-dark); border-color: var(--hair-dark); }

.bento-cell {
  background: var(--light-color);
  padding: clamp(1.6rem, 3vw, 2.6rem);
}
.section--dark .bento-cell { background: var(--shadow-color); }

.bezel {
  border: 1px solid var(--hair-light);
  border-radius: var(--r-lg);
  padding: 8px;
  background: rgba(29, 39, 51, 0.02);
}
.section--dark .bezel {
  border-color: var(--hair-dark);
  background: rgba(255, 255, 255, 0.025);
}
.bezel__core {
  border-radius: calc(var(--r-lg) - 8px);
  overflow: hidden;
  background: var(--white);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.section--dark .bezel__core {
  background: #20303f;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* ---- Scroll reveal ------------------------------------------------------ */

[data-reveal] {
  opacity: 0;
  transform: translateY(2.2rem);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
  will-change: transform, opacity;
}
[data-reveal].is-in { opacity: 1; transform: none; }
[data-reveal][data-delay="1"] { transition-delay: 0.08s; }
[data-reveal][data-delay="2"] { transition-delay: 0.16s; }
[data-reveal][data-delay="3"] { transition-delay: 0.24s; }
[data-reveal][data-delay="4"] { transition-delay: 0.32s; }

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
  .btn, .btn__ico { transition: none !important; }
}

/* ---- Forms (static markup styling) -------------------------------------- */

.field { display: flex; flex-direction: column; gap: 0.5rem; }
.field label {
  font-family: var(--font-display); font-weight: 600;
  font-size: 0.8125rem; letter-spacing: 0.01em;
  color: var(--text-on-light-muted);
}
.section--dark .field label { color: var(--text-on-dark-muted); }
.field input, .field select, .field textarea {
  font: inherit; font-size: 0.95rem;
  width: 100%;
  padding: 0.9rem 1rem;
  background: var(--white);
  border: 1px solid var(--hair-light);
  border-radius: var(--r-sm);
  color: var(--text-color-main);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--tertiary-color);
  box-shadow: 0 0 0 4px rgba(181, 142, 91, 0.14);
}
.field-row {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 640px) { .field-row { grid-template-columns: 1fr; } }

/* ---- PhoneField widget (assets/js/phone/phone-input.js) ----------------- */
.phone-field-container { width: 100%; }
.modern-phone-field { position: relative; width: 100%; }
.phone-input-container {
  display: flex; align-items: stretch;
  border: 1px solid var(--hair-light);
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--white);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.phone-input-container:focus-within {
  border-color: var(--tertiary-color);
  box-shadow: 0 0 0 4px rgba(181, 142, 91, 0.14);
}
.country-button {
  display: flex; align-items: center; gap: 0.45rem;
  padding: 0 0.85rem;
  background: rgba(29, 39, 51, 0.035);
  border-right: 1px solid var(--hair-light);
  font: inherit; font-size: 0.95rem; color: var(--text-color-main);
  white-space: nowrap; cursor: pointer;
}
.country-button .flag { font-size: 1.1rem; line-height: 1; }
.country-button .code { font-weight: 600; font-variant-numeric: tabular-nums; }
.modern-phone-field.no-country .country-button .code { color: var(--text-on-light-faint); font-weight: 500; }
.country-button .arrow {
  width: 11px; height: 11px; fill: none;
  stroke: currentColor; stroke-width: 1.6;
  transition: transform var(--dur) var(--ease);
}
.country-button.active .arrow { transform: rotate(180deg); }
.country-button.is-err {
  background: rgba(196, 30, 30, 0.08);
  box-shadow: inset 0 0 0 1px var(--error-color);
  animation: ak-country-shake 0.32s var(--ease-out);
}
@keyframes ak-country-shake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-4px); }
  50%      { transform: translateX(3px); }
  75%      { transform: translateX(-2px); }
}
@media (prefers-reduced-motion: reduce) {
  .country-button.is-err { animation: none; }
}
.phone-input {
  flex: 1; min-width: 0;
  font: inherit; font-size: 0.95rem;
  padding: 0.9rem 1rem;
  border: 0; outline: none; background: transparent;
  color: var(--text-color-main);
}
.autofill-trap { position: absolute !important; left: -9999px !important; opacity: 0 !important; }

.country-dropdown {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30;
  background: var(--white);
  border: 1px solid var(--hair-light);
  border-radius: var(--r-sm);
  box-shadow: 0 24px 50px -24px rgba(29, 39, 51, 0.45);
  padding: 0.7rem;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0.25s var(--ease);
}
.country-dropdown.open { opacity: 1; visibility: visible; transform: none; }
.country-search {
  width: 100%; font: inherit; font-size: 0.9rem;
  padding: 0.7rem 0.85rem; margin-bottom: 0.5rem;
  border: 1px solid var(--hair-light); border-radius: var(--r-sm);
  background: var(--light-color);
}
.country-search:focus { outline: none; border-color: var(--tertiary-color); }
.country-list { max-height: 240px; overflow-y: auto; display: grid; gap: 1px; }
.country-item {
  display: flex; align-items: center; gap: 0.65rem;
  padding: 0.6rem 0.7rem; border-radius: 8px;
  cursor: pointer; font-size: 0.9rem;
  transition: background var(--dur) var(--ease);
}
.country-item:hover { background: var(--light-color); }
.country-item .flag { font-size: 1.05rem; line-height: 1; }
.country-item .name { flex: 1; color: var(--text-color-main); }
.country-item .code { color: var(--text-on-light-muted); font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) {
  .country-dropdown, .country-button .arrow { transition: none; }
}

/* ---- Utilities ---------------------------------------------------------- */

.lead { font-size: clamp(1.05rem, 1rem + 0.5vw, 1.3rem); line-height: 1.55; }
.muted { color: var(--text-on-light-muted); }
.section--dark .muted { color: var(--text-on-dark-muted); }
.center { text-align: center; }
.stack-lg { display: grid; gap: clamp(2rem, 4vw, 3.5rem); }
.no-scroll { overflow: hidden; }
[hidden] { display: none !important; }
