/* =============================================
   AGR — Against the Grain Research
   Main Stylesheet v1.0
   ============================================= */

/* --- Brand Tokens --- */
:root {
  --navy-deep:   #071C38;
  --navy-ink:    #0C3A6B;
  --agr-blue:    #185FA5;
  --sky:         #7AADDA;
  --frost:       #E6F1FB;
  --frost-bg:    #F2F6FB;
  --white:       #ffffff;
  --text-muted:  #5F5E5A;
  --text-hint:   #888780;
  --border-light:#E6F1FB;

  --font-serif: 'Libre Baskerville', Georgia, serif;
  --font-sans:  'DM Sans', system-ui, sans-serif;

  --max-w: 860px;
  --gutter: 2.5rem;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body { font-family: var(--font-sans); color: var(--navy-deep); background: var(--white); line-height: 1.6; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; }
button { cursor: pointer; font-family: var(--font-sans); }

/* --- Container --- */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--gutter); }
.container--narrow { max-width: 520px; }

/* =============================================
   NAVIGATION
   ============================================= */
.agr-nav {
  background: var(--navy-deep);
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--navy-ink);
}
.nav-left { display: flex; align-items: center; gap: 14px; }
.nav-brand { display: flex; align-items: center; gap: 12px; }
.nav-wordmark {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.nav-links {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 2rem;
  margin-left: 2rem;
  list-style: none;
  padding: 0;
}
.nav-links li {
  display: inline-block;
  margin: 0;
  padding: 0;
}
.nav-links li a {
  display: inline-block;
  font-size: 13px;
  color: var(--sky);
  letter-spacing: 0.04em;
  font-weight: 400;
  transition: color 0.15s;
  white-space: nowrap;
}
.nav-links li a:hover { color: var(--frost); }
.tick-updated {
  font-size: 11px;
  color: #185FA5;
  letter-spacing: 0.04em;
  margin-left: auto;
  white-space: nowrap;
}
.nav-cta {
  background: var(--agr-blue);
  color: var(--white);
  font-size: 12px;
  letter-spacing: 0.08em;
  padding: 8px 20px;
  border: none;
  font-weight: 500;
  transition: background 0.15s;
}
.nav-cta:hover { background: #1a6bbf; }
.nav-cta--member { background: var(--navy-ink); }

/* =============================================
   TICKER BAR
   ============================================= */
.agr-ticker {
  background: var(--navy-ink);
  padding: 10px var(--gutter);
  display: flex;
  gap: 2.5rem;
  overflow-x: auto;
  border-bottom: 1px solid var(--agr-blue);
  scrollbar-width: none;
}
.agr-ticker::-webkit-scrollbar { display: none; }
.tick {
  font-size: 12px;
  color: var(--sky);
  letter-spacing: 0.04em;
  white-space: nowrap;
  display: flex;
  gap: 8px;
  align-items: center;
}
.tick-name { color: var(--frost); font-weight: 500; }
.tick-up   { color: #5DCAA5; }
.tick-down { color: #F09595; }

/* =============================================
   HERO
   ============================================= */
.agr-hero {
  background: var(--navy-deep);
  padding: 5rem var(--gutter) 4rem;
  border-bottom: 1px solid var(--navy-ink);
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--sky);
  margin-bottom: 1.25rem;
  text-transform: uppercase;
}
.agr-hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 700;
  color: var(--white);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
  max-width: 640px;
}
.hero-sub {
  font-size: 17px;
  font-weight: 300;
  color: var(--sky);
  line-height: 1.7;
  max-width: 520px;
  margin-bottom: 2.5rem;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-primary {
  display: inline-block;
  background: var(--agr-blue);
  color: var(--white);
  font-size: 13px;
  letter-spacing: 0.08em;
  padding: 12px 28px;
  border: none;
  font-weight: 500;
  transition: background 0.15s;
}
.btn-primary:hover { background: #1a6bbf; }
.btn-ghost {
  display: inline-block;
  background: transparent;
  color: var(--sky);
  font-size: 13px;
  letter-spacing: 0.06em;
  padding: 12px 28px;
  border: 1px solid var(--agr-blue);
  font-weight: 400;
  transition: border-color 0.15s, color 0.15s;
}
.btn-ghost:hover { border-color: var(--sky); color: var(--frost); }
.hero-stats {
  display: flex;
  gap: 3rem;
  margin-top: 4rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--navy-ink);
  flex-wrap: wrap;
}
.stat-val {
  display: block;
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 700;
  color: var(--white);
}
.stat-label {
  display: block;
  font-size: 12px;
  color: var(--sky);
  letter-spacing: 0.06em;
  margin-top: 4px;
}

/* =============================================
   SECTION HEADS
   ============================================= */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-light);
}
.section-title {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--agr-blue);
  text-transform: uppercase;
  font-weight: 500;
}
.section-title.light { color: var(--sky); }
.section-link {
  font-size: 12px;
  color: var(--agr-blue);
  letter-spacing: 0.04em;
  transition: color 0.15s;
}
.section-link:hover { color: var(--navy-deep); }

/* =============================================
   FEATURED RESEARCH
   ============================================= */
.agr-featured { padding: 4rem var(--gutter); background: var(--white); }
.featured-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--border-light);
}
.feat-main {
  padding: 2.5rem;
  border-right: 1px solid var(--border-light);
}
.feat-tag {
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--agr-blue);
  text-transform: uppercase;
  margin-bottom: 10px;
  font-weight: 500;
}
.feat-title {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 700;
  color: var(--navy-deep);
  line-height: 1.3;
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}
.feat-title a { color: inherit; transition: color 0.15s; }
.feat-title a:hover { color: var(--agr-blue); }
.feat-excerpt {
  font-size: 14px;
  font-weight: 300;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}
.feat-meta {
  font-size: 12px;
  color: var(--text-hint);
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.feat-sidebar { display: flex; flex-direction: column; }
.side-item {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-light);
  flex: 1;
}
.side-item:last-child { border-bottom: none; }
.side-tag {
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--agr-blue);
  text-transform: uppercase;
  margin-bottom: 8px;
  font-weight: 500;
}
.side-title {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
  color: var(--navy-deep);
  line-height: 1.35;
  margin-bottom: 8px;
}
.side-title a { color: inherit; transition: color 0.15s; }
.side-title a:hover { color: var(--agr-blue); }
.side-meta { font-size: 11px; color: var(--text-hint); }

/* =============================================
   PRODUCTS
   ============================================= */
.agr-products {
  background: var(--navy-deep);
  padding: 4rem var(--gutter);
}
.products-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--navy-ink);
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--navy-ink);
}
.product-card {
  background: var(--navy-deep);
  padding: 2rem;
}
.product-icon {
  width: 36px;
  height: 36px;
  background: var(--navy-ink);
  border: 1px solid var(--agr-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}
.product-name {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 8px;
}
.product-desc {
  font-size: 13px;
  font-weight: 300;
  color: var(--sky);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}
.product-link {
  font-size: 12px;
  color: var(--agr-blue);
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--agr-blue);
  padding-bottom: 2px;
  transition: color 0.15s, border-color 0.15s;
}
.product-link:hover { color: var(--sky); border-color: var(--sky); }

/* =============================================
   LATEST POSTS
   ============================================= */
.agr-latest { padding: 4rem var(--gutter); background: var(--frost-bg); }
.post-list {
  border: 1px solid var(--border-light);
  background: var(--white);
}
.post-row {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.15s;
}
.post-row:last-child { border-bottom: none; }
.post-row:hover { background: var(--frost-bg); }
.post-num {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--border-light);
  min-width: 28px;
  padding-top: 2px;
}
.post-body { flex: 1; min-width: 0; }
.post-tag {
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--agr-blue);
  text-transform: uppercase;
  margin-bottom: 5px;
  font-weight: 500;
}
.post-title {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--navy-deep);
  line-height: 1.35;
  margin-bottom: 5px;
}
.post-title a { color: inherit; transition: color 0.15s; }
.post-title a:hover { color: var(--agr-blue); }
.post-excerpt {
  font-size: 13px;
  font-weight: 300;
  color: var(--text-muted);
  line-height: 1.6;
}
.post-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  min-width: 80px;
}
.post-date { font-size: 11px; color: var(--text-hint); }
.post-badge {
  font-size: 10px;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  font-weight: 500;
}
.badge-free    { background: var(--frost); color: #0C447C; }
.badge-premium { background: var(--navy-deep); color: var(--sky); }

/* =============================================
   SUBSCRIBE
   ============================================= */
.agr-subscribe {
  background: var(--agr-blue);
  padding: 4rem var(--gutter);
  text-align: center;
}
.agr-subscribe h2 {
  font-family: var(--font-serif);
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 700;
  color: var(--white);
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}
.agr-subscribe p {
  font-size: 15px;
  font-weight: 300;
  color: #B5D4F4;
  line-height: 1.7;
  margin-bottom: 2rem;
}
.sub-form {
  display: flex;
  max-width: 420px;
  margin: 0 auto;
}
.sub-input {
  flex: 1;
  font-family: var(--font-sans);
  font-size: 14px;
  padding: 12px 16px;
  border: none;
  background: var(--navy-deep);
  color: var(--white);
  outline: none;
}
.sub-input::placeholder { color: var(--sky); }
.sub-btn {
  background: var(--navy-deep);
  color: var(--sky);
  font-size: 12px;
  letter-spacing: 0.1em;
  padding: 12px 22px;
  border: none;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s;
}
.sub-btn:hover { background: var(--navy-ink); }
.sub-note {
  font-size: 11px;
  color: var(--sky);
  margin-top: 1rem;
  letter-spacing: 0.04em;
}
.sub-note--signed-in { font-size: 14px; color: var(--frost); }

/* =============================================
   FOOTER
   ============================================= */
.agr-footer {
  background: var(--navy-deep);
  padding: 3rem var(--gutter);
  border-top: 1px solid var(--navy-ink);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 2rem;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--navy-ink);
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.footer-name {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
  color: var(--white);
}
.footer-motto {
  font-size: 11px;
  color: var(--sky);
  letter-spacing: 0.1em;
}
.footer-links { display: flex; gap: 3rem; flex-wrap: wrap; }
.footer-col-title {
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--sky);
  text-transform: uppercase;
  margin-bottom: 12px;
  font-weight: 500;
}
.footer-col a {
  display: block;
  font-size: 13px;
  color: #B5D4F4;
  margin-bottom: 8px;
  transition: color 0.15s;
}
.footer-col a:hover { color: var(--white); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-copy {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* =============================================
   RESPONSIVE
   ============================================= */
/* Mobile toggle button — hidden on desktop */
.nav-mobile-toggle {
  display: none;
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  :root { --gutter: 1.25rem; }

  /* Nav layout: logo left, [subscribe + hamburger] right */
  .agr-nav {
    padding: 0 1.25rem;
    position: relative;
  }
  .nav-left {
    flex: 1;
    min-width: 0;
  }
  .nav-wordmark { font-size: 14px; }

  /* Hide inline nav links — they drop down instead */
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: #071C38;
    flex-direction: column;
    gap: 0;
    margin-left: 0;
    padding: 0;
    border-top: 1px solid #0C3A6B;
    z-index: 200;
    list-style: none;
  }
  .nav-links.nav-links--open {
    display: flex;
  }
  .nav-links li {
    display: block;
    border-bottom: 1px solid #0C3A6B;
  }
  .nav-links li a {
    display: block;
    padding: 1rem 1.25rem;
    font-size: 15px;
    color: #7AADDA;
    white-space: normal;
  }
  .nav-links li a:hover {
    background: #0C3A6B;
    color: #E6F1FB;
  }

  /* Move subscribe button next to hamburger on right side */
  .nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
  }
  .nav-mobile-toggle {
    display: flex;
  }

  .agr-hero { padding: 3rem var(--gutter) 2.5rem; }
  .hero-stats { gap: 2rem; }

  .featured-grid {
    grid-template-columns: 1fr;
  }
  .feat-main { border-right: none; border-bottom: 1px solid var(--border-light); }

  .product-grid { grid-template-columns: 1fr; }

  .post-row { padding: 1.25rem; }
  .post-excerpt { display: none; }

  .footer-inner { flex-direction: column; }
  .footer-links { gap: 2rem; }
}

@media (max-width: 480px) {
  .feat-title { font-size: 20px; }
  .sub-form { flex-direction: column; }
  .sub-input { width: 100%; }
  .sub-btn { width: 100%; text-align: center; padding: 12px; }
}
