:root {
  --page-bg: 250 244 233;
  --card-bg: 255 251 244;
  --ink: 61 43 31;
  --muted: 137 118 103;
  --border: 232 217 195;
  --accent: 176 108 55;
  --dough: 214 168 110;
  --chip: 91 58 39;

  --ease-out-quad: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  background: rgb(var(--page-bg));
  color: rgb(var(--ink));
  font-family: 'Inter', system-ui, sans-serif;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1.5rem 14rem;
}

.page h1 {
  font-family: 'Fraunces', serif;
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.lede {
  color: rgb(var(--muted));
  margin-bottom: 1.5rem;
}

.reset-btn {
  padding: 0.7rem 1.3rem;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgb(var(--ink));
  background: rgb(var(--card-bg));
  border: 1.5px solid rgb(var(--border));
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 200ms ease;
}

.reset-btn:hover {
  border-color: rgb(var(--accent));
}

/* ---------- Banner ---------- */
.banner {
  position: fixed;
  left: 1.25rem;
  right: 1.25rem;
  bottom: 1.25rem;
  max-width: 460px;
  margin: 0 auto;
  background: rgb(var(--card-bg));
  border: 1px solid rgb(var(--border));
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: 0 30px 60px -25px rgb(var(--chip) / 0.4);
  animation: slide-up 450ms var(--ease-out-expo);
}

@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .banner {
    animation: none;
  }
}

.banner.is-dismissed {
  display: none;
}

.banner-main {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.1rem;
}

.cookie-icon {
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #e6bd85, rgb(var(--dough)));
  flex-shrink: 0;
  box-shadow: inset 0 -4px 6px rgb(var(--chip) / 0.2);
}

.cookie-icon .chip {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgb(var(--chip));
}

.cookie-icon .chip:nth-child(1) {
  top: 8px;
  left: 14px;
}
.cookie-icon .chip:nth-child(2) {
  top: 18px;
  left: 28px;
}
.cookie-icon .chip:nth-child(3) {
  top: 24px;
  left: 12px;
}
.cookie-icon .chip:nth-child(4) {
  top: 30px;
  left: 24px;
}
.cookie-icon .chip:nth-child(5) {
  top: 14px;
  left: 22px;
}

.banner-text h2 {
  font-family: 'Fraunces', serif;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.banner-text p {
  font-size: 0.85rem;
  color: rgb(var(--muted));
  line-height: 1.5;
}

.banner-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.btn {
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  padding: 0.65rem 1rem;
  cursor: pointer;
  transition:
    background-color 200ms ease,
    color 200ms ease,
    transform 150ms var(--ease-out-quad);
}

.btn:active {
  transform: scale(0.97);
}

.btn-text {
  background: none;
  color: rgb(var(--accent));
  padding-left: 0;
  padding-right: 0;
  margin-right: auto;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.btn-ghost {
  background: rgb(var(--border) / 0.6);
  color: rgb(var(--ink));
}

@media (hover: hover) and (pointer: fine) {
  .btn-ghost:hover {
    background: rgb(var(--border));
  }
}

.btn-primary {
  background: rgb(var(--accent));
  color: white;
}

@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover {
    background: rgb(150 89 43);
  }
}

.btn-block {
  width: 100%;
}

/* ---------- Preferences panel ---------- */
.prefs {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition:
    grid-template-rows 320ms var(--ease-out-expo),
    opacity 220ms ease;
}

.prefs.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
  margin-top: 1.1rem;
}

.prefs > * {
  overflow: hidden;
}

.prefs-inner {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding-top: 1.1rem;
  border-top: 1px solid rgb(var(--border));
}

.pref-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
}

.pref-name {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
}

.pref-desc {
  display: block;
  font-size: 0.78rem;
  color: rgb(var(--muted));
  margin-top: 0.15rem;
}

.pref-checkbox {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.switch {
  flex-shrink: 0;
  width: 40px;
  height: 24px;
  border-radius: 999px;
  background: rgb(var(--border));
  padding: 3px;
  transition: background-color 200ms ease;
}

.switch-thumb {
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.25);
  transition: transform 250ms var(--ease-out-expo);
}

.pref-checkbox:checked + .switch {
  background: rgb(var(--accent));
}

.pref-checkbox:checked + .switch .switch-thumb {
  transform: translateX(16px);
}

.pref-checkbox:focus-visible + .switch {
  outline: 2px solid rgb(var(--accent));
  outline-offset: 2px;
}

.switch.is-locked {
  background: rgb(var(--accent) / 0.4);
}

.switch.is-locked .switch-thumb {
  transform: translateX(16px);
}

@media (max-width: 500px) {
  .banner {
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
    padding: 1.25rem;
  }

  .banner-actions {
    flex-wrap: wrap;
  }

  .btn-text {
    order: 3;
    width: 100%;
    text-align: center;
    margin-right: 0;
    margin-top: 0.3rem;
  }

  .btn-ghost,
  .btn-primary {
    flex: 1;
  }
}
