:root {
  color-scheme: dark;
  --ink: #f5eee4;
  --muted: #b7aa9c;
  --copper: #c6854f;
  --copper-bright: #efb372;
  --panel: #26201a;
  --shadow: rgba(0, 0, 0, .55);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 50% 10%, rgba(198, 133, 79, .16), transparent 34rem),
    linear-gradient(145deg, #090807, #18130f 54%, #0b0907);
}

.page-shell {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  place-items: center;
  gap: 1rem;
  padding: clamp(1.25rem, 4vw, 3rem);
  overflow: hidden;
}

.intro { max-width: 40rem; text-align: center; }

.eyebrow {
  margin: 0 0 .7rem;
  color: var(--copper-bright);
  font-size: .78rem;
  font-weight: 750;
  letter-spacing: .24em;
}

.eyebrow a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.eyebrow a:hover { color: #ffd19c; }

.eyebrow a:focus:not(:focus-visible) { outline: none; }

.eyebrow a:focus-visible {
  outline: .15rem solid #fff6df;
  outline-offset: .3rem;
  border-radius: .15rem;
}

h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.2rem, 7vw, 4.8rem);
  font-weight: 500;
  letter-spacing: -.035em;
}

.intro > p:last-child {
  max-width: 34rem;
  margin: .75rem auto 0;
  color: var(--muted);
  font-size: clamp(.95rem, 2.4vw, 1.12rem);
  line-height: 1.55;
}

.doorbell { display: grid; place-items: center; }

.bell-visual {
  position: relative;
  width: min(72vw, 20rem);
  filter: drop-shadow(0 2rem 2.4rem var(--shadow));
}

.bell-visual img {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

.bell-visual.is-ringing img { animation: bell-wobble .58s ease-out; }

.bell-button {
  position: absolute;
  left: 50%;
  top: 51.7%;
  width: 31%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: 0;
  border-radius: 50%;
  color: #24170e;
  background:
    radial-gradient(circle at 38% 30%, #fff3da 0 7%, #e9bd82 22%, #aa6534 65%, #64361e 100%);
  box-shadow:
    inset .15rem .2rem .4rem rgba(255,255,255,.55),
    inset -.35rem -.45rem .8rem rgba(53, 20, 5, .62),
    0 .45rem .9rem rgba(0,0,0,.55);
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform .18s ease, filter .18s ease, box-shadow .18s ease;
}

.bell-button:hover { filter: brightness(1.08); }

.bell-button:active,
.bell-button.is-working {
  transform: translate(-50%, -46%) scale(.94);
  box-shadow: inset .2rem .35rem .8rem rgba(53, 20, 5, .72), 0 .18rem .35rem rgba(0,0,0,.55);
}

.bell-button.is-pressed { animation: button-press .58s cubic-bezier(.2, .8, .25, 1); }

.bell-button:focus:not(:focus-visible) { outline: none; }

.bell-button:focus-visible {
  outline: .28rem solid #fff6df;
  outline-offset: .35rem;
}

.bell-button:disabled { cursor: wait; opacity: .74; }

.button-ring {
  position: absolute;
  inset: -16%;
  border: .13rem solid rgba(239, 179, 114, .55);
  border-radius: 50%;
  opacity: 0;
}

.is-success .button-ring { animation: ring 1.1s ease-out; }

.button-label {
  font-size: clamp(.55rem, 2.5vw, .82rem);
  font-weight: 850;
  letter-spacing: .14em;
  text-shadow: 0 1px rgba(255,255,255,.25);
}

.status {
  min-height: 1.5em;
  margin: .35rem 0 0;
  color: var(--muted);
  font-size: .94rem;
  text-align: center;
}

.status.success { color: #bfe5c1; }
.status.error { color: #ffb5a7; }

footer {
  color: #74695e;
  font-size: .72rem;
  letter-spacing: .14em;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes ring {
  0% { opacity: .9; transform: scale(.75); }
  100% { opacity: 0; transform: scale(1.65); }
}

@keyframes button-press {
  0% { transform: translate(-50%, -50%) scale(1); }
  32% { transform: translate(-50%, -43%) scale(.88); }
  68% { transform: translate(-50%, -52%) scale(1.04); }
  100% { transform: translate(-50%, -46%) scale(.94); }
}

@keyframes bell-wobble {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-1.25deg); }
  52% { transform: rotate(1deg); }
  76% { transform: rotate(-.45deg); }
}

@media (max-height: 720px) and (orientation: landscape) {
  .page-shell { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr auto; }
  .intro { text-align: left; }
  .intro > p:last-child { margin-left: 0; }
  footer { grid-column: 1 / -1; }
  .bell-visual { width: min(38vw, 16rem); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
