/* ============================================================
   Study Skills — v2 design system
   Editorial type, cream palette, paper cards
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --ink: #1a1a2e;
  --ink-soft: #4a4a5e;
  --ink-mute: #8a8a9a;
  --cream: #faf7f2;
  --cream-deep: #f3ede2;
  --paper: #ffffff;
  --line: #e8e2d4;
  --line-soft: #f0ebe0;

  --sage: #7a9b76;
  --sage-bg: #eef3ec;
  --coral: #e8826b;
  --coral-bg: #fbeee9;
  --ochre: #d4a574;
  --ochre-bg: #f8f0e3;
  --plum: #8e6b9e;
  --plum-bg: #f1ebf4;
  --teal: #4a8a8a;
  --teal-bg: #e8f0f0;

  --accent: var(--ink);
  --radius: 14px;
  --radius-sm: 8px;

  /* Default skill accent — overridden per page */
  --skill: var(--ink);
  --skill-bg: var(--cream-deep);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.55;
  font-size: 15px;
}

.display { font-family: 'Fraunces', Georgia, serif; font-optical-sizing: auto; letter-spacing: -0.02em; }

/* ========== TOP CHROME ========== */
/* The existing markup uses .demo-banner and .nav — restyle them as a unified topbar */
.demo-banner {
  display: none; /* hidden — replaced by pill banner below nav */
}

.nav {
  max-width: 1100px; margin: 0 auto; padding: 28px 32px 0;
  display: flex; align-items: center; justify-content: space-between;
  background: transparent; color: var(--ink);
}
.nav-title {
  font-family: 'Fraunces', serif; font-weight: 600; font-size: 20px;
  letter-spacing: -0.01em; color: var(--ink);
  display: inline-flex; align-items: baseline; gap: 10px;
}
.nav-title::before {
  content: 'F'; display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--ink); color: var(--cream);
  font-family: 'Fraunces', serif; font-weight: 700; font-size: 18px;
  transform: translateY(6px);
}
.nav a {
  color: var(--ink-soft); text-decoration: none; font-size: 14px; font-weight: 500;
  padding-bottom: 4px; border-bottom: 1.5px solid transparent;
  margin-left: auto;
}
.nav a:hover { color: var(--ink); border-bottom-color: var(--ink); }

/* Pill demo banner re-introduced under nav via ::before on .content */
.content {
  max-width: 880px; margin: 0 auto; padding: 24px 32px 96px;
  position: relative;
}
.content::before {
  content: 'Sample data \00b7 Demo';
  display: block; max-width: 200px; margin: 16px auto 36px;
  background: var(--cream-deep); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 16px;
  font-size: 11px; font-weight: 600; color: var(--ink-soft);
  text-align: center; letter-spacing: 0.08em; text-transform: uppercase;
}

/* ========== PAGE HEADER ========== */
.page-title {
  font-family: 'Fraunces', serif;
  font-size: 44px; font-weight: 500; line-height: 1.1;
  letter-spacing: -0.02em; color: var(--skill);
  margin: 0 0 12px;
  display: block;
}
.page-subtitle {
  font-size: 17px; color: var(--ink-soft); margin: 0 0 40px;
  max-width: 640px; line-height: 1.55;
}

/* ========== DEFINITION BOX ========== */
.definition-box {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  padding: 0; margin-bottom: 32px;
  position: relative;
}
.definition-box::before {
  content: ''; display: block; height: 4px; background: var(--skill);
}
.definition-box h3 {
  font-family: 'Fraunces', serif; font-size: 22px; font-weight: 500;
  letter-spacing: -0.01em; color: var(--ink);
  margin: 0; padding: 28px 32px 8px;
}
.definition-box p {
  margin: 0; padding: 0 32px 28px;
  font-size: 15.5px; line-height: 1.7; color: var(--ink-soft);
}

/* ========== EXAMPLE CARDS ========== */
.card {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); margin-bottom: 24px; overflow: hidden;
}
.card-header {
  font-family: 'Fraunces', serif; font-size: 14px; font-weight: 600;
  letter-spacing: 0; text-transform: none;
  padding: 22px 32px 0; color: var(--ink);
  display: flex; align-items: center; gap: 8px;
  border-bottom: none;
}
.card-header::before {
  content: ''; display: inline-block; width: 6px; height: 6px;
  border-radius: 50%; background: var(--skill);
  margin-right: 6px;
}
.card-body { padding: 16px 32px 32px; }
.card-body p { margin: 0 0 12px; font-size: 15px; line-height: 1.7; color: var(--ink-soft); }
.card-body p:last-child { margin-bottom: 0; }

/* ========== EXAMPLE BLOCKS ========== */
.example-block { margin-bottom: 24px; }
.example-block:last-child { margin-bottom: 0; }
.example-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--ink-mute);
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
}
.example-text {
  background: var(--cream); border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 22px 26px;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 16px; line-height: 1.75; font-style: normal; font-weight: 400;
  color: var(--ink);
  margin-bottom: 14px;
}
.example-explanation {
  font-size: 14px; color: var(--ink-soft); line-height: 1.65;
  padding: 0 4px;
}
.example-explanation strong { color: var(--ink); font-weight: 600; }

/* Highlights — softer than before */
.hl-good {
  background: var(--sage-bg);
  box-shadow: 0 -1px 0 var(--sage) inset;
  padding: 1px 3px; border-radius: 2px;
}
.hl-weak {
  background: var(--coral-bg);
  box-shadow: 0 -1px 0 var(--coral) inset;
  padding: 1px 3px; border-radius: 2px;
}

/* ========== PRACTICE CARD ========== */
.practice-card {
  background: var(--paper); border: 1px solid var(--line);
  margin-top: 32px;
}
.practice-card::before {
  content: ''; display: block; height: 4px; background: var(--skill);
}
.practice-card .card-header {
  background: transparent; color: var(--ink);
  padding: 28px 32px 4px;
}
.practice-card .card-header::before { background: var(--skill); }
.practice-card .card-body { padding: 12px 32px 32px; }

.bullet-notes {
  background: var(--cream); border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 18px 22px 18px 36px;
  margin: 16px 0 22px;
}
.bullet-notes ul { margin: 0; padding-left: 0; list-style: none; }
.bullet-notes li {
  font-size: 14px; line-height: 1.7; margin-bottom: 8px;
  color: var(--ink); position: relative; padding-left: 16px;
}
.bullet-notes li:last-child { margin-bottom: 0; }
.bullet-notes li::before {
  content: ''; position: absolute; left: 0; top: 11px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--skill);
}

.practice-prompt {
  font-size: 12px; font-weight: 700; color: var(--ink-mute);
  text-transform: uppercase; letter-spacing: 0.1em;
  margin-bottom: 10px;
}
.practice-textarea {
  width: 100%; min-height: 150px; padding: 16px 18px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-family: 'Fraunces', Georgia, serif;
  font-size: 16px; line-height: 1.7;
  resize: vertical; color: var(--ink);
  background: var(--cream);
}
.practice-textarea:focus {
  outline: none; border-color: var(--skill);
  background: var(--paper);
}
.practice-textarea::placeholder { color: var(--ink-mute); font-style: italic; }

.btn-feedback {
  margin-top: 16px; padding: 11px 24px;
  border: none; border-radius: 999px;
  font-size: 12px; font-weight: 600; font-family: 'Inter', sans-serif;
  letter-spacing: 0.04em;
  background: var(--ink); color: var(--cream); cursor: pointer;
  transition: background 0.2s;
}
.btn-feedback:hover { background: var(--ink-soft); }

/* ========== POPUP ========== */
.popup-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(26, 26, 46, 0.55); z-index: 1000;
  align-items: center; justify-content: center; padding: 24px;
  backdrop-filter: blur(2px);
}
.popup-overlay.active { display: flex; }
.popup-box {
  background: var(--paper); border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: 0 30px 80px rgba(26, 26, 46, 0.25);
  max-width: 580px; width: 100%; max-height: 82vh; overflow-y: auto;
  padding: 36px 40px;
}
.popup-title {
  font-family: 'Fraunces', serif; font-size: 24px; font-weight: 500;
  letter-spacing: -0.01em; color: var(--ink);
  margin: 0 0 20px;
}
.popup-body { font-size: 14.5px; line-height: 1.7; color: var(--ink-soft); }
.popup-body p { margin: 0 0 12px; }
.popup-body p:last-child { margin-bottom: 0; }
.popup-body strong { color: var(--ink); font-weight: 600; }
.popup-body ul { margin: 8px 0 12px; padding-left: 18px; }
.popup-body li { margin-bottom: 6px; }
.popup-close {
  margin-top: 24px; padding: 10px 22px;
  background: var(--ink); color: var(--cream); border: none;
  border-radius: 999px;
  font-size: 12px; font-weight: 600; font-family: 'Inter', sans-serif;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.popup-close:hover { background: var(--ink-soft); }

/* ========== RESPONSIVE ========== */
@media (max-width: 720px) {
  .nav { padding: 24px 20px 0; }
  .content { padding: 20px 20px 64px; }
  .page-title { font-size: 34px; }
  .page-subtitle { font-size: 16px; margin-bottom: 32px; }
  .definition-box h3 { padding: 24px 24px 6px; font-size: 20px; }
  .definition-box p { padding: 0 24px 24px; }
  .card-header { padding: 22px 24px 0; }
  .card-body { padding: 14px 24px 26px; }
  .practice-card .card-body { padding: 12px 24px 26px; }
  .popup-box { padding: 26px 24px; }
}
