/* ============================================================
   AgOptics website
   Editorial, restrained, professional. Navy primary, green accent
   used sparingly. Shared across index.html and portal.html.
   ============================================================ */

:root {
  --ink: #14202b;
  --navy: #16324f;
  --navy-deep: #0f2538;
  --green: #2f7d4f;
  --green-deep: #245f3c;
  --muted: #56646f;
  --line: #e4e7ea;
  --line-strong: #cfd6dc;
  --bg: #ffffff;
  --bg-soft: #f6f7f5;
  --bg-navy: #102537;

  --font-sans: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;

  --maxw: 1120px;
  --measure: 68ch;
  --radius: 4px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 32px; }

a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--green-deep); }

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  color: var(--ink);
  line-height: 1.12;
  margin: 0 0 0.5em;
  font-weight: 600;
  letter-spacing: -0.012em;
}

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--green-deep);
  margin: 0 0 18px;
}

.lede { font-size: 1.2rem; color: var(--muted); max-width: var(--measure); }
.measure { max-width: var(--measure); }

.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;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-weight: 600;
  font-size: 0.98rem;
  padding: 12px 22px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-deep); color: #fff; }
.btn-outline { background: transparent; color: var(--navy); border-color: var(--line-strong); }
.btn-outline:hover { border-color: var(--navy); color: var(--navy); }
.text-link { font-weight: 600; }
.text-link::after { content: " \2192"; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.94);
  backdrop-filter: saturate(140%) blur(6px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 116px; gap: 24px; }

.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-logo { display: inline-flex; }
img.brand-logo { display: block; width: 40px; height: 40px; }
/* Real logo lockup used in the header (horizontal artwork) */
.brand-logo-full { display: block; height: 88px; width: auto; }
@media (max-width: 680px) { .brand-logo-full { height: 58px; } }
.brand-name { font-family: var(--font-serif); font-weight: 600; font-size: 1.32rem; letter-spacing: -0.01em; }
.brand-ag { color: var(--green-deep); }
.brand-optics { color: var(--navy); }

.site-nav { display: flex; align-items: center; }
.nav-links { list-style: none; display: flex; align-items: center; gap: 30px; margin: 0; padding: 0; }
.nav-links a { color: var(--muted); font-weight: 500; font-size: 0.97rem; }
.nav-links a:hover { color: var(--ink); }
.nav-links .nav-portal {
  border: 1px solid var(--line-strong);
  padding: 8px 16px; border-radius: var(--radius); color: var(--navy); font-weight: 600;
}
.nav-links .nav-portal:hover { border-color: var(--navy); }

.nav-toggle { display: none; background: none; border: 0; cursor: pointer; width: 40px; height: 40px; position: relative; }
.nav-toggle-bar, .nav-toggle-bar::before, .nav-toggle-bar::after {
  content: ""; position: absolute; left: 9px; width: 22px; height: 2px; background: var(--ink); transition: 0.2s ease;
}
.nav-toggle-bar { top: 19px; }
.nav-toggle-bar::before { top: -7px; }
.nav-toggle-bar::after { top: 7px; }

/* ---------- Hero ---------- */
.hero { border-bottom: 1px solid var(--line); }
.hero-inner { padding: 92px 32px 84px; max-width: 880px; }
.hero h1 { font-size: clamp(2.3rem, 5.2vw, 3.5rem); margin-bottom: 0.32em; }
.hero .lede { font-size: clamp(1.1rem, 2.2vw, 1.32rem); margin-bottom: 34px; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; }
.hero-actions .text-link { color: var(--navy); }

/* ---------- Sections ---------- */
.section { padding: 84px 0; border-bottom: 1px solid var(--line); }
.section-soft { background: var(--bg-soft); }
.section-tight { padding: 64px 0; }
.section-head { max-width: var(--measure); margin-bottom: 44px; }
.section-title { font-size: clamp(1.7rem, 3.4vw, 2.25rem); }
.section-lead { font-size: 1.12rem; color: var(--muted); margin-top: 0.4em; }

/* ---------- Services ---------- */
.services { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 28px; align-items: stretch; }
.service-feature {
  border: 1px solid var(--line);
  border-top: 3px solid var(--green);
  border-radius: var(--radius);
  padding: 36px 34px;
  background: #fff;
}
.service-feature .service-kicker { color: var(--green-deep); font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.72rem; margin: 0 0 12px; }
.service-feature h3 { font-size: 1.5rem; }
.service-feature ul { margin: 18px 0 0; padding: 0; list-style: none; }
.service-feature li { position: relative; padding: 9px 0 9px 22px; border-top: 1px solid var(--line); color: var(--ink); }
.service-feature li:first-child { border-top: 0; }
.service-feature li::before { content: ""; position: absolute; left: 0; top: 18px; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }

/* Tools page: two tool cards side by side, placeholder spans the row below. */
.services-tools { grid-template-columns: 1fr 1fr; }
.services-tools .service-more { grid-column: 1 / -1; }

.service-more {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 34px;
  background: var(--bg-soft);
  display: flex; flex-direction: column; justify-content: center;
}
.service-more h3 { font-size: 1.25rem; }
.service-more p { color: var(--muted); margin-bottom: 0; }

/* ---------- Approach (prose columns) ---------- */
.approach { display: grid; grid-template-columns: repeat(2, 1fr); gap: 40px 56px; }
.approach .item h3 { font-size: 1.2rem; margin-bottom: 0.4em; }
.approach .item p { color: var(--muted); margin: 0; }

/* ---------- Portal CTA band ---------- */
.band { background: var(--bg-navy); color: #e9eef3; }
.band-inner { display: grid; grid-template-columns: 1.3fr 0.7fr; gap: 32px; align-items: center; padding: 60px 0; }
.band h2 { color: #fff; font-size: clamp(1.6rem, 3vw, 2rem); }
.band p { color: #b7c4d1; margin: 0; max-width: 52ch; }
.band-actions { display: flex; justify-content: flex-end; }
.band .btn-primary { background: #fff; color: var(--navy); }
.band .btn-primary:hover { background: #e9eef3; }

/* ---------- Contact ---------- */
.contact-inner { max-width: var(--measure); }
.contact-email { font-family: var(--font-serif); font-size: clamp(1.4rem, 3.2vw, 2rem); color: var(--navy); display: inline-block; margin-top: 10px; }
.contact-note { color: var(--muted); margin-top: 18px; font-size: 0.96rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #aebccb; padding: 48px 0 40px; }
.footer-top { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; padding-bottom: 26px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.footer-brand .brand-name { color: #fff; }
.footer-brand .brand-ag, .footer-brand .brand-optics { color: #fff; }
.footer-tagline { font-family: var(--font-serif); font-style: italic; color: #8aa0b5; margin-top: 6px; }
.footer-links { display: flex; gap: 26px; flex-wrap: wrap; }
.footer-links a { color: #aebccb; font-size: 0.95rem; }
.footer-links a:hover { color: #fff; }
.footer-bottom { padding-top: 22px; display: flex; flex-direction: column; gap: 8px; }
.footer-note { max-width: 70ch; font-size: 0.92rem; margin: 0; }
.footer-disclaimer { max-width: 70ch; font-size: 0.85rem; font-style: italic; color: #7f93a6; margin: 0; }
.footer-copy { font-size: 0.86rem; color: #6f8497; margin: 6px 0 0; }

/* ============================================================
   Portal page
   ============================================================ */
.portal-note {
  background: #fcf6e8; border-bottom: 1px solid #ecdcae; color: #6b5418;
  font-size: 0.9rem; text-align: center; padding: 9px 16px;
}
.portal-note strong { color: #5a4512; }

.login-wrap { padding: 72px 0; }
.login-card {
  max-width: 420px; margin: 0 auto;
  border: 1px solid var(--line); border-radius: 8px;
  padding: 38px 34px; background: #fff;
  box-shadow: 0 1px 2px rgba(20,32,43,0.05), 0 12px 30px rgba(20,32,43,0.06);
}
.login-card h1 { font-size: 1.5rem; text-align: center; }
.login-sub { text-align: center; color: var(--muted); font-size: 0.96rem; margin-bottom: 26px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.field input {
  width: 100%; padding: 11px 13px; font-size: 1rem; font-family: inherit;
  border: 1px solid var(--line-strong); border-radius: var(--radius); background: #fff; color: var(--ink);
}
.field input:focus { outline: 2px solid var(--navy); outline-offset: 0; border-color: var(--navy); }
.login-card .btn { width: 100%; margin-top: 6px; }
.login-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; font-size: 0.88rem; color: var(--muted); }
.login-demo { text-align: center; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }

/* Dashboard */
.dashboard { display: none; padding: 40px 0 80px; }
.dashboard.active { display: block; }
.dash-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 18px; margin-bottom: 30px; }
.dash-head .acct { font-family: var(--font-serif); font-size: 1.5rem; color: var(--ink); }
.dash-head .acct small { display: block; font-family: var(--font-sans); font-size: 0.9rem; color: var(--muted); font-weight: 400; margin-top: 4px; }
.preview-tag { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; color: #8a6d12; background: #fcf6e8; border: 1px solid #ecdcae; padding: 4px 10px; border-radius: 999px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.stat { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px; background: #fff; }
.stat .label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; }
.stat .value { font-family: var(--font-serif); font-size: 1.7rem; color: var(--navy); margin-top: 4px; }
.stat .sub { font-size: 0.82rem; color: var(--muted); margin-top: 2px; }
.stat.flag .value { color: var(--green-deep); }

.callout { border-left: 3px solid var(--green); background: var(--bg-soft); padding: 16px 20px; border-radius: 0 var(--radius) var(--radius) 0; color: var(--ink); margin: 8px 0 36px; }

.dash-section { margin-top: 40px; }
.dash-section > h2 { font-size: 1.35rem; }
.dash-section .hint { color: var(--muted); margin-top: -0.2em; }

/* Search mock */
.search-box { display: flex; gap: 10px; margin: 16px 0 18px; max-width: 640px; }
.search-box input { flex: 1; padding: 12px 14px; font-size: 1rem; font-family: inherit; border: 1px solid var(--line-strong); border-radius: var(--radius); }
.search-box input:focus { outline: 2px solid var(--navy); border-color: var(--navy); }
.faq-list { display: grid; gap: 10px; max-width: 760px; }
.faq { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; background: #fff; }
.faq.hidden { display: none; }
.faq q { display: block; font-weight: 600; color: var(--ink); font-style: normal; }
.faq p { margin: 6px 0 0; color: var(--muted); font-size: 0.96rem; }
.faq .tag { font-size: 0.74rem; color: var(--green-deep); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.search-empty { color: var(--muted); font-style: italic; padding: 8px 2px; }

/* Cheat sheet tabs */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin: 18px 0 0; flex-wrap: wrap; }
.tab {
  border: 1px solid var(--line); border-bottom: none; background: var(--bg-soft);
  padding: 10px 18px; border-radius: var(--radius) var(--radius) 0 0; cursor: pointer;
  font-weight: 600; font-size: 0.95rem; color: var(--muted);
}
.tab.active { background: #fff; color: var(--navy); position: relative; top: 1px; }
.tab-panel { display: none; border: 1px solid var(--line); border-top: none; padding: 24px; background: #fff; }
.tab-panel.active { display: block; }
.sheet-meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; color: var(--muted); font-size: 0.9rem; margin-bottom: 14px; }
.year-pill { border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px 12px; font-weight: 600; color: var(--ink); }

table.sheet { width: 100%; border-collapse: collapse; font-size: 0.96rem; }
table.sheet th, table.sheet td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); }
table.sheet thead th { background: var(--navy); color: #fff; font-weight: 600; font-size: 0.86rem; letter-spacing: 0.02em; }
table.sheet tbody tr:last-child td { border-bottom: none; }
table.sheet td.num { font-variant-numeric: tabular-nums; }
.pending { color: #8a6d12; background: #fcf6e8; border: 1px dashed #ecdcae; border-radius: var(--radius); padding: 16px 18px; font-size: 0.94rem; }
.pending strong { color: #5a4512; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .services { grid-template-columns: 1fr; }
  .band-inner { grid-template-columns: 1fr; gap: 22px; }
  .band-actions { justify-content: flex-start; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .approach { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 680px) {
  body { font-size: 16px; }
  .container { padding: 0 22px; }
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: 116px; left: 0; right: 0;
    flex-direction: column; align-items: flex-start; gap: 0;
    background: #fff; border-bottom: 1px solid var(--line);
    padding: 8px 22px 18px; display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; width: 100%; padding: 12px 0; }
  .nav-links .nav-portal { display: inline-block; width: auto; margin-top: 8px; }
  .hero-inner { padding: 64px 22px 60px; }
  .section { padding: 60px 0; }
  .stat-grid { grid-template-columns: 1fr; }
  .dash-head { align-items: flex-start; }
}
