:root {
  color-scheme: light;
  --ink: #121515;
  --ink-soft: #3a3f3f;
  --paper: #f5f0e6;
  --accent: #c07042;
  --accent-dark: #a2532e;
  --leaf: #1f6f5c;
  --leaf-dark: #155041;
  --mist: #eee3d6;
  --mist-strong: #e2d3c3;
  --shadow: 0 28px 60px rgba(18, 21, 21, 0.18);
  --shadow-soft: 0 16px 30px rgba(18, 21, 21, 0.1);
  --radius: 26px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 12% 8%, rgba(192, 112, 66, 0.22), rgba(192, 112, 66, 0) 45%),
    radial-gradient(circle at 85% 12%, rgba(31, 111, 92, 0.2), rgba(31, 111, 92, 0) 50%),
    linear-gradient(180deg, #f8f2e7 0%, #f1e6d8 55%, #eadccc 100%);
  color: var(--ink);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(18, 19, 26, 0.05) 1px, transparent 0);
  background-size: 26px 26px;
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}

.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(0px);
  opacity: 0.6;
  mix-blend-mode: multiply;
  animation: float 16s ease-in-out infinite;
}

.orb-1 {
  width: 320px;
  height: 320px;
  top: -100px;
  left: -60px;
  background: radial-gradient(circle, rgba(242, 122, 75, 0.6), rgba(242, 122, 75, 0));
}

.orb-2 {
  width: 260px;
  height: 260px;
  bottom: 40px;
  right: -40px;
  background: radial-gradient(circle, rgba(46, 125, 109, 0.5), rgba(46, 125, 109, 0));
  animation-delay: 2s;
}

.orb-3 {
  width: 220px;
  height: 220px;
  top: 30%;
  right: 25%;
  background: radial-gradient(circle, rgba(83, 110, 156, 0.4), rgba(83, 110, 156, 0));
  animation-delay: 4s;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(16px);
  }
}

.hero {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  padding: 56px 8vw 18px;
  gap: 24px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  color: var(--leaf);
  margin: 0 0 12px;
}

h1 {
  font-family: "Fraunces", "Times New Roman", serif;
  font-size: clamp(2.6rem, 6.2vw, 4.6rem);
  margin: 0 0 12px;
}

.subtitle {
  font-size: 1.1rem;
  max-width: 540px;
  color: var(--ink-soft);
}

.hero-card {
  display: grid;
  grid-template-columns: repeat(3, minmax(80px, 1fr));
  gap: 12px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.7);
}

.metric {
  text-align: center;
}

.metric span {
  display: block;
  font-size: 0.75rem;
  color: var(--ink-soft);
}

.metric strong {
  font-size: 1.4rem;
  color: var(--accent-dark);
}

.main {
  position: relative;
  z-index: 1;
  padding: 0 8vw 56px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.5fr);
  gap: 28px;
}

.app-section {
  display: none;
}

.app-section.active {
  display: grid;
}

.panel-wide {
  grid-column: 1 / -1;
}

.panel {
  background: rgba(255, 255, 255, 0.78);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.75);
  animation: panelRise 0.5s ease both;
}

@keyframes panelRise {
  from {
    transform: translateY(10px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.dashboard-card {
  background: linear-gradient(135deg, #fff, #fbf5ea);
  border-radius: 16px;
  padding: 14px 16px;
  border: 1px solid #efe1cf;
  display: grid;
  gap: 6px;
  box-shadow: var(--shadow-soft);
}

.dashboard-card span {
  font-size: 0.75rem;
  color: var(--ink-soft);
}

.dashboard-card strong {
  font-size: 1.4rem;
  color: var(--accent-dark);
}

.dashboard-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.export-block {
  display: grid;
  gap: 8px;
}

.export-block label {
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.export-block textarea {
  border-radius: 12px;
  border: 1px solid #e3d9c9;
  padding: 10px 12px;
  font-size: 0.85rem;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  resize: vertical;
  background: rgba(255, 255, 255, 0.9);
}

.export-block input[type="number"],
.export-block input[type="time"] {
  border-radius: 12px;
  border: 1px solid #e3d9c9;
  padding: 10px 12px;
  font-size: 0.9rem;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  background: rgba(255, 255, 255, 0.9);
}

.reminder-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.reminder-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.dashboard-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

#norwegianCategorySelect {
  border: 1px solid #e3d9c9;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.95);
  color: var(--ink);
}

.language-toggle {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.pill {
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(227, 217, 201, 0.7);
  color: var(--ink-soft);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pill.active {
  background: linear-gradient(135deg, #1f6f5c, #2f8a73);
  color: #fff;
  box-shadow: 0 12px 24px rgba(31, 111, 92, 0.2);
}

input[type="search"] {
  border: 1px solid #e3d9c9;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 0.95rem;
  outline: none;
  min-width: 220px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

#lessonJumpInput {
  border: 1px solid #e3d9c9;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 0.95rem;
  outline: none;
  width: 120px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

button {
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 0.95rem;
  font-weight: 600;
  background: linear-gradient(135deg, #c07042, #b05835);
  color: #fff;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  box-shadow: 0 14px 24px rgba(240, 139, 70, 0.3);
}

#nextLessonButton {
  background: linear-gradient(135deg, #1f6f5c, #2f8a73);
  box-shadow: 0 14px 24px rgba(31, 122, 106, 0.25);
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.02);
  box-shadow: 0 16px 32px rgba(242, 122, 75, 0.32);
}

button.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid #e3d9c9;
  box-shadow: none;
  backdrop-filter: blur(8px);
}

.lesson-list {
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
  display: grid;
  gap: 12px;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}

.lesson-item {
  border: 1px solid #efe1cf;
  border-radius: 16px;
  padding: 16px;
  display: grid;
  gap: 6px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.92);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.lesson-item:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow-soft);
}

.lesson-item.active {
  border-color: var(--leaf);
  box-shadow: 0 16px 30px rgba(46, 125, 109, 0.2);
}

.lesson-item.completed {
  border-color: var(--leaf);
  background: linear-gradient(135deg, #f2fbf6, #effaf5);
}

.lesson-item.next-up {
  border-color: var(--accent-dark);
  box-shadow: 0 16px 30px rgba(242, 122, 75, 0.25);
}

.lesson-title {
  font-weight: 700;
}

.lesson-meta {
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.lesson-progress {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.lesson-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.progress-pill {
  background: #f7efe2;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.75rem;
  color: var(--ink-soft);
  border: 1px solid #efe1cf;
}

.progress-pill.complete {
  background: #e6f6ee;
  color: var(--leaf);
  font-weight: 600;
}

.progress-pill.next {
  background: #ffe8de;
  color: var(--accent-dark);
  font-weight: 600;
}

.lesson-detail h3 {
  margin-top: 0;
}

.lesson-jump {
  margin: 8px 0 12px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.gallery-card {
  background: rgba(255, 255, 255, 0.92);
  border-radius: 16px;
  padding: 12px;
  border: 1px solid #efe1cf;
  display: grid;
  gap: 6px;
  text-align: center;
}

.gallery-card .emoji {
  font-size: 1.8rem;
}

.gallery-card .norwegian {
  font-weight: 700;
}

.gallery-card .english {
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.tag {
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.8rem;
  background: #f2ebe0;
  border: 1px solid rgba(227, 217, 201, 0.7);
}

.section {
  margin-top: 18px;
}

.difficulty-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.difficulty-row select {
  border: 1px solid #e3d9c9;
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 0.95rem;
  background: #fff;
}

.practice-grid {
  display: grid;
  gap: 12px;
}

.practice-item {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #efe1cf;
}

.practice-item.completed {
  border-color: var(--leaf);
  background: #f3fbf7;
}

.practice-item input {
  border: 1px solid #e3d9c9;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.95rem;
  background: #fff;
}

.practice-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.accent-grid {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}

.accent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #efe1cf;
}

.notice {
  background: linear-gradient(135deg, #fff7ec, #f2ebe0);
  border-radius: 12px;
  padding: 12px;
  font-size: 0.9rem;
  color: var(--ink-soft);
  border: 1px solid rgba(227, 217, 201, 0.7);
}

.footer {
  text-align: center;
  padding: 20px 0 40px;
  color: var(--ink-soft);
}

.floating {
  position: fixed;
  right: 18px;
  bottom: 22px;
  z-index: 10;
  background: linear-gradient(135deg, #1f6f5c, #2f8a73);
  box-shadow: 0 16px 28px rgba(31, 111, 92, 0.25);
}

.muted {
  color: var(--ink-soft);
}

@media (max-width: 920px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .hero {
    align-items: flex-start;
  }
}
