:root {
  --paper: #f6efe5;
  --paper-deep: #efe2d1;
  --surface: rgba(255, 255, 255, 0.95);
  --ink: #17202d;
  --ink-soft: #4c5869;
  --navy: #162131;
  --accent: #ff7a1f;
  --accent-deep: #cf5300;
  --line: rgba(23, 32, 45, 0.1);
  --shadow: 0 22px 42px rgba(34, 24, 15, 0.12);
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Poppins", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 122, 31, 0.14), rgba(255, 122, 31, 0) 24%),
    radial-gradient(circle at bottom right, rgba(22, 33, 49, 0.1), rgba(22, 33, 49, 0) 22%),
    linear-gradient(180deg, #fbf7f0, #f4ece1 62%, #efe6da);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 34px 34px;
  opacity: 0.18;
  pointer-events: none;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
.container { width: min(1320px, calc(100% - 2rem)); margin: 0 auto; }
.notes-progress {
  position: fixed;
  inset: 0 auto auto 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), #ffb168);
  transform-origin: 0 50%;
  transform: scaleX(0);
  z-index: 1200;
}
.notes-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(14px);
  background: rgba(246, 239, 229, 0.86);
  border-bottom: 1px solid rgba(23, 32, 45, 0.08);
}
.header-wrap {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand img { width: 128px; }
.top-nav, .hero-actions, .footer-links { display: flex; flex-wrap: wrap; gap: 0.7rem; }
.top-nav a, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0.66rem 0.94rem;
  border-radius: 999px;
  font-weight: 800;
  transition: transform 0.22s ease, background 0.22s ease, color 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}
.top-nav a {
  border: 1px solid rgba(23, 32, 45, 0.08);
  background: rgba(255, 255, 255, 0.7);
  color: var(--navy);
}
.top-nav a:hover, .top-nav a:focus-visible { transform: translateY(-2px); background: var(--navy); color: #fff; }
.notes-main { display: grid; gap: 1.2rem; padding: 1.35rem 0 2.3rem; }
.notes-hero, .notes-shell {
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: var(--surface);
}
.notes-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(280px, 0.92fr);
  gap: 1rem;
  padding: 1.45rem;
  background:
    radial-gradient(circle at top right, rgba(255, 122, 31, 0.18), rgba(255, 122, 31, 0) 24%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(248, 238, 226, 0.96));
}
.section-kicker, .mini-label {
  display: inline-block;
  margin: 0 0 0.55rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 122, 31, 0.12);
  color: #9b4107;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.notes-hero h1, .notes-head h2 {
  margin: 0 0 0.55rem;
  font-family: "Roboto Slab", serif;
  line-height: 1.18;
}
.notes-hero p, .notes-head p, .note-card p, .metric-strip span { color: var(--ink-soft); line-height: 1.74; }
.hero-panel { display: grid; gap: 0.85rem; }
.hero-panel article, .metric-strip article, .note-card {
  padding: 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(23, 32, 45, 0.08);
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 16px 28px rgba(34, 24, 15, 0.08);
  transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
}
.hero-panel article:hover, .metric-strip article:hover, .note-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 122, 31, 0.22);
  box-shadow: 0 24px 34px rgba(34, 24, 15, 0.12);
}
.btn { border: 1px solid transparent; }
.btn:hover, .btn:focus-visible { transform: translateY(-2px); }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-deep)); color: #fff; box-shadow: 0 14px 24px rgba(207, 83, 0, 0.18); }
.btn-secondary {
  background: linear-gradient(135deg, rgba(255, 244, 232, 0.98), rgba(245, 223, 198, 0.96));
  border-color: rgba(22, 33, 49, 0.14);
  color: var(--navy);
  box-shadow: 0 12px 22px rgba(34, 24, 15, 0.08);
}
.metric-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.85rem; }
.metric-strip strong { display: block; color: var(--accent-deep); font-size: 1.5rem; }
.notes-shell { padding: 1.25rem; background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 239, 229, 0.97)); }
.filter-bar { display: flex; flex-wrap: wrap; gap: 0.55rem; margin: 1rem 0; }
.search-shell {
  display: grid;
  gap: 0.7rem;
  margin-top: 1rem;
}
.search-label {
  color: var(--navy);
  font-weight: 700;
}
.search-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}
.search-row input {
  flex: 1 1 320px;
  min-height: 48px;
  padding: 0.8rem 1rem;
  border-radius: 18px;
  border: 1px solid rgba(23, 32, 45, 0.12);
  background: rgba(255, 255, 255, 0.92);
  color: var(--navy);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 12px 24px rgba(34, 24, 15, 0.06);
}
.search-row input:focus {
  outline: 2px solid rgba(255, 122, 31, 0.2);
  border-color: rgba(255, 122, 31, 0.35);
}
.filter-bar button {
  min-height: 40px;
  padding: 0.48rem 0.94rem;
  border-radius: 999px;
  border: 1px solid rgba(23, 32, 45, 0.12);
  background: linear-gradient(135deg, rgba(255, 244, 232, 0.98), rgba(245, 223, 198, 0.96));
  color: var(--navy);
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 20px rgba(34, 24, 15, 0.08);
  transition: transform 0.22s ease, background 0.22s ease, color 0.22s ease, border-color 0.22s ease;
}
.filter-bar button:hover, .filter-bar button:focus-visible { transform: translateY(-2px); border-color: rgba(255, 122, 31, 0.22); }
.filter-bar button.active { background: linear-gradient(135deg, var(--accent), var(--accent-deep)); color: #fff; border-color: transparent; }
.tag-filter-shell {
  display: grid;
  gap: 0.7rem;
}
.tag-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}
.tag-filter-bar button {
  min-height: 36px;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(22, 33, 49, 0.12);
  background: rgba(255, 255, 255, 0.84);
  color: var(--navy);
  font-size: 0.82rem;
  font-weight: 700;
  box-shadow: 0 10px 18px rgba(34, 24, 15, 0.06);
  transition: transform 0.22s ease, background 0.22s ease, color 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}
.tag-filter-bar button:hover,
.tag-filter-bar button:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(255, 122, 31, 0.24);
  box-shadow: 0 14px 22px rgba(34, 24, 15, 0.1);
}
.tag-filter-bar button.active {
  background: linear-gradient(135deg, #1f3044, #101925);
  border-color: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.result-summary {
  margin: 0.85rem 0 1rem;
  color: var(--ink-soft);
  font-weight: 600;
}
.notes-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.95rem; }
.note-card {
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: start;
  gap: 0.85rem;
}
.note-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, rgba(255, 122, 31, 0.9), rgba(72, 168, 255, 0.72));
}
.note-card h3 { margin: 0; font-family: "Roboto Slab", serif; }
.empty-state {
  grid-column: 1 / -1;
  padding: 1.2rem;
  border-radius: var(--radius-lg);
  border: 1px dashed rgba(255, 122, 31, 0.28);
  background: linear-gradient(145deg, rgba(255, 251, 246, 0.98), rgba(247, 239, 229, 0.98));
  box-shadow: 0 18px 30px rgba(34, 24, 15, 0.08);
}
.empty-state h3 {
  margin: 0;
  font-family: "Roboto Slab", serif;
}
.note-meta, .tag-cloud { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.note-meta span, .tag-cloud span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0.36rem 0.68rem;
  border-radius: 999px;
  background: rgba(22, 33, 49, 0.06);
  border: 1px solid rgba(22, 33, 49, 0.08);
  color: var(--navy);
  font-size: 0.78rem;
  font-weight: 700;
}
.note-actions { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-top: auto; }
.note-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  min-width: 148px;
  padding: 0.58rem 0.94rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 800;
  letter-spacing: 0.01em;
  box-shadow: 0 14px 22px rgba(34, 24, 15, 0.1);
  transition: transform 0.22s ease, background 0.22s ease, color 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}
.note-actions a:hover, .note-actions a:focus-visible { transform: translateY(-2px); box-shadow: 0 18px 28px rgba(34, 24, 15, 0.14); }
.note-actions a.note-link { background: linear-gradient(135deg, var(--accent), var(--accent-deep)); color: #fff; }
.note-actions a.blog-link { background: linear-gradient(135deg, rgba(255, 244, 232, 0.98), rgba(245, 223, 198, 0.96)); color: var(--navy); border-color: rgba(22, 33, 49, 0.12); }
.notes-footer { padding: 0 0 1.6rem; }
.footer-wrap {
  min-height: 74px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  color: var(--ink-soft);
}
.footer-links a:hover, .footer-links a:focus-visible { color: var(--accent-deep); }
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.45s ease, transform 0.45s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }
.hidden-card { display: none !important; }
@media (max-width: 1180px) {
  .notes-hero, .metric-strip, .notes-grid { grid-template-columns: 1fr; }
  .notes-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .container { width: min(100% - 1rem, 100%); }
  .header-wrap { padding: 0.7rem 0; align-items: flex-start; flex-direction: column; }
  .top-nav, .hero-actions, .footer-links, .filter-bar, .note-actions, .tag-filter-bar { flex-direction: column; }
  .top-nav a, .btn, .filter-bar button, .tag-filter-bar button, .note-actions a, .search-row input { width: 100%; }
  .search-row { flex-direction: column; }
  .notes-hero, .notes-shell { padding: 1rem; }
  .notes-grid, .metric-strip { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
  .container { width: min(calc(100% - 1.25rem), 100%); }
  .notes-main { gap: 1rem; padding: 1.1rem 0 1.8rem; }
  .notes-hero, .notes-shell { padding: 1.05rem; }
  .hero-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .notes-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .container { width: min(calc(100% - 1rem), 100%); }
  .notes-main { padding: 1rem 0 1.4rem; }
  .header-wrap { padding: 0.65rem 0; align-items: flex-start; flex-direction: column; }
  .top-nav { width: 100%; }
  .top-nav a, .btn, .filter-bar button, .tag-filter-bar button, .note-actions a, .search-row input { width: 100%; }
  .search-row, .note-actions, .tag-filter-bar, .filter-bar { flex-direction: column; }
  .notes-hero, .notes-shell { padding: 0.95rem; }
  .hero-panel, .metric-strip, .notes-grid { grid-template-columns: 1fr; }
}

body.page-research-notes {
  background:
    radial-gradient(circle at top left, rgba(72, 168, 255, 0.12), rgba(72, 168, 255, 0) 24%),
    radial-gradient(circle at bottom right, rgba(255, 122, 31, 0.1), rgba(255, 122, 31, 0) 22%),
    linear-gradient(180deg, #fbf7f0, #f1ebe2 62%, #ece4d8);
}

body.page-research-notes .notes-header {
  background: rgba(245, 240, 232, 0.86);
}

body.page-research-notes .top-nav a:hover,
body.page-research-notes .top-nav a:focus-visible {
  background: #162235;
}

body.page-research-notes .notes-hero {
  background:
    radial-gradient(circle at top right, rgba(72, 168, 255, 0.18), rgba(72, 168, 255, 0) 24%),
    radial-gradient(circle at bottom left, rgba(255, 122, 31, 0.14), rgba(255, 122, 31, 0) 22%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.97), rgba(242, 236, 228, 0.98));
}

body.page-research-notes .hero-panel article {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(246, 239, 228, 0.92));
}

body.page-research-notes .metric-strip article {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(246, 239, 228, 0.96));
}

body.page-research-notes .notes-shell {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 238, 228, 0.98));
}

body.page-research-notes .note-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(247, 239, 228, 0.96));
}

body.page-research-notes .tag-filter-bar button.active {
  background: linear-gradient(135deg, #162235, #0e1724);
}

body.page-research-notes .note-actions a.note-link {
  background: linear-gradient(135deg, #162235, #0d1621);
}

body.page-research-notes .note-actions a.blog-link:hover,
body.page-research-notes .note-actions a.blog-link:focus-visible {
  border-color: rgba(72, 168, 255, 0.3);
  color: #132033;
}
