:root {
  --maize: #e3a72f;
  --maize-soft: #f6e3b4;
  --green: #1f4d3a;
  --green-deep: #13332a;
  --ink: #1d2320;
  --muted: #5d665f;
  --paper: #fbf8f1;
  --tint: #f3ede0;
  --line: #e2dccd;
  --white: #ffffff;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(19, 51, 42, .08);
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--green); }
h1, h2, h3, h4 { font-family: var(--serif); line-height: 1.2; margin: 0 0 .6em; color: var(--green-deep); }
h1 { font-size: clamp(2.3rem, 5.5vw, 4.2rem); font-weight: 700; }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.7rem); font-weight: 600; }
h3 { font-size: 1.35rem; font-weight: 600; }
h4 { font-size: 1.12rem; font-weight: 600; }
p { margin: 0 0 1em; }

.container { width: min(1160px, 100% - 32px); margin-inline: auto; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251, 248, 241, .92);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-wrap { display: flex; align-items: center; justify-content: space-between; min-height: 72px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--green-deep); }
.brand-text { font-family: var(--serif); font-size: .82rem; line-height: 1.2; }
.brand-text strong { font-size: .98rem; font-weight: 600; }
.nav { display: flex; align-items: center; gap: 22px; }
.nav a { text-decoration: none; color: var(--ink); font-size: .93rem; font-weight: 500; }
.nav a:hover { color: var(--green); }
.nav-cta { background: var(--green); color: var(--white) !important; padding: 9px 18px; border-radius: 999px; }
.nav-cta:hover { background: var(--green-deep); }
.nav-toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--green-deep); margin: 5px 0; transition: .25s; }

/* Buttons */
.btn {
  display: inline-block; padding: 14px 26px; border-radius: 999px;
  font-weight: 600; font-size: .98rem; text-decoration: none; cursor: pointer;
  border: 2px solid transparent; transition: transform .15s, background .2s, color .2s;
  font-family: var(--sans);
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--maize); color: var(--green-deep); }
.btn-primary:hover { background: #d6981f; }
.btn-ghost { border-color: var(--green); color: var(--green); }
.btn-ghost:hover { background: var(--green); color: var(--white); }

/* Hero */
.hero { position: relative; overflow: hidden; padding: 96px 0 56px; background: linear-gradient(180deg, var(--paper) 0%, var(--tint) 100%); }
.hero-pattern {
  position: absolute; inset: 0; opacity: .55; pointer-events: none;
  background-image: radial-gradient(circle at 85% 20%, var(--maize-soft) 0, transparent 40%),
                    radial-gradient(circle at 10% 90%, rgba(31,77,58,.10) 0, transparent 45%);
}
.hero-inner { position: relative; max-width: 820px; }
.hero h1 em { font-style: italic; font-weight: 400; color: var(--green); }
.lead { font-size: 1.18rem; color: var(--muted); max-width: 680px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; font-weight: 600; color: #a87512; margin-bottom: .8em; }
.eyebrow-light { color: var(--maize); }

.stats { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 72px; }
.stat { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.stat-num { display: block; font-family: var(--serif); font-size: 2.3rem; font-weight: 700; color: var(--green); line-height: 1.1; }
.stat-label { font-size: .9rem; color: var(--muted); }

/* Sections */
.section { padding: 96px 0; }
.section-tinted { background: var(--tint); }
.section-dark { background: var(--green-deep); color: #e8efe9; }
.section-dark h2, .section-dark h3 { color: var(--white); }
.section-intro { max-width: 760px; color: var(--muted); font-size: 1.08rem; margin-bottom: 40px; }
.two-col { display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: start; }

.cards-stack { display: grid; gap: 18px; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.card p { margin: 0; color: var(--muted); }
.card-accent { border-top: 4px solid var(--maize); }

.values { margin-top: 72px; }
.values-title { text-align: center; margin-bottom: 28px; }
.values-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.value { padding: 26px; border-radius: var(--radius); background: var(--tint); }
.value-n { font-family: var(--serif); color: var(--maize); font-weight: 700; font-size: 1.4rem; }
.value h4 { margin: .4em 0 .3em; }
.value p { margin: 0; font-size: .95rem; color: var(--muted); }

/* Programs */
.program-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.program { background: var(--white); border-radius: var(--radius); padding: 30px; border: 1px solid var(--line); transition: transform .2s, box-shadow .2s; }
.program:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.program-icon { width: 52px; height: 52px; border-radius: 12px; background: var(--maize-soft); display: grid; place-items: center; margin-bottom: 18px; }
.program-icon svg { width: 28px; height: 28px; fill: none; stroke: var(--green); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.program p { color: var(--muted); margin: 0; font-size: .96rem; }

/* Founder */
.founder { align-items: center; }
.founder-portrait { text-align: center; }
.portrait-frame {
  aspect-ratio: 4 / 5; max-width: 380px; margin: 0 auto; border-radius: 22px;
  background: linear-gradient(145deg, var(--green) 0%, var(--green-deep) 100%);
  display: grid; place-items: center; position: relative; overflow: hidden;
  box-shadow: 0 24px 50px rgba(19, 51, 42, .22);
}
.portrait-frame::after {
  content: ""; position: absolute; width: 70%; height: 70%; right: -20%; bottom: -20%;
  border-radius: 50%; background: var(--maize); opacity: .35;
}
.portrait-frame img { width: 100%; height: 100%; object-fit: cover; position: relative; z-index: 1; }
.portrait-initials { font-family: var(--serif); font-size: 4rem; color: var(--maize-soft); letter-spacing: .08em; position: relative; z-index: 1; }
.portrait-caption { margin-top: 18px; font-family: var(--serif); font-weight: 600; color: var(--green-deep); }
.portrait-caption span { font-family: var(--sans); font-weight: 400; font-size: .9rem; color: var(--muted); }

.timeline-title { margin-top: 80px; margin-bottom: 26px; }
.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--line); margin-left: 8px; }
.timeline li { display: grid; grid-template-columns: 150px 1fr; gap: 20px; padding: 0 0 28px 28px; position: relative; }
.timeline li::before {
  content: ""; position: absolute; left: -8px; top: 6px; width: 14px; height: 14px;
  border-radius: 50%; background: var(--maize); border: 3px solid var(--paper);
}
.t-year { font-family: var(--serif); font-weight: 700; color: var(--green); font-size: 1.1rem; }
.timeline h4 { margin-bottom: .2em; }
.timeline p { margin: 0; color: var(--muted); font-size: .96rem; }

/* Legacy */
.legacy-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 36px; }
.legacy { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); border-radius: var(--radius); padding: 30px; }
.legacy-gen { display: inline-block; font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--maize); margin-bottom: 12px; font-weight: 600; }
.legacy h3 small { font-family: var(--sans); font-size: .85rem; font-weight: 400; color: #b9c9be; }
.legacy p { margin: 0; color: #cfdcd3; font-size: .97rem; }
.legacy-quote { margin: 56px auto 0; max-width: 820px; text-align: center; }
.legacy-quote p { font-family: var(--serif); font-size: clamp(1.2rem, 2.4vw, 1.6rem); font-style: italic; color: var(--maize-soft); line-height: 1.5; }

/* Gruma */
.gruma-timeline { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-bottom: 64px; }
.g-item { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 18px; border-left: 4px solid var(--maize); }
.g-item span { font-family: var(--serif); font-weight: 700; color: var(--green); font-size: 1.2rem; }
.g-item p { margin: .3em 0 0; font-size: .93rem; color: var(--muted); }
.sub-title { margin-bottom: 22px; }
.company-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.company { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.company-tag { font-size: .82rem; color: #a87512; font-weight: 600; margin-bottom: .8em; }
.company p:last-child { margin: 0; color: var(--muted); font-size: .96rem; }
.brands { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 44px; }
.brands span { font-family: var(--serif); font-weight: 600; padding: 8px 18px; border-radius: 999px; background: var(--tint); color: var(--green-deep); }

/* Contact */
.contact-list { list-style: none; padding: 0; margin: 20px 0; }
.contact-list a { word-break: break-all; }
.contact-form { background: var(--white); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow); display: grid; gap: 16px; }
.contact-form label { display: grid; gap: 6px; font-size: .9rem; font-weight: 500; }
.contact-form input[type="text"], .contact-form input[type="email"], .contact-form textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  font: inherit; background: var(--paper); color: var(--ink);
}
.contact-form input:focus, .contact-form textarea:focus { outline: 2px solid var(--maize); border-color: transparent; }
.contact-form .consent { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; color: var(--muted); }
.contact-form .consent input { margin-top: 5px; }
.hp { position: absolute !important; left: -9999px !important; height: 0; overflow: hidden; }
.form-status { padding: 14px 18px; border-radius: 10px; font-weight: 500; }
.form-status.ok { background: #e3f1e7; color: var(--green-deep); }
.form-status.err { background: #fbe6e1; color: #8a2b16; }

/* Footer */
.site-footer { background: var(--green-deep); color: #cfdcd3; padding: 56px 0 28px; }
.footer-inner { display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.footer-brand { font-family: var(--serif); font-size: 1.2rem; color: var(--white); margin-bottom: .3em; }
.footer-small { font-size: .92rem; }
.footer-nav { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-nav a { color: #cfdcd3; text-decoration: none; font-size: .93rem; }
.footer-nav a:hover { color: var(--maize); }
.footer-legal { border-top: 1px solid rgba(255,255,255,.12); margin-top: 36px; padding-top: 20px; font-size: .8rem; color: #9fb3a6; }
.footer-legal p { margin: 0 0 .4em; }

/* Reveal animation */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* Responsive */
@media (max-width: 1020px) {
  .nav-toggle { display: block; }
  .nav {
    position: absolute; top: 72px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line); padding: 8px 16px 16px;
    display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 4px; border-bottom: 1px solid var(--line); }
  .nav-cta { text-align: center; margin-top: 12px; border-bottom: 0 !important; }
  .stats, .values-grid { grid-template-columns: repeat(2, 1fr); }
  .program-grid, .company-grid, .legacy-grid { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; gap: 40px; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .hero { padding: 64px 0 40px; }
  .section { padding: 68px 0; }
  .stats, .values-grid, .program-grid, .company-grid, .legacy-grid { grid-template-columns: 1fr; }
  .timeline li { grid-template-columns: 1fr; gap: 4px; }
  .brand-text { font-size: .72rem; }
  .brand-text strong { font-size: .84rem; }
  .contact-form { padding: 22px; }
}
