/* Meridex — brand tokens from the visual identity */
:root {
  --ink: #1B1C22;      /* logo dark */
  --paper: #F1F2F4;    /* light panel */
  --white: #FFFFFF;
  --blue: #3B73F5;     /* group accent */
  --coffee: #B4582A;   /* Meridex Coffee */
  --crops: #1F7A66;    /* Meridex Crops */
  --muted: #5E6170;
  --line: #DADCE2;

  --wide: "Archivo", Arial, Helvetica, sans-serif;
  --radius-lg: 20px;
  --radius-sm: 8px;
  --wrap: 1160px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--wide);
  font-stretch: 100%;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .brand-word, .division-name {
  font-stretch: 125%;      /* the wide cut of the wordmark */
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.12;
  margin: 0;
}
h1 { font-size: clamp(2.1rem, 4.6vw, 3.7rem); max-width: 16ch; }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
h3 { font-size: 1.05rem; }
p { margin: 0; }
a { color: inherit; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
@media (max-width: 600px) { .wrap { padding: 0 16px; } }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 4px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; background: var(--ink); color: var(--white); padding: 8px 14px; z-index: 100; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-row { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 34px; height: 27px; }
.brand-word { font-size: 1.15rem; letter-spacing: 0.01em; display: inline-flex; flex-direction: column; }
.brand-sub { font-size: .55rem; letter-spacing: .32em; font-weight: 500; color: inherit; opacity: .7; margin-top: 3px; }

.nav { display: flex; align-items: center; gap: 28px; }
.nav a { text-decoration: none; font-size: .95rem; color: var(--muted); }
.nav a:hover { color: var(--ink); }
.nav .nav-cta { color: var(--white); background: var(--ink); padding: 9px 16px; border-radius: var(--radius-sm); }
.nav .nav-cta:hover { color: var(--white); background: var(--blue); }
.nav-toggle { display: none; }

@media (max-width: 760px) {
  .nav-toggle {
    display: block; font: inherit; font-size: .95rem; background: none;
    border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 7px 14px; color: var(--ink);
  }
  .nav {
    display: none; position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--white); border-bottom: 1px solid var(--line); padding: 8px 16px 16px;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .nav .nav-cta { margin-top: 12px; text-align: center; border: 0; }
}

/* Buttons */
.btn {
  display: inline-block; font: inherit; font-weight: 600; font-size: .98rem;
  text-decoration: none; border-radius: var(--radius-sm); padding: 13px 22px; cursor: pointer;
  border: 2px solid transparent; transition: background-color .15s, color .15s, border-color .15s;
}
.btn-primary { background: var(--blue); color: var(--white); }
.btn-primary:hover { background: var(--ink); }
.btn-ghost { border-color: var(--ink); color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--white); }

/* Hero */
.hero { background: var(--paper); padding: 88px 0 96px; }
.hero-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 56px; align-items: center; }
.hero-division { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--coffee); margin-bottom: 22px; }
.division-mark { width: 28px; height: 22px; color: var(--ink); }
.lead { font-size: 1.12rem; color: var(--muted); max-width: 52ch; margin-top: 22px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }

.hero-figure {
  margin: 0; background: var(--ink); color: var(--white);
  border-radius: var(--radius-lg); padding: 36px 32px 28px;
}
.bars { display: flex; align-items: flex-end; gap: 14px; height: 210px; padding-left: 24px; }
.bar {
  display: block; width: 18%; background: var(--white);
  transform: skewX(-8deg); transform-origin: bottom;
  animation: rise .9s cubic-bezier(.2,.7,.2,1) both;
}
.b1 { height: 100%; }
.b2 { height: 65%; animation-delay: .08s; }
.b3 { height: 73%; animation-delay: .16s; }
.b4 { height: 100%; background: var(--coffee); animation-delay: .24s; }
@keyframes rise { from { transform: skewX(-8deg) scaleY(0); } to { transform: skewX(-8deg) scaleY(1); } }
@media (prefers-reduced-motion: reduce) { .bar { animation: none; } }

.spec { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 24px; margin: 30px 0 0; border-top: 1px solid rgba(255,255,255,.18); padding-top: 22px; }
.spec dt { font-size: .82rem; color: rgba(255,255,255,.6); }
.spec dd { margin: 2px 0 0; font-stretch: 125%; font-weight: 700; font-size: 1.15rem; }

@media (max-width: 900px) {
  .hero { padding: 56px 0 64px; }
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .bars { height: 150px; }
}

/* Sections */
.section { padding: 96px 0; }
.section-head { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: end; margin-bottom: 44px; }
.section-head p { color: var(--muted); max-width: 48ch; }
@media (max-width: 760px) {
  .section { padding: 64px 0; }
  .section-head { grid-template-columns: 1fr; gap: 12px; margin-bottom: 28px; }
}

/* Grades table */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.grades { width: 100%; border-collapse: collapse; font-size: .95rem; min-width: 680px; }
.grades th, .grades td { text-align: left; padding: 16px 18px; border-bottom: 1px solid var(--line); vertical-align: top; }
.grades thead th { font-size: .82rem; font-weight: 600; color: var(--muted); background: var(--paper); }
.grades tbody th { font-weight: 700; white-space: nowrap; }
.grades tbody tr:last-child > * { border-bottom: 0; }
.grades td:nth-child(4) { font-variant-numeric: tabular-nums; }
.origin { margin-top: 16px; font-size: .98rem; }
.note { font-size: .9rem; color: var(--muted); margin-top: 6px; }

.terms { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin-top: 56px; border-top: 2px solid var(--ink); }
.term { padding: 24px 28px 0 0; }
.term + .term { padding-left: 28px; border-left: 1px solid var(--line); }
.term p { color: var(--muted); margin-top: 10px; font-size: .98rem; }
@media (max-width: 760px) {
  .terms { grid-template-columns: 1fr; }
  .term, .term + .term { padding: 20px 0; border-left: 0; border-bottom: 1px solid var(--line); }
}

/* Process */
.section-dark { background: var(--ink); color: var(--white); }
.section-dark .section-head p { color: rgba(255,255,255,.65); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; counter-reset: step; }
.steps li { counter-increment: step; border-top: 1px solid rgba(255,255,255,.22); padding-top: 22px; }
.steps li::before {
  content: counter(step); display: block; font-stretch: 125%; font-weight: 700;
  font-size: 2.4rem; line-height: 1; color: var(--blue); margin-bottom: 18px;
}
.steps p { color: rgba(255,255,255,.7); margin-top: 10px; font-size: .96rem; }
@media (max-width: 900px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 540px) { .steps { grid-template-columns: 1fr; } }

/* Divisions */
.divisions { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.division {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 18px; row-gap: 6px;
  align-items: center; padding: 30px; border-radius: var(--radius-lg);
  border: 1px solid var(--line); text-decoration: none; color: var(--ink);
}
a.division:hover { border-color: var(--ink); }
.division-logo { width: 52px; height: 41px; grid-row: span 2; color: var(--ink); }
.division-name { display: flex; flex-direction: column; font-size: 1.15rem; }
.division-name span { font-size: .62rem; letter-spacing: .3em; font-weight: 600; margin-top: 4px; }
.division-text { color: var(--muted); font-size: .96rem; }
.division.is-soon { background: var(--paper); border-color: transparent; }
@media (max-width: 700px) { .divisions { grid-template-columns: 1fr; } }

/* Contact */
.contact { background: var(--paper); }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.contact-list { list-style: none; padding: 0; margin: 32px 0 0; }
.contact-list li { display: flex; flex-direction: column; padding: 14px 0; border-top: 1px solid var(--line); }
.contact-list span { font-size: .82rem; color: var(--muted); }
.contact-list a { font-weight: 600; font-size: 1.1rem; text-decoration: none; }
.contact-list a:hover { color: var(--blue); }

.form { background: var(--white); border-radius: var(--radius-lg); padding: 30px; display: grid; gap: 16px; }
.form label { display: grid; gap: 6px; font-size: .9rem; font-weight: 600; }
.form input, .form select, .form textarea {
  font: inherit; font-weight: 400; font-size: 1rem; color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 11px 12px; background: var(--white); width: 100%;
}
.form input:focus, .form select:focus, .form textarea:focus { outline: 2px solid var(--blue); outline-offset: 0; border-color: var(--blue); }
.form .btn { justify-self: start; }
.hp { position: absolute; left: -9999px; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; gap: 36px; } .form { padding: 22px; } }

/* Footer */
.site-footer { background: var(--ink); color: rgba(255,255,255,.7); padding: 36px 0; font-size: .9rem; }
.footer-row { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.brand-light { color: var(--white); }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--white); }
