:root {
  --bg: #0f1728;
  --bg-elevated: #18233b;
  --card: rgba(19, 31, 54, 0.86);
  --card-strong: rgba(17, 28, 49, 0.94);
  --text: #e7edf9;
  --muted: #b7c3db;
  --line: rgba(198, 169, 102, 0.18);
  --accent: #8bb8ff;
  --bronze: #c6a966;
  --shadow: 0 18px 40px rgba(3, 8, 20, 0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background:
    radial-gradient(circle at top, rgba(93, 129, 194, 0.16), transparent 32%),
    linear-gradient(180deg, #0d1524 0%, var(--bg) 100%);
  color: var(--text);
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.page-shell {
  width: min(1120px, calc(100vw - 1.5rem));
  margin: 0 auto;
  padding: 1rem 0 2.5rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 1rem;
  backdrop-filter: blur(8px);
}

.glow-card {
  background: linear-gradient(135deg, rgba(23, 37, 65, 0.96), rgba(26, 40, 68, 0.9));
}

.masthead {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
  gap: 1rem;
  margin-bottom: 1rem;
  overflow: hidden;
  position: relative;
}

.masthead::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(10, 18, 32, 0.9) 0%, rgba(10, 18, 32, 0.82) 44%, rgba(12, 20, 34, 0.58) 100%),
    radial-gradient(circle at top right, rgba(139, 184, 255, 0.18), transparent 32%);
  pointer-events: none;
}

.masthead > * {
  position: relative;
  z-index: 1;
}

.masthead-copy {
  display: grid;
  gap: 1rem;
  align-content: space-between;
}

.masthead h1, .section-heading h2, .spotlight h2, .subcard h3, .note-item h3 {
  font-family: Georgia, 'Times New Roman', serif;
  letter-spacing: 0.01em;
  margin: 0;
}

.masthead-meta, .section-heading, .note-head {
  display: flex;
  gap: 0.5rem;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
}

.masthead-hero-frame,
.visual-medallion,
.inline-ornament {
  margin: 0;
}

.masthead-hero-frame {
  display: grid;
  gap: 0.5rem;
  align-content: start;
}

.masthead-hero-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid rgba(198, 169, 102, 0.22);
  box-shadow: 0 14px 34px rgba(3, 8, 20, 0.32);
}

.masthead-hero-frame figcaption,
.visual-medallion figcaption,
.inline-ornament figcaption {
  color: var(--muted);
  font-size: 0.78rem;
}

.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--bronze);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
}

.lede, .muted {
  color: var(--muted);
}

.badge, .pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  font-size: 0.78rem;
  border: 1px solid rgba(139, 184, 255, 0.26);
  background: rgba(139, 184, 255, 0.08);
}

.badge.bronze, .pill.subtle {
  border-color: rgba(198, 169, 102, 0.28);
  background: rgba(198, 169, 102, 0.1);
}

.badge.outline {
  background: transparent;
}

.hero-grid,
.dashboard-grid {
  display: grid;
  gap: 1rem;
}

.hero-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin-bottom: 1rem;
}

.dashboard-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.spotlight {
  min-height: 100%;
}

.spotlight-visuals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}

.visual-medallion {
  display: grid;
  gap: 0.45rem;
  background: rgba(13, 22, 38, 0.76);
  border: 1px solid rgba(198, 169, 102, 0.12);
  border-radius: 16px;
  padding: 0.65rem;
}

.visual-medallion img,
.inline-ornament img {
  width: 100%;
  display: block;
}

.visual-medallion img {
  border-radius: 14px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.framed-medallion {
  background:
    linear-gradient(180deg, rgba(27, 42, 70, 0.96), rgba(18, 29, 50, 0.92)),
    url('/static/images/art-nouveau-frame.svg') center / cover no-repeat;
}

.room-medallion img {
  object-position: center 22%;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.stats-grid div,
.subcard,
.note-item {
  background: var(--card-strong);
  border: 1px solid rgba(198, 169, 102, 0.12);
  border-radius: 16px;
  padding: 0.85rem;
}

.stats-grid span,
.tiny {
  color: var(--muted);
  font-size: 0.8rem;
}

.stats-grid strong {
  display: block;
  font-size: 1.25rem;
  margin-top: 0.2rem;
}

.stack-form {
  display: grid;
  gap: 0.85rem;
}

label {
  display: grid;
  gap: 0.4rem;
  font-size: 0.92rem;
}

input,
textarea,
button {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(139, 184, 255, 0.16);
  padding: 0.85rem 0.95rem;
  font: inherit;
}

input,
textarea {
  background: rgba(10, 18, 33, 0.88);
  color: var(--text);
}

button {
  background: linear-gradient(135deg, #5c78b7, #7ea6ef);
  color: #09111e;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  filter: brightness(1.04);
}

.timeline-list,
.plain-list,
.check-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.timeline-list li,
.plain-list li,
.check-list li {
  background: rgba(15, 24, 42, 0.72);
  border: 1px solid rgba(198, 169, 102, 0.1);
  border-radius: 14px;
  padding: 0.8rem;
}

.check-list li.done {
  text-decoration: line-through;
  opacity: 0.72;
}

.notes-card {
  grid-column: span 2;
}

.note-item.pinned {
  border-color: rgba(198, 169, 102, 0.34);
}

.quick-add-card {
  align-self: start;
}

.inline-ornament {
  margin-top: 1rem;
  display: grid;
  gap: 0.4rem;
}

.inline-ornament img {
  max-height: 96px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(198, 169, 102, 0.16);
  background: linear-gradient(135deg, rgba(198, 169, 102, 0.18), rgba(139, 184, 255, 0.12));
}

@media (max-width: 800px) {
  .page-shell {
    width: min(100vw - 1rem, 100%);
  }

  .masthead {
    grid-template-columns: 1fr;
  }

  .masthead-hero-image {
    aspect-ratio: 16 / 9;
  }

  .spotlight-visuals {
    grid-template-columns: 1fr;
  }

  .notes-card {
    grid-column: span 1;
  }
}
