:root {
  --blue-700: #2559cf;
  --blue-500: #2f72ee;
  --green-700: #048743;
  --yellow-400: #f1db00;
  --ink-900: #112544;
  --ink-700: #294166;
  --ink-500: #4a6488;
  --surface-100: #f5f7fb;
  --surface-200: #ebf0f9;
  --white: #ffffff;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-soft: 0 20px 42px rgba(17, 37, 68, 0.12);
  --content-width: min(1120px, 92vw);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "DM Sans", "Segoe UI", sans-serif;
  color: var(--ink-900);
  background: linear-gradient(178deg, #f8f9fc 0%, #eff4fb 46%, #f8fbff 100%);
}

.page-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background: url("/images/backgroung.png") center / cover no-repeat;
}

.page-start-anchor {
  position: absolute;
  inset: 0 auto auto 0;
  width: 1px;
  height: 1px;
}

.topbar {
  width: var(--content-width);
  margin: 1.1rem auto 0;
  display: grid;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(37, 89, 207, 0.12);
  border-radius: var(--radius-md);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-soft);
  position: sticky;
  top: 0.8rem;
  z-index: 25;
}

.topbar__brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.topbar__brand {
  display: flex;
  align-items: center;
}

.topbar__brand img {
  width: 240px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

.topbar__summary {
  margin: 0;
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.2;
  font-weight: 700;
  color: var(--blue-700);
  text-align: center;
}

.topbar__summary-title,
.topbar__summary-date,
.topbar__summary-separator {
  color: inherit;
}

.lang-switch {
  display: inline-flex;
  gap: 0.35rem;
  padding: 0.25rem;
  border-radius: 999px;
  background: var(--surface-200);
  margin-left: auto;
  flex-shrink: 0;
}

.lang-switch button {
  border: 0;
  background: transparent;
  color: var(--ink-700);
  font: inherit;
  font-weight: 700;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  cursor: pointer;
}

.lang-switch button.is-active {
  background: var(--blue-700);
  color: var(--white);
}

.lang-switch button:focus-visible,
.topbar__nav a:focus-visible,
.entry-card__links a:focus-visible {
  outline: 2px solid var(--yellow-400);
  outline-offset: 3px;
}

.topbar__nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
}

.topbar__nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  appearance: none;
  text-decoration: none;
  text-decoration-line: none;
  color: var(--ink-700);
  font-weight: 700;
  font-size: 0.84rem;
  line-height: 1.15;
  text-align: center;
  background: var(--surface-100);
  border: 1px solid rgba(37, 89, 207, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.65);
  padding: 0.55rem 0.35rem;
  border-radius: 12px;
  min-height: 3rem;
}

.topbar__nav a:hover,
.topbar__nav a:active {
  background: var(--surface-200);
}

.page-content {
  width: var(--content-width);
  margin: 1rem auto 4rem;
  display: grid;
  gap: 1.25rem;
}

.stage__header h2 {
  margin: 0;
  font-family: "Sora", "Segoe UI", sans-serif;
  letter-spacing: -0.02em;
  color: var(--blue-700);
}

.stage {
  padding: 1.15rem;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(37, 89, 207, 0.14);
}

.stage__header {
  margin-bottom: 0.9rem;
}

.stage__header h2 {
  font-size: clamp(1.3rem, 2.2vw, 1.9rem);
}

.stage__header p {
  margin: 0.45rem 0 0;
  color: var(--ink-700);
}

.stage__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0.85rem;
}

.entry-card {
  background: var(--surface-100);
  border: 1px solid rgba(37, 89, 207, 0.16);
  border-radius: var(--radius-md);
  padding: 0.95rem;
  display: grid;
  align-content: start;
  grid-auto-rows: max-content;
  gap: 0.55rem;
}

.entry-card__date {
  margin: 0;
  width: fit-content;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--white);
  background: var(--blue-700);
}

.entry-card h3 {
  margin: 0;
  color: var(--ink-900);
  font-size: 1rem;
}

.entry-card__badge {
  margin: 0;
  display: inline-flex;
  align-items: center;
  align-self: start;
  justify-self: start;
  width: max-content;
  max-width: 100%;
  border-radius: 999px;
  padding: 0.24rem 0.58rem;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--white);
  background: var(--blue-700);
}

.entry-card--special {
  border-width: 2px;
}

.entry-card--values {
  border-color: #96a347;
  background: #f8fae8;
}

.entry-card--values .entry-card__badge {
  background: #6c7a2d;
}

.entry-card--menu {
  border-color: #ca8a04;
  background: #fff9e8;
}

.entry-card--menu .entry-card__badge {
  background: #b16a00;
}

.entry-card--activities {
  border-color: #0e8f73;
  background: #ecfcf7;
}

.entry-card--activities .entry-card__badge {
  background: #0a6f59;
}

.entry-card--forms {
  border-color: #0f5ca9;
  background: #eff6ff;
}

.entry-card--forms .entry-card__badge {
  background: #0c4d8d;
}

.entry-card--table-manners {
  border-color: #7b3f00;
  background: #fff4ea;
}

.entry-card--table-manners .entry-card__badge {
  background: #8f4f15;
}

.entry-card ul {
  margin: 0;
  padding-left: 1.05rem;
  color: var(--ink-700);
  display: grid;
  gap: 0.35rem;
}

.entry-card__links {
  display: grid;
  gap: 0.45rem;
}

.entry-card__links a {
  display: block;
  width: 100%;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.86rem;
  color: var(--blue-700);
  border-bottom: 1px solid rgba(37, 89, 207, 0.3);
  padding-bottom: 0.2rem;
}

.entry-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
}

.entry-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: auto;
}

.entry-like,
.entry-calendar {
  border: 1px solid rgba(37, 89, 207, 0.24);
  background: #fff;
  color: var(--ink-700);
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.entry-like svg,
.entry-calendar svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.entry-like__filled {
  display: none;
}

.entry-like.is-liked {
  border-color: #d94b4b;
  color: #d94b4b;
}

.entry-like.is-liked .entry-like__outline {
  display: none;
}

.entry-like.is-liked .entry-like__filled {
  display: inline-flex;
}

.entry-like.is-liked .entry-like__filled svg {
  fill: currentColor;
  stroke: currentColor;
}

.entry-like.is-animating {
  animation: heartBeat 0.34s ease-in-out;
}

@keyframes heartBeat {
  0% { transform: scale(1); }
  35% { transform: scale(1.22); }
  70% { transform: scale(0.94); }
  100% { transform: scale(1); }
}

.entry-calendar-wrap {
  position: relative;
}

.entry-calendar-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  z-index: 18;
  min-width: 190px;
  display: grid;
  gap: 0.2rem;
  border-radius: 12px;
  border: 1px solid rgba(37, 89, 207, 0.2);
  background: #fff;
  box-shadow: 0 12px 24px rgba(17, 37, 68, 0.16);
  padding: 0.28rem;
}

.entry-calendar-menu[hidden] {
  display: none !important;
}

.entry-calendar-menu__item {
  border: 0;
  background: transparent;
  color: var(--ink-700);
  text-align: left;
  font: inherit;
  font-weight: 700;
  padding: 0.42rem 0.52rem;
  border-radius: 8px;
  cursor: pointer;
}

.entry-calendar-menu__item:hover,
.entry-calendar-menu__item:focus-visible {
  background: var(--surface-200);
  outline: none;
}

.site-footer {
  display: grid;
  gap: 0.3rem;
  justify-items: center;
  text-align: center;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(37, 89, 207, 0.14);
}

.site-footer img {
  width: 168px;
  height: auto;
}

.site-footer p {
  margin: 0;
  color: var(--ink-700);
}

.back-to-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 40;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--white);
  background: var(--blue-700);
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 22px rgba(17, 37, 68, 0.26);
  font-size: 1.2rem;
  line-height: 1;
}

.back-to-top:focus-visible {
  outline: 2px solid var(--yellow-400);
  outline-offset: 3px;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (max-width: 760px) {
  .topbar {
    margin-top: 0.65rem;
    top: 0.4rem;
    padding: 0.8rem 0.75rem;
  }

  .topbar__brand-row {
    gap: 0.6rem;
  }

  .topbar__summary {
    font-size: 0.94rem;
    line-height: 1.2;
  }

  .topbar__nav a {
    font-size: 0.76rem;
    padding: 0.4rem 0.24rem;
    min-height: 1.4rem;
  }

  .page-content {
    gap: 1rem;
  }

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

  .back-to-top {
    right: 0.75rem;
    bottom: 0.75rem;
    width: 44px;
    height: 44px;
    font-size: 1.08rem;
  }

  .entry-actions {
    gap: 0.38rem;
  }

  .entry-like,
  .entry-calendar {
    width: 2.2rem;
    height: 2.2rem;
  }
}
