:root {
  --bg: #0b0b0f;
  --sidebar-bg: #111118;
  --accent: #d4a15f;
  --accent-soft: rgba(212, 161, 95, 0.25);
  --ink: #1f130a;
  --parchment: #f3e4c9;
  --parchment-deep: #e2cda3;
  --note-shadow: rgba(0, 0, 0, 0.35);
  --text-main: #f7f3ea;
  --text-muted: #c2b8a5;
  --danger: #b84b4b;
  --transition-fast: 0.18s ease-out;
  --transition-med: 0.3s ease-out;
  --border-rough: 1.5px solid rgba(0, 0, 0, 0.35);
  --scribble: rgba(0, 0, 0, 0.5);
  --glow: 0 0 18px rgba(212, 161, 95, 0.35);
  --font-main: "Georgia", "Times New Roman", serif;
  --font-ui: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: radial-gradient(circle at top, #1b1b24 0, #050509 55%, #020205 100%);
  color: var(--text-main);
  font-family: var(--font-main);
}

body {
  /* display: flex; */
  margin: 0;
  padding: 0;
}

/* Site shell */

.site-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  width: 100%;
  min-height: 100vh;
}

/* Sidebar */

.sidebar {
  background: radial-gradient(circle at top left, #1f1f2a 0, #050509 55%);
  border-right: 1px solid rgba(255, 255, 255, 0.04);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

.site-main {
  flex-grow: 1;
}

.sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 10% 0, rgba(212, 161, 95, 0.12), transparent 55%),
    radial-gradient(circle at 90% 100%, rgba(212, 161, 95, 0.08), transparent 60%);
  opacity: 0.9;
  pointer-events: none;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.logo-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid rgba(212, 161, 95, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-main);
  font-size: 18px;
  color: var(--accent);
  box-shadow: 0 0 12px rgba(212, 161, 95, 0.4);
  background: radial-gradient(circle at 30% 0, #2b1b0f, #050509);
}

.logo-text {
  font-family: var(--font-ui);
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Nav */

.nav {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  z-index: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--text-muted);
  text-decoration: none;
  font-family: var(--font-ui);
  font-size: 13px;
  position: relative;
  transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}

.nav-item::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px dashed rgba(212, 161, 95, 0.25);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.nav-item:hover {
  background: rgba(212, 161, 95, 0.08);
  color: var(--text-main);
  transform: translateX(2px);
}

.nav-item:hover::before {
  opacity: 1;
}

.nav-item.active {
  background: rgba(212, 161, 95, 0.18);
  color: var(--text-main);
  box-shadow: 0 0 14px rgba(212, 161, 95, 0.35);
}

.nav-item.active::before {
  opacity: 1;
}

.icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid rgba(212, 161, 95, 0.7);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

/* Doodle icons – hand‑drawn style using borders */

.doodle-house::before,
.doodle-house::after,
.doodle-controller::before,
.doodle-controller::after,
.doodle-notebook::before,
.doodle-notebook::after {
  content: "";
  position: absolute;
  border-radius: 2px;
  border: 1.5px solid rgba(212, 161, 95, 0.9);
}

/* House */

.doodle-house::before {
  width: 12px;
  height: 8px;
  bottom: 4px;
  left: 4px;
  border-top: none;
}

.doodle-house::after {
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 8px solid rgba(212, 161, 95, 0.9);
  top: 3px;
  left: 4px;
}

/* Controller */

.doodle-controller::before {
  width: 14px;
  height: 8px;
  bottom: 5px;
  left: 3px;
  border-radius: 8px;
}

.doodle-controller::after {
  width: 10px;
  height: 2px;
  top: 5px;
  left: 5px;
  border-radius: 2px;
}

/* Notebook */

.doodle-notebook::before {
  width: 12px;
  height: 14px;
  top: 3px;
  left: 5px;
  border-left-width: 2px;
}

.doodle-notebook::after {
  width: 2px;
  height: 10px;
  top: 5px;
  left: 7px;
  border-left: 1.5px solid rgba(212, 161, 95, 0.9);
}

/* Sidebar footer scribbles */

.sidebar-footer {
  margin-top: auto;
  position: relative;
  z-index: 1;
  height: 80px;
}

.scribble {
  position: absolute;
  inset-inline: 10px;
  bottom: 10px;
  height: 40px;
  border-radius: 50%;
  border: 1px dashed rgba(212, 161, 95, 0.25);
  transform: rotate(-4deg);
}

.scribble-small {
  inset-inline: 30px;
  bottom: 18px;
  transform: rotate(6deg);
}

/* Main content */

.main-content {
  position: relative;
  padding: 20px 26px 24px;
  display: block;
  gap: 18px;
}

/* Top bar */

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  font-family: var(--font-ui);
}

.top-title h1 {
  margin: 4px 0 0;
  font-size: 26px;
  letter-spacing: 0.03em;
}

.top-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(212, 161, 95, 0.7);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  background: rgba(0, 0, 0, 0.4);
}

.top-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
}

.meta-item {
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
}

/* Hero parchment */

.hero-parchment {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: radial-gradient(circle at top, #f7e8cf 0, #e2cda3 40%, #c9b18a 100%);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(0, 0, 0, 0.4);
}

.hero-parchment::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.25),
      transparent 40%,
      transparent 60%,
      rgba(0, 0, 0, 0.15)
    ),
    repeating-linear-gradient(
      0deg,
      rgba(0, 0, 0, 0.04),
      rgba(0, 0, 0, 0.04) 1px,
      transparent 1px,
      transparent 4px
    );
  mix-blend-mode: multiply;
  opacity: 0.9;
  pointer-events: none;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 10% 0, rgba(212, 161, 95, 0.4), transparent 55%),
    radial-gradient(circle at 90% 100%, rgba(120, 70, 20, 0.4), transparent 60%);
  mix-blend-mode: soft-light;
  opacity: 0.9;
  pointer-events: none;
}

.hero-content {
  position: relative;
  padding: 22px 26px 20px;
  color: var(--ink);
}

.hero-content h2 {
  margin: 0 0 8px;
  font-size: 20px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-content p {
  margin: 4px 0;
  font-size: 14px;
  line-height: 1.5;
}

/* Notebook grid */
#notebook-grid {
  width: 100%
}

.notebook-grid {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  width: 100%;
  max-width: 100%;
  align-items: start;
}

/* Note cards */

.note-card {
  width: 100%;
  min-width: 0;
  position: relative;
  flex: 1 1 260px;
  max-width: 400px;
  background: radial-gradient(circle at top, #f7e8cf 0, #e2cda3 40%, #c9b18a 100%);
  border-radius: 14px;
  padding: 14px 14px 12px;
  box-shadow: 0 12px 26px var(--note-shadow);
  border: 1px solid rgba(0, 0, 0, 0.45);
  overflow: hidden;
  cursor: pointer;
  transform-origin: center;
  transition: transform var(--transition-med), box-shadow var(--transition-med), filter var(--transition-med);
}

.note-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
      0deg,
      rgba(0, 0, 0, 0.04),
      rgba(0, 0, 0, 0.04) 1px,
      transparent 1px,
      transparent 4px
    ),
    radial-gradient(circle at 0 0, rgba(255, 255, 255, 0.3), transparent 55%);
  mix-blend-mode: multiply;
  opacity: 0.9;
  pointer-events: none;
}

.note-card::after {
  content: "";
  position: absolute;
  inset: 10px 10px auto auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px dashed rgba(0, 0, 0, 0.25);
  opacity: 0.4;
  transform: rotate(-6deg);
}

.note-card:hover {
  transform: translateY(-4px) rotate(-0.5deg);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.7);
  filter: brightness(1.02);
}

.note-card-highlight {
  box-shadow: 0 18px 40px rgba(212, 161, 95, 0.6);
}

.note-card-highlight::after {
  border-color: rgba(212, 161, 95, 0.7);
}

/* Note content */

.note-header {
  position: relative;
  z-index: 1;
}

.note-header h3 {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.note-subtitle {
  display: inline-block;
  margin-top: 2px;
  font-size: 11px;
  color: rgba(0, 0, 0, 0.6);
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px dashed rgba(0, 0, 0, 0.25);
  background: rgba(255, 255, 255, 0.35);
}

.note-body {
  position: relative;
  z-index: 1;
  margin-top: 8px;
  font-size: 13px;
  color: rgba(0, 0, 0, 0.85);
}

.note-snippet {
  margin: 0;
}

.note-expanded {
  margin: 6px 0 0;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(4px);
  transition: max-height var(--transition-med), opacity var(--transition-med), transform var(--transition-med);
}

.note-card.expanded .note-expanded {
  max-height: 200px;
  opacity: 1;
  transform: translateY(0);
}

.note-footer {
  position: relative;
  z-index: 1;
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  color: rgba(0, 0, 0, 0.6);
}

.note-hint {
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

/* Doodle accents on notes */

.note-doodle-train,
.note-doodle-arrow,
.note-doodle-leaf,
.note-doodle-quill,
.note-doodle-building,
.note-doodle-key {
  position: relative;
  width: 32px;
  height: 18px;
  border-radius: 999px;
  border: 1px dashed rgba(0, 0, 0, 0.35);
}

/* Train */

.note-doodle-train::before,
.note-doodle-train::after {
  content: "";
  position: absolute;
  border-radius: 2px;
  border: 1px solid rgba(0, 0, 0, 0.7);
}

.note-doodle-train::before {
  width: 16px;
  height: 8px;
  left: 6px;
  top: 4px;
}

.note-doodle-train::after {
  width: 18px;
  height: 2px;
  left: 5px;
  bottom: 2px;
}

/* Arrow */

.note-doodle-arrow::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 0;
  border-top: 1.5px solid rgba(0, 0, 0, 0.7);
  top: 8px;
  left: 6px;
}

.note-doodle-arrow::after {
  content: "";
  position: absolute;
  border-left: 5px solid rgba(0, 0, 0, 0.7);
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  top: 4px;
  right: 5px;
}

/* Leaf */

.note-doodle-leaf::before {
  content: "";
  position: absolute;
  width: 14px;
  height: 10px;
  border-radius: 50% 50% 50% 0;
  border: 1px solid rgba(0, 0, 0, 0.7);
  transform: rotate(-20deg);
  left: 8px;
  top: 3px;
}

.note-doodle-leaf::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 0;
  border-top: 1px solid rgba(0, 0, 0, 0.7);
  left: 6px;
  bottom: 4px;
}

/* Quill */

.note-doodle-quill::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 10px;
  border-radius: 50% 50% 0 50%;
  border: 1px solid rgba(0, 0, 0, 0.7);
  transform: rotate(25deg);
  left: 6px;
  top: 2px;
}

.note-doodle-quill::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 0;
  border-top: 1px solid rgba(0, 0, 0, 0.7);
  left: 10px;
  bottom: 3px;
}

/* Building */

.note-doodle-building::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 10px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.7);
  left: 7px;
  top: 3px;
}

.note-doodle-building::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 4px;
  border-top: 1px solid rgba(0, 0, 0, 0.7);
  border-bottom: 1px solid rgba(0, 0, 0, 0.7);
  left: 10px;
  top: 6px;
}

/* Key */

.note-doodle-key::before {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.7);
  left: 6px;
  top: 3px;
}

.note-doodle-key::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 0;
  border-top: 1px solid rgba(0, 0, 0, 0.7);
  right: 4px;
  top: 8px;
}

/* Footer */

.footer {
  margin-top: 10px;
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--text-muted);
  text-align: right;
}

/* Responsive */

@media (max-width: 840px) {
  .app-shell {
    grid-template-columns: 70px minmax(0, 1fr);
  }

  .logo-text {
    display: none;
  }

  .nav-label {
    display: none;
  }

  .main-content {
    padding: 16px;
  }

  .top-bar {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .sidebar {
    flex-direction: row;
    align-items: center;
    height: 60px;
    padding: 8px 12px;
  }

  .sidebar-footer {
    display: none;
  }

  .main-content {
    padding: 14px;
  }

  .hero-content {
    padding: 16px 18px;
  }
  
  .notebook-grid {
    outline: 4px solid red !important;
  }

  .note-card {
    outline: 4px solid blue !important;
}
