:root {
  --bg1: #fff0f6;
  --bg2: #ffe3ec;

  --card: #ffffff;
  --border: #ff8fab;

  --text: #5a2a3a;
  --muted: #7b4a5a;

  --accent: #ff4d8d;
  --accent2: #ff758f;
  --link: #d6336c;

  --shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);

  /* Valentine background */
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 77, 141, 0.18), transparent 35%),
    radial-gradient(circle at 80% 30%, rgba(255, 117, 143, 0.18), transparent 40%),
    linear-gradient(135deg, var(--bg1), var(--bg2));
}

/* Center page content */
#page {
  width: min(900px, 92vw);
  margin: 28px auto 40px;
  text-align: center;
}

/* Headings */
h1 {
  margin: 0 0 4px;
  letter-spacing: 0.5px;
  font-weight: 800;
  font-size: clamp(34px, 5vw, 52px);
  color: var(--link);
  text-shadow: 0 2px 0 rgba(255, 77, 141, 0.15);
}

h2 {
  margin: 0 0 10px;
  font-weight: 800;
  font-size: clamp(18px, 2.6vw, 26px);
  color: var(--accent);
}

/* NAV */
nav {
  margin: 8px auto 20px;
  display: grid;
  place-items: center;
  gap: 10px;
}

.nav-wrap {
  width: 100%;
  display: grid;
  place-items: center;
  gap: 10px;
}

/* Arrow button (small screens) */
#menuToggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 2px solid rgba(255, 143, 171, 0.65);
  background: rgba(255, 255, 255, 0.65);
  color: var(--link);
  font-size: 18px;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(214, 51, 108, 0.15);
}

#menuToggle:hover {
  background: rgba(255, 255, 255, 0.85);
}

#arrow {
  font-size: 18px;
  line-height: 1;
}

ul#navItems {
  list-style: none;
  padding: 0;
  margin: 0;
  display: none; /* initially hidden on small screens */
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 320px;
}

ul#navItems.open {
  display: flex;
}

ul#navItems li a {
  display: block;
  padding: 10px 14px;
  border-radius: 16px;
  text-decoration: none;
  color: var(--link);
  background: rgba(255,255,255,0.72);
  border: 2px solid rgba(255, 143, 171, 0.55);
  box-shadow: 0 6px 16px rgba(214, 51, 108, 0.10);
  cursor: pointer; /* hand cursor */
}

ul#navItems li a:hover {
  background: rgba(255, 77, 141, 0.10);
}

ul#navItems li a.active {
  outline: 2px solid rgba(255, 77, 141, 0.25);
  background: rgba(255, 77, 141, 0.12);
  color: #7a1f3f;
}

/* Card */
.card {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 18px;
  padding: 26px 18px;
  box-shadow: var(--shadow);
  margin: 16px auto 18px;
  width: 100%;
  position: relative;
  overflow: hidden;
}

/* subtle heart shimmer */
.card::before {
  content: "❤";
  position: absolute;
  top: -10px;
  right: 14px;
  font-size: 46px;
  color: rgba(255, 77, 141, 0.10);
  transform: rotate(12deg);
}

.card h3 {
  margin: 0 0 10px;
  color: #b0124b;
  font-size: 20px;
  font-weight: 800;
}

.muted {
  color: var(--muted);
  margin: 6px 0 0;
}

/* Exercise 1 layout */
.slider-block {
  display: grid;
  justify-items: center;
  gap: 12px;
  margin-top: 6px;
}

.slider-row {
  width: min(420px, 90%);
  display: grid;
  gap: 10px;
  justify-items: center;
}

input[type="range"] {
  width: 100%;
  cursor: pointer;
}

.big-number {
  font-size: 18px;
  font-weight: 800;
  color: #b0124b;
}

.msg {
  margin-top: 4px;
  color: #a61e4d;
  font-size: 16px;
  font-weight: 600;
}

footer {
  margin-top: 14px;
  color: var(--link);
  font-weight: 700;
}

/* Large screens: show nav items horizontally with pipes, hide arrow */
@media (min-width: 720px) {
  #menuToggle { display: none; }

  ul#navItems {
    display: flex !important;
    flex-direction: row;
    gap: 0;
    max-width: none;
    width: auto;
    align-items: center;
  }

  ul#navItems li a {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 6px 10px;
  }

  /* add pipes using CSS and stop at the end */
  ul#navItems li:not(:last-child) a::after {
    content: " |";
    color: rgba(214, 51, 108, 0.55);
    margin-left: 10px;
  }
}

/* Helper: hide/show sections */
.hidden { display: none; }
