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

:root {
  --primary: #1e3a5f;
  --primary-dark: #142844;
  --accent: #c19a3e;
  --text: #1a2332;
  --text-secondary: #5a6776;
  --text-muted: #8a96a3;
  --bg: #fafbfc;
  --bg-card: #ffffff;
  --border: #e2e6ec;
  --border-strong: #c8cfd8;
  --warning: #b85c00;
  --success: #2d5a3d;
}

body {
  font-family: 'Charter', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  font-size: 16px;
}

.container { max-width: 1180px; margin: 0 auto; padding: 0 32px; }

header { background: var(--bg-card); border-bottom: 1px solid var(--border); padding: 20px 0; }
header .container { display: flex; justify-content: space-between; align-items: center; }
.logo { font-family: 'Charter', Georgia, serif; font-size: 22px; font-weight: 700; color: var(--primary); letter-spacing: -0.01em; }
.logo-mark { display: inline-block; width: 8px; height: 8px; background: var(--accent); border-radius: 50%; margin-right: 10px; vertical-align: middle; margin-bottom: 2px; }
nav a { margin-left: 32px; text-decoration: none; color: var(--text-secondary); font-size: 15px; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; transition: color 0.15s; }
nav a:hover { color: var(--primary); }

.hero { background: linear-gradient(180deg, #ffffff 0%, #f5f7fa 100%); padding: 96px 0 80px; border-bottom: 1px solid var(--border); text-align: center; }
.hero h1 { font-size: 48px; font-weight: 700; color: var(--primary-dark); letter-spacing: -0.02em; margin-bottom: 20px; line-height: 1.2; max-width: 820px; margin-left: auto; margin-right: auto; }
.hero .subtitle { font-size: 19px; color: var(--text-secondary); margin: 0 auto 44px; max-width: 680px; line-height: 1.5; }
.search-form { display: flex; gap: 0; max-width: 620px; margin: 0 auto; border: 1px solid var(--border-strong); border-radius: 999px; background: white; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.search-form input { flex: 1; padding: 16px 24px; border: none; font-size: 15px; font-family: -apple-system, sans-serif; background: transparent; outline: none; }
.search-form button { padding: 16px 32px; background: var(--primary); color: white; border: none; font-size: 14px; font-weight: 600; letter-spacing: 0.03em; cursor: pointer; font-family: -apple-system, sans-serif; transition: background 0.15s; }

.filters { background: var(--bg-card); border-bottom: 1px solid var(--border); padding: 18px 0; }
.filters .container { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filter-label { font-size: 13px; color: var(--text-muted); font-family: -apple-system, sans-serif; text-transform: uppercase; letter-spacing: 0.06em; margin-right: 8px; }
.tag { padding: 7px 14px; background: transparent; border: 1px solid var(--border-strong); border-radius: 3px; text-decoration: none; color: var(--text-secondary); font-size: 13px; font-family: -apple-system, sans-serif; transition: all 0.15s; }
.tag:hover { background: var(--primary); color: white; border-color: var(--primary); }
.tag.all-link { color: var(--primary); border-color: transparent; font-weight: 600; margin-left: auto; }
.tag.all-link:hover { background: transparent; color: var(--primary-dark); }

.grants-section { padding: 56px 0 72px; }
.section-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 32px; padding-bottom: 16px; border-bottom: 2px solid var(--primary); }
.grants-section h2 { font-size: 26px; font-weight: 700; color: var(--primary-dark); letter-spacing: -0.01em; }
.section-meta { font-size: 13px; color: var(--text-muted); font-family: -apple-system, sans-serif; text-transform: uppercase; letter-spacing: 0.06em; }
.grants-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }
.grant-card { background: var(--bg-card); padding: 24px 26px; display: flex; flex-direction: column; transition: background 0.15s; }
.grant-card:hover { background: #fbfcfd; }
.grant-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-family: -apple-system, sans-serif; }
.funder { font-size: 11px; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: 0.08em; }
.country { font-size: 12px; color: var(--text-muted); }
.grant-card h3 { font-size: 17px; font-weight: 600; margin-bottom: 12px; line-height: 1.4; color: var(--text); }
.grant-card h3 a { text-decoration: none; color: inherit; }
.grant-card h3 a:hover { color: var(--primary); }
.summary { font-size: 14px; color: var(--text-secondary); line-height: 1.65; margin-bottom: 20px; flex: 1; }
.grant-footer { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding-top: 14px; border-top: 1px solid var(--border); font-family: -apple-system, sans-serif; }
.deadline { font-size: 12px; color: var(--warning); font-weight: 600; }
.deadline::before { content: "● "; }
.amount { font-size: 12px; color: var(--success); font-weight: 600; }
.tag-small { font-size: 11px; padding: 3px 9px; background: #eef2f6; border-radius: 3px; color: var(--text-secondary); font-weight: 500; }

.empty { color: var(--text-muted); font-size: 15px; padding: 40px; text-align: center; background: var(--bg-card); border-radius: 4px; }

.subscribe-section { background: var(--primary-dark); color: white; padding: 72px 0; }
.subscribe-section .container { max-width: 680px; text-align: center; }
.subscribe-section h2 { font-size: 28px; font-weight: 700; margin-bottom: 12px; letter-spacing: -0.01em; }
.subscribe-section p { color: rgba(255, 255, 255, 0.7); margin-bottom: 28px; font-size: 16px; }
.subscribe-form { display: flex; gap: 0; max-width: 480px; margin: 0 auto; background: white; border-radius: 4px; overflow: hidden; }
.subscribe-form input { flex: 1; padding: 14px 18px; border: none; font-size: 15px; font-family: -apple-system, sans-serif; outline: none; }
.subscribe-form button { padding: 14px 28px; background: var(--accent); color: var(--primary-dark); border: none; font-size: 14px; font-weight: 700; letter-spacing: 0.03em; cursor: pointer; font-family: -apple-system, sans-serif; transition: background 0.15s; }
.subscribe-form button:hover { background: #d4ad4d; }
#sub-message { margin-top: 16px; color: rgba(255, 255, 255, 0.7); font-size: 14px; }

footer { background: var(--bg-card); border-top: 1px solid var(--border); padding: 32px 0; }
footer p { font-size: 13px; color: var(--text-muted); text-align: center; font-family: -apple-system, sans-serif; }

@media (max-width: 768px) {
  .hero h1 { font-size: 32px; }
  .hero .subtitle { font-size: 16px; }
  .search-form, .subscribe-form { flex-direction: column; }
  .grants-grid { grid-template-columns: 1fr; }
}
