/* ═══════════════════════════════════════════════════════════
   SOULARY — ANALYTICS / GOALS PAGE
   Diary aesthetic: aged paper, leather binding, candlelit desk
   Fonts: Poppins / Inter / Roboto / Open Sans
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&family=Roboto:ital,wght@0,400;0,500;0,700;1,400;1,500&family=Open+Sans:wght@400;600;700;800&display=swap');

/* ─── DESIGN TOKENS ─── */
:root {
  /* Desk */
  --desk-dark:    #1a0f07;
  --desk-mid:     #2c1a0e;
  --desk-grain:   #3d2618;

  /* Leather */
  --leather:      #4e3221;
  --leather-dk:   #2a1a0d;
  --leather-lt:   #6b4d3a;

  /* Paper */
  --paper:        #faf6ea;
  --paper-warm:   #f5f0de;
  --paper-crease: #ede6ce;
  --paper-edge:   #d9d0b4;

  /* Ink — dark, high contrast */
  --ink:          #0d0905;
  --ink-mid:      #1e1409;
  --ink-fade:     #2e2214;
  --ink-ghost:    #4a3828;

  /* Accents */
  --gold:         #c9a84c;
  --gold-dim:     rgba(201,168,76,0.32);
  --gold-bright:  rgba(201,168,76,0.18);
  --red-wax:      #8b1a1a;
  --red-wax-lt:   #a52020;
  --red-margin:   rgba(185,65,65,0.24);

  /* Ruled lines */
  --rule:         rgba(0,0,0,0.07);
  --rule-h:       36px;

  /* Fonts */
  --font-hand:    'Poppins', sans-serif;
  --font-body:    'Inter', sans-serif;
  --font-formal:  'Roboto', sans-serif;
  --font-scrawl:  'Open Sans', sans-serif;

  /* Shadows */
  --shadow-book:  0 20px 60px rgba(0,0,0,0.65), 0 4px 20px rgba(0,0,0,0.4);
  --shadow-card:  0 4px 18px rgba(0,0,0,0.1);
  --shadow-lift:  0 10px 30px rgba(0,0,0,0.18);
}

/* ─── INK PEN CURSOR ─── */
html, body, * {
  cursor: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2232%22%20height%3D%2232%22%20viewBox%3D%220%200%2032%2032%22%3E%3Crect%20x%3D%2210%22%20y%3D%222%22%20width%3D%2210%22%20height%3D%2220%22%20rx%3D%223%22%20ry%3D%223%22%20transform%3D%22rotate%2845%2015%2012%29%22%20fill%3D%22%232a1a0d%22%20stroke%3D%22%234e3221%22%20stroke-width%3D%220.6%22%2F%3E%3Crect%20x%3D%2211.5%22%20y%3D%223%22%20width%3D%223%22%20height%3D%2216%22%20rx%3D%221.5%22%20transform%3D%22rotate%2845%2015%2012%29%22%20fill%3D%22rgba%28255%2C255%2C255%2C0.12%29%22%2F%3E%3Crect%20x%3D%2210%22%20y%3D%2219.5%22%20width%3D%2210%22%20height%3D%222.5%22%20transform%3D%22rotate%2845%2015%2012%29%22%20fill%3D%22%23c9a84c%22%2F%3E%3Cpolygon%20points%3D%225%2C27%2012%2C20%208%2C16%202%2C30%22%20fill%3D%22%23c9a84c%22%20stroke%3D%22%239a7a28%22%20stroke-width%3D%220.5%22%2F%3E%3Cline%20x1%3D%223.5%22%20y1%3D%2228.5%22%20x2%3D%2210%22%20y2%3D%2218.5%22%20stroke%3D%22%239a7a28%22%20stroke-width%3D%220.7%22%20opacity%3D%220.8%22%2F%3E%3Ccircle%20cx%3D%222.5%22%20cy%3D%2229.5%22%20r%3D%221.2%22%20fill%3D%22%231c1209%22%20opacity%3D%220.85%22%2F%3E%3C%2Fsvg%3E") 2 30, crosshair !important;
}

/* ─── RESET ─── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html { scroll-behavior: smooth; }

/* ═══════════════════════════════════════════════════════════
   BODY — candlelit wooden desk
═══════════════════════════════════════════════════════════ */
body {
  min-height: 100vh;
  background: var(--desk-dark);
  font-family: var(--font-body);
  font-size: 20px; /* Increased font size */
  color: var(--ink);
  overflow-x: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 0;
}

/* Ensure all interactive elements inherit the larger font size */
input, 
textarea, 
button, 
select {
  font-family: inherit;
  font-size: 18px; /* Larger font for inputs and buttons */
}

/* Larger placeholder text for better clarity */
::placeholder {
  font-size: 18px;
  opacity: 0.7;
}

/* Wood grain */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 0%,   rgba(255,210,120,0.07) 0%, transparent 52%),
    radial-gradient(ellipse at 80% 85%,  rgba(0,0,0,0.45)       0%, transparent 55%),
    repeating-linear-gradient(
      92deg,
      transparent 0px, transparent 36px,
      rgba(0,0,0,0.07) 36px, rgba(0,0,0,0.07) 38px,
      transparent 38px, transparent 76px,
      rgba(255,255,255,0.012) 76px, rgba(255,255,255,0.012) 78px
    ),
    repeating-linear-gradient(
      180deg,
      var(--desk-mid)   0px, var(--desk-mid)   4px,
      var(--desk-grain) 4px, var(--desk-grain)  5px,
      var(--desk-mid)   5px, var(--desk-mid)   20px,
      rgba(0,0,0,0.18) 20px, rgba(0,0,0,0.18) 22px
    );
  z-index: 0;
  pointer-events: none;
}

/* Vignette */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse 80% 70% at 50% 42%, transparent 28%, rgba(0,0,0,0.68) 100%);
  z-index: 0;
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════
   OUTER WRAPPER — diary book frame
═══════════════════════════════════════════════════════════ */
body > div,
.wrapper,
.container,
.page {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  animation: bookOpen 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.diary-book {
  background: var(--paper);
  border-left: 10px solid var(--leather);
  box-shadow: 
    inset 52px 0 0 -50px var(--red-margin),
    0 20px 60px rgba(0,0,0,0.65), 
    0 4px 20px rgba(0,0,0,0.4);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

@keyframes bookOpen {
  from { opacity: 0; transform: perspective(1400px) rotateX(5deg) scale(0.97); }
  to   { opacity: 1; transform: perspective(1400px) rotateX(0deg) scale(1); }
}

/* Leather top + bottom strips */
body > div::before,
.wrapper::before,
.container::before,
.page::before {
  content: '';
  display: block;
  height: 18px;
  background: linear-gradient(to bottom, #1a0d05, var(--leather-dk));
  border-radius: 4px 4px 0 0;
  box-shadow: 0 -3px 14px rgba(0,0,0,0.5);
  margin-top: 0;
}

body > div::after,
.wrapper::after,
.container::after,
.page::after {
  content: '';
  display: block;
  height: 18px;
  background: linear-gradient(to top, #1a0d05, var(--leather-dk));
  border-radius: 0 0 4px 4px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.5);
  margin-bottom: 0;
}

/* ═══════════════════════════════════════════════════════════
   PAPER SURFACE MIXIN (used on all sections)
═══════════════════════════════════════════════════════════ */
.paper-surface {
  position: relative;
  overflow: hidden;
  background: var(--paper);
}

/* ─── Paper grain helper ─── */
header,
.achievements-card,
.section,
.search-container,
.nav-tabs,
.diary-book {
  position: relative;
  overflow: hidden;
}

header::before,
.achievements-card::before,
.section::before,
.search-container::before,
.diary-book::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.045'/%3E%3C/svg%3E");
  opacity: 0.7;
  pointer-events: none;
  z-index: 0;
}

/* Ruled lines */
header::after,
.achievements-card::after,
.section::after,
.search-container::after,
.diary-book::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    transparent 0px,
    transparent calc(var(--rule-h) - 1px),
    var(--rule) calc(var(--rule-h) - 1px),
    var(--rule) var(--rule-h)
  );
  pointer-events: none;
  z-index: 0;
}

header > *,
.achievements-card > *,
.section > *,
.search-container > *,
.diary-book > * {
  position: relative;
  z-index: 2;
}

/* ═══════════════════════════════════════════════════════════
   HEADER
═══════════════════════════════════════════════════════════ */
header {
  background: transparent;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 52px 20px 62px;
  margin-bottom: 0;
  border-left: none;
  box-shadow: none;
  animation: inkDry 0.6s ease both 0.1s;
}

.logo {
  font-family: var(--font-hand);
  font-weight: 800;
  font-size: 34px;
  color: var(--ink);
  letter-spacing: -0.5px;
  line-height: 1;
  text-decoration: none;
}

h1 {
  font-family: var(--font-hand);
  font-size: 34px;
  font-weight: 800;
  color: var(--ink) !important;
  /* Remove the purple gradient fill */
  background: none !important;
  -webkit-background-clip: unset !important;
  -webkit-text-fill-color: var(--ink) !important;
  background-clip: unset !important;
  text-shadow: none;
  margin: 0;
  letter-spacing: -0.5px;
  line-height: 1.1;
}

/* ─── NEW ENTRY BUTTON ─── */
.new-entry-btn {
  background: radial-gradient(ellipse at 40% 30%, var(--red-wax-lt), var(--red-wax));
  color: #faf3e0 !important;
  border: none;
  padding: 11px 26px;
  border-radius: 50px;
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.3px;
  margin: 0;
  box-shadow: 0 4px 14px rgba(139,26,26,0.38), inset 0 1px 0 rgba(255,255,255,0.1);
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.25s;
  position: relative;
  overflow: hidden;
}

.new-entry-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.15) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.4s ease;
}
.new-entry-btn:hover::after { transform: translateX(100%); }

.new-entry-btn:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 10px 26px rgba(139,26,26,0.48);
}
.new-entry-btn:active { transform: translateY(0) scale(1); }

/* ─── HERO IMAGE ─── */
.hero {
  background: transparent;
  border-left: none;
  overflow: hidden;
  position: relative;
  padding: 20px 52px 30px 62px;
  text-align: center;
  box-shadow: none;
}

/* Tape strips on hero image */
.hero::before {
  content: '';
  position: absolute;
  top: 10px; left: 44px;
  width: 60px; height: 18px;
  background: rgba(255,240,160,0.55);
  border: 1px solid rgba(220,195,110,0.4);
  border-radius: 2px;
  transform: rotate(-1.5deg);
  z-index: 5;
}
.hero::after {
  content: '';
  position: absolute;
  top: 10px; right: 44px;
  width: 60px; height: 18px;
  background: rgba(255,240,160,0.55);
  border: 1px solid rgba(220,195,110,0.4);
  border-radius: 2px;
  transform: rotate(1.5deg);
  z-index: 5;
}

.hero img {
  width: 44%;
  display: block;
  margin: 0 auto;
  padding: 20px 0;
  transition: transform 0.5s ease;
  filter: sepia(20%) contrast(1.05) brightness(0.95);
}
.hero:hover img { transform: scale(1.04); }

/* ═══════════════════════════════════════════════════════════
   SEARCH BAR
═══════════════════════════════════════════════════════════ */
.search-container {
  background: var(--paper);
  border-left: 10px solid var(--leather);
  padding: 18px 52px;
  margin: 0;
  box-shadow: inset 52px 0 0 -50px var(--red-margin);
  animation: inkDry 0.6s ease both 0.2s;
}

.search-bar {
  width: 100%;
  padding: 10px 16px 10px 44px;
  border: none;
  border-bottom: 2px solid var(--paper-edge);
  border-radius: 0;
  background: transparent;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  box-shadow: none;
  transition: border-color 0.3s;
}

.search-bar:focus {
  outline: none;
  border-bottom-color: var(--gold);
  box-shadow: none;
  transform: none;
  background: transparent;
}

.search-bar::placeholder {
  font-family: var(--font-formal);
  font-style: italic;
  font-size: 14px;
  color: var(--ink-ghost);
  font-weight: 500;
}

.search-icon {
  position: absolute;
  top: 50%;
  left: 56px;
  transform: translateY(-50%);
  color: var(--ink-fade);
  opacity: 0.6;
  font-size: 16px;
  z-index: 3;
}

/* ═══════════════════════════════════════════════════════════
   NAV TABS — filter buttons, look like page tabs
═══════════════════════════════════════════════════════════ */
.nav-tabs {
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 10px;
  padding: 18px 52px;
  background: var(--paper-warm);
  border-left: 10px solid var(--leather);
  margin: 0;
  box-shadow: inset 52px 0 0 -50px var(--red-margin);
  animation: inkDry 0.6s ease both 0.28s;
}

.nav-tab {
  background: var(--paper);
  border: 1.5px solid var(--paper-edge);
  border-bottom: 3px solid var(--paper-edge);
  padding: 8px 22px;
  border-radius: 4px 4px 0 0;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-fade);
  transition: border-color 0.2s, color 0.2s, background 0.2s, transform 0.2s;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.nav-tab:hover {
  background: var(--paper-warm);
  border-color: var(--gold);
  color: var(--ink);
  transform: translateY(-2px);
}

.nav-tab.active {
  background: var(--paper);
  border-color: var(--gold);
  border-bottom-color: var(--paper);
  color: var(--ink);
  font-weight: 800;
}

/* ═══════════════════════════════════════════════════════════
   ACHIEVEMENTS CARD — stats summary
═══════════════════════════════════════════════════════════ */
.achievements-card {
  background: var(--paper);
  border-left: 10px solid var(--leather);
  border-radius: 0;
  padding: 36px 52px;
  margin: 0;
  box-shadow:
    inset 52px 0 0 -50px var(--red-margin),
    0 4px 20px rgba(0,0,0,0.38);
  animation: inkDry 0.6s ease both 0.3s;
}

.achievements-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 1px dashed var(--paper-edge);
}

.icon-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(201,168,76,0.12);
  border: 1.5px solid var(--gold-dim);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 22px;
  color: var(--gold);
  flex-shrink: 0;
  /* Remove original purple gradient */
}

.achievements-header h2 {
  font-family: var(--font-hand);
  font-size: 26px;
  font-weight: 800;
  color: var(--ink);
}

.achievements-subtitle,
.achievements-header p {
  font-family: var(--font-formal);
  font-style: italic;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-ghost);
  margin-top: 3px;
}

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid var(--paper-edge);
  border-radius: 3px;
  overflow: hidden;
  background: var(--paper-warm);
}

.stat-item {
  padding: 24px 20px;
  text-align: center;
  border-right: 1px solid var(--paper-edge);
  position: relative;
  overflow: hidden;
}
.stat-item:last-child { border-right: none; }

/* Ruled lines in stat cells */
.stat-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    transparent 0px, transparent 27px,
    rgba(0,0,0,0.05) 27px, rgba(0,0,0,0.05) 28px
  );
  pointer-events: none;
}
.stat-item > * { position: relative; z-index: 2; }

.stat-item h3 {
  font-family: var(--font-hand);
  font-size: 48px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1;
  margin-bottom: 6px;
}

.stat-label {
  font-family: var(--font-formal);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-fade);
  text-transform: uppercase;
  letter-spacing: 1.2px;
}

/* ═══════════════════════════════════════════════════════════
   CONTENT GRID — two-column page spread
═══════════════════════════════════════════════════════════ */
.content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  margin-top: 0;
  animation: inkDry 0.6s ease both 0.42s;
}

/* ═══════════════════════════════════════════════════════════
   SECTIONS — left & right pages
═══════════════════════════════════════════════════════════ */
.section {
  background: var(--paper);
  border-left: 10px solid var(--leather);
  border-radius: 0;
  padding: 36px 36px 36px 52px;
  box-shadow:
    inset 52px 0 0 -50px var(--red-margin),
    0 4px 20px rgba(0,0,0,0.35);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--paper-edge);
}

.section-title {
  font-family: var(--font-hand);
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.3px;
}

/* ─── ADD GOAL / UPDATE BUTTONS ─── */
.add-goal-btn,
.btn-update {
  background: radial-gradient(ellipse at 40% 30%, var(--red-wax-lt), var(--red-wax));
  color: #faf3e0 !important;
  border: none;
  padding: 8px 18px;
  border-radius: 50px;
  font-family: var(--font-hand);
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 3px 10px rgba(139,26,26,0.35);
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.25s;
  position: relative;
  overflow: hidden;
}

.add-goal-btn::after,
.btn-update::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.14) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.35s ease;
}
.add-goal-btn:hover::after,
.btn-update:hover::after { transform: translateX(100%); }

.add-goal-btn:hover,
.btn-update:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 8px 20px rgba(139,26,26,0.45);
  background: radial-gradient(ellipse at 40% 30%, var(--red-wax-lt), var(--red-wax)) !important;
}

/* ─── DELETE BUTTON ─── */
.btn-delete-goal {
  background: transparent;
  color: var(--ink-ghost);
  border: 1.5px dashed var(--paper-edge);
  padding: 7px 16px;
  border-radius: 50px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  transition: all 0.25s ease;
}

.btn-delete-goal:hover {
  border-color: var(--red-wax);
  color: var(--red-wax);
  background: rgba(139,26,26,0.06) !important;
}

/* ═══════════════════════════════════════════════════════════
   GOAL CARDS — sticky notes / folded pages
═══════════════════════════════════════════════════════════ */
.goal-card {
  background: var(--paper-warm);
  border: 1px solid var(--paper-edge);
  border-left: 4px solid var(--gold-dim);
  border-radius: 3px;
  padding: 20px 18px;
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
  transition: transform 0.28s cubic-bezier(0.175, 0.885, 0.32, 1.275),
              box-shadow 0.28s, border-left-color 0.28s;
  box-shadow: var(--shadow-card);
}

/* Ruled lines in goal card */
.goal-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    transparent 0px, transparent 27px,
    rgba(0,0,0,0.045) 27px, rgba(0,0,0,0.045) 28px
  );
  pointer-events: none;
  z-index: 0;
}

.goal-card > * { position: relative; z-index: 2; }

.goal-card:hover {
  transform: translateX(7px) rotate(0.15deg);
  box-shadow: var(--shadow-lift);
  border-left-color: var(--gold);
}

.goal-title {
  font-family: var(--font-hand);
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 7px;
  line-height: 1.25;
}

.goal-description {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-mid);
  margin-bottom: 14px;
  line-height: 1.65;
}

/* ─── PROGRESS BAR ─── */
.progress-bar {
  background: var(--paper-crease);
  height: 6px;
  border-radius: 0;
  overflow: hidden;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--paper-edge);
  position: relative;
}

/* Tick marks on track */
.progress-bar::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    90deg, transparent 0px, transparent 24px,
    rgba(0,0,0,0.07) 24px, rgba(0,0,0,0.07) 25px
  );
  z-index: 1;
}

.progress-fill {
  background: linear-gradient(90deg, var(--gold) 0%, #a8842e 100%);
  height: 100%;
  border-radius: 0;
  position: relative;
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Ink drip at fill end */
.progress-fill::after {
  content: '';
  position: absolute;
  right: -1px;
  top: -2px;
  width: 3px;
  height: 10px;
  background: var(--gold);
  border-radius: 0 0 2px 2px;
  animation: none; /* remove shimmer */
}

/* ─── GOAL ACTIONS ROW ─── */
.goal-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
  animation: none;
}

/* ═══════════════════════════════════════════════════════════
   ACHIEVEMENT CARDS — stamps / clippings pasted in
═══════════════════════════════════════════════════════════ */
.achievement-card {
  background: var(--paper-warm);
  border: 1px solid var(--paper-edge);
  border-left: 4px solid var(--gold-dim);
  border-radius: 3px;
  padding: 16px 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
  transition: transform 0.28s cubic-bezier(0.175, 0.885, 0.32, 1.275),
              box-shadow 0.28s, border-left-color 0.28s;
  box-shadow: var(--shadow-card);
}

/* Ruled lines in achievement card */
.achievement-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    transparent 0px, transparent 27px,
    rgba(0,0,0,0.04) 27px, rgba(0,0,0,0.04) 28px
  );
  pointer-events: none;
  z-index: 0;
}
.achievement-card > * { position: relative; z-index: 2; }

.achievement-card:hover {
  transform: translateX(7px);
  box-shadow: var(--shadow-lift);
  border-left-color: var(--gold);
}

.achievement-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(201,168,76,0.1);
  border: 1.5px solid var(--gold-dim);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 22px;
  flex-shrink: 0;
}

.achievement-title {
  font-family: var(--font-hand);
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 4px;
  line-height: 1.2;
}

.achievement-description {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-mid);
  line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════
   ANIMATIONS
═══════════════════════════════════════════════════════════ */
@keyframes inkDry {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.goal-card:nth-child(1)        { animation: inkDry 0.5s ease both 0.5s; }
.goal-card:nth-child(2)        { animation: inkDry 0.5s ease both 0.62s; }
.goal-card:nth-child(3)        { animation: inkDry 0.5s ease both 0.74s; }
.goal-card:nth-child(n+4)      { animation: inkDry 0.5s ease both 0.86s; }
.achievement-card:nth-child(1) { animation: inkDry 0.5s ease both 0.52s; }
.achievement-card:nth-child(2) { animation: inkDry 0.5s ease both 0.64s; }
.achievement-card:nth-child(3) { animation: inkDry 0.5s ease both 0.76s; }

/* ═══════════════════════════════════════════════════════════
   SCROLLBAR
═══════════════════════════════════════════════════════════ */
::-webkit-scrollbar { width: 7px; }
::-webkit-scrollbar-track { background: var(--desk-dark); }
::-webkit-scrollbar-thumb { background: var(--leather); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--leather-lt); }

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .content-grid { grid-template-columns: 1fr; gap: 0; }
  .stats-grid   { grid-template-columns: 1fr; }

  .stat-item { border-right: none; border-bottom: 1px solid var(--paper-edge); }
  .stat-item:last-child { border-bottom: none; }

  header         { padding: 16px 24px; flex-wrap: wrap; gap: 12px; }
  .search-container,
  .nav-tabs      { padding: 14px 24px; }
  .achievements-card,
  .section       { padding: 28px 24px 28px 36px; border-left-width: 6px; }

  .hero img { width: 70%; }

  h1 { font-size: 26px; }

  .feature-cards {
    grid-template-columns: 1fr 1fr !important;
  }
}

@media (max-width: 480px) {
  header  { padding: 14px 16px; flex-direction: row; }
  h1      { font-size: 22px; }

  .achievements-card,
  .section { padding: 22px 18px 22px 26px; border-left-width: 5px; }

  .stat-item h3  { font-size: 38px; }
  .nav-tabs      { padding: 12px 18px; gap: 7px; }
  .nav-tab       { padding: 6px 14px; font-size: 11px; }
  .hero img      { width: 90%; }
}

/* ═══════════════════════════════════════════════════════════
   GLOBAL READABILITY — bold, dark, antialiased
═══════════════════════════════════════════════════════════ */
body, p, span, div, li, td, th, input, textarea, select, button, a {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, .section-title, .goal-title, .achievement-title,
.stat-item h3, .new-entry-btn, .add-goal-btn {
  font-weight: 800 !important;
  color: var(--ink) !important;
}

.goal-description, .achievement-description,
.stat-label, .search-bar, .nav-tab {
  font-weight: 600 !important;
  color: var(--ink-mid) !important;
  opacity: 1 !important;
}

input::placeholder, textarea::placeholder {
  color: var(--ink-ghost) !important;
  font-weight: 500 !important;
  opacity: 1 !important;
}

label { font-weight: 700 !important; color: var(--ink-mid) !important; }

/* ─── ADD GOAL CONTAINER & FORM ─── */
.add-goal-container {
  background: transparent;
  border-left: none;
  padding: 30px 52px 60px 62px;
  margin-top: 0;
  box-shadow: none;
  position: relative;
  overflow: hidden;
  animation: inkDry 0.6s ease both 0.35s;
}

.add-goal-container::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.045'/%3E%3C/svg%3E");
  opacity: 0.7;
  pointer-events: none;
  z-index: 0;
}

.add-goal-container::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    transparent 0px,
    transparent calc(var(--rule-h) - 1px),
    var(--rule) calc(var(--rule-h) - 1px),
    var(--rule) var(--rule-h)
  );
  pointer-events: none;
  z-index: 0;
}

.add-goal-container > * {
  position: relative;
  z-index: 2;
}

.add-goal-header {
  margin-bottom: 30px;
  padding-bottom: 15px;
  border-bottom: 1px dashed var(--paper-edge);
}

.add-goal-header h2 {
  font-family: var(--font-hand);
  font-size: 28px;
  margin-bottom: 5px;
}

.form-group {
  margin-bottom: 25px;
}

.form-row {
  display: flex;
  gap: 20px;
}

.form-row .form-group {
  flex: 1;
}

label {
  display: block;
  margin-bottom: 8px;
  font-family: var(--font-hand);
  font-size: 15px;
}

.required {
  color: var(--red-wax);
}

input[type="text"],
input[type="number"],
input[type="date"],
textarea {
  width: 100%;
  padding: 12px 15px;
  background: rgba(0,0,0,0.03);
  border: 1px solid var(--paper-edge);
  border-bottom: 2px solid var(--ink-ghost);
  border-radius: 2px;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--ink);
  transition: all 0.3s ease;
}

input:focus, textarea:focus {
  outline: none;
  background: rgba(201,168,76,0.05);
  border-bottom-color: var(--gold);
}

textarea {
  min-height: 100px;
  resize: vertical;
}

/* ─── CATEGORY CHIPS ─── */
.category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.chip {
  padding: 8px 18px;
  background: var(--paper-warm);
  border: 1px solid var(--paper-edge);
  border-radius: 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-fade);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 2px 2px 5px rgba(0,0,0,0.05);
}

.chip:hover {
  transform: translateY(-2px);
  border-color: var(--gold-dim);
}

.chip.selected {
  background: var(--gold);
  color: white !important;
  border-color: #a8842e;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(201,168,76,0.3);
}

/* ─── ICON SELECTOR ─── */
.icon-selector {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(45px, 1fr));
  gap: 10px;
  margin-top: 10px;
  padding: 15px;
  background: rgba(0,0,0,0.02);
  border-radius: 4px;
  border: 1px dashed var(--paper-edge);
}

.icon-option {
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: var(--paper-warm);
  border: 1px solid var(--paper-edge);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-option:hover {
  transform: scale(1.1);
  background: var(--paper);
}

.icon-option.selected {
  background: var(--paper);
  border: 2px solid var(--gold);
  box-shadow: 0 0 10px var(--gold-bright);
}

/* ─── FORM ACTIONS ─── */
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 15px;
  margin-top: 40px;
  border-top: 1px dashed var(--paper-edge);
  padding-top: 30px;
}

.btn {
  padding: 12px 28px;
  border-radius: 50px;
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-secondary {
  background: transparent;
  color: var(--ink-ghost);
  border: 1.5px dashed var(--paper-edge);
}

.btn-secondary:hover {
  background: rgba(0,0,0,0.05);
  color: var(--ink);
  border-color: var(--ink-ghost);
}

.btn-primary {
  background: radial-gradient(ellipse at 40% 30%, var(--red-wax-lt), var(--red-wax));
  color: #faf3e0 !important;
  border: none;
  box-shadow: 0 4px 14px rgba(139,26,26,0.38);
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 10px 26px rgba(139,26,26,0.48);
}

/* ─── FEATURE CARDS ─── */
.feature-cards {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
  gap: 16px !important;
  margin-bottom: 0 !important;
  padding: 20px 52px 20px 62px !important;
  border-left: none;
  background: transparent;
  box-shadow: none;
}

.feature-card {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px;
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  border-radius: 4px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 4px; height: 100%;
  background: var(--ink-ghost);
  opacity: 0.3;
}

.feature-card:hover {
  transform: translateY(-4px) rotate(1deg);
  box-shadow: var(--shadow-lift);
}

.feature-card.blue::before { background: #4a90e2; opacity: 1; }
.feature-card.pink::before { background: #e24a90; opacity: 1; }
.feature-card.green::before { background: #4ae290; opacity: 1; }
.feature-card.gold::before { background: #e2a84a; opacity: 1; }
.feature-card.purple::before { background: #904ae2; opacity: 1; }

.feature-icon {
  font-size: 24px;
}

.feature-content h3 {
  font-size: 15px;
  margin-bottom: 2px;
}

.feature-content p {
  font-size: 12px;
  font-weight: 500 !important;
  color: var(--ink-ghost) !important;
}
